@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
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunkPTZ2TVNEcjs = require('./chunk-PTZ2TVNE.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
|
|
4
7
|
|
|
5
8
|
|
|
6
|
-
var
|
|
9
|
+
var _chunk4WQ6PGSJcjs = require('./chunk-4WQ6PGSJ.cjs');
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
|
|
@@ -19,14 +22,15 @@ var _chunkTKJZFIMLcjs = require('./chunk-TKJZFIML.cjs');
|
|
|
19
22
|
var _chunk75RZHGLScjs = require('./chunk-75RZHGLS.cjs');
|
|
20
23
|
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
|
|
26
|
+
var _chunkKIIMAWOJcjs = require('./chunk-KIIMAWOJ.cjs');
|
|
23
27
|
|
|
24
28
|
|
|
25
29
|
|
|
26
30
|
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
27
31
|
|
|
28
32
|
|
|
29
|
-
var
|
|
33
|
+
var _chunkNQ6QFZWDcjs = require('./chunk-NQ6QFZWD.cjs');
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -153,7 +157,7 @@ function ensureFarmDocumentHead(markup) {
|
|
|
153
157
|
}
|
|
154
158
|
_chunkS3JO3N4Hcjs.__name.call(void 0, ensureFarmDocumentHead, "ensureFarmDocumentHead");
|
|
155
159
|
function ensureFarmDocumentRoot(markup) {
|
|
156
|
-
if (
|
|
160
|
+
if (/<body\b[^>]*>\s*<div\b[^>]*\sid=["']root["']/i.test(markup)) return markup;
|
|
157
161
|
return markup.replace(
|
|
158
162
|
/<body\b([^>]*)>/i,
|
|
159
163
|
(_match, attributes) => `<body${attributes}><div id="root">`
|
|
@@ -398,7 +402,7 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
|
|
|
398
402
|
if (isResponse(value)) {
|
|
399
403
|
return method === "HEAD" ? _chunkTKJZFIMLcjs.omitFarmResponseBody.call(void 0, value) : value;
|
|
400
404
|
}
|
|
401
|
-
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ?
|
|
405
|
+
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunk4WQ6PGSJcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
|
|
402
406
|
const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
|
|
403
407
|
return new Response(method === "HEAD" ? null : body, {
|
|
404
408
|
headers: {
|
|
@@ -436,6 +440,13 @@ function listFarmMCPServerSources(input) {
|
|
|
436
440
|
if (sources.has(endpoint)) continue;
|
|
437
441
|
sources.set(endpoint, { ...server, endpoint, local: Boolean(server.path) });
|
|
438
442
|
}
|
|
443
|
+
if (sources.size === 0 && input.defaultMCP) {
|
|
444
|
+
const server = input.defaultMCP();
|
|
445
|
+
if (server) {
|
|
446
|
+
const endpoint = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, server.path, input.basePath);
|
|
447
|
+
sources.set(endpoint, { ...server, endpoint, local: true });
|
|
448
|
+
}
|
|
449
|
+
}
|
|
439
450
|
return [...sources.values()];
|
|
440
451
|
}
|
|
441
452
|
_chunkS3JO3N4Hcjs.__name.call(void 0, listFarmMCPServerSources, "listFarmMCPServerSources");
|
|
@@ -526,7 +537,7 @@ function createFarmAiCatalogResponse(request, input = {}, requestUrl) {
|
|
|
526
537
|
const body = JSON.stringify(
|
|
527
538
|
card ? card.card : { specVersion: "1.0", entries: servers.map(({ entry }) => entry) }
|
|
528
539
|
);
|
|
529
|
-
const etag =
|
|
540
|
+
const etag = _chunkKIIMAWOJcjs.createFarmWeakETag.call(void 0, body);
|
|
530
541
|
const headers = {
|
|
531
542
|
...corsHeaders(),
|
|
532
543
|
"Content-Type": card ? `${SERVER_CARD_TYPE}; charset=utf-8` : ard ? "application/json; charset=utf-8" : `${AI_CATALOG_TYPE}; charset=utf-8`,
|
|
@@ -535,7 +546,7 @@ function createFarmAiCatalogResponse(request, input = {}, requestUrl) {
|
|
|
535
546
|
ETag: etag,
|
|
536
547
|
"X-Content-Type-Options": "nosniff"
|
|
537
548
|
};
|
|
538
|
-
if (
|
|
549
|
+
if (_chunkKIIMAWOJcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), etag)) {
|
|
539
550
|
return new Response(null, { status: 304, headers });
|
|
540
551
|
}
|
|
541
552
|
_chunkJ63ZH5OQcjs.emitFarmAgentRead.call(void 0, request, card ? "mcp-server-card" : "ai-catalog", 200);
|
|
@@ -565,15 +576,6 @@ function truncate(text) {
|
|
|
565
576
|
return text.length <= CARD_DESCRIPTION_MAX ? text : `${text.slice(0, CARD_DESCRIPTION_MAX - 1).trimEnd()}\u2026`;
|
|
566
577
|
}
|
|
567
578
|
_chunkS3JO3N4Hcjs.__name.call(void 0, truncate, "truncate");
|
|
568
|
-
function fnv1a(value) {
|
|
569
|
-
let hash = 2166136261;
|
|
570
|
-
for (let index = 0; index < value.length; index++) {
|
|
571
|
-
hash ^= value.charCodeAt(index);
|
|
572
|
-
hash = Math.imul(hash, 16777619);
|
|
573
|
-
}
|
|
574
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
575
|
-
}
|
|
576
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, fnv1a, "fnv1a");
|
|
577
579
|
|
|
578
580
|
// src/components/error-page.ts
|
|
579
581
|
var ERROR_STATUS_TEXT = {
|
|
@@ -868,7 +870,12 @@ function createFarmApiCatalogResponse(method, input, request) {
|
|
|
868
870
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmApiCatalogResponse, "createFarmApiCatalogResponse");
|
|
869
871
|
|
|
870
872
|
// src/app-manifest.ts
|
|
871
|
-
var FARM_APP_MANIFEST_PATH = "/.well-known/farmjs";
|
|
873
|
+
var FARM_APP_MANIFEST_PATH = "/.well-known/farmjs.json";
|
|
874
|
+
var FARM_APP_MANIFEST_LEGACY_PATH = "/.well-known/farmjs";
|
|
875
|
+
function isFarmAppManifestPath(pathname) {
|
|
876
|
+
return pathname === FARM_APP_MANIFEST_PATH || pathname === FARM_APP_MANIFEST_LEGACY_PATH;
|
|
877
|
+
}
|
|
878
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmAppManifestPath, "isFarmAppManifestPath");
|
|
872
879
|
var FARM_INFRA_SIGNATURE_HEADER = "farmjs-infra-signature";
|
|
873
880
|
var SIGNED_PURPOSE = "farmjs-manifest-v1";
|
|
874
881
|
var SIGNATURE_WINDOW_SECONDS = 300;
|
|
@@ -901,48 +908,80 @@ var SOURCES = {
|
|
|
901
908
|
standalone: "defineTool",
|
|
902
909
|
serverFunction: "serverFunction"
|
|
903
910
|
};
|
|
904
|
-
function createFarmAppManifest(input) {
|
|
905
|
-
|
|
911
|
+
function createFarmAppManifest(input, { full = false } = {}) {
|
|
912
|
+
const manifest = {
|
|
906
913
|
schemaVersion: 1,
|
|
907
914
|
app: {
|
|
908
|
-
farm:
|
|
915
|
+
farm: _chunkNQ6QFZWDcjs.FARM_VERSION,
|
|
909
916
|
renderer: input.renderer,
|
|
910
917
|
basePath: input.basePath,
|
|
911
918
|
build: input.build
|
|
912
919
|
},
|
|
913
920
|
packages: input.packages,
|
|
914
921
|
mcp: {
|
|
915
|
-
servers: _chunk75RZHGLScjs._listFarmMCPCatalogs.call(void 0, ).map(({ server, tools, details }) =>
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
922
|
+
servers: _chunk75RZHGLScjs._listFarmMCPCatalogs.call(void 0, ).map(({ server, tools, details }) => {
|
|
923
|
+
const listed = full || _optionalChain([details, 'optionalAccess', _37 => _37.public]) === true;
|
|
924
|
+
return {
|
|
925
|
+
name: server.name,
|
|
926
|
+
version: server.version,
|
|
927
|
+
path: server.path,
|
|
928
|
+
authorization: _optionalChain([details, 'optionalAccess', _38 => _38.public]) === true ? "none" : "required",
|
|
929
|
+
resources: listed ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _39 => _39.resources]), () => ( []))] : [],
|
|
930
|
+
prompts: listed ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _40 => _40.prompts]), () => ( []))] : [],
|
|
931
|
+
tools: (listed ? tools : []).map((tool) => {
|
|
932
|
+
const schemas = _optionalChain([details, 'optionalAccess', _41 => _41.schemas, 'optionalAccess', _42 => _42[tool.name]]);
|
|
933
|
+
const hints = Object.fromEntries(
|
|
934
|
+
["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"].filter((hint) => typeof tool[hint] === "boolean").map((hint) => [hint, tool[hint]])
|
|
935
|
+
);
|
|
936
|
+
return {
|
|
937
|
+
name: tool.name,
|
|
938
|
+
...tool.title ? { title: tool.title } : {},
|
|
939
|
+
...tool.description ? { description: tool.description } : {},
|
|
940
|
+
source: SOURCES[tool.kind],
|
|
941
|
+
// MCP clients never see the route behind a tool; only Infra's view names it.
|
|
942
|
+
...full && tool.kind === "endpoint" ? { method: tool.method, path: tool.path } : {},
|
|
943
|
+
...hints,
|
|
944
|
+
...schemas ? { inputSchema: schemas.input } : {},
|
|
945
|
+
..._optionalChain([schemas, 'optionalAccess', _43 => _43.output]) ? { outputSchema: schemas.output } : {}
|
|
946
|
+
};
|
|
947
|
+
})
|
|
948
|
+
};
|
|
949
|
+
})
|
|
938
950
|
},
|
|
939
951
|
webmcp: input.webmcp,
|
|
940
952
|
integrations: input.integrations,
|
|
941
953
|
agent: input.agent,
|
|
942
954
|
plugins: input.plugins
|
|
943
955
|
};
|
|
956
|
+
manifest.mcp.servers.push(...listDefaultServer(input));
|
|
957
|
+
return manifest;
|
|
944
958
|
}
|
|
945
959
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmAppManifest, "createFarmAppManifest");
|
|
960
|
+
function listDefaultServer(input) {
|
|
961
|
+
const server = _optionalChain([input, 'access', _44 => _44.defaultMCP, 'optionalCall', _45 => _45()]);
|
|
962
|
+
if (!server) return [];
|
|
963
|
+
return [
|
|
964
|
+
{
|
|
965
|
+
name: server.name,
|
|
966
|
+
version: server.version,
|
|
967
|
+
path: server.path,
|
|
968
|
+
authorization: "none",
|
|
969
|
+
resources: [],
|
|
970
|
+
prompts: [],
|
|
971
|
+
tools: _chunkPTZ2TVNEcjs.FARM_DEFAULT_MCP_TOOLS.map((tool) => ({
|
|
972
|
+
name: tool.name,
|
|
973
|
+
title: tool.title,
|
|
974
|
+
description: tool.description,
|
|
975
|
+
// Standalone tools with no endpoint behind them, like defineTool's.
|
|
976
|
+
source: "defineTool",
|
|
977
|
+
...tool.annotations,
|
|
978
|
+
inputSchema: tool.inputSchema,
|
|
979
|
+
..."outputSchema" in tool ? { outputSchema: tool.outputSchema } : {}
|
|
980
|
+
}))
|
|
981
|
+
}
|
|
982
|
+
];
|
|
983
|
+
}
|
|
984
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, listDefaultServer, "listDefaultServer");
|
|
946
985
|
var encoder = new TextEncoder();
|
|
947
986
|
var hex = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (bytes) => [...new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join(""), "hex");
|
|
948
987
|
async function sha256Hex(value) {
|
|
@@ -972,7 +1011,7 @@ async function verifyFarmInfraManifestSignature(header, key, now = Date.now()) {
|
|
|
972
1011
|
if (!header || header.length > 2048) return false;
|
|
973
1012
|
const parts = header.split(",").map((part) => part.trim());
|
|
974
1013
|
const timestamp = Number(
|
|
975
|
-
_optionalChain([/^t=(\d{1,12})$/, 'access',
|
|
1014
|
+
_optionalChain([/^t=(\d{1,12})$/, 'access', _46 => _46.exec, 'call', _47 => _47(_nullishCoalesce(parts.find((part) => part.startsWith("t=")), () => ( ""))), 'optionalAccess', _48 => _48[1]])
|
|
976
1015
|
);
|
|
977
1016
|
if (!Number.isSafeInteger(timestamp)) return false;
|
|
978
1017
|
if (Math.abs(now / 1e3 - timestamp) > SIGNATURE_WINDOW_SECONDS) return false;
|
|
@@ -984,25 +1023,44 @@ ${timestamp}`);
|
|
|
984
1023
|
}
|
|
985
1024
|
_chunkS3JO3N4Hcjs.__name.call(void 0, verifyFarmInfraManifestSignature, "verifyFarmInfraManifestSignature");
|
|
986
1025
|
function processEnv() {
|
|
987
|
-
return _nullishCoalesce(_optionalChain([globalThis, 'access',
|
|
1026
|
+
return _nullishCoalesce(_optionalChain([globalThis, 'access', _49 => _49.process, 'optionalAccess', _50 => _50.env]), () => ( {}));
|
|
988
1027
|
}
|
|
989
1028
|
_chunkS3JO3N4Hcjs.__name.call(void 0, processEnv, "processEnv");
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1029
|
+
var CORS_HEADERS = {
|
|
1030
|
+
"access-control-allow-origin": "*",
|
|
1031
|
+
"access-control-allow-methods": "GET, HEAD, OPTIONS",
|
|
1032
|
+
"access-control-allow-headers": `If-None-Match, ${FARM_INFRA_SIGNATURE_HEADER}`,
|
|
1033
|
+
"access-control-expose-headers": "ETag"
|
|
1034
|
+
};
|
|
1035
|
+
async function createFarmAppManifestResponse(request, input, options = {}) {
|
|
1036
|
+
const method = request.method.toUpperCase();
|
|
1037
|
+
if (method === "OPTIONS") return new Response(null, { status: 204, headers: CORS_HEADERS });
|
|
1038
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
1039
|
+
return new Response("Method Not Allowed", {
|
|
1040
|
+
status: 405,
|
|
1041
|
+
headers: { ...CORS_HEADERS, allow: "GET, HEAD, OPTIONS", "content-type": "text/plain" }
|
|
1042
|
+
});
|
|
1001
1043
|
}
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1044
|
+
const signature = request.headers.get(FARM_INFRA_SIGNATURE_HEADER);
|
|
1045
|
+
const key = input.analytics ? _optionalChain([(_nullishCoalesce(options.env, () => ( processEnv()))), 'access', _51 => _51.FARMJS_API_KEY, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]) : void 0;
|
|
1046
|
+
const full = Boolean(
|
|
1047
|
+
signature && key && await verifyFarmInfraManifestSignature(signature, key)
|
|
1048
|
+
);
|
|
1049
|
+
const body = JSON.stringify(createFarmAppManifest(input, { full }));
|
|
1050
|
+
const etag = _chunkKIIMAWOJcjs.createFarmWeakETag.call(void 0, body);
|
|
1051
|
+
const headers = {
|
|
1052
|
+
...CORS_HEADERS,
|
|
1053
|
+
"content-type": "application/json; charset=utf-8",
|
|
1054
|
+
// The full view is for Infra alone; shared caches keep the two views apart.
|
|
1055
|
+
"cache-control": full ? "private, no-store" : "public, max-age=0, must-revalidate",
|
|
1056
|
+
vary: FARM_INFRA_SIGNATURE_HEADER,
|
|
1057
|
+
etag,
|
|
1058
|
+
"x-content-type-options": "nosniff"
|
|
1059
|
+
};
|
|
1060
|
+
if (!full && _chunkKIIMAWOJcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), etag)) {
|
|
1061
|
+
return new Response(null, { status: 304, headers });
|
|
1062
|
+
}
|
|
1063
|
+
return new Response(method === "HEAD" ? null : body, { status: 200, headers });
|
|
1006
1064
|
}
|
|
1007
1065
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmAppManifestResponse, "createFarmAppManifestResponse");
|
|
1008
1066
|
|
|
@@ -1037,4 +1095,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmAppManifestResponse, "createFarm
|
|
|
1037
1095
|
|
|
1038
1096
|
|
|
1039
1097
|
|
|
1040
|
-
|
|
1098
|
+
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
exports.formatRouteSegment = formatRouteSegment; exports.createRouteDirectoryPattern = createRouteDirectoryPattern; exports.stripRouteGroups = stripRouteGroups; exports.getRouteGroupScope = getRouteGroupScope; exports.isInRouteGroupScope = isInRouteGroupScope; exports.getRouteDirectoryDepth = getRouteDirectoryDepth; exports.routeBoundaryCoversDirectory = routeBoundaryCoversDirectory; exports.HOISTED_HEAD_ELEMENT = HOISTED_HEAD_ELEMENT; exports.extractFarmFullDocument = extractFarmFullDocument; exports.classifyFarmDocumentPrefix = classifyFarmDocumentPrefix; exports.removeFarmDocumentTitles = removeFarmDocumentTitles; exports.ensureFarmDocumentMeta = ensureFarmDocumentMeta; exports.composeFarmFullDocument = composeFarmFullDocument; exports.renderFarmLocaleAlternateLinks = renderFarmLocaleAlternateLinks; exports.createLateRedirectRecovery = createLateRedirectRecovery; exports.createLateNotFoundRecovery = createLateNotFoundRecovery; exports.createFarmMetadataRouteResponse = createFarmMetadataRouteResponse; exports.listFarmMCPLlmsTxtLinks = listFarmMCPLlmsTxtLinks; exports.createFarmAiCatalogResponse = createFarmAiCatalogResponse; exports.resolveDefaultErrorStatus = resolveDefaultErrorStatus; exports.getDefaultErrorStatusText = getDefaultErrorStatusText; exports.createDefaultErrorMarkup = createDefaultErrorMarkup; exports.createFarmThemeDocumentParts = createFarmThemeDocumentParts; exports.applyFarmThemeDocument = applyFarmThemeDocument; exports.FARM_API_CATALOG_PATH = FARM_API_CATALOG_PATH; exports.resolveFarmApiCatalogInput = resolveFarmApiCatalogInput; exports.createFarmApiCatalogResponse = createFarmApiCatalogResponse; exports.FARM_APP_MANIFEST_PATH = FARM_APP_MANIFEST_PATH; exports.FARM_APP_MANIFEST_LEGACY_PATH = FARM_APP_MANIFEST_LEGACY_PATH; exports.isFarmAppManifestPath = isFarmAppManifestPath; exports.FARM_INFRA_SIGNATURE_HEADER = FARM_INFRA_SIGNATURE_HEADER; exports.resolveFarmAppManifestInput = resolveFarmAppManifestInput; exports.createFarmAppManifestResponse = createFarmAppManifestResponse;
|
|
@@ -7,40 +7,41 @@ var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkG2TEB74Scjs = require('./chunk-G2TEB74S.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
var _chunk4GWRFP22cjs = require('./chunk-4GWRFP22.cjs');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
var
|
|
24
|
+
var _chunkSHLXACIOcjs = require('./chunk-SHLXACIO.cjs');
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
27
28
|
|
|
28
29
|
|
|
29
|
-
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
30
|
-
|
|
31
|
-
|
|
32
30
|
var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
36
34
|
|
|
37
35
|
|
|
36
|
+
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
37
|
+
|
|
38
|
+
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
41
42
|
|
|
42
43
|
|
|
43
|
-
var
|
|
44
|
+
var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
@@ -56,7 +57,7 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
56
57
|
constructor(req, res) {
|
|
57
58
|
this.req = req;
|
|
58
59
|
this.res = res;
|
|
59
|
-
this.cookies =
|
|
60
|
+
this.cookies = _chunkG2TEB74Scjs.parseMiddlewareCookieHeader.call(void 0, req.headers.cookie);
|
|
60
61
|
const existing = res.getHeader("Set-Cookie");
|
|
61
62
|
this.setCookies = Array.isArray(existing) ? existing.map(String) : existing === void 0 ? [] : [String(existing)];
|
|
62
63
|
}
|
|
@@ -65,13 +66,13 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
65
66
|
}
|
|
66
67
|
set(name, value, options = {}) {
|
|
67
68
|
this.cookies[name] = value;
|
|
68
|
-
const cookieString =
|
|
69
|
+
const cookieString = _chunkG2TEB74Scjs.serializeMiddlewareCookie.call(void 0, name, value, options);
|
|
69
70
|
this.setCookies.push(cookieString);
|
|
70
71
|
this.res.setHeader("Set-Cookie", this.setCookies);
|
|
71
72
|
}
|
|
72
73
|
delete(name, options = {}) {
|
|
73
74
|
delete this.cookies[name];
|
|
74
|
-
this.setCookies.push(
|
|
75
|
+
this.setCookies.push(_chunkG2TEB74Scjs.serializeMiddlewareCookieDeletion.call(void 0, name, options));
|
|
75
76
|
this.res.setHeader("Set-Cookie", this.setCookies);
|
|
76
77
|
}
|
|
77
78
|
getAll() {
|
|
@@ -80,8 +81,8 @@ var _CookieJarImpl = class _CookieJarImpl {
|
|
|
80
81
|
};
|
|
81
82
|
_chunkS3JO3N4Hcjs.__name.call(void 0, _CookieJarImpl, "CookieJarImpl");
|
|
82
83
|
var CookieJarImpl = _CookieJarImpl;
|
|
83
|
-
function createContext(req, res, viteServer, parent, server) {
|
|
84
|
-
const url =
|
|
84
|
+
function createContext(req, res, viteServer, parent, server, toRoutePathname) {
|
|
85
|
+
const url = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([server, 'optionalAccess', _ => _.trustProxy]) });
|
|
85
86
|
const headers = /* @__PURE__ */ new Map();
|
|
86
87
|
const data = _optionalChain([parent, 'optionalAccess', _2 => _2.data]) ? new Map(parent.data) : /* @__PURE__ */ new Map();
|
|
87
88
|
const locals = _optionalChain([parent, 'optionalAccess', _3 => _3.locals]) ? new Map(parent.locals) : /* @__PURE__ */ new Map();
|
|
@@ -105,6 +106,7 @@ function createContext(req, res, viteServer, parent, server) {
|
|
|
105
106
|
response: res,
|
|
106
107
|
url,
|
|
107
108
|
pathname: url.pathname,
|
|
109
|
+
routePathname: _chunk4GWRFP22cjs.toMiddlewareRoutePathname.call(void 0, url.pathname, toRoutePathname),
|
|
108
110
|
searchParams: url.searchParams,
|
|
109
111
|
method: req.method || "GET",
|
|
110
112
|
params: {},
|
|
@@ -140,6 +142,7 @@ function createContext(req, res, viteServer, parent, server) {
|
|
|
140
142
|
const newUrl = new URL(rewriteUrl, ctx.url);
|
|
141
143
|
ctx.url = newUrl;
|
|
142
144
|
ctx.pathname = newUrl.pathname;
|
|
145
|
+
ctx.routePathname = _chunk4GWRFP22cjs.toMiddlewareRoutePathname.call(void 0, newUrl.pathname, toRoutePathname);
|
|
143
146
|
ctx.searchParams = newUrl.searchParams;
|
|
144
147
|
ctx.route = newUrl.pathname;
|
|
145
148
|
req.url = rewriteUrl;
|
|
@@ -246,7 +249,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
246
249
|
for (const [index, entry] of entries.entries()) {
|
|
247
250
|
const handlers = this.getConfigHandlers(entry);
|
|
248
251
|
const middlewareConfig = this.toMiddlewareConfig(entry);
|
|
249
|
-
|
|
252
|
+
_chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, middlewareConfig);
|
|
250
253
|
if (handlers.length === 0) {
|
|
251
254
|
this.globalConfig = middlewareConfig;
|
|
252
255
|
continue;
|
|
@@ -269,7 +272,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
269
272
|
const discovered = [];
|
|
270
273
|
await this.discoverInDirectory(appDir, "/", "", discovered);
|
|
271
274
|
for (const entry of discovered) {
|
|
272
|
-
|
|
275
|
+
_chunk4GWRFP22cjs.compileMiddlewareRoute.call(void 0, entry.middleware);
|
|
273
276
|
middlewareByDirectory.set(entry.location.directory, entry);
|
|
274
277
|
}
|
|
275
278
|
}
|
|
@@ -327,19 +330,19 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
327
330
|
try {
|
|
328
331
|
let module;
|
|
329
332
|
if (this.viteServer) {
|
|
330
|
-
module = await
|
|
333
|
+
module = await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, filePath);
|
|
331
334
|
} else {
|
|
332
335
|
module = await import(
|
|
333
336
|
/* @vite-ignore */
|
|
334
|
-
|
|
337
|
+
_chunkSHLXACIOcjs.toFileModuleUrl.call(void 0, filePath)
|
|
335
338
|
);
|
|
336
339
|
}
|
|
337
|
-
const normalized =
|
|
340
|
+
const normalized = _chunkG2TEB74Scjs.normalizeMiddlewareModule.call(void 0, module, routePath);
|
|
338
341
|
if (!normalized) {
|
|
339
342
|
throw new Error("must export a default handler or a named middleware handler");
|
|
340
343
|
}
|
|
341
344
|
if (normalized.config) {
|
|
342
|
-
|
|
345
|
+
_chunk4GWRFP22cjs.compileMiddlewareConfig.call(void 0, normalized.config);
|
|
343
346
|
}
|
|
344
347
|
return {
|
|
345
348
|
path: routePath,
|
|
@@ -356,7 +359,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
356
359
|
* Execute middleware for a request
|
|
357
360
|
*/
|
|
358
361
|
async execute(req, res) {
|
|
359
|
-
const url =
|
|
362
|
+
const url = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _6 => _6.server, 'optionalAccess', _7 => _7.trustProxy]) });
|
|
360
363
|
const pathname = url.pathname;
|
|
361
364
|
const toRoutePathname = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => _optionalChain([this, 'access', _8 => _8.i18n, 'optionalAccess', _9 => _9.enabled]) ? _chunkBIDYX3SLcjs.stripFarmLocaleFromPathname.call(void 0, value, this.i18n) : _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, value, _nullishCoalesce(_optionalChain([this, 'access', _10 => _10.i18n, 'optionalAccess', _11 => _11.basePath]), () => ( "/"))), "toRoutePathname");
|
|
362
365
|
const routePathname = toRoutePathname(pathname);
|
|
@@ -364,7 +367,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
364
367
|
const method = req.method || "GET";
|
|
365
368
|
const startTime = Date.now();
|
|
366
369
|
let parentData;
|
|
367
|
-
let ctx = createContext(req, res, this.viteServer, void 0, this.server);
|
|
370
|
+
let ctx = createContext(req, res, this.viteServer, void 0, this.server, toRoutePathname);
|
|
368
371
|
if (this.globalConfig) {
|
|
369
372
|
const globalMatch = this.matchesConfig(routePathname, this.globalConfig, ctx);
|
|
370
373
|
if (!globalMatch.matched) {
|
|
@@ -378,7 +381,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
378
381
|
...this.configMiddleware.map((mw) => ({ mw, routeMatch: { matched: true } })),
|
|
379
382
|
...this.middleware.map((mw) => ({
|
|
380
383
|
mw,
|
|
381
|
-
routeMatch:
|
|
384
|
+
routeMatch: _chunk4GWRFP22cjs.matchesMiddlewareRouteAt.call(void 0, toMiddlewarePathnames(routePathname), mw)
|
|
382
385
|
})).filter((entry) => entry.routeMatch.matched)
|
|
383
386
|
];
|
|
384
387
|
if (applicable.length === 0) {
|
|
@@ -404,17 +407,17 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
404
407
|
for (; ; ) {
|
|
405
408
|
for (const entry of pass) yield { ...entry, pathname: passPathname };
|
|
406
409
|
const rewrittenPathname = toRoutePathname(
|
|
407
|
-
|
|
410
|
+
_chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy }).pathname
|
|
408
411
|
);
|
|
409
412
|
if (rewrittenPathname === passPathname) return;
|
|
410
413
|
passPathname = rewrittenPathname;
|
|
411
414
|
const passPathnames = toMiddlewarePathnames(passPathname);
|
|
412
|
-
if (globalConfig && !
|
|
415
|
+
if (globalConfig && !_chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0, passPathnames, globalConfig, ctx).matched) {
|
|
413
416
|
return;
|
|
414
417
|
}
|
|
415
418
|
pass = allMiddleware.filter((mw) => !ran.has(mw)).map((mw) => ({
|
|
416
419
|
mw,
|
|
417
|
-
routeMatch: mw.source === "config" ? { matched: true } :
|
|
420
|
+
routeMatch: mw.source === "config" ? { matched: true } : _chunk4GWRFP22cjs.matchesMiddlewareRouteAt.call(void 0, passPathnames, mw)
|
|
418
421
|
})).filter((entry) => entry.routeMatch.matched);
|
|
419
422
|
}
|
|
420
423
|
}
|
|
@@ -432,7 +435,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
432
435
|
ctx.params = { ...ctx.params, ...configMatch.params };
|
|
433
436
|
}
|
|
434
437
|
if (parentData) {
|
|
435
|
-
ctx = createContext(req, res, this.viteServer, parentData, this.server);
|
|
438
|
+
ctx = createContext(req, res, this.viteServer, parentData, this.server, toRoutePathname);
|
|
436
439
|
if (routeMatch.params) {
|
|
437
440
|
ctx.params = { ...ctx.params, ...routeMatch.params };
|
|
438
441
|
}
|
|
@@ -525,7 +528,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
525
528
|
* Check if pathname matches middleware config
|
|
526
529
|
*/
|
|
527
530
|
matchesConfig(pathname, config, ctx) {
|
|
528
|
-
return
|
|
531
|
+
return _chunk4GWRFP22cjs.matchesMiddlewareConfigAt.call(void 0, this.toMiddlewarePathnames(pathname), config, ctx);
|
|
529
532
|
}
|
|
530
533
|
/**
|
|
531
534
|
* Reload middleware (for HMR)
|