@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
|
@@ -75,9 +75,30 @@ async function evaluateMdxSource(source, filePath) {
|
|
|
75
75
|
remarkPlugins: [remarkGfm]
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
var MARKDOWN_ROUTE_CONFIG_EXPORT = /^export\s+const\s+(dynamic|revalidate|ssg)\s*=\s*("[^"\\]*"|'[^'\\]*'|\d+(?:\.\d+)?|true|false)\s*;?\s*$/;
|
|
79
|
+
function readFarmMarkdownRouteConfig(body) {
|
|
80
|
+
const config = {};
|
|
81
|
+
let fence;
|
|
82
|
+
for (const line of body.split(/\r?\n/)) {
|
|
83
|
+
const marker = _optionalChain([line, 'access', _6 => _6.match, 'call', _7 => _7(/^ {0,3}(`{3,}|~{3,})/), 'optionalAccess', _8 => _8[1]]);
|
|
84
|
+
if (fence) {
|
|
85
|
+
if (marker && marker[0] === fence[0] && marker.length >= fence.length) fence = void 0;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (marker) {
|
|
89
|
+
fence = marker;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const match = line.match(MARKDOWN_ROUTE_CONFIG_EXPORT);
|
|
93
|
+
if (!match) continue;
|
|
94
|
+
const literal = match[2];
|
|
95
|
+
config[match[1]] = literal === "true" ? true : literal === "false" ? false : /^\d/.test(literal) ? Number(literal) : literal.slice(1, -1);
|
|
96
|
+
}
|
|
97
|
+
return config;
|
|
98
|
+
}
|
|
78
99
|
function createFarmMarkdownRouteModule(input) {
|
|
79
100
|
const { body } = parseMarkdownFrontmatter(input.source);
|
|
80
|
-
const className = _optionalChain([input, 'access',
|
|
101
|
+
const className = _optionalChain([input, 'access', _9 => _9.config, 'optionalAccess', _10 => _10.className]) || "farm-markdown";
|
|
81
102
|
let evaluatedPromise;
|
|
82
103
|
let componentsPromise;
|
|
83
104
|
const loadContent = async () => {
|
|
@@ -104,12 +125,13 @@ function createFarmMarkdownRouteModule(input) {
|
|
|
104
125
|
...props,
|
|
105
126
|
components: {
|
|
106
127
|
...components,
|
|
107
|
-
..._optionalChain([props, 'optionalAccess',
|
|
128
|
+
..._optionalChain([props, 'optionalAccess', _11 => _11.components])
|
|
108
129
|
}
|
|
109
130
|
})
|
|
110
131
|
);
|
|
111
132
|
}
|
|
112
133
|
return {
|
|
134
|
+
...readFarmMarkdownRouteConfig(body),
|
|
113
135
|
default: FarmMarkdownPage,
|
|
114
136
|
metadata: createMarkdownMetadata(input.source, input.filePath),
|
|
115
137
|
source: input.source
|
|
@@ -183,8 +205,8 @@ async function anonymousVisitorOpensPage(options, url, targetPathname) {
|
|
|
183
205
|
signal: options.request.signal
|
|
184
206
|
})
|
|
185
207
|
);
|
|
186
|
-
if (response.status < 200 || response.status >= 300 || !_optionalChain([response, 'access',
|
|
187
|
-
void _optionalChain([response, 'access',
|
|
208
|
+
if (response.status < 200 || response.status >= 300 || !_optionalChain([response, 'access', _12 => _12.headers, 'access', _13 => _13.get, 'call', _14 => _14("content-type"), 'optionalAccess', _15 => _15.toLowerCase, 'call', _16 => _16(), 'access', _17 => _17.includes, 'call', _18 => _18("text/html")])) {
|
|
209
|
+
void _optionalChain([response, 'access', _19 => _19.body, 'optionalAccess', _20 => _20.cancel, 'call', _21 => _21(), 'access', _22 => _22.catch, 'call', _23 => _23(() => {
|
|
188
210
|
})]);
|
|
189
211
|
return false;
|
|
190
212
|
}
|
|
@@ -201,7 +223,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
201
223
|
if (options.request.method !== "GET" && options.request.method !== "HEAD") {
|
|
202
224
|
return null;
|
|
203
225
|
}
|
|
204
|
-
if (_optionalChain([options, 'access',
|
|
226
|
+
if (_optionalChain([options, 'access', _24 => _24.config, 'optionalAccess', _25 => _25.markdownRoutes]) === false) {
|
|
205
227
|
return null;
|
|
206
228
|
}
|
|
207
229
|
const url = new URL(options.request.url);
|
|
@@ -244,7 +266,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
244
266
|
publicSourceResponses.add(response);
|
|
245
267
|
return response;
|
|
246
268
|
}
|
|
247
|
-
await _optionalChain([publicResponse, 'access',
|
|
269
|
+
await _optionalChain([publicResponse, 'access', _26 => _26.body, 'optionalAccess', _27 => _27.cancel, 'call', _28 => _28()]);
|
|
248
270
|
if (!hasMarkdownExtension) return null;
|
|
249
271
|
return new Response(`No public Markdown version of ${targetPathname}.
|
|
250
272
|
`, {
|
|
@@ -262,7 +284,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
262
284
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
263
285
|
"Content-Location": _chunkC2JOS77Zcjs._getFarmMarkdownPath.call(void 0,
|
|
264
286
|
targetPathname,
|
|
265
|
-
_optionalChain([options, 'access',
|
|
287
|
+
_optionalChain([options, 'access', _29 => _29.routePathname, 'optionalCall', _30 => _30(targetPathname)])
|
|
266
288
|
),
|
|
267
289
|
"Cache-Control": "public, s-maxage=60, stale-while-revalidate=300",
|
|
268
290
|
"X-Farm-Markdown-Route": targetPathname,
|
|
@@ -291,4 +313,5 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
291
313
|
|
|
292
314
|
|
|
293
315
|
|
|
294
|
-
|
|
316
|
+
|
|
317
|
+
exports.isFarmMarkdownPageFile = isFarmMarkdownPageFile; exports.normalizeFarmMarkdownRoutePath = normalizeFarmMarkdownRoutePath; exports.parseMarkdownFrontmatter = parseMarkdownFrontmatter; exports.titleFromMarkdown = titleFromMarkdown; exports.createMarkdownMetadata = createMarkdownMetadata; exports.readFarmMarkdownRouteConfig = readFarmMarkdownRouteConfig; exports.createFarmMarkdownRouteModule = createFarmMarkdownRouteModule; exports.isFarmMarkdownPublicSourceResponse = isFarmMarkdownPublicSourceResponse; exports.FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS = FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS; exports.createFarmMarkdownSourceResponse = createFarmMarkdownSourceResponse;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FARM_DEFAULT_MCP_PATH,
|
|
3
3
|
FARM_DEFAULT_MCP_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JMFTKNBA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
normalizeFarmProductionSiteOrigin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V25GSH43.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveFarmAppManifestConfig
|
|
10
10
|
} from "./chunk-SQ5O7I3L.mjs";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-QDWMCFTH.mjs";
|
|
30
30
|
import {
|
|
31
31
|
FARM_VERSION
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-RJUCNO7R.mjs";
|
|
33
33
|
import {
|
|
34
34
|
applyFarmBasePath
|
|
35
35
|
} from "./chunk-SF3JB56B.mjs";
|
|
@@ -23,6 +23,7 @@ function normalizeRouteRules(routeRules) {
|
|
|
23
23
|
if (!rule) continue;
|
|
24
24
|
const normalizedSource = normalizeRuleSource(source);
|
|
25
25
|
_chunkPWKAX5MScjs.validateConfigRouteSource.call(void 0, normalizedSource, `Route rule "${source}" source`);
|
|
26
|
+
assertSingleCatchAll(normalizedSource);
|
|
26
27
|
const existingSource = normalizedSources.get(normalizedSource);
|
|
27
28
|
if (existingSource !== void 0) {
|
|
28
29
|
throw new Error(
|
|
@@ -150,6 +151,31 @@ function normalizeList(value) {
|
|
|
150
151
|
if (!value || typeof value === "string") return value;
|
|
151
152
|
return value.join(", ");
|
|
152
153
|
}
|
|
154
|
+
function assertSingleCatchAll(source) {
|
|
155
|
+
let catchAlls = 0;
|
|
156
|
+
for (const segment of source.split("/")) {
|
|
157
|
+
if (/^:[A-Za-z_]\w*[*+]$/.test(segment)) {
|
|
158
|
+
catchAlls += 1;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
const withoutDoubleStars = segment.replace(/\*\*/g, () => {
|
|
162
|
+
catchAlls += 1;
|
|
163
|
+
return "";
|
|
164
|
+
});
|
|
165
|
+
catchAlls += withoutDoubleStars.split("*").length - 1;
|
|
166
|
+
}
|
|
167
|
+
if (catchAlls <= 1) return;
|
|
168
|
+
const segments = source.split("/");
|
|
169
|
+
let last = segments.length - 1;
|
|
170
|
+
while (last > 0 && !segments[last].includes("*")) last -= 1;
|
|
171
|
+
let names = 0;
|
|
172
|
+
const suggestion = segments.map(
|
|
173
|
+
(segment, index) => segment === "*" && index !== last ? `:segment${++names === 1 ? "" : names}` : segment
|
|
174
|
+
).join("/");
|
|
175
|
+
throw new Error(
|
|
176
|
+
`Route rule "${source}" has more than one catch-all. A route rule may use one "*", "**", ":name*" or ":name+", and "*" matches any number of segments, as "**" does. Match one segment with a named parameter instead` + (suggestion !== source ? `: "${suggestion}".` : `, as in "/:locale/docs/**".`)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
153
179
|
function normalizeRuleSource(source) {
|
|
154
180
|
const trimmed = source.trim();
|
|
155
181
|
if (!trimmed) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
|
|
4
4
|
|
|
5
5
|
// src/app-markdown.ts
|
|
6
6
|
var _promises = require('fs/promises');
|
|
@@ -8,7 +8,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
8
8
|
var _url = require('url');
|
|
9
9
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
10
10
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
11
|
-
return
|
|
11
|
+
return _chunkL6E4SHUBcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
12
12
|
source,
|
|
13
13
|
filePath,
|
|
14
14
|
components: options.components,
|
|
@@ -23,6 +23,7 @@ function normalizeRouteRules(routeRules) {
|
|
|
23
23
|
if (!rule) continue;
|
|
24
24
|
const normalizedSource = normalizeRuleSource(source);
|
|
25
25
|
validateConfigRouteSource(normalizedSource, `Route rule "${source}" source`);
|
|
26
|
+
assertSingleCatchAll(normalizedSource);
|
|
26
27
|
const existingSource = normalizedSources.get(normalizedSource);
|
|
27
28
|
if (existingSource !== void 0) {
|
|
28
29
|
throw new Error(
|
|
@@ -150,6 +151,31 @@ function normalizeList(value) {
|
|
|
150
151
|
if (!value || typeof value === "string") return value;
|
|
151
152
|
return value.join(", ");
|
|
152
153
|
}
|
|
154
|
+
function assertSingleCatchAll(source) {
|
|
155
|
+
let catchAlls = 0;
|
|
156
|
+
for (const segment of source.split("/")) {
|
|
157
|
+
if (/^:[A-Za-z_]\w*[*+]$/.test(segment)) {
|
|
158
|
+
catchAlls += 1;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
const withoutDoubleStars = segment.replace(/\*\*/g, () => {
|
|
162
|
+
catchAlls += 1;
|
|
163
|
+
return "";
|
|
164
|
+
});
|
|
165
|
+
catchAlls += withoutDoubleStars.split("*").length - 1;
|
|
166
|
+
}
|
|
167
|
+
if (catchAlls <= 1) return;
|
|
168
|
+
const segments = source.split("/");
|
|
169
|
+
let last = segments.length - 1;
|
|
170
|
+
while (last > 0 && !segments[last].includes("*")) last -= 1;
|
|
171
|
+
let names = 0;
|
|
172
|
+
const suggestion = segments.map(
|
|
173
|
+
(segment, index) => segment === "*" && index !== last ? `:segment${++names === 1 ? "" : names}` : segment
|
|
174
|
+
).join("/");
|
|
175
|
+
throw new Error(
|
|
176
|
+
`Route rule "${source}" has more than one catch-all. A route rule may use one "*", "**", ":name*" or ":name+", and "*" matches any number of segments, as "**" does. Match one segment with a named parameter instead` + (suggestion !== source ? `: "${suggestion}".` : `, as in "/:locale/docs/**".`)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
153
179
|
function normalizeRuleSource(source) {
|
|
154
180
|
const trimmed = source.trim();
|
|
155
181
|
if (!trimmed) {
|
|
@@ -10,7 +10,7 @@ var _chunk42KMUIWZcjs = require('./chunk-42KMUIWZ.cjs');
|
|
|
10
10
|
var _chunkXVSBALOYcjs = require('./chunk-XVSBALOY.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkKEB7AGS6cjs = require('./chunk-KEB7AGS6.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -156,7 +156,7 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
156
156
|
server: { environmentName: "rsc" },
|
|
157
157
|
config: {
|
|
158
158
|
preset: options.preset,
|
|
159
|
-
outputDir: options.outputDir &&
|
|
159
|
+
outputDir: options.outputDir && _chunkKEB7AGS6cjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
|
|
160
160
|
}
|
|
161
161
|
})
|
|
162
162
|
]
|
|
@@ -210,7 +210,7 @@ async function resolveFarmRscServerPlugins(userConfig, config, root) {
|
|
|
210
210
|
}
|
|
211
211
|
async function configureFarmRscPlugins(config, command) {
|
|
212
212
|
if (config.plugins.length === 0) return config;
|
|
213
|
-
const { PluginManager } = await import("./plugin-
|
|
213
|
+
const { PluginManager } = await import("./plugin-5PIQQVRP.cjs");
|
|
214
214
|
const manager = new PluginManager({
|
|
215
215
|
config,
|
|
216
216
|
isDev: command === "serve",
|
|
@@ -688,6 +688,7 @@ var PluginManager = class {
|
|
|
688
688
|
* Runs only `runtime.before` for a request Farm re-routed internally, such as
|
|
689
689
|
* a configured rewrite, so guards also see the destination URL. The session
|
|
690
690
|
* opened for `source` keeps its context; context and after hooks don't rerun.
|
|
691
|
+
* `options` describe the destination; the session keeps the source's route.
|
|
691
692
|
*/
|
|
692
693
|
async runRuntimeBeforeForRewrite(source, request, options = {}) {
|
|
693
694
|
if (!this.hasRuntimeHook("before")) return request;
|
|
@@ -1,10 +1,10 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkDPYBVVL3cjs = require('./chunk-DPYBVVL3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
@@ -29,7 +29,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
29
29
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkMEJCP2LXcjs = require('./chunk-MEJCP2LX.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -288,7 +288,7 @@ function createFarmAppManifest(input) {
|
|
|
288
288
|
return {
|
|
289
289
|
schemaVersion: 1,
|
|
290
290
|
app: app ? {
|
|
291
|
-
...app.version ? { farm:
|
|
291
|
+
...app.version ? { farm: _chunkMEJCP2LXcjs.FARM_VERSION } : {},
|
|
292
292
|
...app.renderer ? { renderer: input.renderer } : {},
|
|
293
293
|
basePath: input.basePath,
|
|
294
294
|
...app.build ? { build: input.build } : {}
|
|
@@ -319,7 +319,7 @@ function resolveFarmSiteUrl() {
|
|
|
319
319
|
asUrl(read("RAILWAY_PUBLIC_DOMAIN"))
|
|
320
320
|
];
|
|
321
321
|
for (const candidate of candidates) {
|
|
322
|
-
const origin = candidate ?
|
|
322
|
+
const origin = candidate ? _chunkDPYBVVL3cjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
|
|
323
323
|
if (origin) return origin;
|
|
324
324
|
}
|
|
325
325
|
return null;
|
|
@@ -374,7 +374,7 @@ function listDefaultServer(input) {
|
|
|
374
374
|
authorization: "none",
|
|
375
375
|
resources: [],
|
|
376
376
|
prompts: [],
|
|
377
|
-
tools:
|
|
377
|
+
tools: _chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_TOOLS.map((tool) => ({
|
|
378
378
|
name: tool.name,
|
|
379
379
|
title: tool.title,
|
|
380
380
|
description: tool.description,
|
|
@@ -434,7 +434,7 @@ function listFarmBuiltInRoutePaths(input) {
|
|
|
434
434
|
...agent.manifest !== false ? [FARM_APP_MANIFEST_PATH, FARM_APP_MANIFEST_LEGACY_PATH] : [],
|
|
435
435
|
...agent.apiCatalog ? [FARM_API_CATALOG_PATH] : [],
|
|
436
436
|
...agent.aiCatalog !== false ? [FARM_AI_CATALOG_PATH, FARM_ARD_PATH] : [],
|
|
437
|
-
...agent.mcp === true ? [
|
|
437
|
+
...agent.mcp === true ? [_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH, `${_chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH}${FARM_MCP_SERVER_CARD_SUFFIX}`] : [],
|
|
438
438
|
..._optionalChain([agent, 'access', _43 => _43.llmsTxt, 'optionalAccess', _44 => _44.enabled]) ? ["/llms.txt"] : [],
|
|
439
439
|
..._optionalChain([agent, 'access', _45 => _45.llmsTxt, 'optionalAccess', _46 => _46.enabled]) && agent.llmsTxt.full ? ["/llms-full.txt"] : [],
|
|
440
440
|
..._optionalChain([agent, 'access', _47 => _47.sitemap, 'optionalAccess', _48 => _48.enabled]) ? ["/sitemap.xml"] : [],
|
|
@@ -1,5 +1,7 @@
|
|
|
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
|
+
|
|
4
|
+
|
|
3
5
|
var _chunkO32QPFVVcjs = require('./chunk-O32QPFVV.cjs');
|
|
4
6
|
|
|
5
7
|
|
|
@@ -14,10 +16,6 @@ var _chunkLRB5OVRTcjs = require('./chunk-LRB5OVRT.cjs');
|
|
|
14
16
|
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
15
17
|
|
|
16
18
|
|
|
17
|
-
var _chunkOWQV6MLMcjs = require('./chunk-OWQV6MLM.cjs');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
19
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
22
20
|
|
|
23
21
|
// src/agent-mcp.ts
|
|
@@ -114,8 +112,7 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
114
112
|
if (!_chunkC2JOS77Zcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, source.pattern)) continue;
|
|
115
113
|
readable.push({ pattern: source.pattern, metadata: _optionalChain([module, 'optionalAccess', _2 => _2.metadata]) });
|
|
116
114
|
}
|
|
117
|
-
const
|
|
118
|
-
const toPublicPath = (pathname) => i18n ? _chunkOWQV6MLMcjs.localizeFarmPathname.call(void 0, pathname, i18n.defaultLocale, i18n) : _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, pathname, options.basePath);
|
|
115
|
+
const base = _chunkO32QPFVVcjs.resolveFarmAgentOrigin.call(void 0, options.metadataBase, options.origin);
|
|
119
116
|
return _chunkO32QPFVVcjs.collectFarmLlmsTxtPages.call(void 0, readable, {
|
|
120
117
|
origin: options.origin,
|
|
121
118
|
basePath: options.basePath,
|
|
@@ -124,13 +121,16 @@ function collectFarmDefaultMCPPages(sources, options) {
|
|
|
124
121
|
path: page.path,
|
|
125
122
|
title: page.title,
|
|
126
123
|
// As the sitemap lists it: '/base' without trailingSlash ('/base/' redirects there).
|
|
127
|
-
url: `${
|
|
128
|
-
|
|
124
|
+
url: `${base}${_chunkDVJM55D2cjs.normalizeFarmTrailingSlashPathname.call(void 0,
|
|
125
|
+
_chunkO32QPFVVcjs.getFarmAgentPagePublicPath.call(void 0, page.path, options),
|
|
129
126
|
options.trailingSlash === true
|
|
130
127
|
)}`,
|
|
131
128
|
...page.description ? { description: page.description } : {},
|
|
132
129
|
// A mirror keeps its .md URL whatever trailingSlash says, as llms.txt links it.
|
|
133
|
-
markdownUrl: `${options.origin}${
|
|
130
|
+
markdownUrl: `${options.origin}${_chunkO32QPFVVcjs.getFarmAgentPagePublicPath.call(void 0,
|
|
131
|
+
_chunkC2JOS77Zcjs.getFarmMarkdownMirrorPath.call(void 0, page.path),
|
|
132
|
+
options
|
|
133
|
+
)}`
|
|
134
134
|
}));
|
|
135
135
|
}
|
|
136
136
|
function resolveFarmDefaultMCPI18n(i18n, basePath) {
|
|
@@ -17,7 +17,7 @@ var _chunkNAXKOTPPcjs = require('./chunk-NAXKOTPP.cjs');
|
|
|
17
17
|
var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkKEB7AGS6cjs = require('./chunk-KEB7AGS6.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -590,7 +590,7 @@ async function resolveAPIContext(options) {
|
|
|
590
590
|
config: options.config,
|
|
591
591
|
configPath: options.configPath
|
|
592
592
|
}));
|
|
593
|
-
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await
|
|
593
|
+
const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkKEB7AGS6cjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
|
|
594
594
|
const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _28 => _28.guardedPaths]), () => ( [])));
|
|
595
595
|
return {
|
|
596
596
|
root,
|