@farm.js/core 0.1.71 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-VIT4GOSR.mjs → agent-mcp-handler-RK7LDYEL.mjs} +5 -5
- package/dist/{agent-mcp-handler-KE4J3W7S.cjs → agent-mcp-handler-VBCA3WZ6.cjs} +6 -6
- package/dist/{agent-mcp.d-BzNw6JI8.d.ts → agent-mcp.d-D_gHjCAE.d.ts} +2 -2
- package/dist/{agent-mcp.d-CgFen3EH.d.mts → agent-mcp.d-PvEf-1mi.d.mts} +2 -2
- package/dist/agent-runtime.d.mts +4 -4
- package/dist/agent-runtime.d.ts +4 -4
- package/dist/{analyzer-VK3BAOFI.mjs → analyzer-MFYCJT75.mjs} +2 -2
- package/dist/analyzer-V5ZMRIIY.cjs +16 -0
- package/dist/api/node.d.mts +6 -6
- package/dist/api/node.d.ts +6 -6
- package/dist/api/route-manager.cjs +7 -6
- package/dist/api/route-manager.d.mts +8 -8
- package/dist/api/route-manager.d.ts +8 -8
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.d.mts +5 -5
- package/dist/api/runtime.d.ts +5 -5
- package/dist/api.cjs +8 -7
- package/dist/api.d.mts +9 -9
- package/dist/api.d.ts +9 -9
- package/dist/api.mjs +7 -6
- package/dist/{app-manifest.d-DY4JfJxi.d.ts → app-manifest.d-BpVTg43i.d.ts} +1 -1
- package/dist/{app-manifest.d-DpDK_B1k.d.mts → app-manifest.d-CN7cEWHX.d.mts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +5 -5
- package/dist/app-markdown.d.ts +5 -5
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-D-5UNrFd.d.mts → app.d-BFWzAdTe.d.mts} +54 -6
- package/dist/{app.d-BeK6bb1c.d.ts → app.d-DO4PTCWm.d.ts} +54 -6
- package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
- package/dist/{chunk-IYDJNCR7.mjs → chunk-462MUII7.mjs} +10 -5
- package/dist/{chunk-MWUDEYBI.mjs → chunk-4CTCSKAF.mjs} +1 -1
- package/dist/{chunk-SXMWVP2L.cjs → chunk-4YHGQDTT.cjs} +12 -12
- package/dist/{chunk-YCNHUIPR.cjs → chunk-4Z3YLMSW.cjs} +10 -10
- package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
- package/dist/{chunk-O32QPFVV.cjs → chunk-5PDMBWAF.cjs} +5 -5
- package/dist/{chunk-IGXS54GC.mjs → chunk-6O6PAZZR.mjs} +1 -1
- package/dist/{chunk-LXEJNWF5.mjs → chunk-73K53YPP.mjs} +2 -2
- package/dist/{chunk-2CQC5CMD.mjs → chunk-7GMBETHM.mjs} +1 -1
- package/dist/{chunk-W2T6NDNP.mjs → chunk-B67CW2LM.mjs} +2 -2
- package/dist/{chunk-CSQPMV3Q.cjs → chunk-CLEWORVY.cjs} +6 -6
- package/dist/{chunk-KPJYBSHL.mjs → chunk-CPMME66W.mjs} +149 -22
- package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
- package/dist/{chunk-4OD2LXF2.mjs → chunk-CYRIIVD4.mjs} +26 -15
- package/dist/{chunk-DPIGYXSV.mjs → chunk-FRO4BB2T.mjs} +1 -1
- package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
- package/dist/{chunk-N3XO5AL5.cjs → chunk-GPO3LJDJ.cjs} +2 -2
- package/dist/{chunk-MITIAOUQ.mjs → chunk-GZOKWJIW.mjs} +4 -4
- package/dist/{chunk-NAXKOTPP.cjs → chunk-HFUOLILA.cjs} +21 -21
- package/dist/{chunk-C2JOS77Z.cjs → chunk-HGB4PM2C.cjs} +178 -51
- package/dist/{chunk-2IFT2CSA.cjs → chunk-HTXKSREF.cjs} +515 -151
- package/dist/{chunk-Z3GPAFIA.mjs → chunk-HY6IVQ54.mjs} +1 -1
- package/dist/{chunk-X7LGLF33.mjs → chunk-IBVN7SW5.mjs} +480 -116
- package/dist/{chunk-DPYBVVL3.cjs → chunk-ILQ5DKYF.cjs} +2 -2
- package/dist/{chunk-V25GSH43.mjs → chunk-IXZSBO76.mjs} +1 -1
- package/dist/{chunk-RJUCNO7R.mjs → chunk-JMOCMXTQ.mjs} +1 -1
- package/dist/{chunk-UISZLYKY.cjs → chunk-KDOZORJD.cjs} +52 -41
- package/dist/{chunk-PLXD2MJV.cjs → chunk-KTDG4THT.cjs} +2 -2
- package/dist/{chunk-L6E4SHUB.cjs → chunk-LGR7565L.cjs} +6 -6
- package/dist/chunk-LRPPXKCX.mjs +58 -0
- package/dist/{chunk-GUU3IZSM.mjs → chunk-MJEKMT6B.mjs} +324 -148
- package/dist/chunk-NDOE76QC.cjs +58 -0
- package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
- package/dist/{chunk-REP6HWJN.mjs → chunk-OBYM5S5G.mjs} +2 -2
- package/dist/{chunk-ZUVAGMQ5.cjs → chunk-ODBM54RT.cjs} +7 -7
- package/dist/{chunk-J5ASGNKF.mjs → chunk-OIP62QEL.mjs} +1 -1
- package/dist/{chunk-KEB7AGS6.cjs → chunk-OXNZUCHN.cjs} +16 -11
- package/dist/{chunk-2MR4MABG.cjs → chunk-PXAHSCR6.cjs} +58 -8
- package/dist/{chunk-7BUE2GM6.mjs → chunk-QGCSUC5O.mjs} +174 -81
- package/dist/{chunk-VXB5CMNC.cjs → chunk-QKEZLYON.cjs} +2 -2
- package/dist/{chunk-UQUOSNRN.mjs → chunk-REK6HZSU.mjs} +470 -267
- package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
- package/dist/{chunk-3BQ7QHUH.cjs → chunk-ROCF6UQD.cjs} +17 -8
- package/dist/{chunk-KQAB5LML.mjs → chunk-SUQACHER.mjs} +2 -2
- package/dist/{chunk-NA77GEIU.mjs → chunk-SVQX5HYW.mjs} +53 -3
- package/dist/{chunk-KWST2O22.cjs → chunk-TAU3OF5B.cjs} +611 -435
- package/dist/{chunk-ZPUAOKHV.cjs → chunk-TDCP3Z4T.cjs} +3 -3
- package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
- package/dist/{chunk-TP4RAV7Y.cjs → chunk-TU6VAH4V.cjs} +8 -8
- package/dist/{chunk-MEJCP2LX.cjs → chunk-UVQRMUAR.cjs} +1 -1
- package/dist/{chunk-JMFTKNBA.mjs → chunk-UVZMSRHF.mjs} +2 -2
- package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
- package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
- package/dist/{chunk-GF22VGMS.cjs → chunk-VPETSSWN.cjs} +2 -2
- package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
- package/dist/{chunk-AYVGD3PK.mjs → chunk-XI3OXOMK.mjs} +1 -1
- package/dist/{chunk-7OHJWFLB.cjs → chunk-XUSJVHHD.cjs} +466 -373
- package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
- package/dist/{chunk-JVA4PIYN.cjs → chunk-YZK64PZT.cjs} +635 -432
- package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
- package/dist/{chunk-QUFENL7Q.mjs → chunk-Z3IN6GEX.mjs} +16 -7
- package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
- package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
- package/dist/{client-component.d-DwpH251K.d.mts → client-component.d-C71rMuHF.d.mts} +2 -2
- package/dist/{client-component.d-fYupugbZ.d.ts → client-component.d-sF-Znk0j.d.ts} +2 -2
- package/dist/{client-plugins.d-k3bOT5gz.d.mts → client-plugins.d-B-Gd9mWR.d.mts} +5 -4
- package/dist/{client-plugins.d-BxqFfHpM.d.ts → client-plugins.d-MFibjgBg.d.ts} +5 -4
- package/dist/client-plugins.d.mts +4 -4
- package/dist/client-plugins.d.ts +4 -4
- package/dist/client.cjs +1 -1
- package/dist/client.d.mts +9 -9
- package/dist/client.d.ts +9 -9
- package/dist/client.mjs +1 -1
- package/dist/config.d.mts +4 -4
- package/dist/config.d.ts +4 -4
- package/dist/desktop.d.mts +5 -5
- package/dist/desktop.d.ts +5 -5
- package/dist/{devtools-O5625KCK.cjs → devtools-6K4QXFRL.cjs} +7 -7
- package/dist/{devtools-6MXPFPNJ.mjs → devtools-TDIJ6HVC.mjs} +6 -6
- package/dist/docs.cjs +10 -10
- package/dist/docs.d.mts +5 -5
- package/dist/docs.d.ts +5 -5
- package/dist/docs.mjs +9 -9
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{headers.d-sNT7ZQiU.d.mts → headers.d-BUxGJTsj.d.mts} +2 -2
- package/dist/{headers.d-DalIGbVO.d.ts → headers.d-uQ6BR59u.d.ts} +2 -2
- package/dist/i18n/client.cjs +3 -2
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +2 -1
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/index.cjs +32 -30
- package/dist/{index.d-BcA-secm.d.ts → index.d-BCGfxCXY.d.ts} +1 -1
- package/dist/{index.d-DDHHAv7j.d.mts → index.d-CuWOJ-un.d.mts} +1 -1
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.mjs +31 -29
- package/dist/integrations/orm.d.mts +4 -4
- package/dist/integrations/orm.d.ts +4 -4
- package/dist/integrations.d.mts +4 -4
- package/dist/integrations.d.ts +4 -4
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +5 -5
- package/dist/internal/app-markdown-runtime.d.ts +5 -5
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +29 -29
- package/dist/internal/build-runtime.d.mts +6 -6
- package/dist/internal/build-runtime.d.ts +6 -6
- package/dist/internal/build-runtime.mjs +28 -28
- package/dist/internal/cli-runtime.cjs +12 -12
- package/dist/internal/cli-runtime.mjs +11 -11
- 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.d.mts +7 -7
- package/dist/internal/client-runtime.d.ts +7 -7
- package/dist/internal/client-runtime.mjs +3 -3
- package/dist/internal/compression-runtime.d.mts +4 -4
- package/dist/internal/compression-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +7 -7
- package/dist/internal/config-runtime.d.ts +7 -7
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/infra-analytics-runtime.cjs +10 -10
- package/dist/internal/infra-analytics-runtime.mjs +8 -8
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +19 -19
- package/dist/internal/production-runtime.d.mts +37 -25
- package/dist/internal/production-runtime.d.ts +37 -25
- package/dist/internal/production-runtime.mjs +18 -18
- package/dist/internal/vercel-edge-middleware.d.mts +2 -2
- package/dist/internal/vercel-edge-middleware.d.ts +2 -2
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +4 -4
- package/dist/markdown.d.ts +4 -4
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +3 -3
- package/dist/middleware.d.mts +5 -5
- package/dist/middleware.d.ts +5 -5
- package/dist/middleware.mjs +2 -2
- package/dist/mobile.d.mts +3 -3
- package/dist/mobile.d.ts +3 -3
- package/dist/{mount.d-C1PONsEe.d.mts → mount.d-BIYmcGGg.d.mts} +1 -1
- package/dist/{mount.d-D3JOux2V.d.ts → mount.d-q8k0cJV0.d.ts} +1 -1
- package/dist/{native-tree-L2IIEBXH.mjs → native-tree-OYGKP2NZ.mjs} +2 -2
- package/dist/{native-tree-GF4BH33L.cjs → native-tree-R6CQMDTI.cjs} +3 -3
- package/dist/{navigation-delegate.d-CQQPbdkE.d.ts → navigation-delegate.d-Btfs6Uoa.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CJQQHboA.d.mts → navigation-delegate.d-CYBUupsv.d.mts} +1 -1
- package/dist/navigation.d.mts +7 -7
- package/dist/navigation.d.ts +7 -7
- package/dist/{observability.d-B2363jB6.d.mts → observability.d-DdJRiaIX.d.mts} +27 -3
- package/dist/{observability.d-B2363jB6.d.ts → observability.d-DdJRiaIX.d.ts} +27 -3
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +21 -21
- package/dist/plugin.d.mts +7 -7
- package/dist/plugin.d.ts +7 -7
- package/dist/plugin.mjs +20 -20
- package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
- package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
- package/dist/{render-plan.d-DHuJMJRP.d.ts → render-plan.d-0FHusf1D.d.ts} +1 -1
- package/dist/{render-plan.d-CiUj0rq5.d.mts → render-plan.d-BlyxqKMu.d.mts} +1 -1
- package/dist/renderer-client.cjs +3 -2
- package/dist/renderer-client.d.mts +7 -7
- package/dist/renderer-client.d.ts +7 -7
- package/dist/renderer-client.mjs +2 -1
- package/dist/{request.d-DRUbOmYD.d.ts → request.d-CPdVjssg.d.ts} +1 -1
- package/dist/{request.d-D-F7o7tb.d.mts → request.d-CX-gks1l.d.mts} +1 -1
- package/dist/request.d.mts +5 -5
- package/dist/request.d.ts +5 -5
- package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
- package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
- package/dist/{route-rendering.d-6smgwT2t.d.mts → route-rendering.d-CcvZ_4N2.d.mts} +1 -1
- package/dist/{route-rendering.d-KwqM_mlK.d.ts → route-rendering.d-DcOoSNoG.d.ts} +1 -1
- package/dist/{router.d-BYmDeDlp.d.mts → router.d-C8RHma4A.d.mts} +1 -1
- package/dist/{router.d-B6sesMRD.d.ts → router.d-D2QnK8cM.d.ts} +1 -1
- package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
- package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
- package/dist/routes.d.mts +4 -4
- package/dist/routes.d.ts +4 -4
- package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-BhPgtN_S.d.ts} +2 -1
- package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-D67HQmnv.d.mts} +2 -1
- package/dist/{rsc-pipeline-R2GOKIMU.mjs → rsc-pipeline-LC2FBZAR.mjs} +7 -7
- package/dist/{rsc-pipeline-P4PCWDO2.cjs → rsc-pipeline-NTAM65NT.cjs} +8 -8
- package/dist/{runtime-DP5DYGW5.mjs → runtime-MWAC7NWR.mjs} +7 -7
- package/dist/{runtime-WA2Q4SLG.cjs → runtime-U4PAMTVH.cjs} +9 -9
- package/dist/{runtime.d-CbdMI0Oy.d.ts → runtime.d-1l_1bLrL.d.ts} +1 -1
- package/dist/{runtime.d-BFSJf-ww.d.mts → runtime.d-BQUHHq8M.d.mts} +1 -1
- package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
- package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
- package/dist/server-plugins.d.mts +6 -6
- package/dist/server-plugins.d.ts +6 -6
- package/dist/server.cjs +43 -41
- package/dist/server.d.mts +15 -15
- package/dist/server.d.ts +15 -15
- package/dist/server.mjs +26 -24
- package/dist/{spa-router.d-mC1D5cTN.d.ts → spa-router.d-BJtXNeqo.d.ts} +3 -3
- package/dist/{spa-router.d-D4EDwR20.d.mts → spa-router.d-BzPdi48R.d.mts} +3 -3
- package/dist/testing.cjs +6 -5
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.mjs +6 -5
- package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.mts} +4 -0
- package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.ts} +4 -0
- package/dist/{utils.d-DxMzteqE.d.mts → utils.d-B4ZW-6z6.d.mts} +1 -1
- package/dist/{utils.d-A2X3a6z_.d.ts → utils.d-DquC6qxy.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -21
- package/dist/vite.d.mts +18 -9
- package/dist/vite.d.ts +18 -9
- package/dist/vite.mjs +22 -20
- package/package.json +1 -1
- package/dist/analyzer-LPIVRSTJ.cjs +0 -16
- package/dist/chunk-V3UOEWCB.cjs +0 -46
- package/dist/chunk-VE3FWJBO.mjs +0 -46
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
3
|
+
var _chunk4YHGQDTTcjs = require('./chunk-4YHGQDTT.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkHGB4PM2Ccjs = require('./chunk-HGB4PM2C.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
@@ -11,6 +11,9 @@ var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
|
11
11
|
|
|
12
12
|
var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
|
|
13
13
|
|
|
14
|
+
|
|
15
|
+
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
16
|
+
|
|
14
17
|
// src/plugins/infra-analytics.ts
|
|
15
18
|
var _async_hooks = require('async_hooks');
|
|
16
19
|
var FARM_PRERENDER_ENV = "FARM_PRERENDER";
|
|
@@ -74,12 +77,15 @@ function resolveFarmInfraAnalytics(env = processEnv()) {
|
|
|
74
77
|
}
|
|
75
78
|
};
|
|
76
79
|
}
|
|
77
|
-
function classifyFarmInfraAgent(userAgent) {
|
|
78
|
-
return _chunkC2JOS77Zcjs.classifyFarmAgent.call(void 0, userAgent);
|
|
79
|
-
}
|
|
80
80
|
function routeTemplate(pattern) {
|
|
81
81
|
return typeof pattern === "string" && pattern.length <= 256 && /^\/(?!\/)[a-zA-Z0-9_./:[\]()*-]*$/.test(pattern) ? pattern : "/[unmatched]";
|
|
82
82
|
}
|
|
83
|
+
var PATH = /^\/(?!\/)[\w!$%&'()*+,\-./:;=@[\]^|~]*$/;
|
|
84
|
+
var MAX_PATH_LENGTH = 1024;
|
|
85
|
+
function requestPath(request) {
|
|
86
|
+
const path = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, new URL(request.url).pathname);
|
|
87
|
+
return path.length <= MAX_PATH_LENGTH && PATH.test(path) ? path : void 0;
|
|
88
|
+
}
|
|
83
89
|
function duration(value) {
|
|
84
90
|
return Number.isFinite(value) ? Math.min(864e5, Math.max(0, value)) : 0;
|
|
85
91
|
}
|
|
@@ -262,7 +268,8 @@ var CONTEXT_KEY = "farm.infra.analytics";
|
|
|
262
268
|
function beginRequest(request, route, waitUntil) {
|
|
263
269
|
return {
|
|
264
270
|
id: uuid(),
|
|
265
|
-
agent:
|
|
271
|
+
agent: _chunkHGB4PM2Ccjs.classifyFarmClient.call(void 0, request),
|
|
272
|
+
path: requestPath(request),
|
|
266
273
|
route,
|
|
267
274
|
completed: false,
|
|
268
275
|
waitUntil
|
|
@@ -273,7 +280,8 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
273
280
|
id: uuid(),
|
|
274
281
|
requestId: metadata.id,
|
|
275
282
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
276
|
-
route: routeTemplate(
|
|
283
|
+
route: routeTemplate(_chunk4YHGQDTTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
284
|
+
...metadata.path ? { path: metadata.path } : {},
|
|
277
285
|
agent: metadata.agent,
|
|
278
286
|
kind: "request",
|
|
279
287
|
method,
|
|
@@ -286,7 +294,8 @@ function toolEvent(metadata, event) {
|
|
|
286
294
|
id: uuid(),
|
|
287
295
|
requestId: metadata.id,
|
|
288
296
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
289
|
-
route: routeTemplate(
|
|
297
|
+
route: routeTemplate(_chunk4YHGQDTTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
298
|
+
...metadata.path ? { path: metadata.path } : {},
|
|
290
299
|
agent: metadata.agent,
|
|
291
300
|
kind: "mcp.tool",
|
|
292
301
|
tool: event.tool,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
FARM_DEFAULT_MCP_PROTOCOL_VERSIONS,
|
|
4
4
|
FARM_DEFAULT_MCP_TOOLS,
|
|
5
5
|
resolveFarmDefaultMCPI18n
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UVZMSRHF.mjs";
|
|
7
7
|
import {
|
|
8
8
|
resolveFarmAgentOrigin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HY6IVQ54.mjs";
|
|
10
10
|
import {
|
|
11
11
|
resolveFarmLocalePath
|
|
12
12
|
} from "./chunk-7S7AAK2D.mjs";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-XAXTTBUT.mjs";
|
|
4
4
|
import {
|
|
5
5
|
serializeFarmLlmsTxt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HY6IVQ54.mjs";
|
|
7
7
|
import {
|
|
8
8
|
stampFarmCspNonce
|
|
9
9
|
} from "./chunk-22W4FNTG.mjs";
|
|
10
10
|
import {
|
|
11
11
|
emitFarmAgentRead
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CPMME66W.mjs";
|
|
13
13
|
import {
|
|
14
14
|
resolveFarmThemeConfig
|
|
15
15
|
} from "./chunk-YWPNIYUP.mjs";
|
|
@@ -33,6 +33,9 @@ import {
|
|
|
33
33
|
parseRoutePattern,
|
|
34
34
|
splitNormalizedPathname
|
|
35
35
|
} from "./chunk-MFQGU5CC.mjs";
|
|
36
|
+
import {
|
|
37
|
+
normalizeFarmTrailingSlashPathname
|
|
38
|
+
} from "./chunk-4O26BPUY.mjs";
|
|
36
39
|
import {
|
|
37
40
|
localizeFarmPathname
|
|
38
41
|
} from "./chunk-7S7AAK2D.mjs";
|
|
@@ -237,6 +240,32 @@ function classifyFarmDocumentPrefix(markup) {
|
|
|
237
240
|
if (/^<!doctype/i.test(inner) || /^<html[\s>]/i.test(inner)) return "document";
|
|
238
241
|
return inner === "" ? "pending" : "fragment";
|
|
239
242
|
}
|
|
243
|
+
function takeFarmHoistedHead(markup, complete) {
|
|
244
|
+
const kind = classifyFarmDocumentPrefix(markup);
|
|
245
|
+
if (kind === "document") return { head: "", body: markup };
|
|
246
|
+
if (kind === "pending" && !complete) return null;
|
|
247
|
+
let head = "";
|
|
248
|
+
let body = markup;
|
|
249
|
+
let match;
|
|
250
|
+
while (match = HOISTED_HEAD_ELEMENT.exec(body.replace(/^\s+/, ""))) {
|
|
251
|
+
head += match[0];
|
|
252
|
+
body = body.replace(/^\s+/, "").slice(match[0].length);
|
|
253
|
+
}
|
|
254
|
+
if (!complete && endsInsideHoistable(body)) return null;
|
|
255
|
+
return { head, body };
|
|
256
|
+
}
|
|
257
|
+
function endsInsideHoistable(body) {
|
|
258
|
+
const open = /^\s*<(meta|link|base|title|script|style)\b/i.exec(body);
|
|
259
|
+
if (!open) return false;
|
|
260
|
+
const tag = open[1].toLowerCase();
|
|
261
|
+
if (!body.includes(">")) return true;
|
|
262
|
+
return (tag === "title" || tag === "script" || tag === "style") && !new RegExp(`</${tag}>`, "i").test(body);
|
|
263
|
+
}
|
|
264
|
+
function appendFarmHead(document, head) {
|
|
265
|
+
if (!head) return document;
|
|
266
|
+
return document.replace(/<\/head>/i, () => `${head}
|
|
267
|
+
</head>`);
|
|
268
|
+
}
|
|
240
269
|
function ensureFarmDocumentHead(markup) {
|
|
241
270
|
if (/<head[\s>]/i.test(markup)) return markup;
|
|
242
271
|
return markup.replace(/<html([^>]*)>/i, (_match, attributes) => {
|
|
@@ -423,10 +452,21 @@ function pathSpecificConfigMiddlewareCovers(config, pathname) {
|
|
|
423
452
|
return matchesCompiledMiddlewareConfig(pathname, compiled, {}).matched;
|
|
424
453
|
});
|
|
425
454
|
}
|
|
455
|
+
function middlewareRouteConfig(route) {
|
|
456
|
+
if (route.config !== void 0) return route.config === "unknown" ? void 0 : route.config;
|
|
457
|
+
return route.module?.config;
|
|
458
|
+
}
|
|
426
459
|
function farmPathGuardCoversPage(options, pathname) {
|
|
427
460
|
return appMiddlewareMayHandlePath(
|
|
428
461
|
options.middlewareRoutes.filter((route) => route.path !== "/"),
|
|
429
462
|
pathname
|
|
463
|
+
) || // The root file runs for every path unless its own matcher narrows it, which is how a
|
|
464
|
+
// Next.js-style `middleware.ts` guards `/dashboard/:path*`.
|
|
465
|
+
options.middlewareRoutes.some(
|
|
466
|
+
(route) => route.path === "/" && pathSpecificConfigMiddlewareCovers(
|
|
467
|
+
middlewareRouteConfig(route),
|
|
468
|
+
pathname
|
|
469
|
+
)
|
|
430
470
|
) || pathSpecificConfigMiddlewareCovers(options.config.middleware, pathname) || integrationMiddlewareMayHandlePath(options.config.integrations, pathname, CATCH_ALL_PROBE);
|
|
431
471
|
}
|
|
432
472
|
function farmPathGuardCoversEndpoint(options, path, apiServerBasePath) {
|
|
@@ -440,7 +480,15 @@ function renderFarmLocaleAlternateLinks(pathname, config, options = {}) {
|
|
|
440
480
|
if (config.routing === "none") return "";
|
|
441
481
|
const base = resolveAlternateBase(options);
|
|
442
482
|
const link = (hreflang, locale) => `<link rel="alternate" hreflang="${escapeHtmlAttribute(hreflang)}" href="${escapeHtmlAttribute(
|
|
443
|
-
resolveAlternateHref(
|
|
483
|
+
resolveAlternateHref(
|
|
484
|
+
// Each alternate is the page's canonical URL in that locale, so it carries the app's
|
|
485
|
+
// trailingSlash: an alternate the server redirects reads as an error to search engines.
|
|
486
|
+
normalizeFarmTrailingSlashPathname(
|
|
487
|
+
localizeFarmPathname(pathname, locale, config),
|
|
488
|
+
config.trailingSlash === true
|
|
489
|
+
),
|
|
490
|
+
base
|
|
491
|
+
)
|
|
444
492
|
)}">`;
|
|
445
493
|
const links = config.locales.map((locale) => link(locale, locale));
|
|
446
494
|
links.push(link("x-default", config.defaultLocale));
|
|
@@ -856,6 +904,8 @@ export {
|
|
|
856
904
|
HOISTED_HEAD_ELEMENT,
|
|
857
905
|
extractFarmFullDocument,
|
|
858
906
|
classifyFarmDocumentPrefix,
|
|
907
|
+
takeFarmHoistedHead,
|
|
908
|
+
appendFarmHead,
|
|
859
909
|
removeFarmDocumentTitles,
|
|
860
910
|
ensureFarmDocumentMeta,
|
|
861
911
|
composeFarmFullDocument,
|