@farm.js/core 0.1.35 → 0.1.37
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/{metadata-BnLDsUOS.d.ts → agent-mcp-BC0bAGVF.d.mts} +45 -2
- package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
- package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
- package/dist/{metadata-WGpBYcGn.d.mts → agent-mcp-jyDHbQKe.d.ts} +45 -2
- package/dist/agent-runtime.cjs +6 -4
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +5 -3
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +9 -9
- package/dist/api/route-manager.d.mts +10 -4
- package/dist/api/route-manager.d.ts +10 -4
- package/dist/api/route-manager.mjs +8 -8
- package/dist/api/runtime.cjs +6 -6
- package/dist/api/runtime.d.mts +4 -62
- package/dist/api/runtime.d.ts +4 -62
- package/dist/api/runtime.mjs +5 -5
- package/dist/api.cjs +13 -12
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +12 -11
- package/dist/{app-BXB3JZYc.d.ts → app-CKO3iN1c.d.ts} +17 -3
- package/dist/{app-D_j9AAVL.d.mts → app-Cbkj9ufe.d.mts} +17 -3
- package/dist/app-markdown.cjs +6 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +5 -3
- package/dist/{chunk-F7JZENPF.cjs → chunk-3A4KGQYI.cjs} +38 -30
- package/dist/{chunk-4MMGO7YW.cjs → chunk-3IP27TCG.cjs} +43 -32
- package/dist/{chunk-FDR64H6B.mjs → chunk-3KGDJLJK.mjs} +41 -2
- package/dist/{chunk-UJD4PHYB.mjs → chunk-4E5WBPEG.mjs} +72 -354
- package/dist/{chunk-KXWRO25S.cjs → chunk-4GPOC4LN.cjs} +3 -3
- package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
- package/dist/{chunk-4KU5Q7C2.mjs → chunk-4P6ULFMD.mjs} +253 -67
- package/dist/chunk-4WQ6PGSJ.cjs +367 -0
- package/dist/{chunk-SMHH4VDG.mjs → chunk-4WVJLURN.mjs} +1 -1
- package/dist/{chunk-2F2ER724.cjs → chunk-5BXGGEC7.cjs} +27 -22
- package/dist/{chunk-3BHT4WMP.cjs → chunk-5D2JIPLH.cjs} +8 -8
- package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
- package/dist/{chunk-GFHLGIYC.cjs → chunk-6LGFV2CQ.cjs} +8 -8
- package/dist/chunk-6SJ2KJTA.mjs +314 -0
- package/dist/{chunk-PFQKNERH.cjs → chunk-6TJITR2B.cjs} +457 -218
- package/dist/{chunk-73MC7ZL6.cjs → chunk-75X755YZ.cjs} +2 -2
- package/dist/{chunk-3UH7MRCP.cjs → chunk-7DWNJI73.cjs} +13 -13
- package/dist/{chunk-7L5V3KQO.cjs → chunk-7O5M4UKW.cjs} +2 -2
- package/dist/{chunk-BJPBQNIE.cjs → chunk-7SQ5SGYZ.cjs} +2 -2
- package/dist/{chunk-27ZWSI3W.cjs → chunk-ADOAUDQ6.cjs} +2 -2
- package/dist/{chunk-CP6X4AEU.mjs → chunk-AJQTP4OO.mjs} +1 -1
- package/dist/{chunk-YKX5BK66.cjs → chunk-ATWHHSY2.cjs} +7 -7
- package/dist/{chunk-EFCQPQMG.cjs → chunk-B5PFZLKV.cjs} +89 -8
- package/dist/{chunk-FNO7A7CM.cjs → chunk-BHY547NB.cjs} +34 -16
- package/dist/{chunk-JHWOVJ3M.mjs → chunk-BUGNQIHC.mjs} +5 -0
- package/dist/{chunk-7GLPRTTF.cjs → chunk-CGBDNNSM.cjs} +2 -2
- package/dist/chunk-CI6E3UOH.cjs +314 -0
- package/dist/{chunk-2G2NNLE2.mjs → chunk-CQMVIOYP.mjs} +5 -5
- package/dist/{chunk-X6W5FFH6.cjs → chunk-CVH2BXPY.cjs} +8 -8
- package/dist/{chunk-TKSCR644.cjs → chunk-D3C5LBQY.cjs} +2 -2
- package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
- package/dist/chunk-DTSROJ5J.mjs +367 -0
- package/dist/{chunk-DBNKI4NF.cjs → chunk-ECKF2BAM.cjs} +6 -2
- package/dist/{chunk-GQ3Z3IZI.cjs → chunk-EMMQ64QW.cjs} +18 -18
- package/dist/{chunk-6DU6UFUE.mjs → chunk-EXG5LD6B.mjs} +16 -8
- package/dist/{chunk-HUMR6LSU.mjs → chunk-F5QO4FNE.mjs} +1 -1
- package/dist/{chunk-YULD7ICZ.mjs → chunk-FBOJ55OM.mjs} +1 -1
- package/dist/{chunk-IHNMMXHV.mjs → chunk-FGRYBX5X.mjs} +15 -10
- package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
- package/dist/{chunk-3BU22U3M.cjs → chunk-G2TEB74S.cjs} +5 -2
- package/dist/{chunk-G5RT7EXW.mjs → chunk-HEVMCTSR.mjs} +21 -6
- package/dist/{chunk-W7LF2J2S.mjs → chunk-HMRSWN47.mjs} +1 -1
- package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
- package/dist/{chunk-UAORZ7QA.mjs → chunk-IAIYV4RZ.mjs} +2 -2
- package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
- package/dist/{chunk-2NNMOPDN.mjs → chunk-J3ANCZKA.mjs} +4 -1
- package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
- package/dist/{chunk-SC2WYWPF.mjs → chunk-JPNFPAZ4.mjs} +3 -3
- package/dist/{chunk-F6Z3Y5KL.mjs → chunk-K3SAEIM3.mjs} +5 -2
- package/dist/{chunk-QAU5JD57.mjs → chunk-K4I4O5TS.mjs} +289 -50
- package/dist/{chunk-KN7K4VQN.mjs → chunk-KDTBF3UU.mjs} +1 -1
- package/dist/{chunk-OMVAU7NT.cjs → chunk-KIIMAWOJ.cjs} +11 -1
- package/dist/{chunk-43FMW62B.mjs → chunk-KMTGADN3.mjs} +28 -0
- package/dist/{chunk-QORUJDIV.mjs → chunk-KPFKMDM7.mjs} +2 -2
- package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
- package/dist/{chunk-YDQZGSDS.mjs → chunk-LBDP3YT3.mjs} +1 -1
- package/dist/{chunk-6ETPZTJI.mjs → chunk-LBGILORX.mjs} +116 -55
- package/dist/{chunk-IPXLADVO.cjs → chunk-LOFKRKO7.cjs} +122 -61
- package/dist/{chunk-ULAWS2PA.cjs → chunk-LPFV45AY.cjs} +29 -26
- package/dist/{chunk-3KZS4SUS.mjs → chunk-MCIZVNOQ.mjs} +1 -1
- package/dist/{chunk-RU3M2FIK.cjs → chunk-MRMI32SN.cjs} +87 -369
- package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
- package/dist/{chunk-XCACDAZZ.cjs → chunk-NDILNQ4L.cjs} +25 -10
- package/dist/{chunk-6TJOML4E.mjs → chunk-NFMDCAOS.mjs} +14 -11
- package/dist/{chunk-UXFQ3UDA.cjs → chunk-NICDYKBS.cjs} +42 -3
- package/dist/{chunk-EZDQRNQ7.mjs → chunk-NNSAQX3U.mjs} +23 -5
- package/dist/{chunk-YC6V7PWE.cjs → chunk-NQ6QFZWD.cjs} +1 -1
- package/dist/{chunk-PDOCJ6RY.mjs → chunk-O6WAEAX3.mjs} +1 -1
- package/dist/{chunk-U4KT7QP3.cjs → chunk-OW67PDDS.cjs} +14 -1
- package/dist/{chunk-77GNHH2Z.cjs → chunk-PMQHMWZU.cjs} +3 -3
- package/dist/chunk-PTZ2TVNE.cjs +178 -0
- package/dist/{chunk-6WCPV6G2.mjs → chunk-Q2KB32T4.mjs} +1 -1
- package/dist/{chunk-ICUQICNC.cjs → chunk-Q5FYSK45.cjs} +718 -532
- package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
- package/dist/{chunk-Q3VLETLE.mjs → chunk-RRMVL6CJ.mjs} +4 -4
- package/dist/{chunk-IZY3V5XW.mjs → chunk-S3VWVTVA.mjs} +14 -1
- package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
- package/dist/{chunk-VFQT3LAO.cjs → chunk-SDOTRX3V.cjs} +5 -5
- package/dist/chunk-SGBZPZUW.mjs +75 -0
- package/dist/{chunk-BMWDEBXO.cjs → chunk-SHLXACIO.cjs} +31 -3
- package/dist/{chunk-ZXGAFZDO.cjs → chunk-T5OJPTVN.cjs} +2 -2
- package/dist/{chunk-2ELDTQRN.mjs → chunk-TDNWPAVR.mjs} +1 -1
- package/dist/{chunk-VZJR7UTG.cjs → chunk-TE2G5ION.cjs} +2 -2
- package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
- package/dist/{chunk-4JHOT46A.mjs → chunk-TPLJVC7E.mjs} +86 -5
- package/dist/{chunk-NRSN7G7E.mjs → chunk-TW4GYDBJ.mjs} +1 -1
- package/dist/{chunk-XBML5KMG.cjs → chunk-U6MPZ35Q.cjs} +24 -14
- package/dist/chunk-UH6QN5NL.mjs +178 -0
- package/dist/{chunk-FTFYRMQQ.cjs → chunk-UJZLSXUB.cjs} +53 -28
- package/dist/chunk-UXHS27O6.cjs +75 -0
- package/dist/{chunk-DQQOKWYA.cjs → chunk-VR4GD5I3.cjs} +3 -3
- package/dist/{chunk-22LTEMGQ.mjs → chunk-VXAWRDK7.mjs} +14 -4
- package/dist/{chunk-62XKI4Z3.cjs → chunk-W2YDNK66.cjs} +6 -3
- package/dist/{chunk-VPTDD5XF.cjs → chunk-WBKEZXWE.cjs} +5 -0
- package/dist/{chunk-EJQT6KZN.cjs → chunk-WC5UV2HQ.cjs} +2 -2
- package/dist/{chunk-SAZVVAJH.mjs → chunk-WQ7T2263.mjs} +18 -7
- package/dist/chunk-WRPHYQVY.mjs +109 -0
- package/dist/chunk-WT4TGLXT.cjs +109 -0
- package/dist/{chunk-SOMHP6GF.mjs → chunk-XOPOIFTJ.mjs} +2 -2
- package/dist/{chunk-3PXS2MHU.mjs → chunk-YCKO6FRS.mjs} +1 -1
- package/dist/{chunk-C35ZBVRD.mjs → chunk-YWMZUGIS.mjs} +6 -2
- package/dist/{chunk-HMIJDL7S.mjs → chunk-Z5BEWYVO.mjs} +31 -6
- package/dist/{chunk-OKZUAXHF.mjs → chunk-Z7LA7MHQ.mjs} +1 -1
- package/dist/{chunk-Y7RKTKYI.mjs → chunk-ZMMBIVQM.mjs} +10 -0
- package/dist/{client-plugins-HIyulDym.d.ts → client-plugins-C8DjftDF.d.ts} +112 -5
- package/dist/{client-plugins-CvIslxWi.d.mts → client-plugins-CV4eJ9De.d.mts} +112 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-EAUY43BS.cjs → devtools-JXFQNWSH.cjs} +11 -10
- package/dist/{devtools-EE5RIBTH.mjs → devtools-KVOY2TCZ.mjs} +10 -9
- package/dist/docs.cjs +13 -12
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +12 -11
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +11 -11
- package/dist/i18n/client.mjs +3 -3
- package/dist/image/server.cjs +3 -3
- package/dist/image/server.mjs +2 -2
- package/dist/image/sharp.cjs +10 -10
- package/dist/image/sharp.mjs +2 -2
- package/dist/index.cjs +61 -54
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +60 -53
- package/dist/integrations.cjs +8 -4
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +7 -3
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +19 -5
- package/dist/internal/app-markdown-runtime.d.ts +19 -5
- package/dist/internal/app-markdown-runtime.mjs +4 -2
- package/dist/internal/build-runtime.cjs +38 -34
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +37 -33
- package/dist/internal/cli-runtime.cjs +17 -16
- package/dist/internal/cli-runtime.mjs +16 -15
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +11 -10
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +10 -9
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/isolated-boundary.cjs +2 -2
- package/dist/internal/isolated-boundary.d.mts +0 -1
- package/dist/internal/isolated-boundary.d.ts +0 -1
- package/dist/internal/isolated-boundary.mjs +1 -1
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +27 -48
- package/dist/internal/production-runtime.d.mts +67 -27
- package/dist/internal/production-runtime.d.ts +67 -27
- package/dist/internal/production-runtime.mjs +34 -55
- package/dist/{layers-BRQF5ETU.mjs → layers-UTB43B7A.mjs} +1 -1
- package/dist/layers-VUWIOFEO.cjs +18 -0
- package/dist/markdown.cjs +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +6 -4
- package/dist/middleware.d.ts +6 -4
- package/dist/middleware.mjs +9 -9
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +6 -6
- package/dist/{nitro-OVPLKPE2.cjs → nitro-7F65EZZS.cjs} +3 -3
- package/dist/{nitro-MXRDCXWZ.mjs → nitro-MPZJGPXK.mjs} +2 -2
- package/dist/plugin.cjs +31 -28
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +30 -27
- package/dist/{production-runtime-Crq6CJ-2.d.ts → production-runtime-C2kkrPVZ.d.ts} +1 -1
- package/dist/{production-runtime-0sRnuYc-.d.mts → production-runtime-Du_FHb2-.d.mts} +1 -1
- package/dist/query/client.cjs +9 -9
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-8ozZh2Qv.d.ts → render-plan-BnnPTpus.d.ts} +1 -1
- package/dist/{render-plan-gs9GGPzw.d.mts → render-plan-Cgx7v8tJ.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +3 -3
- package/dist/renderer/react/server.mjs +1 -1
- package/dist/renderer-client.cjs +12 -12
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +4 -4
- package/dist/{request-B5G8rLBH.d.ts → request-BNWr7r5e.d.ts} +1 -1
- package/dist/{request-fkhiynXe.d.mts → request-sKayKcop.d.mts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-lS5nUMua.d.ts → route-rendering-Bx4Auw6Q.d.ts} +1 -1
- package/dist/{route-rendering-CLnS7AZj.d.mts → route-rendering-DWFp3Yq4.d.mts} +1 -1
- package/dist/{router-ifU8Dui1.d.mts → router-BK6K42Ij.d.mts} +1 -1
- package/dist/{router-4iuiYnOW.d.ts → router-DnW_2tQi.d.ts} +1 -1
- package/dist/routes.cjs +2 -2
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/runtime-CA3Ei5k_.d.ts +69 -0
- package/dist/runtime-DJDaCMd_.d.mts +69 -0
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +57 -54
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +35 -32
- package/dist/{spa-router-Bq7VCOwx.d.mts → spa-router-D6fUA4Rn.d.mts} +2 -2
- package/dist/{spa-router-DaJk5Re4.d.ts → spa-router-Mwbd7g2L.d.ts} +2 -2
- package/dist/testing.cjs +13 -13
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +10 -10
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-BXLmFsVR.d.ts → utils-BwVcAfUR.d.ts} +1 -1
- package/dist/{utils-XJn0c9bj.d.mts → utils-p9Hs-jCc.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +31 -28
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +30 -27
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +1 -1
- package/types/middleware.d.ts +5 -1
- package/dist/chunk-FXEF4PPL.mjs +0 -47
- package/dist/chunk-XD32KALF.cjs +0 -47
- package/dist/layers-4PNE2HOY.cjs +0 -18
- /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
- /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
|
@@ -16,7 +16,7 @@ var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -29,7 +29,10 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkMRMI32SNcjs = require('./chunk-MRMI32SN.cjs');
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var _chunk4WQ6PGSJcjs = require('./chunk-4WQ6PGSJ.cjs');
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
|
|
@@ -38,7 +41,7 @@ var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
|
|
|
38
41
|
var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
|
|
39
42
|
|
|
40
43
|
|
|
41
|
-
var
|
|
44
|
+
var _chunkT5OJPTVNcjs = require('./chunk-T5OJPTVN.cjs');
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
|
|
@@ -54,16 +57,16 @@ var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
|
|
|
54
57
|
var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
|
|
55
58
|
|
|
56
59
|
|
|
57
|
-
var
|
|
60
|
+
var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
|
|
58
61
|
|
|
59
62
|
|
|
60
63
|
var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
61
64
|
|
|
62
65
|
|
|
63
|
-
var
|
|
66
|
+
var _chunkUJZLSXUBcjs = require('./chunk-UJZLSXUB.cjs');
|
|
64
67
|
|
|
65
68
|
|
|
66
|
-
var
|
|
69
|
+
var _chunkKIIMAWOJcjs = require('./chunk-KIIMAWOJ.cjs');
|
|
67
70
|
|
|
68
71
|
|
|
69
72
|
var _chunkHLJ6MBUZcjs = require('./chunk-HLJ6MBUZ.cjs');
|
|
@@ -135,13 +138,18 @@ function resolveFarmAgentConfig(input, context = {}) {
|
|
|
135
138
|
const jsonLd = _optionalChain([input, 'optionalAccess', _ => _.jsonLd]);
|
|
136
139
|
return {
|
|
137
140
|
jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
138
|
-
noindexPreviews:
|
|
141
|
+
noindexPreviews: _chunkMRMI32SNcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
|
|
139
142
|
// The docs engine answers /llms.txt with its own pages; a default here would replace it.
|
|
140
143
|
// llms-full.txt renders every listed page, so it stays opt-in.
|
|
141
|
-
llmsTxt:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
llmsTxt: _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt]), () => ( (context.docs ? false : { full: false })))),
|
|
145
|
+
// Same rule as llms.txt: the docs engine answers /sitemap.xml with its own pages.
|
|
146
|
+
sitemap: _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _4 => _4.sitemap]), () => ( !context.docs))),
|
|
147
|
+
crawlers: _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _5 => _5.crawlers])),
|
|
148
|
+
apiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _6 => _6.apiCatalog]), "apiCatalog", false),
|
|
149
|
+
aiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _7 => _7.aiCatalog]), "aiCatalog", true),
|
|
150
|
+
manifest: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _8 => _8.manifest]), "manifest", true),
|
|
151
|
+
// Same rule as llms.txt: the docs engine serves its own MCP server at /mcp.
|
|
152
|
+
mcp: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _9 => _9.mcp]), "mcp", !context.docs)
|
|
145
153
|
};
|
|
146
154
|
}
|
|
147
155
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAgentConfig, "resolveFarmAgentConfig");
|
|
@@ -226,7 +234,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
226
234
|
/* @vite-ignore */
|
|
227
235
|
_url.pathToFileURL.call(void 0, configEntryPath).href
|
|
228
236
|
);
|
|
229
|
-
const withDocs = _optionalChain([frameworkConfig, 'optionalAccess',
|
|
237
|
+
const withDocs = _optionalChain([frameworkConfig, 'optionalAccess', _10 => _10.withDocs]);
|
|
230
238
|
if (typeof withDocs !== "function") {
|
|
231
239
|
noticeOnce(
|
|
232
240
|
"missing-withdocs",
|
|
@@ -236,7 +244,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
236
244
|
return userConfig;
|
|
237
245
|
}
|
|
238
246
|
const applied = withDocs(userConfig);
|
|
239
|
-
const adapter = _optionalChain([applied, 'optionalAccess',
|
|
247
|
+
const adapter = _optionalChain([applied, 'optionalAccess', _11 => _11.docs, 'optionalAccess', _12 => _12.adapter]);
|
|
240
248
|
if (!isSupportedAdapterDescriptor(adapter)) {
|
|
241
249
|
noticeOnce(
|
|
242
250
|
"unsupported-descriptor",
|
|
@@ -351,7 +359,7 @@ var PLATFORM_BUILD_ENV_TARGETS = [
|
|
|
351
359
|
];
|
|
352
360
|
function detectPlatformDeployTarget(env = process.env) {
|
|
353
361
|
for (const [key, target] of PLATFORM_BUILD_ENV_TARGETS) {
|
|
354
|
-
const value = _optionalChain([env, 'access',
|
|
362
|
+
const value = _optionalChain([env, 'access', _13 => _13[key], 'optionalAccess', _14 => _14.trim, 'call', _15 => _15(), 'access', _16 => _16.toLowerCase, 'call', _17 => _17()]);
|
|
355
363
|
if (value === "1" || value === "true") return target;
|
|
356
364
|
}
|
|
357
365
|
return void 0;
|
|
@@ -391,7 +399,7 @@ function resolveDeployConfig(config, overrides = {}) {
|
|
|
391
399
|
);
|
|
392
400
|
}
|
|
393
401
|
}
|
|
394
|
-
const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access',
|
|
402
|
+
const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access', _18 => _18.vercel, 'optionalAccess', _19 => _19.outputDirectory]) : resolvedTarget === "cloudflare" ? _optionalChain([deploy, 'access', _20 => _20.cloudflare, 'optionalAccess', _21 => _21.outputDir]) : resolvedTarget === "netlify" ? _optionalChain([deploy, 'access', _22 => _22.netlify, 'optionalAccess', _23 => _23.outputDir]) : void 0;
|
|
395
403
|
const outputDir = overrides.outputDir || deploy.outputDir || deploy.output || platformOutput || getDefaultDeployOutputDir(resolvedTarget, preset, distDir);
|
|
396
404
|
return {
|
|
397
405
|
...deploy,
|
|
@@ -587,14 +595,14 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
587
595
|
config: void 0,
|
|
588
596
|
configPath: void 0
|
|
589
597
|
});
|
|
590
|
-
const loadedDocsConfig = sanitizeDocsConfig(_optionalChain([loadedConfig, 'optionalAccess',
|
|
598
|
+
const loadedDocsConfig = sanitizeDocsConfig(_optionalChain([loadedConfig, 'optionalAccess', _24 => _24.config]) || {});
|
|
591
599
|
const mergedDocsConfig = {
|
|
592
600
|
...loadedDocsConfig,
|
|
593
601
|
...inlineDocsConfig,
|
|
594
602
|
...directDocsConfig
|
|
595
603
|
};
|
|
596
604
|
const runtimeDocsConfig = {
|
|
597
|
-
..._optionalChain([loadedConfig, 'optionalAccess',
|
|
605
|
+
..._optionalChain([loadedConfig, 'optionalAccess', _25 => _25.config]) || {},
|
|
598
606
|
...isRecord(docsOptions.config) ? docsOptions.config : {},
|
|
599
607
|
...omitUndefined({
|
|
600
608
|
...docsOptions,
|
|
@@ -620,7 +628,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
620
628
|
entry: entryRoute,
|
|
621
629
|
...docsOptions.adapter ? { adapter: docsOptions.adapter } : {},
|
|
622
630
|
contentDir,
|
|
623
|
-
configPath: _optionalChain([loadedConfig, 'optionalAccess',
|
|
631
|
+
configPath: _optionalChain([loadedConfig, 'optionalAccess', _26 => _26.configPath]),
|
|
624
632
|
config: {
|
|
625
633
|
...mergedDocsConfig,
|
|
626
634
|
entry: docsEntry,
|
|
@@ -658,7 +666,7 @@ function validateConfigRouteSources(routes, field) {
|
|
|
658
666
|
_chunkS3JO3N4Hcjs.__name.call(void 0, validateConfigRouteSources, "validateConfigRouteSources");
|
|
659
667
|
async function resolveConfig(userConfig, mode) {
|
|
660
668
|
const projectRoot = userConfig.root || process.cwd();
|
|
661
|
-
const layerResolution = await
|
|
669
|
+
const layerResolution = await _chunkWBKEZXWEcjs.resolveFarmLayers.call(void 0, userConfig, {
|
|
662
670
|
root: projectRoot,
|
|
663
671
|
mode
|
|
664
672
|
});
|
|
@@ -689,9 +697,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
689
697
|
const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
|
|
690
698
|
const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
|
|
691
699
|
const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
|
|
692
|
-
const security =
|
|
693
|
-
const securityHeader =
|
|
694
|
-
if (
|
|
700
|
+
const security = _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
|
|
701
|
+
const securityHeader = _chunkMRMI32SNcjs.getFarmSecurityHeader.call(void 0, security);
|
|
702
|
+
if (_chunkMRMI32SNcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
|
|
695
703
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
696
704
|
"security.csp blocks the inline scripts Farm injects for theming and hydration. Set security.csp.nonce to true for managed dynamic nonces and prerendered hashes, or make the governing script directive allow 'unsafe-inline' without a nonce, hash, or 'strict-dynamic' source."
|
|
697
705
|
);
|
|
@@ -708,7 +716,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
708
716
|
const api = await _chunkS3A45T7Fcjs.resolveFarmAPIConfig.call(void 0, userConfig.api, { root, mode, env });
|
|
709
717
|
const auth = _chunk6MVFL3R5cjs.resolveFarmAuthConfig.call(void 0, userConfig.auth);
|
|
710
718
|
const mcp = resolveFarmMCPConfig(userConfig.mcp);
|
|
711
|
-
if (auth.enabled && _optionalChain([userConfig, 'access',
|
|
719
|
+
if (auth.enabled && _optionalChain([userConfig, 'access', _27 => _27.integrations, 'optionalAccess', _28 => _28.auth])) {
|
|
712
720
|
throw new Error(
|
|
713
721
|
"Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
|
|
714
722
|
);
|
|
@@ -718,7 +726,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
718
726
|
mode
|
|
719
727
|
});
|
|
720
728
|
const nativeMCPPlugin = await resolveFarmMCPPlugin(mcp, { root });
|
|
721
|
-
if (nativeMCPPlugin && _optionalChain([userConfig, 'access',
|
|
729
|
+
if (nativeMCPPlugin && _optionalChain([userConfig, 'access', _29 => _29.plugins, 'optionalAccess', _30 => _30.some, 'call', _31 => _31((plugin) => _optionalChain([plugin, 'optionalAccess', _32 => _32.name]) === "farm:api-mcp")])) {
|
|
722
730
|
throw new Error(
|
|
723
731
|
"Choose either the top-level `mcp` config or `apiMcp()` in `plugins`; they configure the same MCP transport."
|
|
724
732
|
);
|
|
@@ -756,7 +764,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
756
764
|
mdx,
|
|
757
765
|
migrations: resolveMigrationsConfig(userConfig.migrations),
|
|
758
766
|
cron: _chunk6EXBPJ24cjs.resolveCronConfig.call(void 0, userConfig.cron),
|
|
759
|
-
workflows:
|
|
767
|
+
workflows: _chunkSDOTRX3Vcjs.resolveWorkflowsConfig.call(void 0, userConfig.workflows),
|
|
760
768
|
api,
|
|
761
769
|
observability: _nullishCoalesce(userConfig.observability, () => ( false)),
|
|
762
770
|
telemetry: userConfig.telemetry !== false,
|
|
@@ -777,7 +785,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
777
785
|
},
|
|
778
786
|
agent: resolveFarmAgentConfig(userConfig.agent, { docs: docs.enabled }),
|
|
779
787
|
plugins: [
|
|
780
|
-
...
|
|
788
|
+
..._chunkUJZLSXUBcjs.resolveIntegrationPlugins.call(void 0, integrations),
|
|
781
789
|
...nativeMCPPlugin ? [nativeMCPPlugin] : [],
|
|
782
790
|
...userConfig.plugins || []
|
|
783
791
|
],
|
|
@@ -792,7 +800,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
792
800
|
], "headers"),
|
|
793
801
|
routeRules,
|
|
794
802
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
|
|
795
|
-
performance:
|
|
803
|
+
performance: _chunkMRMI32SNcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
|
|
796
804
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
|
|
797
805
|
publicDir: userConfig.publicDir || "public",
|
|
798
806
|
i18n: _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
|
|
@@ -800,8 +808,8 @@ async function resolveConfig(userConfig, mode) {
|
|
|
800
808
|
middleware: userConfig.middleware || {},
|
|
801
809
|
notFound: userConfig.notFound || {},
|
|
802
810
|
context: userConfig.context || (() => void 0),
|
|
803
|
-
server:
|
|
804
|
-
serverActions:
|
|
811
|
+
server: _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, userConfig.server),
|
|
812
|
+
serverActions: _chunkT5OJPTVNcjs.resolveServerActionsConfig.call(void 0, userConfig.serverActions),
|
|
805
813
|
security,
|
|
806
814
|
deploymentId,
|
|
807
815
|
distDir: userConfig.distDir || ".farm",
|
|
@@ -870,7 +878,7 @@ async function loadConfig(rootDir, configPath, mode = process.env.NODE_ENV === "
|
|
|
870
878
|
if (!existsSync(normalizedPath)) {
|
|
871
879
|
continue;
|
|
872
880
|
}
|
|
873
|
-
const loadedConfig = await
|
|
881
|
+
const loadedConfig = await _chunkWBKEZXWEcjs.loadFarmConfigFile.call(void 0, normalizedPath, { root });
|
|
874
882
|
return loadedConfig.root === void 0 ? { ...loadedConfig, root } : loadedConfig;
|
|
875
883
|
} catch (error) {
|
|
876
884
|
const configError = new Error(
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
|
+
var _chunkUXHS27O6cjs = require('./chunk-UXHS27O6.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
7
10
|
|
|
8
11
|
|
|
9
|
-
var
|
|
12
|
+
var _chunkU6MPZ35Qcjs = require('./chunk-U6MPZ35Q.cjs');
|
|
10
13
|
|
|
11
14
|
|
|
12
|
-
var
|
|
15
|
+
var _chunkFUCSUGDMcjs = require('./chunk-FUCSUGDM.cjs');
|
|
13
16
|
|
|
14
17
|
|
|
15
18
|
var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
@@ -20,7 +23,7 @@ var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
|
20
23
|
|
|
21
24
|
|
|
22
25
|
|
|
23
|
-
var
|
|
26
|
+
var _chunkNDILNQ4Lcjs = require('./chunk-NDILNQ4L.cjs');
|
|
24
27
|
|
|
25
28
|
|
|
26
29
|
var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
|
|
@@ -28,13 +31,13 @@ var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
|
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
|
|
31
|
-
var
|
|
34
|
+
var _chunkKIIMAWOJcjs = require('./chunk-KIIMAWOJ.cjs');
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
|
|
35
38
|
|
|
36
39
|
|
|
37
|
-
var
|
|
40
|
+
var _chunkSHLXACIOcjs = require('./chunk-SHLXACIO.cjs');
|
|
38
41
|
|
|
39
42
|
|
|
40
43
|
|
|
@@ -44,7 +47,7 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
44
47
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
45
48
|
|
|
46
49
|
|
|
47
|
-
var
|
|
50
|
+
var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
|
|
@@ -58,13 +61,14 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
58
61
|
function farmApiPlugin(options = {}) {
|
|
59
62
|
const srcDir = _nullishCoalesce(options.srcDir, () => ( "src"));
|
|
60
63
|
const debug = _nullishCoalesce(options.debug, () => ( false));
|
|
61
|
-
const bodySizeLimit =
|
|
64
|
+
const bodySizeLimit = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, {
|
|
62
65
|
bodySizeLimit: options.bodySizeLimit
|
|
63
66
|
}).bodySizeLimit;
|
|
64
67
|
const basePath = options.basePath;
|
|
65
68
|
let apiRoutesCache = /* @__PURE__ */ new Map();
|
|
66
69
|
let apiRouterHandler = null;
|
|
67
70
|
let projectRoot = process.cwd();
|
|
71
|
+
let devServer;
|
|
68
72
|
let pluginMergedRoutes = null;
|
|
69
73
|
const servedRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _nullishCoalesce(pluginMergedRoutes, () => ( apiRoutesCache)), "servedRoutes");
|
|
70
74
|
let routePlugins;
|
|
@@ -110,7 +114,7 @@ function farmApiPlugin(options = {}) {
|
|
|
110
114
|
const existing = apiRoutesCache.get(routePath);
|
|
111
115
|
const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
|
|
112
116
|
if (existingFile) {
|
|
113
|
-
throw new (0,
|
|
117
|
+
throw new (0, _chunkU6MPZ35Qcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
114
118
|
}
|
|
115
119
|
if (existing) {
|
|
116
120
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -186,8 +190,14 @@ function farmApiPlugin(options = {}) {
|
|
|
186
190
|
const createRouter = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
187
191
|
const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
|
|
188
192
|
pluginMergedRoutes = plugins.length ? new Map(
|
|
189
|
-
|
|
190
|
-
bodySizeLimit
|
|
193
|
+
_chunkNDILNQ4Lcjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
|
|
194
|
+
bodySizeLimit,
|
|
195
|
+
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
196
|
+
// so the middleware that guards the endpoint's path runs for it.
|
|
197
|
+
dispatch: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (request) => {
|
|
198
|
+
if (!devServer) throw new Error("The Farm API dev server is not running.");
|
|
199
|
+
return _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, devServer)(request);
|
|
200
|
+
}, "dispatch")
|
|
191
201
|
}).map((route) => [route.path, route])
|
|
192
202
|
) : null;
|
|
193
203
|
const totalEndpoints = Array.from(servedRoutes().values()).reduce(
|
|
@@ -200,7 +210,7 @@ function farmApiPlugin(options = {}) {
|
|
|
200
210
|
const url = new URL(request.url);
|
|
201
211
|
const method = request.method.toUpperCase();
|
|
202
212
|
const pathname = url.pathname;
|
|
203
|
-
const match =
|
|
213
|
+
const match = _chunkNDILNQ4Lcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
|
|
204
214
|
if (!match) {
|
|
205
215
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
206
216
|
status: 404,
|
|
@@ -208,18 +218,18 @@ function farmApiPlugin(options = {}) {
|
|
|
208
218
|
});
|
|
209
219
|
}
|
|
210
220
|
const { route, params } = match;
|
|
211
|
-
const endpoint =
|
|
221
|
+
const endpoint = _chunkNDILNQ4Lcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
212
222
|
if (!endpoint) {
|
|
213
223
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
214
224
|
status: 405,
|
|
215
225
|
headers: {
|
|
216
|
-
Allow:
|
|
226
|
+
Allow: _chunkNDILNQ4Lcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
217
227
|
"Content-Type": "application/json"
|
|
218
228
|
}
|
|
219
229
|
});
|
|
220
230
|
}
|
|
221
231
|
try {
|
|
222
|
-
return await
|
|
232
|
+
return await _chunkNDILNQ4Lcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
|
|
223
233
|
} catch (error) {
|
|
224
234
|
return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
|
|
225
235
|
status: 500,
|
|
@@ -235,6 +245,7 @@ function farmApiPlugin(options = {}) {
|
|
|
235
245
|
enforce: "pre",
|
|
236
246
|
configureServer(server) {
|
|
237
247
|
projectRoot = server.config.root;
|
|
248
|
+
devServer = server;
|
|
238
249
|
const discoverFileRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (apiDir) => {
|
|
239
250
|
const fs = await import("fs");
|
|
240
251
|
const path = await import("path");
|
|
@@ -264,10 +275,10 @@ function farmApiPlugin(options = {}) {
|
|
|
264
275
|
try {
|
|
265
276
|
const relativePath = path.relative(apiDir, path.dirname(filePath));
|
|
266
277
|
const routePath = "/api/" + (relativePath === "." ? "" : relativePath.replace(/\\/g, "/"));
|
|
267
|
-
const routeModule = await
|
|
278
|
+
const routeModule = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
268
279
|
const endpoints = {};
|
|
269
280
|
const availableMethods = [];
|
|
270
|
-
for (const method of
|
|
281
|
+
for (const method of _chunkNDILNQ4Lcjs.API_ROUTE_METHODS) {
|
|
271
282
|
if (routeModule[method]) {
|
|
272
283
|
availableMethods.push(method);
|
|
273
284
|
endpoints[method] = routeModule[method];
|
|
@@ -280,7 +291,7 @@ function farmApiPlugin(options = {}) {
|
|
|
280
291
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
281
292
|
}
|
|
282
293
|
} catch (e) {
|
|
283
|
-
if (e instanceof
|
|
294
|
+
if (e instanceof _chunkU6MPZ35Qcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
284
295
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
285
296
|
}
|
|
286
297
|
}
|
|
@@ -296,7 +307,7 @@ function farmApiPlugin(options = {}) {
|
|
|
296
307
|
for (const routesFile of routesFiles) {
|
|
297
308
|
if (fs.existsSync(routesFile)) {
|
|
298
309
|
try {
|
|
299
|
-
const routesModule = await
|
|
310
|
+
const routesModule = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, routesFile);
|
|
300
311
|
for (const [exportName, exportValue] of Object.entries(routesModule)) {
|
|
301
312
|
const endpoint = exportValue;
|
|
302
313
|
if (endpoint && endpoint.__path) {
|
|
@@ -307,7 +318,7 @@ function farmApiPlugin(options = {}) {
|
|
|
307
318
|
}
|
|
308
319
|
}
|
|
309
320
|
} catch (e) {
|
|
310
|
-
if (e instanceof
|
|
321
|
+
if (e instanceof _chunkU6MPZ35Qcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
311
322
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
312
323
|
}
|
|
313
324
|
break;
|
|
@@ -317,12 +328,12 @@ function farmApiPlugin(options = {}) {
|
|
|
317
328
|
const discoverProgrammaticRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
318
329
|
const path = await import("path");
|
|
319
330
|
const srcRoot = path.join(server.config.root, srcDir);
|
|
320
|
-
const routeFiles =
|
|
331
|
+
const routeFiles = _chunkFUCSUGDMcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot);
|
|
321
332
|
if (routeFiles.length === 0) return;
|
|
322
333
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
323
334
|
for (const routeFile of routeFiles) {
|
|
324
335
|
try {
|
|
325
|
-
const routesModule = await
|
|
336
|
+
const routesModule = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0,
|
|
326
337
|
server,
|
|
327
338
|
_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, routeFile, server.config.root)
|
|
328
339
|
);
|
|
@@ -338,7 +349,7 @@ function farmApiPlugin(options = {}) {
|
|
|
338
349
|
}
|
|
339
350
|
}
|
|
340
351
|
} catch (e) {
|
|
341
|
-
if (e instanceof
|
|
352
|
+
if (e instanceof _chunkU6MPZ35Qcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
342
353
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
343
354
|
}
|
|
344
355
|
}
|
|
@@ -390,7 +401,7 @@ function farmApiPlugin(options = {}) {
|
|
|
390
401
|
const pathname = url.split("?")[0];
|
|
391
402
|
const method = req.method || "GET";
|
|
392
403
|
if (discoveryPromise) await waitForDiscovery();
|
|
393
|
-
if (!
|
|
404
|
+
if (!_chunkNDILNQ4Lcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
|
|
394
405
|
return next();
|
|
395
406
|
}
|
|
396
407
|
if (!apiRouterHandler) {
|
|
@@ -411,10 +422,10 @@ function farmApiPlugin(options = {}) {
|
|
|
411
422
|
}
|
|
412
423
|
const currentUrl = req.url || url;
|
|
413
424
|
const currentPathname = currentUrl.split("?")[0];
|
|
414
|
-
if (currentPathname !== pathname && !
|
|
425
|
+
if (currentPathname !== pathname && !_chunkNDILNQ4Lcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
|
|
415
426
|
return next();
|
|
416
427
|
}
|
|
417
|
-
const fullUrl =
|
|
428
|
+
const fullUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req);
|
|
418
429
|
const headers = new Headers();
|
|
419
430
|
for (const [key, value] of Object.entries(req.headers)) {
|
|
420
431
|
if (value) {
|
|
@@ -423,7 +434,7 @@ function farmApiPlugin(options = {}) {
|
|
|
423
434
|
}
|
|
424
435
|
let body;
|
|
425
436
|
if (method !== "GET" && method !== "HEAD") {
|
|
426
|
-
body = await
|
|
437
|
+
body = await _chunkKIIMAWOJcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
|
|
427
438
|
}
|
|
428
439
|
const request = new Request(fullUrl, {
|
|
429
440
|
method,
|
|
@@ -438,7 +449,7 @@ function farmApiPlugin(options = {}) {
|
|
|
438
449
|
logResponse(method, currentPathname, response.status, duration);
|
|
439
450
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
|
|
440
451
|
} catch (error) {
|
|
441
|
-
const bodyErrorResponse =
|
|
452
|
+
const bodyErrorResponse = _chunkKIIMAWOJcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
442
453
|
if (bodyErrorResponse) {
|
|
443
454
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
444
455
|
return;
|
|
@@ -487,7 +498,7 @@ function farmApiPlugin(options = {}) {
|
|
|
487
498
|
if (await _optionalChain([recoverFailedDiscovery, 'optionalCall', _9 => _9()])) return [];
|
|
488
499
|
const previousState = snapshotRouteState();
|
|
489
500
|
try {
|
|
490
|
-
const routesModule = await
|
|
501
|
+
const routesModule = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
491
502
|
removeEndpointsFromFile(file);
|
|
492
503
|
for (const [exportName, exportValue] of Object.entries(routesModule)) {
|
|
493
504
|
const endpoint = exportValue;
|
|
@@ -515,7 +526,7 @@ function farmApiPlugin(options = {}) {
|
|
|
515
526
|
log(`API router recreated`);
|
|
516
527
|
} catch (e) {
|
|
517
528
|
restoreRouteState(previousState);
|
|
518
|
-
if (e instanceof
|
|
529
|
+
if (e instanceof _chunkU6MPZ35Qcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
519
530
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
520
531
|
}
|
|
521
532
|
return [];
|
|
@@ -540,10 +551,10 @@ function farmApiPlugin(options = {}) {
|
|
|
540
551
|
log(`API route file removed: ${routePath}`);
|
|
541
552
|
return [];
|
|
542
553
|
}
|
|
543
|
-
const routeModule = await
|
|
554
|
+
const routeModule = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
544
555
|
removeEndpointsFromFile(file);
|
|
545
556
|
const availableMethods = [];
|
|
546
|
-
for (const method of
|
|
557
|
+
for (const method of _chunkNDILNQ4Lcjs.API_ROUTE_METHODS) {
|
|
547
558
|
if (!routeModule[method]) continue;
|
|
548
559
|
availableMethods.push(method);
|
|
549
560
|
addEndpoint(routePath, file, method, routeModule[method]);
|
|
@@ -553,7 +564,7 @@ function farmApiPlugin(options = {}) {
|
|
|
553
564
|
log(`API router recreated`);
|
|
554
565
|
} catch (e) {
|
|
555
566
|
restoreRouteState(previousState);
|
|
556
|
-
if (e instanceof
|
|
567
|
+
if (e instanceof _chunkU6MPZ35Qcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
|
|
557
568
|
log(`API route HMR failed: ${e.message}`);
|
|
558
569
|
}
|
|
559
570
|
return [];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
_setAppRequestView,
|
|
2
3
|
_setCurrentRequestResolver
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S3VWVTVA.mjs";
|
|
4
5
|
import {
|
|
5
6
|
__name
|
|
6
7
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -28,7 +29,45 @@ function getRequestReads() {
|
|
|
28
29
|
}
|
|
29
30
|
__name(getRequestReads, "getRequestReads");
|
|
30
31
|
var requestReads = getRequestReads();
|
|
32
|
+
function countRequestRead(request) {
|
|
33
|
+
requestReads.set(request, (requestReads.get(request) ?? 0) + 1);
|
|
34
|
+
}
|
|
35
|
+
__name(countRequestRead, "countRequestRead");
|
|
36
|
+
var appRequestViews = /* @__PURE__ */ new WeakMap();
|
|
37
|
+
function getAppRequestView(request) {
|
|
38
|
+
const existing = appRequestViews.get(request);
|
|
39
|
+
if (existing) return existing;
|
|
40
|
+
let view;
|
|
41
|
+
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
42
|
+
countRequestRead(request);
|
|
43
|
+
view = request;
|
|
44
|
+
} else {
|
|
45
|
+
view = new Request(request);
|
|
46
|
+
Object.defineProperties(view, {
|
|
47
|
+
// The rendered request's own signal, so aborting it reaches the handler unchanged.
|
|
48
|
+
signal: { configurable: true, get: /* @__PURE__ */ __name(() => request.signal, "get") },
|
|
49
|
+
headers: {
|
|
50
|
+
configurable: true,
|
|
51
|
+
get() {
|
|
52
|
+
countRequestRead(request);
|
|
53
|
+
return request.headers;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
clone: {
|
|
57
|
+
configurable: true,
|
|
58
|
+
value() {
|
|
59
|
+
countRequestRead(request);
|
|
60
|
+
return request.clone();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
appRequestViews.set(request, view);
|
|
66
|
+
return view;
|
|
67
|
+
}
|
|
68
|
+
__name(getAppRequestView, "getAppRequestView");
|
|
31
69
|
_setCurrentRequestResolver(() => requestStore.getStore());
|
|
70
|
+
_setAppRequestView(getAppRequestView);
|
|
32
71
|
function resolveFarmRequestURL(req, options = {}) {
|
|
33
72
|
if (options.origin) {
|
|
34
73
|
return new URL(req.url || "/", options.origin);
|
|
@@ -116,7 +155,7 @@ function getCurrentRequest() {
|
|
|
116
155
|
"No current request is available. getCurrentRequest() can only be used during server rendering."
|
|
117
156
|
);
|
|
118
157
|
}
|
|
119
|
-
|
|
158
|
+
countRequestRead(request);
|
|
120
159
|
return request;
|
|
121
160
|
}
|
|
122
161
|
__name(getCurrentRequest, "getCurrentRequest");
|