@farm.js/core 0.1.70 → 0.1.71
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-6T2Z7TB6.cjs → agent-mcp-handler-KE4J3W7S.cjs} +3 -3
- package/dist/{agent-mcp-handler-CPU354QQ.mjs → agent-mcp-handler-VIT4GOSR.mjs} +2 -2
- package/dist/{agent-mcp.d-DulgFLBt.d.ts → agent-mcp.d-BzNw6JI8.d.ts} +14 -4
- package/dist/{agent-mcp.d-TAs1ES2F.d.mts → agent-mcp.d-CgFen3EH.d.mts} +14 -4
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-LPIVRSTJ.cjs +16 -0
- package/dist/{analyzer-QGRBLETM.mjs → analyzer-VK3BAOFI.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/{app-manifest.d-C-nf3Vmm.d.ts → app-manifest.d-DY4JfJxi.d.ts} +1 -1
- package/dist/{app-manifest.d-6zXb90o6.d.mts → app-manifest.d-DpDK_B1k.d.mts} +1 -1
- package/dist/app-markdown.cjs +5 -3
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +4 -2
- package/dist/{app.d-C2xeMIYT.d.ts → app.d-BeK6bb1c.d.ts} +8 -6
- package/dist/{app.d-DF0aundc.d.mts → app.d-D-5UNrFd.d.mts} +8 -6
- package/dist/{chunk-HAXFV2CD.mjs → chunk-2CQC5CMD.mjs} +1 -1
- package/dist/{chunk-IEN2EFE5.cjs → chunk-2IFT2CSA.cjs} +4 -4
- package/dist/{chunk-BPUVDCGG.cjs → chunk-3BQ7QHUH.cjs} +3 -3
- package/dist/{chunk-JFVT5ZZV.mjs → chunk-4OD2LXF2.mjs} +1 -1
- package/dist/{chunk-CCHJWJGP.mjs → chunk-7BUE2GM6.mjs} +141 -86
- package/dist/{chunk-FJ5YCERM.cjs → chunk-7OHJWFLB.cjs} +387 -331
- package/dist/{chunk-5R3JQPWD.mjs → chunk-AYVGD3PK.mjs} +1 -1
- package/dist/{chunk-K7JMTAFH.cjs → chunk-CSQPMV3Q.cjs} +16 -6
- package/dist/{chunk-N62IYXYD.mjs → chunk-DPIGYXSV.mjs} +1 -1
- package/dist/{chunk-LECZ5DPZ.cjs → chunk-DPYBVVL3.cjs} +2 -2
- package/dist/{chunk-RMOU3PR4.mjs → chunk-GUU3IZSM.mjs} +63 -23
- package/dist/{chunk-EDZU7YRK.mjs → chunk-IGXS54GC.mjs} +2 -2
- package/dist/{chunk-3WS5AZ3R.mjs → chunk-IYDJNCR7.mjs} +1 -1
- package/dist/{chunk-R7254L3R.mjs → chunk-J5ASGNKF.mjs} +23 -0
- package/dist/{chunk-75E5FDX2.mjs → chunk-JMFTKNBA.mjs} +10 -10
- package/dist/{chunk-DIHBWZDZ.cjs → chunk-JVA4PIYN.cjs} +408 -294
- package/dist/{chunk-XYVPTTUT.cjs → chunk-KEB7AGS6.cjs} +4 -4
- package/dist/{chunk-TLSSIYAL.mjs → chunk-KQAB5LML.mjs} +10 -3
- package/dist/{chunk-M6U6E4F7.cjs → chunk-KWST2O22.cjs} +108 -68
- package/dist/{chunk-NSZY3EWG.cjs → chunk-L6E4SHUB.cjs} +31 -8
- package/dist/{chunk-MZLJFNMH.cjs → chunk-MEJCP2LX.cjs} +1 -1
- package/dist/{chunk-A2TH5MKE.mjs → chunk-MITIAOUQ.mjs} +3 -3
- package/dist/{chunk-OCNV4CI2.cjs → chunk-MQ4DYVFS.cjs} +26 -0
- package/dist/{chunk-4AC4PXZO.cjs → chunk-N3XO5AL5.cjs} +2 -2
- package/dist/{chunk-R2ZHU37O.mjs → chunk-NLRAQXAA.mjs} +26 -0
- package/dist/{chunk-32SYRIQ7.cjs → chunk-PLXD2MJV.cjs} +3 -3
- package/dist/{chunk-JFPKARWM.cjs → chunk-PMU4U2W2.cjs} +1 -0
- package/dist/{chunk-3EXCZJEN.mjs → chunk-QUFENL7Q.mjs} +1 -1
- package/dist/{chunk-NYF7A4UW.mjs → chunk-RJUCNO7R.mjs} +1 -1
- package/dist/{chunk-K4UGCUXX.cjs → chunk-SXMWVP2L.cjs} +7 -7
- package/dist/{chunk-VG6HYT5K.cjs → chunk-TP4RAV7Y.cjs} +9 -9
- package/dist/{chunk-I7NUT24Z.cjs → chunk-UISZLYKY.cjs} +2 -2
- package/dist/{chunk-KPMLDT3B.mjs → chunk-UQUOSNRN.mjs} +378 -264
- package/dist/{chunk-QZHTDVH4.mjs → chunk-V25GSH43.mjs} +1 -1
- package/dist/{chunk-65FPDDT4.cjs → chunk-VXB5CMNC.cjs} +2 -2
- package/dist/{chunk-5IJRJWJS.mjs → chunk-W2T6NDNP.mjs} +10 -0
- package/dist/{chunk-JRF2SKCD.mjs → chunk-X7LGLF33.mjs} +1 -1
- package/dist/{chunk-QEWWKYDL.cjs → chunk-YCNHUIPR.cjs} +17 -10
- package/dist/{chunk-PJQ5W356.mjs → chunk-Z5ZZAGIH.mjs} +1 -0
- package/dist/{chunk-A7HCBHMC.cjs → chunk-ZPUAOKHV.cjs} +3 -3
- package/dist/{client-component.d-Bk5qKJM-.d.mts → client-component.d-DwpH251K.d.mts} +2 -2
- package/dist/{client-component.d-DNbC4oWI.d.ts → client-component.d-fYupugbZ.d.ts} +2 -2
- package/dist/{client-plugins.d-DwUqh4gp.d.ts → client-plugins.d-BxqFfHpM.d.ts} +8 -5
- package/dist/{client-plugins.d-Pi9nG0W0.d.mts → client-plugins.d-k3bOT5gz.d.mts} +8 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-CB43AHEP.mjs → devtools-6MXPFPNJ.mjs} +2 -2
- package/dist/{devtools-L5DUNDF3.cjs → devtools-O5625KCK.cjs} +3 -3
- package/dist/docs.cjs +4 -4
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +3 -3
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{headers.d-CE6OWB-n.d.ts → headers.d-DalIGbVO.d.ts} +1 -1
- package/dist/{headers.d-DED1hHh4.d.mts → headers.d-sNT7ZQiU.d.mts} +1 -1
- package/dist/index.cjs +20 -18
- package/dist/{index.d-c9UwIqDy.d.ts → index.d-BcA-secm.d.ts} +1 -1
- package/dist/{index.d-CbvOjJcp.d.mts → index.d-DDHHAv7j.d.mts} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +19 -17
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +4 -2
- package/dist/internal/app-markdown-runtime.d.mts +11 -3
- package/dist/internal/app-markdown-runtime.d.ts +11 -3
- package/dist/internal/app-markdown-runtime.mjs +3 -1
- package/dist/internal/build-runtime.cjs +19 -19
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +18 -18
- package/dist/internal/cli-runtime.cjs +6 -4
- package/dist/internal/cli-runtime.mjs +5 -3
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +4 -4
- package/dist/internal/client-runtime.d.ts +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +7 -7
- package/dist/internal/infra-analytics-runtime.mjs +5 -5
- 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 +6 -6
- package/dist/internal/production-runtime.d.mts +14 -9
- package/dist/internal/production-runtime.d.ts +14 -9
- package/dist/internal/production-runtime.mjs +5 -5
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-BvWxf8ZE.d.mts → mount.d-C1PONsEe.d.mts} +1 -1
- package/dist/{mount.d-DngLY7NL.d.ts → mount.d-D3JOux2V.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CMyl1h2l.d.mts → navigation-delegate.d-CJQQHboA.d.mts} +1 -1
- package/dist/{navigation-delegate.d-zZogiDfa.d.ts → navigation-delegate.d-CQQPbdkE.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{nitro-Y3LGITW3.cjs → nitro-2LMOMIST.cjs} +2 -2
- package/dist/{nitro-NSTXT7LB.mjs → nitro-72TFIGGO.mjs} +1 -1
- package/dist/{plugin-F2O4BFTK.cjs → plugin-5PIQQVRP.cjs} +2 -2
- package/dist/{plugin-VEBRN7A3.mjs → plugin-QZT747YW.mjs} +1 -1
- package/dist/plugin.cjs +13 -13
- package/dist/plugin.d.mts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.mjs +12 -12
- package/dist/{render-plan.d-Di1znBDW.d.mts → render-plan.d-CiUj0rq5.d.mts} +1 -1
- package/dist/{render-plan.d-DQj2bzd2.d.ts → render-plan.d-DHuJMJRP.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-CJWzfDYJ.d.mts → request.d-D-F7o7tb.d.mts} +1 -1
- package/dist/{request.d-C5vyoYeL.d.ts → request.d-DRUbOmYD.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-C-et2TZ1.d.mts → route-rendering.d-6smgwT2t.d.mts} +1 -1
- package/dist/{route-rendering.d-DhsY5M2I.d.ts → route-rendering.d-KwqM_mlK.d.ts} +1 -1
- package/dist/{router.d-CJB-Ntni.d.ts → router.d-B6sesMRD.d.ts} +1 -1
- package/dist/{router.d-BMDS5s5X.d.mts → router.d-BYmDeDlp.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-NJKLZ3YE.cjs → rsc-pipeline-P4PCWDO2.cjs} +4 -4
- package/dist/{rsc-pipeline-AXQJCCHI.mjs → rsc-pipeline-R2GOKIMU.mjs} +3 -3
- package/dist/{runtime-JXNEKOSE.mjs → runtime-DP5DYGW5.mjs} +3 -3
- package/dist/{runtime-DMW6DDOI.cjs → runtime-WA2Q4SLG.cjs} +5 -5
- package/dist/{runtime.d-BonodRI9.d.mts → runtime.d-BFSJf-ww.d.mts} +1 -1
- package/dist/{runtime.d-uw4123iI.d.ts → runtime.d-CbdMI0Oy.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +33 -33
- package/dist/server.d.mts +10 -10
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +15 -15
- package/dist/{spa-router.d-rha3M95y.d.mts → spa-router.d-D4EDwR20.d.mts} +2 -2
- package/dist/{spa-router.d-l0d9pPZj.d.ts → spa-router.d-mC1D5cTN.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BK-PTOF8.d.ts → utils.d-A2X3a6z_.d.ts} +1 -1
- package/dist/{utils.d-BzuTobEc.d.mts → utils.d-DxMzteqE.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -13
- package/dist/vite.d.mts +7 -5
- package/dist/vite.d.ts +7 -5
- package/dist/vite.mjs +12 -12
- package/package.json +2 -2
- package/dist/analyzer-GUIRJWZH.cjs +0 -16
|
@@ -7,7 +7,7 @@ var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkMQ4DYVFScjs = require('./chunk-MQ4DYVFS.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkLSHX2H5Gcjs = require('./chunk-LSHX2H5G.cjs');
|
|
@@ -1077,9 +1077,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1077
1077
|
validateConfigRouteSources(rewrites, "rewrites");
|
|
1078
1078
|
const headers = typeof userConfig.headers === "function" ? await userConfig.headers() : userConfig.headers || [];
|
|
1079
1079
|
validateConfigRouteSources(headers, "headers");
|
|
1080
|
-
const routeRules =
|
|
1081
|
-
const routeRuleRedirects =
|
|
1082
|
-
const routeRuleHeaders =
|
|
1080
|
+
const routeRules = _chunkMQ4DYVFScjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
|
|
1081
|
+
const routeRuleRedirects = _chunkMQ4DYVFScjs.routeRulesToRedirects.call(void 0, routeRules);
|
|
1082
|
+
const routeRuleHeaders = _chunkMQ4DYVFScjs.routeRulesToHeaders.call(void 0, routeRules);
|
|
1083
1083
|
const security = _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
|
|
1084
1084
|
const securityHeader = _chunk6JHZPB52cjs.getFarmSecurityHeader.call(void 0, security);
|
|
1085
1085
|
if (_chunk6JHZPB52cjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
|
|
@@ -3,7 +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-JMFTKNBA.mjs";
|
|
7
|
+
import {
|
|
8
|
+
resolveFarmAgentOrigin
|
|
9
|
+
} from "./chunk-Z3GPAFIA.mjs";
|
|
7
10
|
import {
|
|
8
11
|
resolveFarmLocalePath
|
|
9
12
|
} from "./chunk-7S7AAK2D.mjs";
|
|
@@ -154,6 +157,7 @@ async function callTool(params, request, context) {
|
|
|
154
157
|
const pagePath = toPagePath(
|
|
155
158
|
path,
|
|
156
159
|
request.url,
|
|
160
|
+
context.metadataBase,
|
|
157
161
|
context.basePath,
|
|
158
162
|
resolveFarmDefaultMCPI18n(context.i18n, context.basePath)
|
|
159
163
|
);
|
|
@@ -203,14 +207,17 @@ function searchPages(pages, query, limit) {
|
|
|
203
207
|
(left, right) => right.score - left.score || left.page.path.localeCompare(right.page.path)
|
|
204
208
|
).slice(0, limit).map(({ page }) => page);
|
|
205
209
|
}
|
|
206
|
-
function toPagePath(input, requestUrl, basePath, i18n) {
|
|
210
|
+
function toPagePath(input, requestUrl, metadataBase, basePath, i18n) {
|
|
207
211
|
let url;
|
|
208
212
|
try {
|
|
209
213
|
url = new URL(input.trim(), requestUrl);
|
|
210
214
|
} catch {
|
|
211
215
|
return null;
|
|
212
216
|
}
|
|
213
|
-
|
|
217
|
+
const requestOrigin = new URL(requestUrl).origin;
|
|
218
|
+
if (url.origin !== requestOrigin && url.origin !== resolveFarmAgentOrigin(metadataBase, requestOrigin)) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
214
221
|
let path = url.pathname;
|
|
215
222
|
try {
|
|
216
223
|
path = decodeURI(path);
|
|
@@ -9,7 +9,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkCSQPMV3Qcjs = require('./chunk-CSQPMV3Q.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
|
|
@@ -42,7 +42,7 @@ var _chunkAXVRUDMBcjs = require('./chunk-AXVRUDMB.cjs');
|
|
|
42
42
|
var _chunk2MR4MABGcjs = require('./chunk-2MR4MABG.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
var
|
|
45
|
+
var _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ var _chunkK4UGCUXXcjs = require('./chunk-K4UGCUXX.cjs');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
var
|
|
53
|
+
var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -76,7 +76,7 @@ var _chunkXGJVRPYLcjs = require('./chunk-XGJVRPYL.cjs');
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
var
|
|
79
|
+
var _chunk2IFT2CSAcjs = require('./chunk-2IFT2CSA.cjs');
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
|
|
@@ -93,7 +93,7 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
|
|
|
93
93
|
var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
var
|
|
96
|
+
var _chunkMQ4DYVFScjs = require('./chunk-MQ4DYVFS.cjs');
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
@@ -154,10 +154,10 @@ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
var
|
|
157
|
+
var _chunkN3XO5AL5cjs = require('./chunk-N3XO5AL5.cjs');
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
var
|
|
160
|
+
var _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
@@ -278,7 +278,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
278
278
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
var
|
|
281
|
+
var _chunkMEJCP2LXcjs = require('./chunk-MEJCP2LX.cjs');
|
|
282
282
|
|
|
283
283
|
|
|
284
284
|
|
|
@@ -460,7 +460,7 @@ var RouteManager = class _RouteManager {
|
|
|
460
460
|
this.redirects = /* @__PURE__ */ new Map();
|
|
461
461
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
462
462
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
463
|
-
this.programmaticClientRoutes =
|
|
463
|
+
this.programmaticClientRoutes = _chunk2IFT2CSAcjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
464
464
|
this.discovery = Promise.resolve();
|
|
465
465
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
466
466
|
this.config = config;
|
|
@@ -509,7 +509,7 @@ var RouteManager = class _RouteManager {
|
|
|
509
509
|
await this.discoverFileRoutes(source);
|
|
510
510
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
511
511
|
}
|
|
512
|
-
this.programmaticClientRoutes =
|
|
512
|
+
this.programmaticClientRoutes = _chunk2IFT2CSAcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
513
513
|
for (const slot of this.routeSlots.values()) {
|
|
514
514
|
if (slot.interception && !this.pageRouteShapes.has(_chunkYTVSWXEZcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
515
515
|
throw new (0, _chunkYTVSWXEZcjs.AmbiguousRouteError)(
|
|
@@ -778,7 +778,7 @@ var RouteManager = class _RouteManager {
|
|
|
778
778
|
return this.clientManifestCache.manifest;
|
|
779
779
|
}
|
|
780
780
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
781
|
-
return cacheFile ?
|
|
781
|
+
return cacheFile ? _chunk2IFT2CSAcjs.runWithPackageClientBoundaryCacheFile.call(void 0,
|
|
782
782
|
cacheFile,
|
|
783
783
|
() => this.computeClientManifest(normalizedProjectRoot)
|
|
784
784
|
) : this.computeClientManifest(normalizedProjectRoot);
|
|
@@ -811,28 +811,28 @@ var RouteManager = class _RouteManager {
|
|
|
811
811
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
812
812
|
);
|
|
813
813
|
}
|
|
814
|
-
const isolatedMode =
|
|
814
|
+
const isolatedMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
815
815
|
_optionalChain([this, 'access', _12 => _12.config, 'access', _13 => _13.experimental, 'optionalAccess', _14 => _14.isolatedClientHydration]),
|
|
816
816
|
{
|
|
817
817
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _15 => _15.config, 'access', _16 => _16.experimental, 'optionalAccess', _17 => _17.serverComponents])) === "rsc",
|
|
818
818
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
819
819
|
}
|
|
820
820
|
);
|
|
821
|
-
const planOptions =
|
|
821
|
+
const planOptions = _chunk2IFT2CSAcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
822
822
|
this.config.renderer,
|
|
823
823
|
Boolean(unsupportedIntegrationProvider)
|
|
824
824
|
);
|
|
825
825
|
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _18 => _18.config, 'access', _19 => _19.experimental, 'optionalAccess', _20 => _20.serverComponents])) === "islands";
|
|
826
826
|
const layoutEntries = Array.from(this.layouts.values()).map((entry) => ({
|
|
827
827
|
entry,
|
|
828
|
-
metadata:
|
|
828
|
+
metadata: _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0,
|
|
829
829
|
entry.modulePath,
|
|
830
830
|
normalizedProjectRoot,
|
|
831
831
|
isolatedMode,
|
|
832
832
|
islandsMode ? { ...planOptions, serverTreeLayouts: true } : planOptions
|
|
833
833
|
)
|
|
834
834
|
}));
|
|
835
|
-
const markdownPagePlan =
|
|
835
|
+
const markdownPagePlan = _chunk2IFT2CSAcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
836
836
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
837
837
|
normalizedProjectRoot,
|
|
838
838
|
isolatedMode,
|
|
@@ -840,13 +840,13 @@ var RouteManager = class _RouteManager {
|
|
|
840
840
|
);
|
|
841
841
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
842
842
|
entry,
|
|
843
|
-
metadata:
|
|
843
|
+
metadata: _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0, entry.modulePath, normalizedProjectRoot, isolatedMode, {
|
|
844
844
|
...planOptions,
|
|
845
845
|
serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _21 => _21.config, 'access', _22 => _22.experimental, 'optionalAccess', _23 => _23.serverComponents])) === "islands"
|
|
846
846
|
})
|
|
847
847
|
}));
|
|
848
848
|
const markdownFallback = routeEntries.find(
|
|
849
|
-
({ entry, metadata }) =>
|
|
849
|
+
({ entry, metadata }) => _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
850
850
|
);
|
|
851
851
|
if (markdownFallback) {
|
|
852
852
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
@@ -854,7 +854,7 @@ var RouteManager = class _RouteManager {
|
|
|
854
854
|
);
|
|
855
855
|
}
|
|
856
856
|
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _24 => _24.find, 'call', _25 => _25(
|
|
857
|
-
({ entry, metadata }) =>
|
|
857
|
+
({ entry, metadata }) => _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
858
858
|
), 'optionalAccess', _26 => _26.metadata, 'access', _27 => _27.staticPackageBoundaries]);
|
|
859
859
|
if (markdownStaticPackages) {
|
|
860
860
|
_chunkQMNWKQL4cjs.logger.info(
|
|
@@ -862,12 +862,12 @@ var RouteManager = class _RouteManager {
|
|
|
862
862
|
);
|
|
863
863
|
}
|
|
864
864
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
865
|
-
if (
|
|
865
|
+
if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
866
866
|
_chunkQMNWKQL4cjs.logger.info(
|
|
867
867
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
868
868
|
);
|
|
869
869
|
}
|
|
870
|
-
|
|
870
|
+
_chunk2IFT2CSAcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
871
871
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
872
872
|
pattern: entry.pattern,
|
|
873
873
|
depth: _chunk2MR4MABGcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
@@ -914,7 +914,7 @@ var RouteManager = class _RouteManager {
|
|
|
914
914
|
modulePath: toUrlPath(boundary.modulePath)
|
|
915
915
|
}))
|
|
916
916
|
} : {},
|
|
917
|
-
...
|
|
917
|
+
..._chunk2IFT2CSAcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
918
918
|
renderPlan: _chunk2MR4MABGcjs.createFarmRouteRenderPlan.call(void 0, {
|
|
919
919
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
920
920
|
layoutShouldHydrate,
|
|
@@ -956,7 +956,7 @@ var RouteManager = class _RouteManager {
|
|
|
956
956
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
957
957
|
}));
|
|
958
958
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
959
|
-
const metadata =
|
|
959
|
+
const metadata = _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
960
960
|
return {
|
|
961
961
|
name: entry.name,
|
|
962
962
|
ownerPattern: entry.ownerPattern,
|
|
@@ -972,7 +972,7 @@ var RouteManager = class _RouteManager {
|
|
|
972
972
|
};
|
|
973
973
|
});
|
|
974
974
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
975
|
-
metadata:
|
|
975
|
+
metadata: _chunk2IFT2CSAcjs.getClientModuleHydrationPlan.call(void 0,
|
|
976
976
|
entry.modulePath,
|
|
977
977
|
normalizedProjectRoot,
|
|
978
978
|
isolatedMode,
|
|
@@ -1063,12 +1063,12 @@ var RouteManager = class _RouteManager {
|
|
|
1063
1063
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
1064
1064
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
1065
1065
|
}
|
|
1066
|
-
if (
|
|
1066
|
+
if (_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
1067
1067
|
const mdxConfig = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
1068
1068
|
const viteServer = this.viteServer;
|
|
1069
|
-
return await
|
|
1069
|
+
return await _chunkN3XO5AL5cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
1070
1070
|
// Loaded on render: the route runtime manifest only reads metadata and rendering config.
|
|
1071
|
-
components: () =>
|
|
1071
|
+
components: () => _chunkN3XO5AL5cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
1072
1072
|
root: this.config.root,
|
|
1073
1073
|
loadModule: viteServer ? (componentModulePath) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1074
1074
|
}),
|
|
@@ -1171,8 +1171,8 @@ var RouteManager = class _RouteManager {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
}
|
|
1173
1173
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
1174
|
-
const componentFiles = group.files.filter((file) => !
|
|
1175
|
-
const markdownFiles = group.files.filter(
|
|
1174
|
+
const componentFiles = group.files.filter((file) => !_chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
1175
|
+
const markdownFiles = group.files.filter(_chunkL6E4SHUBcjs.isFarmMarkdownPageFile);
|
|
1176
1176
|
if (componentFiles.length > 1) {
|
|
1177
1177
|
throw new Error(
|
|
1178
1178
|
`Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path3.default.join(appDir, file)).join(" and ")}.`
|
|
@@ -1318,11 +1318,11 @@ var RouteManager = class _RouteManager {
|
|
|
1318
1318
|
srcDir: source.srcDir,
|
|
1319
1319
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1320
1320
|
});
|
|
1321
|
-
const graph = this.viteServer ?
|
|
1321
|
+
const graph = this.viteServer ? _chunk2IFT2CSAcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1322
1322
|
for (const { filePath, manifest } of manifests) {
|
|
1323
1323
|
if (graph) {
|
|
1324
1324
|
clientRoutes.push(
|
|
1325
|
-
|
|
1325
|
+
_chunk2IFT2CSAcjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1326
1326
|
graph,
|
|
1327
1327
|
routesFile: toRealPath(filePath),
|
|
1328
1328
|
routes: manifest.routes,
|
|
@@ -1538,7 +1538,7 @@ var RouteManager = class _RouteManager {
|
|
|
1538
1538
|
}));
|
|
1539
1539
|
const i18n = this.getI18nConfig();
|
|
1540
1540
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1541
|
-
const result = await
|
|
1541
|
+
const result = await _chunkCSQPMV3Qcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1542
1542
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1543
1543
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1544
1544
|
});
|
|
@@ -1585,7 +1585,7 @@ var RouteManager = class _RouteManager {
|
|
|
1585
1585
|
async isRouteSSG(modulePath) {
|
|
1586
1586
|
try {
|
|
1587
1587
|
const mod = await this.loadRouteModule(modulePath);
|
|
1588
|
-
const rendering = await
|
|
1588
|
+
const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1589
1589
|
return rendering.ssg;
|
|
1590
1590
|
} catch (e) {
|
|
1591
1591
|
return false;
|
|
@@ -1597,7 +1597,7 @@ var RouteManager = class _RouteManager {
|
|
|
1597
1597
|
async hasRouteISR(modulePath) {
|
|
1598
1598
|
try {
|
|
1599
1599
|
const mod = await this.loadRouteModule(modulePath);
|
|
1600
|
-
const rendering = await
|
|
1600
|
+
const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1601
1601
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1602
1602
|
} catch (e2) {
|
|
1603
1603
|
return false;
|
|
@@ -1609,7 +1609,7 @@ var RouteManager = class _RouteManager {
|
|
|
1609
1609
|
async getRouteRevalidateInterval(modulePath) {
|
|
1610
1610
|
try {
|
|
1611
1611
|
const mod = await this.loadRouteModule(modulePath);
|
|
1612
|
-
const rendering = await
|
|
1612
|
+
const rendering = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1613
1613
|
return rendering.revalidate;
|
|
1614
1614
|
} catch (e3) {
|
|
1615
1615
|
return void 0;
|
|
@@ -2875,7 +2875,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
2875
2875
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
2876
2876
|
parse: parseFarmIslandSource,
|
|
2877
2877
|
resolve: (specifier, importer) => {
|
|
2878
|
-
const resolved =
|
|
2878
|
+
const resolved = _chunk2IFT2CSAcjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
2879
2879
|
return resolved.local ? resolved.path : null;
|
|
2880
2880
|
}
|
|
2881
2881
|
});
|
|
@@ -2889,7 +2889,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
2889
2889
|
const files = [];
|
|
2890
2890
|
const modules = [];
|
|
2891
2891
|
for (const owner of owners) {
|
|
2892
|
-
const rendered =
|
|
2892
|
+
const rendered = _chunk2IFT2CSAcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
2893
2893
|
if (!rendered) {
|
|
2894
2894
|
return {
|
|
2895
2895
|
strategy: null,
|
|
@@ -2905,7 +2905,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
2905
2905
|
source = fs.default.readFileSync(module, "utf8");
|
|
2906
2906
|
} catch (e10) {
|
|
2907
2907
|
}
|
|
2908
|
-
if (
|
|
2908
|
+
if (_chunk2IFT2CSAcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
2909
2909
|
}
|
|
2910
2910
|
for (const module of modules) {
|
|
2911
2911
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3326,7 +3326,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
3326
3326
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
3327
3327
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
3328
3328
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
3329
|
-
_chunkQMNWKQL4cjs.logger.warn(
|
|
3329
|
+
_chunkQMNWKQL4cjs.logger.warn(_chunk2IFT2CSAcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
3330
3330
|
}
|
|
3331
3331
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
3332
3332
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -3845,7 +3845,7 @@ var ServerRenderer = class {
|
|
|
3845
3845
|
* Check if a path should be served from SSG cache
|
|
3846
3846
|
*/
|
|
3847
3847
|
async shouldServeSSG(pathname) {
|
|
3848
|
-
const ssgPage =
|
|
3848
|
+
const ssgPage = _chunkCSQPMV3Qcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
3849
3849
|
if (!ssgPage) return null;
|
|
3850
3850
|
const cached = await this.getCachedSSGPage(pathname);
|
|
3851
3851
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -4205,7 +4205,7 @@ var ServerRenderer = class {
|
|
|
4205
4205
|
layouts = match.layouts;
|
|
4206
4206
|
routeSlots = _nullishCoalesce(match.slots, () => ( []));
|
|
4207
4207
|
if (!route) {
|
|
4208
|
-
if (
|
|
4208
|
+
if (_chunkTP4RAV7Ycjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
|
|
4209
4209
|
await this.renderDefaultMCP(req, res);
|
|
4210
4210
|
completeRender(res.statusCode || 200, pathname);
|
|
4211
4211
|
return;
|
|
@@ -4314,7 +4314,7 @@ var ServerRenderer = class {
|
|
|
4314
4314
|
throw error;
|
|
4315
4315
|
}
|
|
4316
4316
|
}
|
|
4317
|
-
const renderingConfig = await
|
|
4317
|
+
const renderingConfig = await _chunkCSQPMV3Qcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
4318
4318
|
routeModule,
|
|
4319
4319
|
route.modulePath,
|
|
4320
4320
|
{ experimentalPPR: _optionalChain([this, 'access', _99 => _99.config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.ppr]) === true }
|
|
@@ -4400,7 +4400,7 @@ var ServerRenderer = class {
|
|
|
4400
4400
|
const routeManifestEntry = routeManifest.routes.find(
|
|
4401
4401
|
(entry) => entry.pattern === route.pattern
|
|
4402
4402
|
);
|
|
4403
|
-
const moduleMetadata = routeManifestEntry ||
|
|
4403
|
+
const moduleMetadata = routeManifestEntry || _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
4404
4404
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4405
4405
|
const renderedRouteSlots = await Promise.all(
|
|
4406
4406
|
routeSlots.map(async (slot) => {
|
|
@@ -5200,26 +5200,28 @@ var ServerRenderer = class {
|
|
|
5200
5200
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
5201
5201
|
*/
|
|
5202
5202
|
getDefaultMCPServer() {
|
|
5203
|
-
if (_optionalChain([this, 'access', _169 => _169.config, 'access', _170 => _170.agent, 'optionalAccess', _171 => _171.mcp]) !== true ||
|
|
5203
|
+
if (_optionalChain([this, 'access', _169 => _169.config, 'access', _170 => _170.agent, 'optionalAccess', _171 => _171.mcp]) !== true || _chunkTP4RAV7Ycjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
5204
5204
|
if (_optionalChain([this, 'access', _172 => _172.apiRouteExists, 'optionalCall', _173 => _173("/api/mcp")])) return void 0;
|
|
5205
|
-
if (this.routeManager.matchRoute(
|
|
5206
|
-
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer =
|
|
5205
|
+
if (this.routeManager.matchRoute(_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
5206
|
+
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkTP4RAV7Ycjs.createFarmDefaultMCPServer.call(void 0,
|
|
5207
5207
|
readAppPackageIdentity(this.config.root),
|
|
5208
|
-
|
|
5208
|
+
_chunkMEJCP2LXcjs.FARM_VERSION
|
|
5209
5209
|
))));
|
|
5210
|
-
return
|
|
5210
|
+
return _chunkTP4RAV7Ycjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
5211
5211
|
}
|
|
5212
5212
|
async renderDefaultMCP(req, res) {
|
|
5213
5213
|
const server = this.getDefaultMCPServer();
|
|
5214
5214
|
const request2 = _nullishCoalesce(_chunkHDPT6OYEcjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkHDPT6OYEcjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _174 => _174.config, 'access', _175 => _175.server, 'optionalAccess', _176 => _176.trustProxy]) })));
|
|
5215
5215
|
try {
|
|
5216
|
-
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-
|
|
5216
|
+
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-KE4J3W7S.cjs");
|
|
5217
5217
|
const origin = new URL(request2.url).origin;
|
|
5218
5218
|
const i18n = _optionalChain([this, 'access', _177 => _177.i18nRuntime, 'optionalAccess', _178 => _178.config]);
|
|
5219
|
+
const metadataBase = await this.getRootMetadataBase();
|
|
5219
5220
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
5220
5221
|
server,
|
|
5221
5222
|
basePath: this.config.basePath,
|
|
5222
5223
|
i18n,
|
|
5224
|
+
metadataBase,
|
|
5223
5225
|
listPages: async () => {
|
|
5224
5226
|
const sources = await Promise.all(
|
|
5225
5227
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -5228,10 +5230,11 @@ var ServerRenderer = class {
|
|
|
5228
5230
|
return await this.isAgentPageNoIndex(pattern, metadata) ? null : { pattern, module };
|
|
5229
5231
|
})
|
|
5230
5232
|
);
|
|
5231
|
-
return
|
|
5233
|
+
return _chunkTP4RAV7Ycjs.collectFarmDefaultMCPPages.call(void 0,
|
|
5232
5234
|
sources.filter((source) => source !== null),
|
|
5233
5235
|
{
|
|
5234
5236
|
origin,
|
|
5237
|
+
metadataBase,
|
|
5235
5238
|
basePath: this.config.basePath,
|
|
5236
5239
|
markdown: _chunkC2JOS77Zcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
5237
5240
|
trailingSlash: this.config.trailingSlash,
|
|
@@ -5296,7 +5299,7 @@ var ServerRenderer = class {
|
|
|
5296
5299
|
pages,
|
|
5297
5300
|
config,
|
|
5298
5301
|
rootMetadata,
|
|
5299
|
-
mcp: _optionalChain([this, 'access', _184 => _184.config, 'access', _185 => _185.agent, 'optionalAccess', _186 => _186.aiCatalog]) === false ? [] :
|
|
5302
|
+
mcp: _optionalChain([this, 'access', _184 => _184.config, 'access', _185 => _185.agent, 'optionalAccess', _186 => _186.aiCatalog]) === false ? [] : _chunkSXMWVP2Lcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
5300
5303
|
basePath: this.config.basePath,
|
|
5301
5304
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
5302
5305
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -5316,16 +5319,17 @@ var ServerRenderer = class {
|
|
|
5316
5319
|
};
|
|
5317
5320
|
}
|
|
5318
5321
|
/**
|
|
5319
|
-
* The origin llms.txt
|
|
5320
|
-
* request's origin, as for the sitemap and the production server.
|
|
5322
|
+
* The origin llms.txt, llms-full.txt and list_pages link to: the root layout's
|
|
5323
|
+
* `metadataBase`, else the request's origin, as for the sitemap and the production server.
|
|
5321
5324
|
*/
|
|
5322
5325
|
async getAgentOrigin(request2) {
|
|
5326
|
+
return _chunkO32QPFVVcjs.resolveFarmAgentOrigin.call(void 0, await this.getRootMetadataBase(), new URL(request2.url).origin);
|
|
5327
|
+
}
|
|
5328
|
+
/** The root layout's `metadataBase`, which generated agent files and list_pages link to. */
|
|
5329
|
+
async getRootMetadataBase() {
|
|
5323
5330
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
5324
5331
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
5325
|
-
return
|
|
5326
|
-
_optionalChain([rootMetadata, 'optionalAccess', _187 => _187.metadataBase]),
|
|
5327
|
-
new URL(request2.url).origin
|
|
5328
|
-
);
|
|
5332
|
+
return _optionalChain([rootMetadata, 'optionalAccess', _187 => _187.metadataBase]);
|
|
5329
5333
|
}
|
|
5330
5334
|
/**
|
|
5331
5335
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
@@ -6343,7 +6347,7 @@ window.__FARM_I18N__ = ${_chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6343
6347
|
stack: _optionalChain([diagnostics, 'optionalAccess', _241 => _241.stack]),
|
|
6344
6348
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _242 => _242.sourceFrame]),
|
|
6345
6349
|
development: isDev,
|
|
6346
|
-
farmVersion:
|
|
6350
|
+
farmVersion: _chunkMEJCP2LXcjs.FARM_VERSION,
|
|
6347
6351
|
nodeVersion: process.version,
|
|
6348
6352
|
mode: isDev ? "development" : "production"
|
|
6349
6353
|
})
|
|
@@ -6576,7 +6580,7 @@ var FarmApp = class {
|
|
|
6576
6580
|
workflows: _chunkFSODPZRTcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
|
|
6577
6581
|
api: normalizeFarmAppAPIConfig(config.api),
|
|
6578
6582
|
middleware: config.middleware || {},
|
|
6579
|
-
routeRules:
|
|
6583
|
+
routeRules: _chunkMQ4DYVFScjs.normalizeRouteRules.call(void 0, config.routeRules),
|
|
6580
6584
|
context: config.context || (() => void 0),
|
|
6581
6585
|
server: _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
6582
6586
|
serverActions: _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
@@ -7479,17 +7483,23 @@ function mergeNoExternal(farmValue, userValue) {
|
|
|
7479
7483
|
const normalize = (value) => value == null || value === true ? [] : Array.isArray(value) ? value : [value];
|
|
7480
7484
|
return Array.from(/* @__PURE__ */ new Set([...normalize(farmValue), ...normalize(userValue)]));
|
|
7481
7485
|
}
|
|
7482
|
-
function
|
|
7486
|
+
function mergeFarmViteAlias(farmValue, userValue) {
|
|
7483
7487
|
if (!farmValue) return userValue || {};
|
|
7484
7488
|
if (!userValue) return farmValue;
|
|
7485
7489
|
if (!Array.isArray(farmValue) && !Array.isArray(userValue)) {
|
|
7486
7490
|
return {
|
|
7487
|
-
...
|
|
7488
|
-
...
|
|
7491
|
+
...userValue,
|
|
7492
|
+
...Object.fromEntries(
|
|
7493
|
+
Object.entries(farmValue).filter(
|
|
7494
|
+
([find]) => !Object.prototype.hasOwnProperty.call(userValue, find)
|
|
7495
|
+
)
|
|
7496
|
+
)
|
|
7489
7497
|
};
|
|
7490
7498
|
}
|
|
7491
7499
|
const normalize = (value) => Array.isArray(value) ? [...value] : Object.entries(value).map(([find, replacement]) => ({ find, replacement }));
|
|
7492
|
-
|
|
7500
|
+
const userEntries = normalize(userValue);
|
|
7501
|
+
const userNames = new Set(userEntries.map((entry) => entry.find));
|
|
7502
|
+
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
7493
7503
|
}
|
|
7494
7504
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
7495
7505
|
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _289 => _289.optimizeDeps, 'optionalAccess', _290 => _290.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _291 => _291.optimizeDeps, 'optionalAccess', _292 => _292.noDiscovery])));
|
|
@@ -7505,7 +7515,7 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
7505
7515
|
resolve: {
|
|
7506
7516
|
...farmConfig.resolve,
|
|
7507
7517
|
...userConfig.resolve,
|
|
7508
|
-
alias:
|
|
7518
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _299 => _299.resolve, 'optionalAccess', _300 => _300.alias]), _optionalChain([userConfig, 'access', _301 => _301.resolve, 'optionalAccess', _302 => _302.alias])),
|
|
7509
7519
|
dedupe: Array.from(
|
|
7510
7520
|
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _303 => _303.resolve, 'optionalAccess', _304 => _304.dedupe]) || [], ..._optionalChain([userConfig, 'access', _305 => _305.resolve, 'optionalAccess', _306 => _306.dedupe]) || []])
|
|
7511
7521
|
)
|
|
@@ -7541,7 +7551,33 @@ function mergeExternal(farmValue, userValue) {
|
|
|
7541
7551
|
if (farmValue === true || userValue === true) return true;
|
|
7542
7552
|
return Array.from(/* @__PURE__ */ new Set([...farmValue, ...userValue]));
|
|
7543
7553
|
}
|
|
7544
|
-
|
|
7554
|
+
var FARM_CLIENT_OWNED_OUTPUT_OPTIONS = [
|
|
7555
|
+
"dir",
|
|
7556
|
+
"file",
|
|
7557
|
+
"format",
|
|
7558
|
+
"entryFileNames",
|
|
7559
|
+
"chunkFileNames",
|
|
7560
|
+
"assetFileNames",
|
|
7561
|
+
"hashCharacters"
|
|
7562
|
+
];
|
|
7563
|
+
function isFarmOwnedClientOutputOption(key) {
|
|
7564
|
+
return FARM_CLIENT_OWNED_OUTPUT_OPTIONS.includes(key) || key.startsWith("sourcemap");
|
|
7565
|
+
}
|
|
7566
|
+
function mergeFarmClientOutputOptions(farmOutput, userOutput) {
|
|
7567
|
+
if (userOutput === void 0) return farmOutput;
|
|
7568
|
+
if (Array.isArray(userOutput) || Array.isArray(farmOutput)) {
|
|
7569
|
+
throw new Error(
|
|
7570
|
+
"Farm builds one client output: set vite.build.rolldownOptions.output (or rollupOptions.output) to an object, not an array."
|
|
7571
|
+
);
|
|
7572
|
+
}
|
|
7573
|
+
const app = Object.fromEntries(
|
|
7574
|
+
Object.entries(userOutput).filter(
|
|
7575
|
+
([key, value]) => value !== void 0 && !isFarmOwnedClientOutputOption(key)
|
|
7576
|
+
)
|
|
7577
|
+
);
|
|
7578
|
+
return { ...app, ...farmOutput };
|
|
7579
|
+
}
|
|
7580
|
+
function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}) {
|
|
7545
7581
|
const {
|
|
7546
7582
|
plugins: _plugins,
|
|
7547
7583
|
root: _root,
|
|
@@ -7569,13 +7605,15 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
7569
7605
|
} = userBuild;
|
|
7570
7606
|
const {
|
|
7571
7607
|
input: _input,
|
|
7572
|
-
output:
|
|
7608
|
+
output: userOutput,
|
|
7573
7609
|
...userBundlerOptions
|
|
7574
7610
|
} = {
|
|
7575
7611
|
...userRollupOptions,
|
|
7576
7612
|
...userRolldownOptions
|
|
7577
7613
|
};
|
|
7578
7614
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
7615
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _319 => _319.build, 'optionalAccess', _320 => _320.rollupOptions]);
|
|
7616
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _321 => _321.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _322 => _322.output]);
|
|
7579
7617
|
return {
|
|
7580
7618
|
...merged,
|
|
7581
7619
|
build: {
|
|
@@ -7583,7 +7621,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
7583
7621
|
...farmConfig.build,
|
|
7584
7622
|
rollupOptions: {
|
|
7585
7623
|
...userBundlerOptions,
|
|
7586
|
-
...
|
|
7624
|
+
...farmBundlerOptions,
|
|
7625
|
+
...output === void 0 ? {} : { output }
|
|
7587
7626
|
}
|
|
7588
7627
|
},
|
|
7589
7628
|
css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
|
|
@@ -7591,7 +7630,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
7591
7630
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
7592
7631
|
ssr: {
|
|
7593
7632
|
...merged.ssr,
|
|
7594
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
7633
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _323 => _323.ssr, 'optionalAccess', _324 => _324.external]), _optionalChain([userConfig, 'access', _325 => _325.ssr, 'optionalAccess', _326 => _326.external]))
|
|
7595
7634
|
}
|
|
7596
7635
|
};
|
|
7597
7636
|
}
|
|
@@ -7661,4 +7700,5 @@ ${FARM_DARK_VARIANT}
|
|
|
7661
7700
|
|
|
7662
7701
|
|
|
7663
7702
|
|
|
7664
|
-
|
|
7703
|
+
|
|
7704
|
+
exports.inspectStaticMetadataImage = inspectStaticMetadataImage; exports.RouteManager = RouteManager; exports.resolveDevGlobalStylesheetHref = resolveDevGlobalStylesheetHref; exports.collectDevStylesheetUrls = collectDevStylesheetUrls; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.inferFarmIslandStrategy = inferFarmIslandStrategy; exports.resolveFarmRouteRootStrategy = resolveFarmRouteRootStrategy; exports.canBootFarmIslandsClient = canBootFarmIslandsClient; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.resolveFarmImageServerRuntime = resolveFarmImageServerRuntime; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE = FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE; exports.FARM_NAVIGATION_SCRIPT_SOURCE = FARM_NAVIGATION_SCRIPT_SOURCE; exports.FARM_NAVIGATION_STREAM_READER_SOURCE = FARM_NAVIGATION_STREAM_READER_SOURCE; exports.FARM_REFRESH_FIELDS_SOURCE = FARM_REFRESH_FIELDS_SOURCE; exports.exactIdPattern = exactIdPattern; exports.fileNamePattern = fileNamePattern; exports.redactFarmDocsClientConfig = redactFarmDocsClientConfig; exports.isFarmDocsClientConfigModule = isFarmDocsClientConfigModule; exports.farmDocsClientConfigPlugin = farmDocsClientConfigPlugin; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteAlias = mergeFarmViteAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin;
|