@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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
matchSSGPage,
|
|
5
5
|
resolveRouteRenderingConfig,
|
|
6
6
|
resolveRouteRenderingConfigFromFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CQMVIOYP.mjs";
|
|
8
8
|
import {
|
|
9
9
|
collectSchemaExtensions,
|
|
10
10
|
declareSchemaTables,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-ZMSZZXOR.mjs";
|
|
16
16
|
import {
|
|
17
17
|
FARM_API_CATALOG_PATH,
|
|
18
|
-
|
|
18
|
+
FARM_INFRA_SIGNATURE_HEADER,
|
|
19
19
|
classifyFarmDocumentPrefix,
|
|
20
20
|
composeFarmFullDocument,
|
|
21
21
|
createDefaultErrorMarkup,
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
getDefaultErrorStatusText,
|
|
33
33
|
getRouteDirectoryDepth,
|
|
34
34
|
getRouteGroupScope,
|
|
35
|
+
isFarmAppManifestPath,
|
|
35
36
|
isInRouteGroupScope,
|
|
36
37
|
listFarmMCPLlmsTxtLinks,
|
|
37
38
|
removeFarmDocumentTitles,
|
|
@@ -41,16 +42,24 @@ import {
|
|
|
41
42
|
resolveFarmAppManifestInput,
|
|
42
43
|
routeBoundaryCoversDirectory,
|
|
43
44
|
stripRouteGroups
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-LBGILORX.mjs";
|
|
46
|
+
import {
|
|
47
|
+
FARM_DEFAULT_MCP_PATH,
|
|
48
|
+
collectFarmDefaultMCPPages,
|
|
49
|
+
createFarmDefaultMCPServer,
|
|
50
|
+
farmConfigMountsMCP,
|
|
51
|
+
isFarmDefaultMCPPathname,
|
|
52
|
+
resolveFarmDefaultMCPServer
|
|
53
|
+
} from "./chunk-UH6QN5NL.mjs";
|
|
45
54
|
import {
|
|
46
55
|
isFarmPreviewDeploymentEnvironment
|
|
47
56
|
} from "./chunk-BOYNDCZL.mjs";
|
|
48
57
|
import {
|
|
49
58
|
createFarmMetadataImageResponse
|
|
50
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-AJQTP4OO.mjs";
|
|
51
60
|
import {
|
|
52
61
|
createFarmImageHandler
|
|
53
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-F5QO4FNE.mjs";
|
|
54
63
|
import {
|
|
55
64
|
FARM_ISLAND_REPLAYABLE_SELECTOR,
|
|
56
65
|
isFarmIslandStrategy
|
|
@@ -64,7 +73,7 @@ import {
|
|
|
64
73
|
import {
|
|
65
74
|
_setDefaultFarmThemeConfig,
|
|
66
75
|
getTheme
|
|
67
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-TDNWPAVR.mjs";
|
|
68
77
|
import {
|
|
69
78
|
generateFarmDocsAdapterClientRuntime,
|
|
70
79
|
getFarmDocsAdapterConfigModule,
|
|
@@ -93,7 +102,7 @@ import {
|
|
|
93
102
|
getFarmAppDirectories,
|
|
94
103
|
getFarmLayerAliases,
|
|
95
104
|
getFarmSourceRoots
|
|
96
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-BUGNQIHC.mjs";
|
|
97
106
|
import {
|
|
98
107
|
REACT_RENDERER,
|
|
99
108
|
assertFarmRendererStreamingRuntime,
|
|
@@ -111,19 +120,23 @@ import {
|
|
|
111
120
|
import {
|
|
112
121
|
FARM_PREVIEW_ROBOTS_TAG,
|
|
113
122
|
addFarmCspNonceToScriptTags,
|
|
114
|
-
collectFarmLlmsTxtPages,
|
|
115
123
|
createFarmAgentRobots,
|
|
116
124
|
createFarmCspNonce,
|
|
117
125
|
createFarmCspNonceRewriter,
|
|
118
|
-
|
|
119
|
-
createFarmLlmsMarkdownReader,
|
|
126
|
+
createFarmDefaultSitemap,
|
|
120
127
|
getFarmSecurityHeader,
|
|
121
|
-
renderFarmLlmsFullTxt,
|
|
122
128
|
resolveFarmAgentCrawlers,
|
|
123
|
-
|
|
129
|
+
resolveFarmAgentSitemap,
|
|
124
130
|
resolveFarmPerformanceConfig,
|
|
125
131
|
resolveFarmSecurityConfig
|
|
126
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-4E5WBPEG.mjs";
|
|
133
|
+
import {
|
|
134
|
+
collectFarmLlmsTxtPages,
|
|
135
|
+
createFarmDefaultLlmsTxt,
|
|
136
|
+
createFarmLlmsMarkdownReader,
|
|
137
|
+
renderFarmLlmsFullTxt,
|
|
138
|
+
resolveFarmLlmsTxtConfig
|
|
139
|
+
} from "./chunk-DTSROJ5J.mjs";
|
|
127
140
|
import {
|
|
128
141
|
getPublicFarmImageConfig,
|
|
129
142
|
resolveFarmImageConfig
|
|
@@ -133,7 +146,7 @@ import {
|
|
|
133
146
|
} from "./chunk-YHOCRI4H.mjs";
|
|
134
147
|
import {
|
|
135
148
|
resolveServerActionsConfig
|
|
136
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-4WVJLURN.mjs";
|
|
137
150
|
import {
|
|
138
151
|
createBundledEnv,
|
|
139
152
|
getResolvedEnv
|
|
@@ -141,12 +154,12 @@ import {
|
|
|
141
154
|
import {
|
|
142
155
|
createFarmMarkdownRouteModuleFromFile,
|
|
143
156
|
loadFarmMdxComponents
|
|
144
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-FBOJ55OM.mjs";
|
|
145
158
|
import {
|
|
146
159
|
createFarmMarkdownSourceResponse,
|
|
147
160
|
isFarmMarkdownPageFile,
|
|
148
161
|
normalizeFarmMarkdownRoutePath
|
|
149
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-TPLJVC7E.mjs";
|
|
150
163
|
import {
|
|
151
164
|
resolveFarmMdxComponentsModulePath,
|
|
152
165
|
resolveMdxConfig
|
|
@@ -163,7 +176,7 @@ import {
|
|
|
163
176
|
} from "./chunk-WWIKMBRN.mjs";
|
|
164
177
|
import {
|
|
165
178
|
resolveWorkflowsConfig
|
|
166
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-Q2KB32T4.mjs";
|
|
167
180
|
import {
|
|
168
181
|
initStorage
|
|
169
182
|
} from "./chunk-UWPLULNK.mjs";
|
|
@@ -183,10 +196,10 @@ import {
|
|
|
183
196
|
getRegisteredIntegrationAPIManifest,
|
|
184
197
|
isFarmIntegrationProviderComponentReference,
|
|
185
198
|
matchIntegrationRoute
|
|
186
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-Z5BEWYVO.mjs";
|
|
187
200
|
import {
|
|
188
201
|
MiddlewareManager
|
|
189
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-NFMDCAOS.mjs";
|
|
190
203
|
import {
|
|
191
204
|
createRouteSlotContainerId,
|
|
192
205
|
parseRouteSlotFile
|
|
@@ -196,7 +209,10 @@ import {
|
|
|
196
209
|
_clearCurrentMiddlewareData,
|
|
197
210
|
_runWithMiddlewareContext,
|
|
198
211
|
_runWithMiddlewareData
|
|
199
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-J3ANCZKA.mjs";
|
|
213
|
+
import {
|
|
214
|
+
createFarmDevServerDispatch
|
|
215
|
+
} from "./chunk-SGBZPZUW.mjs";
|
|
200
216
|
import {
|
|
201
217
|
_runWithAPIRequestRuntime
|
|
202
218
|
} from "./chunk-R3DS7A2T.mjs";
|
|
@@ -205,11 +221,11 @@ import {
|
|
|
205
221
|
} from "./chunk-IOEH4VWN.mjs";
|
|
206
222
|
import {
|
|
207
223
|
APIRouteManager
|
|
208
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-VXAWRDK7.mjs";
|
|
209
225
|
import {
|
|
210
226
|
findProgrammaticRouteFiles,
|
|
211
227
|
loadProgrammaticRouteManifests
|
|
212
|
-
} from "./chunk-
|
|
228
|
+
} from "./chunk-MYIZXDZA.mjs";
|
|
213
229
|
import {
|
|
214
230
|
_runWithFarmI18nRequest,
|
|
215
231
|
_setDefaultFarmI18nRuntime,
|
|
@@ -224,7 +240,7 @@ import {
|
|
|
224
240
|
} from "./chunk-YOZYCI6Z.mjs";
|
|
225
241
|
import {
|
|
226
242
|
isFarmAPIPathname
|
|
227
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-HEVMCTSR.mjs";
|
|
228
244
|
import {
|
|
229
245
|
registerFarmMCPServer
|
|
230
246
|
} from "./chunk-ZLAT2CWY.mjs";
|
|
@@ -262,15 +278,16 @@ import {
|
|
|
262
278
|
readNodeRequestBody,
|
|
263
279
|
resolveFarmServerConfig,
|
|
264
280
|
setRequestContext
|
|
265
|
-
} from "./chunk-
|
|
281
|
+
} from "./chunk-ZMMBIVQM.mjs";
|
|
266
282
|
import {
|
|
267
283
|
createCliColors
|
|
268
284
|
} from "./chunk-I2BHUNBU.mjs";
|
|
269
285
|
import {
|
|
270
286
|
invalidateFailedFarmDevModules,
|
|
287
|
+
invalidateFarmDevDependents,
|
|
271
288
|
loadFarmDevModule,
|
|
272
289
|
toFileModuleUrl
|
|
273
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-KMTGADN3.mjs";
|
|
274
291
|
import {
|
|
275
292
|
isFarmI18nCatalogFile,
|
|
276
293
|
resolveFarmI18nConfig,
|
|
@@ -294,9 +311,6 @@ import {
|
|
|
294
311
|
import {
|
|
295
312
|
searchParamsToObject
|
|
296
313
|
} from "./chunk-QVKYGNVM.mjs";
|
|
297
|
-
import {
|
|
298
|
-
resolveFarmAPIServerBasePath
|
|
299
|
-
} from "./chunk-BTHHUD7Q.mjs";
|
|
300
314
|
import {
|
|
301
315
|
configureFarmObservability,
|
|
302
316
|
emitFarmEvent,
|
|
@@ -306,9 +320,12 @@ import {
|
|
|
306
320
|
applyWebResponseHeaders,
|
|
307
321
|
sendWebResponse
|
|
308
322
|
} from "./chunk-Z2RZJZIZ.mjs";
|
|
323
|
+
import {
|
|
324
|
+
resolveFarmAPIServerBasePath
|
|
325
|
+
} from "./chunk-BTHHUD7Q.mjs";
|
|
309
326
|
import {
|
|
310
327
|
FARM_VERSION
|
|
311
|
-
} from "./chunk-
|
|
328
|
+
} from "./chunk-YCKO6FRS.mjs";
|
|
312
329
|
import {
|
|
313
330
|
resolveFarmTrailingSlashRedirect,
|
|
314
331
|
setFarmTrailingSlashPreference
|
|
@@ -346,7 +363,7 @@ import {
|
|
|
346
363
|
} from "./chunk-CNOQY6Z7.mjs";
|
|
347
364
|
import {
|
|
348
365
|
FARM_CONFIG_REWRITES_PLUGIN_NAME
|
|
349
|
-
} from "./chunk-
|
|
366
|
+
} from "./chunk-HMRSWN47.mjs";
|
|
350
367
|
import {
|
|
351
368
|
appendFarmRedirectQuery
|
|
352
369
|
} from "./chunk-BRYHOB4X.mjs";
|
|
@@ -359,11 +376,12 @@ import {
|
|
|
359
376
|
_getRequestReadCount,
|
|
360
377
|
_runWithCurrentRequest,
|
|
361
378
|
createWebRequestFromFarmRequest,
|
|
379
|
+
getCurrentRequestOrNull,
|
|
362
380
|
resolveFarmRequestURL
|
|
363
|
-
} from "./chunk-
|
|
381
|
+
} from "./chunk-3KGDJLJK.mjs";
|
|
364
382
|
import {
|
|
365
383
|
_resolveCurrentRequest
|
|
366
|
-
} from "./chunk-
|
|
384
|
+
} from "./chunk-S3VWVTVA.mjs";
|
|
367
385
|
import {
|
|
368
386
|
localizeFarmHref,
|
|
369
387
|
localizeFarmPathname,
|
|
@@ -825,6 +843,7 @@ function getClientModuleHydrationPlan(modulePath, root, mode = "off", options =
|
|
|
825
843
|
}
|
|
826
844
|
const inspection = collectIsolatedClientBoundaries(resolvedPath, root, {
|
|
827
845
|
allowDynamicCardinality: asyncOwner,
|
|
846
|
+
allowElementProps: asyncOwner,
|
|
828
847
|
staticPackageBoundaries: asyncOwner
|
|
829
848
|
});
|
|
830
849
|
if (inspection.boundaries.length === 0) {
|
|
@@ -1322,7 +1341,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
1322
1341
|
fallbackReason = `the client boundary imported from ${specifier} renders inside <${container}>, where the HTML parser relocates its hydration marker`;
|
|
1323
1342
|
return 0;
|
|
1324
1343
|
}
|
|
1325
|
-
if (passesElementValuedProps(content, localBindings)) {
|
|
1344
|
+
if (!options.allowElementProps && passesElementValuedProps(content, localBindings)) {
|
|
1326
1345
|
fallbackReason = `the client boundary imported from ${specifier} receives React elements, which cannot cross the boundary as serialized props`;
|
|
1327
1346
|
return 0;
|
|
1328
1347
|
}
|
|
@@ -1371,10 +1390,12 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
|
|
|
1371
1390
|
};
|
|
1372
1391
|
}
|
|
1373
1392
|
let importsClientBoundary = false;
|
|
1393
|
+
let importsAsyncOwner = false;
|
|
1374
1394
|
let importedIslandStrategy = null;
|
|
1375
1395
|
for (const specifier of getImportSpecifiers(content)) {
|
|
1376
1396
|
const imported = resolveImportedModule(resolvedPath, specifier, root);
|
|
1377
1397
|
const importedMetadata = imported.local ? inspectClientModuleMetadata(imported.path, root, visited, false) : inspectPackageClientBoundary(imported.path, root, visited);
|
|
1398
|
+
if (importedMetadata.suppressedAsyncHydration) importsAsyncOwner = true;
|
|
1378
1399
|
if (importedMetadata.isClientComponent || importedMetadata.shouldHydrate) {
|
|
1379
1400
|
importsClientBoundary = true;
|
|
1380
1401
|
if (importedIslandStrategy === null) {
|
|
@@ -1385,7 +1406,7 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
|
|
|
1385
1406
|
}
|
|
1386
1407
|
}
|
|
1387
1408
|
const shouldHydrate = parsed.hasHydrateExport || importsClientBoundary;
|
|
1388
|
-
if (shouldHydrate && hasAsyncDefaultExport(content)) {
|
|
1409
|
+
if (shouldHydrate && hasAsyncDefaultExport(content) || importsAsyncOwner) {
|
|
1389
1410
|
return {
|
|
1390
1411
|
isClientComponent: false,
|
|
1391
1412
|
shouldHydrate: false,
|
|
@@ -4804,6 +4825,16 @@ function createRouteStateProps(input) {
|
|
|
4804
4825
|
};
|
|
4805
4826
|
}
|
|
4806
4827
|
__name(createRouteStateProps, "createRouteStateProps");
|
|
4828
|
+
function readAppPackageIdentity(root) {
|
|
4829
|
+
try {
|
|
4830
|
+
return JSON.parse(
|
|
4831
|
+
fs5.readFileSync(path9.join(root || process.cwd(), "package.json"), "utf8")
|
|
4832
|
+
);
|
|
4833
|
+
} catch {
|
|
4834
|
+
return {};
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
__name(readAppPackageIdentity, "readAppPackageIdentity");
|
|
4807
4838
|
var _ServerRenderer = class _ServerRenderer {
|
|
4808
4839
|
constructor(config, routeManager, i18nRuntime, viteServer) {
|
|
4809
4840
|
this.ssgManifest = [];
|
|
@@ -5387,6 +5418,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5387
5418
|
completeRender(res.statusCode || 200, pathname);
|
|
5388
5419
|
return;
|
|
5389
5420
|
}
|
|
5421
|
+
if (pathname === "/sitemap.xml" && this.getAgentSitemap().enabled) {
|
|
5422
|
+
await this.renderGeneratedSitemap(req, res);
|
|
5423
|
+
completeRender(res.statusCode || 200, pathname);
|
|
5424
|
+
return;
|
|
5425
|
+
}
|
|
5390
5426
|
const metadataImageMatch = this.routeManager.matchMetadataImage(pathname);
|
|
5391
5427
|
if (metadataImageMatch) {
|
|
5392
5428
|
await this.renderMetadataImage(req, res, {
|
|
@@ -5424,6 +5460,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5424
5460
|
layouts = match.layouts;
|
|
5425
5461
|
routeSlots = match.slots ?? [];
|
|
5426
5462
|
if (!route) {
|
|
5463
|
+
if (isFarmDefaultMCPPathname(pathname) && this.getDefaultMCPServer()) {
|
|
5464
|
+
await this.renderDefaultMCP(req, res);
|
|
5465
|
+
completeRender(res.statusCode || 200, pathname);
|
|
5466
|
+
return;
|
|
5467
|
+
}
|
|
5427
5468
|
emitFarmEvent({ type: "route.notFound", pathname });
|
|
5428
5469
|
await this.render404(req, res);
|
|
5429
5470
|
completeRender(404);
|
|
@@ -6208,7 +6249,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6208
6249
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6209
6250
|
async renderGeneratedRobotsTxt(req, res) {
|
|
6210
6251
|
try {
|
|
6211
|
-
const sitemapPath = this.routeManager.matchMetadataRoute("/sitemap.xml")?.metadata.kind === "sitemap" ? "/sitemap.xml" : void 0;
|
|
6252
|
+
const sitemapPath = this.routeManager.matchMetadataRoute("/sitemap.xml")?.metadata.kind === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
6212
6253
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6213
6254
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6214
6255
|
const robots = createFarmAgentRobots({
|
|
@@ -6232,6 +6273,112 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6232
6273
|
);
|
|
6233
6274
|
}
|
|
6234
6275
|
}
|
|
6276
|
+
getAgentSitemap() {
|
|
6277
|
+
return resolveFarmAgentSitemap(this.config.agent?.sitemap);
|
|
6278
|
+
}
|
|
6279
|
+
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
6280
|
+
async renderGeneratedSitemap(req, res) {
|
|
6281
|
+
try {
|
|
6282
|
+
const request2 = createWebRequestFromFarmRequest(req, {
|
|
6283
|
+
trustProxy: this.config.server?.trustProxy
|
|
6284
|
+
});
|
|
6285
|
+
const sources = await Promise.all(
|
|
6286
|
+
[...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => {
|
|
6287
|
+
const [module, stat] = await Promise.all([
|
|
6288
|
+
this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
|
|
6289
|
+
logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
|
|
6290
|
+
return void 0;
|
|
6291
|
+
}),
|
|
6292
|
+
fs5.promises.stat(route.modulePath).catch(() => void 0)
|
|
6293
|
+
]);
|
|
6294
|
+
return { pattern, module, lastModified: stat?.mtime.toISOString() };
|
|
6295
|
+
})
|
|
6296
|
+
);
|
|
6297
|
+
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6298
|
+
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6299
|
+
const sitemap = createFarmDefaultSitemap(sources, {
|
|
6300
|
+
origin: new URL(request2.url).origin,
|
|
6301
|
+
config: this.getAgentSitemap(),
|
|
6302
|
+
metadataBase: rootMetadata?.metadataBase,
|
|
6303
|
+
basePath: this.config.basePath
|
|
6304
|
+
});
|
|
6305
|
+
await sendWebResponse(
|
|
6306
|
+
res,
|
|
6307
|
+
createFarmMetadataRouteResponse("sitemap", sitemap, {}, { method: req.method })
|
|
6308
|
+
);
|
|
6309
|
+
} catch (error) {
|
|
6310
|
+
logger.error(`Generated sitemap.xml failed: ${error}`);
|
|
6311
|
+
await sendWebResponse(
|
|
6312
|
+
res,
|
|
6313
|
+
new Response("Internal Server Error", {
|
|
6314
|
+
status: 500,
|
|
6315
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
6316
|
+
})
|
|
6317
|
+
);
|
|
6318
|
+
}
|
|
6319
|
+
}
|
|
6320
|
+
/** Lets the default MCP server see the app's API routes, which the dev server owns. */
|
|
6321
|
+
setAPIRouteLookup(exists) {
|
|
6322
|
+
this.apiRouteExists = exists;
|
|
6323
|
+
}
|
|
6324
|
+
/**
|
|
6325
|
+
* The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
|
|
6326
|
+
* server of its own: a route that answers /mcp, an API route at /api/mcp, `@farm.js/mcp`,
|
|
6327
|
+
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
6328
|
+
*/
|
|
6329
|
+
getDefaultMCPServer() {
|
|
6330
|
+
if (this.config.agent?.mcp !== true || farmConfigMountsMCP(this.config)) return void 0;
|
|
6331
|
+
if (this.apiRouteExists?.("/api/mcp")) return void 0;
|
|
6332
|
+
if (this.routeManager.matchRoute(FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6333
|
+
this.defaultMCPServer ?? (this.defaultMCPServer = createFarmDefaultMCPServer(
|
|
6334
|
+
readAppPackageIdentity(this.config.root),
|
|
6335
|
+
FARM_VERSION
|
|
6336
|
+
));
|
|
6337
|
+
return resolveFarmDefaultMCPServer(this.defaultMCPServer);
|
|
6338
|
+
}
|
|
6339
|
+
async renderDefaultMCP(req, res) {
|
|
6340
|
+
const server = this.getDefaultMCPServer();
|
|
6341
|
+
const request2 = getCurrentRequestOrNull() ?? createWebRequestFromFarmRequest(req, { trustProxy: this.config.server?.trustProxy });
|
|
6342
|
+
try {
|
|
6343
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-LPJ2CADR.mjs");
|
|
6344
|
+
const origin = new URL(request2.url).origin;
|
|
6345
|
+
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
6346
|
+
server,
|
|
6347
|
+
basePath: this.config.basePath,
|
|
6348
|
+
listPages: /* @__PURE__ */ __name(async () => {
|
|
6349
|
+
const sources = await Promise.all(
|
|
6350
|
+
[...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => ({
|
|
6351
|
+
pattern,
|
|
6352
|
+
// The page itself surfaces a load error. Without its module a guard cannot
|
|
6353
|
+
// be ruled out, so the page is left out.
|
|
6354
|
+
module: await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }))
|
|
6355
|
+
}))
|
|
6356
|
+
);
|
|
6357
|
+
return collectFarmDefaultMCPPages(sources, {
|
|
6358
|
+
origin,
|
|
6359
|
+
basePath: this.config.basePath,
|
|
6360
|
+
markdown: resolveMarkdownConfig(this.config.md)
|
|
6361
|
+
});
|
|
6362
|
+
}, "listPages"),
|
|
6363
|
+
// Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
|
|
6364
|
+
readMarkdown: this.createDevMarkdownReader(req)
|
|
6365
|
+
});
|
|
6366
|
+
await sendWebResponse(res, response);
|
|
6367
|
+
} catch (error) {
|
|
6368
|
+
logger.error(`Default MCP server failed: ${error}`);
|
|
6369
|
+
await sendWebResponse(
|
|
6370
|
+
res,
|
|
6371
|
+
new Response(
|
|
6372
|
+
JSON.stringify({
|
|
6373
|
+
jsonrpc: "2.0",
|
|
6374
|
+
id: null,
|
|
6375
|
+
error: { code: -32603, message: "Internal error." }
|
|
6376
|
+
}),
|
|
6377
|
+
{ status: 500, headers: { "Content-Type": "application/json" } }
|
|
6378
|
+
)
|
|
6379
|
+
);
|
|
6380
|
+
}
|
|
6381
|
+
}
|
|
6235
6382
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6236
6383
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6237
6384
|
const config = resolveFarmLlmsTxtConfig(this.config.agent?.llmsTxt);
|
|
@@ -6272,7 +6419,8 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6272
6419
|
normalizeFarmAPIConfig(
|
|
6273
6420
|
this.config.api
|
|
6274
6421
|
)
|
|
6275
|
-
)
|
|
6422
|
+
),
|
|
6423
|
+
defaultMCP: /* @__PURE__ */ __name(() => this.getDefaultMCPServer(), "defaultMCP")
|
|
6276
6424
|
})
|
|
6277
6425
|
}),
|
|
6278
6426
|
...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
|
|
@@ -9268,7 +9416,7 @@ var SOURCE_QUERY_FLAGS = ["raw", "inline", "url"];
|
|
|
9268
9416
|
var MODULE_EXTENSION = /\.(?:[cm]?[jt]sx?|vue|svelte|astro|mdx?|css|scss|sass|less|styl|stylus|pcss|postcss|sss)$/i;
|
|
9269
9417
|
var ASSET_EXTENSION = /\.(?:apng|bmp|png|jpe?g|jfif|pjpeg|pjp|gif|svg|ico|webp|avif|cur|jxl|mp4|webm|ogg|mp3|wav|flac|aac|opus|mov|m4a|vtt|woff2?|eot|ttf|otf|webmanifest|pdf|txt|wasm)$/i;
|
|
9270
9418
|
var INTERNAL_PREFIXES = ["/@vite/", "/@farm/", "/@react-refresh", "/__vite_ping"];
|
|
9271
|
-
var DEVELOPER_ONLY_PREFIXES = ["/__farm/devtools", "/__open-in-editor"];
|
|
9419
|
+
var DEVELOPER_ONLY_PREFIXES = ["/__farm/devtools", "/__open-in-editor", "/__mf_runner__"];
|
|
9272
9420
|
function createFarmDevPreviewGuard(server, options) {
|
|
9273
9421
|
return /* @__PURE__ */ __name(async function farmDevPreviewGuard(req, res, next) {
|
|
9274
9422
|
if (!isFarmPreviewTunnelRequest(req.headers)) return next();
|
|
@@ -9966,7 +10114,12 @@ function farmLlmsTxtGeneratedPaths(config) {
|
|
|
9966
10114
|
__name(farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
9967
10115
|
function farmAgentGeneratedPaths(config) {
|
|
9968
10116
|
const crawlers = resolveFarmAgentCrawlers(config.agent?.crawlers);
|
|
9969
|
-
|
|
10117
|
+
const sitemap = resolveFarmAgentSitemap(config.agent?.sitemap);
|
|
10118
|
+
return [
|
|
10119
|
+
...farmLlmsTxtGeneratedPaths(config),
|
|
10120
|
+
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
10121
|
+
...crawlers.enabled ? ["/robots.txt"] : []
|
|
10122
|
+
];
|
|
9970
10123
|
}
|
|
9971
10124
|
__name(farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
|
|
9972
10125
|
var ALL_TYPE_ARTIFACTS = {
|
|
@@ -10011,7 +10164,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
10011
10164
|
}
|
|
10012
10165
|
__name(loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
10013
10166
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
10014
|
-
return import("./devtools-
|
|
10167
|
+
return import("./devtools-KVOY2TCZ.mjs");
|
|
10015
10168
|
}
|
|
10016
10169
|
__name(loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
10017
10170
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -10919,13 +11072,22 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10919
11072
|
layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
|
|
10920
11073
|
});
|
|
10921
11074
|
}
|
|
11075
|
+
const dispatchToDevServer = createFarmDevServerDispatch(server);
|
|
10922
11076
|
apiRouteManager = new APIRouteManager(appDirs, server, {
|
|
10923
11077
|
plugins: farmConfig.plugins,
|
|
10924
11078
|
i18n: farmApp.getI18nRuntime(),
|
|
10925
11079
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
10926
|
-
basePath: apiServerBasePath
|
|
11080
|
+
basePath: apiServerBasePath,
|
|
11081
|
+
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
11082
|
+
// so the endpoint's middleware and integration guards run for it, as in production.
|
|
11083
|
+
dispatch: /* @__PURE__ */ __name((request2) => {
|
|
11084
|
+
const url = new URL(request2.url);
|
|
11085
|
+
url.pathname = applyFarmBasePath(url.pathname, farmConfig.basePath);
|
|
11086
|
+
return dispatchToDevServer(new Request(url, request2));
|
|
11087
|
+
}, "dispatch")
|
|
10927
11088
|
});
|
|
10928
11089
|
await apiRouteManager.discoverRoutes();
|
|
11090
|
+
farmApp.getServerRenderer().setAPIRouteLookup((routePath) => apiRouteManager.getRoutes().has(routePath));
|
|
10929
11091
|
let discoveredWorkflows = [];
|
|
10930
11092
|
const hasWorkflowDirectory = workflowConfig.enabled && workflowConfig.dirs.some(
|
|
10931
11093
|
(dir) => fs11.existsSync(path21.isAbsolute(dir) ? dir : path21.join(farmConfig.root, dir))
|
|
@@ -11328,22 +11490,30 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11328
11490
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
11329
11491
|
return docsHandler(req, res);
|
|
11330
11492
|
}
|
|
11331
|
-
if (stripFarmBasePath(requestPathname, farmConfig.basePath)
|
|
11493
|
+
if (options.agent?.manifest !== false && isFarmAppManifestPath(stripFarmBasePath(requestPathname, farmConfig.basePath))) {
|
|
11494
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
11332
11495
|
farmAppPackages ?? (farmAppPackages = resolveFarmAppPackages(farmConfig.root ?? process.cwd()));
|
|
11496
|
+
const header = /* @__PURE__ */ __name((name) => String(req.headers[name] ?? ""), "header");
|
|
11333
11497
|
const manifest = await createFarmAppManifestResponse(
|
|
11334
|
-
new Request(parsedRequestUrl, {
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11498
|
+
new Request(parsedRequestUrl, {
|
|
11499
|
+
method: requestMethod,
|
|
11500
|
+
headers: {
|
|
11501
|
+
"if-none-match": header("if-none-match"),
|
|
11502
|
+
[FARM_INFRA_SIGNATURE_HEADER]: header(FARM_INFRA_SIGNATURE_HEADER)
|
|
11503
|
+
}
|
|
11340
11504
|
}),
|
|
11341
|
-
{
|
|
11505
|
+
{
|
|
11506
|
+
...resolveFarmAppManifestInput(farmConfig, {
|
|
11507
|
+
build: "development",
|
|
11508
|
+
packages: farmAppPackages,
|
|
11509
|
+
// Read again on each request; unchanged files come from a cache.
|
|
11510
|
+
webmcpTools: farmConfig.plugins?.some(({ name }) => name === "farm:webmcp") ? collectFarmWebMCPTools(farmConfig.root ?? process.cwd(), farmConfig.srcDir) : []
|
|
11511
|
+
}),
|
|
11512
|
+
defaultMCP: /* @__PURE__ */ __name(() => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP")
|
|
11513
|
+
}
|
|
11342
11514
|
);
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
return;
|
|
11346
|
-
}
|
|
11515
|
+
await sendWebResponse(res, manifest);
|
|
11516
|
+
return;
|
|
11347
11517
|
}
|
|
11348
11518
|
if (options.agent?.apiCatalog && stripFarmBasePath(requestPathname, farmConfig.basePath) === FARM_API_CATALOG_PATH) {
|
|
11349
11519
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
@@ -11368,7 +11538,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11368
11538
|
"if-none-match": String(req.headers["if-none-match"] ?? "")
|
|
11369
11539
|
}
|
|
11370
11540
|
}),
|
|
11371
|
-
{
|
|
11541
|
+
{
|
|
11542
|
+
basePath: farmConfig.basePath,
|
|
11543
|
+
apiServerBasePath,
|
|
11544
|
+
defaultMCP: /* @__PURE__ */ __name(() => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP")
|
|
11545
|
+
}
|
|
11372
11546
|
);
|
|
11373
11547
|
if (aiCatalog) {
|
|
11374
11548
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
@@ -11422,11 +11596,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11422
11596
|
};
|
|
11423
11597
|
}, "resolveSource"),
|
|
11424
11598
|
// The anonymous check goes through this server, so its guards and
|
|
11425
|
-
// middleware see the page's own path, as in production.
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11599
|
+
// middleware see the page's own path, as in production. It connects to
|
|
11600
|
+
// this server's own listener, never the host the caller's Host names.
|
|
11601
|
+
renderPage: /* @__PURE__ */ __name(async (request2) => createFarmDevServerDispatch(server)(
|
|
11602
|
+
new Request(request2, {
|
|
11603
|
+
signal: res.destroyed ? AbortSignal.abort() : createFarmNodeRequestAbortSignal(req, res)
|
|
11604
|
+
})
|
|
11605
|
+
), "renderPage")
|
|
11430
11606
|
});
|
|
11431
11607
|
if (markdownSourceResponse) {
|
|
11432
11608
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
@@ -11440,14 +11616,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11440
11616
|
}),
|
|
11441
11617
|
config: farmApp.getConfig().md,
|
|
11442
11618
|
routeExists: /* @__PURE__ */ __name((pathname2) => Boolean(farmApp.getRouteManager().matchRoute(pathname2).route), "routeExists"),
|
|
11443
|
-
//
|
|
11444
|
-
//
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11619
|
+
// The page is rendered by this server's own listener, never the host the
|
|
11620
|
+
// caller's Host names. Redirects are not followed, so the mirror answers with
|
|
11621
|
+
// the page's own (a sign-in gate, say), as production does.
|
|
11622
|
+
renderPage: /* @__PURE__ */ __name(async (request2) => {
|
|
11623
|
+
const headers = new Headers(request2.headers);
|
|
11624
|
+
headers.delete("accept-encoding");
|
|
11625
|
+
return createFarmDevServerDispatch(server)(
|
|
11626
|
+
new Request(request2, {
|
|
11627
|
+
headers,
|
|
11628
|
+
// Only accepted mirrors need disconnect listeners. An earlier
|
|
11629
|
+
// close (for example while the docs handler ran) must also abort.
|
|
11630
|
+
signal: res.destroyed ? AbortSignal.abort() : createFarmNodeRequestAbortSignal(req, res)
|
|
11631
|
+
})
|
|
11632
|
+
);
|
|
11633
|
+
}, "renderPage"),
|
|
11451
11634
|
apiServerBasePath
|
|
11452
11635
|
});
|
|
11453
11636
|
if (markdownResponse) {
|
|
@@ -12755,6 +12938,9 @@ if (import.meta.hot) {
|
|
|
12755
12938
|
});
|
|
12756
12939
|
return [];
|
|
12757
12940
|
}
|
|
12941
|
+
if (apiRouteManager && invalidateFarmDevDependents(server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
12942
|
+
await refreshRouteDiscovery?.(`updated ${file}`);
|
|
12943
|
+
}
|
|
12758
12944
|
const isolatedHydrationMode = currentFarmConfig?.experimental?.isolatedClientHydration;
|
|
12759
12945
|
const planRouteManager = farmApp?.getRouteManager();
|
|
12760
12946
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
@@ -14854,7 +15040,7 @@ async function defineConfig(config = {}) {
|
|
|
14854
15040
|
const tailwindVitePlugin = await loadTailwindVitePlugin();
|
|
14855
15041
|
const appRoot = path21.resolve(config.root || process.cwd());
|
|
14856
15042
|
if (config.extends?.length) {
|
|
14857
|
-
const { config: layeredConfig } = await import("./layers-
|
|
15043
|
+
const { config: layeredConfig } = await import("./layers-UTB43B7A.mjs").then(
|
|
14858
15044
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
14859
15045
|
root: appRoot,
|
|
14860
15046
|
mode: process.env.NODE_ENV === "production" ? "production" : "development"
|