@farm.js/core 0.1.62 → 0.1.64
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-OV4WRFBL.cjs → agent-mcp-handler-OXT73ZBY.cjs} +5 -5
- package/dist/{agent-mcp-handler-7QMX2LUY.mjs → agent-mcp-handler-QLFDDTYN.mjs} +4 -4
- package/dist/{agent-mcp.d-BKZ3UNbt.d.mts → agent-mcp.d-CO_ABmNK.d.mts} +1 -1
- package/dist/{agent-mcp.d-C1zr_nGS.d.ts → agent-mcp.d-QD2WZ9BS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-ODLF2Z6O.cjs +16 -0
- package/dist/{analyzer-YESYU3GK.mjs → analyzer-Q3QXC6PD.mjs} +3 -2
- 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 +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-manifest.d-ntch_bvA.d.ts → app-manifest.d-BpKxiU_E.d.mts} +9 -1
- package/dist/{app-manifest.d-BpvhfKRH.d.mts → app-manifest.d-DDmNkYQQ.d.ts} +9 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-CysWA_8v.d.mts → app.d-kuoVWhWM.d.mts} +4 -4
- package/dist/{app.d-AE8_v3Db.d.ts → app.d-x68Cwr0_.d.ts} +4 -4
- package/dist/{chunk-LT4VAF5Z.cjs → chunk-2C5L5RPM.cjs} +7 -6
- package/dist/{chunk-RMUD75WT.cjs → chunk-3EBHJET2.cjs} +355 -270
- package/dist/{chunk-RZNCMRD3.mjs → chunk-6NHSGVVA.mjs} +1 -1
- package/dist/{chunk-LVWGURLD.mjs → chunk-6NNYPY5W.mjs} +327 -13
- package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
- package/dist/{chunk-SG57PX7K.cjs → chunk-BTVDYS4B.cjs} +7 -2
- package/dist/{chunk-545WJ5UG.cjs → chunk-DUSHDZQL.cjs} +11 -11
- package/dist/{chunk-GVOMPU3Y.cjs → chunk-EL4364S2.cjs} +209 -32
- package/dist/{chunk-GGNJAGGE.cjs → chunk-FAP7CX7C.cjs} +1056 -529
- package/dist/{chunk-T46NNU4D.mjs → chunk-FH45OB37.mjs} +2 -2
- package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
- package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
- package/dist/chunk-IOEXXZK3.mjs +88 -0
- package/dist/{chunk-EXXFSZOC.cjs → chunk-JCPSA4X5.cjs} +135 -134
- package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
- package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
- package/dist/{chunk-NT3QDN2E.mjs → chunk-LQDLEWPO.mjs} +1 -1
- package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
- package/dist/{chunk-WKJQ2FJA.cjs → chunk-MG356ROI.cjs} +5 -5
- package/dist/{chunk-AJB3DHN6.cjs → chunk-N3Z3PLHC.cjs} +2 -2
- package/dist/{chunk-2CNKQC3G.mjs → chunk-NNLFW3P4.mjs} +2 -2
- package/dist/{chunk-XX32BOMM.cjs → chunk-NXFA7G3Y.cjs} +52 -26
- package/dist/{chunk-SM25ZC4S.cjs → chunk-O2XFIPNL.cjs} +1 -1
- package/dist/{chunk-VWW4Q3BJ.mjs → chunk-O4FWNLQK.mjs} +4 -4
- package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
- package/dist/{chunk-UWI3SJAK.cjs → chunk-O7IEMY55.cjs} +3 -3
- package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
- package/dist/{chunk-OUWRNHTV.mjs → chunk-OYF23QLG.mjs} +17 -16
- package/dist/{chunk-IQIKPKFP.mjs → chunk-RAH5MT53.mjs} +110 -25
- package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
- package/dist/{chunk-ZVIEFTUA.cjs → chunk-S25BQIFW.cjs} +16 -16
- package/dist/chunk-S7ZW72JH.cjs +254 -0
- package/dist/{chunk-VM7X5CKC.mjs → chunk-SLYDIHLW.mjs} +31 -5
- package/dist/chunk-SNFTMSHX.mjs +254 -0
- package/dist/{chunk-2WZTGPK6.mjs → chunk-SQ5O7I3L.mjs} +7 -2
- package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
- package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
- package/dist/{chunk-T4TBK5NY.mjs → chunk-VQ4NWOWO.mjs} +2 -2
- package/dist/{chunk-ZZ2QKCKW.mjs → chunk-WAY6LOQH.mjs} +1 -1
- package/dist/chunk-WBTHHTBO.cjs +88 -0
- package/dist/{chunk-ZBUAOGMY.mjs → chunk-WFNAOWH4.mjs} +1 -1
- package/dist/{chunk-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
- package/dist/{chunk-2JYBLE63.mjs → chunk-WNYRYI4D.mjs} +770 -243
- package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
- package/dist/{chunk-IOF4KXMP.mjs → chunk-XVWSDSUM.mjs} +201 -24
- package/dist/{chunk-JEJQGZI7.cjs → chunk-XZLZ6YPP.cjs} +346 -32
- package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
- package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
- package/dist/{client-component.d-BoqC2MLC.d.mts → client-component.d-D74pqdea.d.mts} +14 -3
- package/dist/{client-component.d-Bgt3x5Fu.d.ts → client-component.d-D8VcypQA.d.ts} +14 -3
- package/dist/{client-plugins.d-BcqIy4au.d.ts → client-plugins.d-CXElzotB.d.ts} +18 -2
- package/dist/{client-plugins.d-CWyYBxXf.d.mts → client-plugins.d-D4-6hNx7.d.mts} +18 -2
- 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-NUVXYG7I.mjs → devtools-MX3FE733.mjs} +5 -5
- package/dist/{devtools-SVRSGPNC.cjs → devtools-WET5NAKO.cjs} +6 -6
- package/dist/docs.cjs +8 -8
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +7 -7
- package/dist/index.cjs +21 -20
- package/dist/{index.d-nAncqTXz.d.ts → index.d-A_x10zGS.d.ts} +1 -1
- package/dist/{index.d-BDaiu2i5.d.mts → index.d-SSgYDv4D.d.mts} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +20 -19
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +22 -21
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +21 -20
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- 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 +7 -7
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +6 -6
- package/dist/internal/infra-analytics-runtime.cjs +11 -9
- package/dist/internal/infra-analytics-runtime.mjs +9 -7
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -3
- package/dist/internal/product-telemetry-runtime.cjs +17 -211
- package/dist/internal/product-telemetry-runtime.mjs +10 -204
- package/dist/internal/production-runtime.cjs +13 -12
- package/dist/internal/production-runtime.d.mts +13 -12
- package/dist/internal/production-runtime.d.ts +13 -12
- package/dist/internal/production-runtime.mjs +14 -13
- package/dist/internal/react-cache.cjs +21 -1
- package/dist/internal/react-cache.d.mts +8 -1
- package/dist/internal/react-cache.d.ts +8 -1
- package/dist/internal/react-cache.mjs +21 -1
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/mobile.d.mts +2 -2
- package/dist/mobile.d.ts +2 -2
- package/dist/{native-tree-AS5L3ID3.mjs → native-tree-BPEE2LAL.mjs} +2 -2
- package/dist/{native-tree-Z2WYUJEV.cjs → native-tree-WOX3JMBG.cjs} +3 -3
- package/dist/{navigation-delegate.d-CSCm8ZxL.d.mts → navigation-delegate.d-DQVYKoaZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BbUHRXxG.d.ts → navigation-delegate.d-GghbHJuK.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +14 -14
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +13 -13
- package/dist/{production-runtime.d-DgT24A0f.d.ts → production-runtime.d-Bzns3NW9.d.ts} +1 -1
- package/dist/{production-runtime.d-CcQiDko5.d.mts → production-runtime.d-DiFa5vHW.d.mts} +1 -1
- package/dist/{render-plan.d-CyrX6MDs.d.ts → render-plan.d-CL_Ikfg_.d.ts} +1 -1
- package/dist/{render-plan.d-BH9WF-JZ.d.mts → render-plan.d-CcF0MeCf.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-BB8M8bcD.d.ts → request.d-B1RnTLri.d.ts} +1 -1
- package/dist/{request.d-CUrPnCW7.d.mts → request.d-DarDOCk9.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-DYqZMIf4.d.ts → route-rendering.d-BTUYCIj4.d.ts} +1 -1
- package/dist/{route-rendering.d-CYxlzaFm.d.mts → route-rendering.d-D_2Ual0-.d.mts} +1 -1
- package/dist/{router.d-DaKo507j.d.ts → router.d-CMANF6da.d.ts} +1 -1
- package/dist/{router.d-7o24CD8u.d.mts → router.d-Cuv1jntg.d.mts} +1 -1
- package/dist/{routes.d-BknKQcTu.d.ts → routes.d-B6yFe6jm.d.ts} +1 -1
- package/dist/{routes.d-D1IrO9KK.d.mts → routes.d-c2HKfrfL.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-RFLHDAKD.mjs → rsc-pipeline-3LNVP2OO.mjs} +6 -6
- package/dist/{rsc-pipeline-OF2I7PCX.cjs → rsc-pipeline-G5WELVW3.cjs} +7 -7
- package/dist/{runtime-LBTK62AD.cjs → runtime-DMEULPE7.cjs} +22 -11
- package/dist/{runtime-M6UJCSLA.mjs → runtime-HQJ2LLQL.mjs} +20 -9
- package/dist/{runtime.d-CN73a-IL.d.ts → runtime.d-C3RQUj6_.d.ts} +1 -1
- package/dist/{runtime.d-CcNuzhX6.d.mts → runtime.d-wvh4ngU0.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +31 -31
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +16 -16
- package/dist/{spa-router.d-CNi77LZm.d.mts → spa-router.d-WU_qS5gJ.d.mts} +2 -2
- package/dist/{spa-router.d-Cvgf5QP4.d.ts → spa-router.d-m8H_Kl_B.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-C3H-14_Y.d.ts → utils.d-C9dQD5Zg.d.ts} +1 -1
- package/dist/{utils.d-D8VfzZYn.d.mts → utils.d-W9IiEqmW.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +18 -14
- package/dist/vite.d.mts +23 -5
- package/dist/vite.d.ts +23 -5
- package/dist/vite.mjs +17 -13
- package/package.json +1 -1
- package/dist/analyzer-2AHWJJR7.cjs +0 -15
- package/dist/chunk-CSLUBKGG.mjs +0 -44
- package/dist/chunk-SGBNF56S.cjs +0 -44
|
@@ -892,13 +892,14 @@ function extractHtmlTitle(html) {
|
|
|
892
892
|
function readHtmlContentRegion(html) {
|
|
893
893
|
return extractHtmlBody(_readFarmRenderedHtml(html));
|
|
894
894
|
}
|
|
895
|
-
function _readFarmRenderedHtml(html) {
|
|
895
|
+
function _readFarmRenderedHtml(html, options = {}) {
|
|
896
896
|
const streamed = readStreamedBoundaryInstructions(html);
|
|
897
897
|
return removeHiddenElements(
|
|
898
898
|
resolveStreamedBoundaries(
|
|
899
899
|
html.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, "").replace(/<noscript\b[^>]*>[\s\S]*?<\/noscript>/gi, ""),
|
|
900
900
|
streamed
|
|
901
|
-
).replace(/<!--[\s\S]*?-->/g, "")
|
|
901
|
+
).replace(/<!--[\s\S]*?-->/g, ""),
|
|
902
|
+
options.keepAriaHidden
|
|
902
903
|
);
|
|
903
904
|
}
|
|
904
905
|
function extractHtmlBody(html) {
|
|
@@ -1182,7 +1183,7 @@ var VOID_TAGS = /* @__PURE__ */ new Set([
|
|
|
1182
1183
|
"track",
|
|
1183
1184
|
"wbr"
|
|
1184
1185
|
]);
|
|
1185
|
-
function removeHiddenElements(html) {
|
|
1186
|
+
function removeHiddenElements(html, keepAriaHidden = false) {
|
|
1186
1187
|
if (!/hidden/i.test(html)) return html;
|
|
1187
1188
|
const openingTag = /<([a-zA-Z][\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g;
|
|
1188
1189
|
let closingTags;
|
|
@@ -1191,7 +1192,7 @@ function removeHiddenElements(html) {
|
|
|
1191
1192
|
let match;
|
|
1192
1193
|
while (match = openingTag.exec(html)) {
|
|
1193
1194
|
const [tag, name, attributes] = match;
|
|
1194
|
-
if (!isHiddenElement(attributes)) continue;
|
|
1195
|
+
if (!isHiddenElement(attributes, keepAriaHidden)) continue;
|
|
1195
1196
|
const start = match.index;
|
|
1196
1197
|
let end = start + tag.length;
|
|
1197
1198
|
if (!VOID_TAGS.has(name.toLowerCase()) && !isSelfClosingTag(tag)) {
|
|
@@ -1206,13 +1207,13 @@ function removeHiddenElements(html) {
|
|
|
1206
1207
|
}
|
|
1207
1208
|
return result + html.slice(cursor);
|
|
1208
1209
|
}
|
|
1209
|
-
function isHiddenElement(attributes) {
|
|
1210
|
+
function isHiddenElement(attributes, keepAriaHidden = false) {
|
|
1210
1211
|
const attribute = /([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;
|
|
1211
1212
|
let match;
|
|
1212
1213
|
while (match = attribute.exec(attributes)) {
|
|
1213
1214
|
const name = match[1].toLowerCase();
|
|
1214
1215
|
const value = (match[2] ?? match[3] ?? match[4] ?? "").trim().toLowerCase();
|
|
1215
|
-
if (name === "aria-hidden" && value === "true") return true;
|
|
1216
|
+
if (name === "aria-hidden" && value === "true" && !keepAriaHidden) return true;
|
|
1216
1217
|
if (name === "hidden" && value !== "until-found") return true;
|
|
1217
1218
|
}
|
|
1218
1219
|
return false;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectFarmLlmsTxtPages
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KL7SHLQB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getFarmMarkdownMirrorPath,
|
|
6
6
|
isFarmMarkdownMirrorExposed
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-K7OZAVOI.mjs";
|
|
8
8
|
import {
|
|
9
9
|
_listFarmMCPCatalogs,
|
|
10
10
|
_listFarmRegisteredMCPServers
|
|
@@ -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 _chunkNXFA7G3Ycjs = require('./chunk-NXFA7G3Y.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
@@ -75,7 +75,7 @@ function resolveFarmInfraAnalytics(env = processEnv()) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
function classifyFarmInfraAgent(userAgent) {
|
|
78
|
-
return
|
|
78
|
+
return _chunk2C5L5RPMcjs.classifyFarmAgent.call(void 0, userAgent);
|
|
79
79
|
}
|
|
80
80
|
function routeTemplate(pattern) {
|
|
81
81
|
return typeof pattern === "string" && pattern.length <= 256 && /^\/(?!\/)[a-zA-Z0-9_./:[\]()*-]*$/.test(pattern) ? pattern : "/[unmatched]";
|
|
@@ -273,7 +273,7 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
273
273
|
id: uuid(),
|
|
274
274
|
requestId: metadata.id,
|
|
275
275
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
276
|
-
route: routeTemplate(
|
|
276
|
+
route: routeTemplate(_chunkNXFA7G3Ycjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
277
277
|
agent: metadata.agent,
|
|
278
278
|
kind: "request",
|
|
279
279
|
method,
|
|
@@ -286,7 +286,7 @@ function toolEvent(metadata, event) {
|
|
|
286
286
|
id: uuid(),
|
|
287
287
|
requestId: metadata.id,
|
|
288
288
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
289
|
-
route: routeTemplate(
|
|
289
|
+
route: routeTemplate(_chunkNXFA7G3Ycjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
290
290
|
agent: metadata.agent,
|
|
291
291
|
kind: "mcp.tool",
|
|
292
292
|
tool: event.tool,
|
|
@@ -7,7 +7,7 @@ var _chunkVVTJTMGQcjs = require('./chunk-VVTJTMGQ.cjs');
|
|
|
7
7
|
var _chunkXVSBALOYcjs = require('./chunk-XVSBALOY.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkDUSHDZQLcjs = require('./chunk-DUSHDZQL.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -114,7 +114,7 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
114
114
|
server: { environmentName: "rsc" },
|
|
115
115
|
config: {
|
|
116
116
|
preset: options.preset,
|
|
117
|
-
outputDir: options.outputDir &&
|
|
117
|
+
outputDir: options.outputDir && _chunkDUSHDZQLcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
|
|
118
118
|
}
|
|
119
119
|
})
|
|
120
120
|
]
|
|
@@ -1,14 +1,20 @@
|
|
|
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 _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkS7ZW72JHcjs = require('./chunk-S7ZW72JH.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunk2KMIJDY6cjs = require('./chunk-2KMIJDY6.cjs');
|
|
12
18
|
|
|
13
19
|
|
|
14
20
|
|
|
@@ -23,7 +29,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
23
29
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
24
30
|
|
|
25
31
|
|
|
26
|
-
var
|
|
32
|
+
var _chunkO2XFIPNLcjs = require('./chunk-O2XFIPNL.cjs');
|
|
27
33
|
|
|
28
34
|
|
|
29
35
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -159,7 +165,7 @@ function createFarmAiCatalogResponse(request, input = {}, requestUrl) {
|
|
|
159
165
|
if (_chunkCFG4QERRcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), etag)) {
|
|
160
166
|
return new Response(null, { status: 304, headers });
|
|
161
167
|
}
|
|
162
|
-
|
|
168
|
+
_chunk2C5L5RPMcjs.emitFarmAgentRead.call(void 0, request, card ? "mcp-server-card" : "ai-catalog", 200);
|
|
163
169
|
return new Response(method === "HEAD" ? null : body, { status: 200, headers });
|
|
164
170
|
}
|
|
165
171
|
function corsHeaders() {
|
|
@@ -227,7 +233,7 @@ function createFarmApiCatalogResponse(method, input, request) {
|
|
|
227
233
|
headers: { Allow: "GET, HEAD", "Content-Type": "text/plain; charset=utf-8" }
|
|
228
234
|
});
|
|
229
235
|
}
|
|
230
|
-
if (request)
|
|
236
|
+
if (request) _chunk2C5L5RPMcjs.emitFarmAgentRead.call(void 0, request, "api-catalog", 200);
|
|
231
237
|
const catalog = createFarmApiCatalog(input);
|
|
232
238
|
return new Response(upperMethod === "HEAD" ? null : JSON.stringify(catalog), {
|
|
233
239
|
status: 200,
|
|
@@ -250,7 +256,7 @@ function resolveFarmAppManifestInput(config, extra) {
|
|
|
250
256
|
const llms = _optionalChain([config, 'access', _17 => _17.agent, 'optionalAccess', _18 => _18.llmsTxt]);
|
|
251
257
|
const plugins = (_nullishCoalesce(config.plugins, () => ( []))).map(({ name }) => name);
|
|
252
258
|
const webmcp = plugins.includes("farm:webmcp");
|
|
253
|
-
const sections =
|
|
259
|
+
const sections = _chunkBTVDYS4Bcjs.resolveFarmAppManifestConfig.call(void 0, _optionalChain([config, 'access', _19 => _19.agent, 'optionalAccess', _20 => _20.manifest]));
|
|
254
260
|
return {
|
|
255
261
|
renderer: _nullishCoalesce(_optionalChain([config, 'access', _21 => _21.renderer, 'optionalAccess', _22 => _22.name]), () => ( "react")),
|
|
256
262
|
basePath: config.basePath || "/",
|
|
@@ -275,14 +281,14 @@ var SOURCES = {
|
|
|
275
281
|
standalone: "defineTool",
|
|
276
282
|
serverFunction: "serverFunction"
|
|
277
283
|
};
|
|
278
|
-
var DEFAULT_SECTIONS =
|
|
284
|
+
var DEFAULT_SECTIONS = _chunkBTVDYS4Bcjs.resolveFarmAppManifestConfig.call(void 0, void 0);
|
|
279
285
|
function createFarmAppManifest(input) {
|
|
280
286
|
const sections = _nullishCoalesce(input.sections, () => ( DEFAULT_SECTIONS));
|
|
281
287
|
const { app, mcp, webmcp } = sections;
|
|
282
288
|
return {
|
|
283
289
|
schemaVersion: 1,
|
|
284
290
|
app: app ? {
|
|
285
|
-
...app.version ? { farm:
|
|
291
|
+
...app.version ? { farm: _chunkO2XFIPNLcjs.FARM_VERSION } : {},
|
|
286
292
|
...app.renderer ? { renderer: input.renderer } : {},
|
|
287
293
|
basePath: input.basePath,
|
|
288
294
|
...app.build ? { build: input.build } : {}
|
|
@@ -295,21 +301,41 @@ function createFarmAppManifest(input) {
|
|
|
295
301
|
} : null,
|
|
296
302
|
integrations: sections.integrations ? input.integrations : null,
|
|
297
303
|
agent: sections.agent ? input.agent : null,
|
|
298
|
-
plugins: sections.plugins ? input.plugins : null
|
|
304
|
+
plugins: sections.plugins ? input.plugins : null,
|
|
305
|
+
site: sections.site ? { url: resolveFarmSiteUrl() } : null
|
|
299
306
|
};
|
|
300
307
|
}
|
|
308
|
+
function asUrl(value) {
|
|
309
|
+
const trimmed = _optionalChain([value, 'optionalAccess', _29 => _29.trim, 'call', _30 => _30()]);
|
|
310
|
+
if (!trimmed) return void 0;
|
|
311
|
+
return /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
312
|
+
}
|
|
313
|
+
function resolveFarmSiteUrl() {
|
|
314
|
+
const read = _chunk2KMIJDY6cjs.readFarmEnvironmentValue;
|
|
315
|
+
const explicit = read("FARM_SITE_URL");
|
|
316
|
+
const candidates = _optionalChain([explicit, 'optionalAccess', _31 => _31.trim, 'call', _32 => _32()]) ? [explicit] : [
|
|
317
|
+
asUrl(read("VERCEL_PROJECT_PRODUCTION_URL")),
|
|
318
|
+
read("RENDER_EXTERNAL_URL"),
|
|
319
|
+
asUrl(read("RAILWAY_PUBLIC_DOMAIN"))
|
|
320
|
+
];
|
|
321
|
+
for (const candidate of candidates) {
|
|
322
|
+
const origin = candidate ? _chunkS7ZW72JHcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
|
|
323
|
+
if (origin) return origin;
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
301
327
|
function listServers(input, mcp) {
|
|
302
328
|
const servers = _chunkLRB5OVRTcjs._listFarmMCPCatalogs.call(void 0, ).map(({ server, tools, details }) => {
|
|
303
|
-
const open = _optionalChain([details, 'optionalAccess',
|
|
329
|
+
const open = _optionalChain([details, 'optionalAccess', _33 => _33.public]) === true && !_optionalChain([input, 'access', _34 => _34.guardCoversPath, 'optionalCall', _35 => _35(server.path)]);
|
|
304
330
|
return {
|
|
305
331
|
name: server.name,
|
|
306
332
|
version: server.version,
|
|
307
333
|
path: server.path,
|
|
308
334
|
authorization: open ? "none" : "required",
|
|
309
|
-
resources: open ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess',
|
|
310
|
-
prompts: open ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess',
|
|
335
|
+
resources: open ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _36 => _36.resources]), () => ( []))] : [],
|
|
336
|
+
prompts: open ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _37 => _37.prompts]), () => ( []))] : [],
|
|
311
337
|
tools: (open ? tools : []).map((tool) => {
|
|
312
|
-
const schemas = _optionalChain([details, 'optionalAccess',
|
|
338
|
+
const schemas = _optionalChain([details, 'optionalAccess', _38 => _38.schemas, 'optionalAccess', _39 => _39[tool.name]]);
|
|
313
339
|
const hints = Object.fromEntries(
|
|
314
340
|
["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"].filter((hint) => typeof tool[hint] === "boolean").map((hint) => [hint, tool[hint]])
|
|
315
341
|
);
|
|
@@ -320,7 +346,7 @@ function listServers(input, mcp) {
|
|
|
320
346
|
source: SOURCES[tool.kind],
|
|
321
347
|
...hints,
|
|
322
348
|
...schemas ? { inputSchema: schemas.input } : {},
|
|
323
|
-
..._optionalChain([schemas, 'optionalAccess',
|
|
349
|
+
..._optionalChain([schemas, 'optionalAccess', _40 => _40.output]) ? { outputSchema: schemas.output } : {}
|
|
324
350
|
};
|
|
325
351
|
})
|
|
326
352
|
};
|
|
@@ -338,7 +364,7 @@ function withoutSchemas({
|
|
|
338
364
|
return tool;
|
|
339
365
|
}
|
|
340
366
|
function listDefaultServer(input) {
|
|
341
|
-
const server = _optionalChain([input, 'access',
|
|
367
|
+
const server = _optionalChain([input, 'access', _41 => _41.defaultMCP, 'optionalCall', _42 => _42()]);
|
|
342
368
|
if (!server) return [];
|
|
343
369
|
return [
|
|
344
370
|
{
|
|
@@ -348,7 +374,7 @@ function listDefaultServer(input) {
|
|
|
348
374
|
authorization: "none",
|
|
349
375
|
resources: [],
|
|
350
376
|
prompts: [],
|
|
351
|
-
tools:
|
|
377
|
+
tools: _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_TOOLS.map((tool) => ({
|
|
352
378
|
name: tool.name,
|
|
353
379
|
title: tool.title,
|
|
354
380
|
description: tool.description,
|
|
@@ -408,13 +434,13 @@ function listFarmBuiltInRoutePaths(input) {
|
|
|
408
434
|
...agent.manifest !== false ? [FARM_APP_MANIFEST_PATH, FARM_APP_MANIFEST_LEGACY_PATH] : [],
|
|
409
435
|
...agent.apiCatalog ? [FARM_API_CATALOG_PATH] : [],
|
|
410
436
|
...agent.aiCatalog !== false ? [FARM_AI_CATALOG_PATH, FARM_ARD_PATH] : [],
|
|
411
|
-
...agent.mcp === true ? [
|
|
412
|
-
..._optionalChain([agent, 'access',
|
|
413
|
-
..._optionalChain([agent, 'access',
|
|
414
|
-
..._optionalChain([agent, 'access',
|
|
415
|
-
..._optionalChain([agent, 'access',
|
|
416
|
-
..._optionalChain([input, 'access',
|
|
417
|
-
..._optionalChain([input, 'access',
|
|
437
|
+
...agent.mcp === true ? [_chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH, `${_chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH}${FARM_MCP_SERVER_CARD_SUFFIX}`] : [],
|
|
438
|
+
..._optionalChain([agent, 'access', _43 => _43.llmsTxt, 'optionalAccess', _44 => _44.enabled]) ? ["/llms.txt"] : [],
|
|
439
|
+
..._optionalChain([agent, 'access', _45 => _45.llmsTxt, 'optionalAccess', _46 => _46.enabled]) && agent.llmsTxt.full ? ["/llms-full.txt"] : [],
|
|
440
|
+
..._optionalChain([agent, 'access', _47 => _47.sitemap, 'optionalAccess', _48 => _48.enabled]) ? ["/sitemap.xml"] : [],
|
|
441
|
+
..._optionalChain([agent, 'access', _49 => _49.crawlers, 'optionalAccess', _50 => _50.enabled]) ? ["/robots.txt"] : [],
|
|
442
|
+
..._optionalChain([input, 'access', _51 => _51.openapi, 'optionalAccess', _52 => _52.route]) ? [input.openapi.route] : [],
|
|
443
|
+
..._optionalChain([input, 'access', _53 => _53.openapi, 'optionalAccess', _54 => _54.specRoute]) ? [input.openapi.specRoute] : []
|
|
418
444
|
];
|
|
419
445
|
}
|
|
420
446
|
function normalize(pathname) {
|
|
@@ -447,7 +473,7 @@ function resolveFarmDocsRouteLabel(routePathname, docs) {
|
|
|
447
473
|
for (const entry of entries) {
|
|
448
474
|
const base = entry === "/" ? "" : entry;
|
|
449
475
|
if (page === entry || entry === "/" && page === "/index") {
|
|
450
|
-
return markdown ?
|
|
476
|
+
return markdown ? _chunk2C5L5RPMcjs.getFarmMarkdownMirrorPath.call(void 0, entry) : entry;
|
|
451
477
|
}
|
|
452
478
|
if (page.startsWith(`${base}/`)) return `${base}/[...slug]${markdown ? ".md" : ""}`;
|
|
453
479
|
}
|
|
@@ -467,7 +493,7 @@ function resolveFarmMarkdownRouteLabel(routePathname, matchPagePattern) {
|
|
|
467
493
|
if (!routePathname.toLowerCase().endsWith(".md")) return null;
|
|
468
494
|
const page = routePathname === "/index.md" ? "/" : routePathname.slice(0, -".md".length) || "/";
|
|
469
495
|
const pattern = matchPagePattern(page);
|
|
470
|
-
return pattern ?
|
|
496
|
+
return pattern ? _chunk2C5L5RPMcjs.getFarmMarkdownMirrorPath.call(void 0, pattern) : null;
|
|
471
497
|
}
|
|
472
498
|
|
|
473
499
|
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveFarmAgentSitemap,
|
|
26
26
|
resolveFarmNoindexPreviews,
|
|
27
27
|
resolveFarmPerformanceConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-VQ4NWOWO.mjs";
|
|
29
29
|
import {
|
|
30
30
|
farmCspBlocksFrameworkInlineScripts,
|
|
31
31
|
getFarmSecurityHeader,
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
} from "./chunk-22W4FNTG.mjs";
|
|
34
34
|
import {
|
|
35
35
|
resolveFarmAppManifestConfig
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-SQ5O7I3L.mjs";
|
|
37
37
|
import {
|
|
38
38
|
resolveFarmLlmsTxtConfig
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-KL7SHLQB.mjs";
|
|
40
40
|
import {
|
|
41
41
|
loadFarmConfigFile,
|
|
42
42
|
resolveFarmLayers
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
} from "./chunk-UIJOLBUL.mjs";
|
|
54
54
|
import {
|
|
55
55
|
resolveMarkdownConfig
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-K7OZAVOI.mjs";
|
|
57
57
|
import {
|
|
58
58
|
bundleNodeModule
|
|
59
59
|
} from "./chunk-VFXE6NWR.mjs";
|
|
@@ -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 _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -166,12 +166,12 @@ function createFarmDefaultSitemap(sources, options) {
|
|
|
166
166
|
for (const source of sources) {
|
|
167
167
|
const path = source.pattern;
|
|
168
168
|
if (path.includes("[") || path.includes("(") || entries.has(path)) continue;
|
|
169
|
-
if (include.length && !include.some((pattern) =>
|
|
169
|
+
if (include.length && !include.some((pattern) => _chunk2C5L5RPMcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
|
|
170
170
|
continue;
|
|
171
171
|
}
|
|
172
|
-
if (exclude.some((pattern) =>
|
|
172
|
+
if (exclude.some((pattern) => _chunk2C5L5RPMcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
|
|
173
173
|
const module = isRecord(source.module) ? source.module : void 0;
|
|
174
|
-
if (
|
|
174
|
+
if (_chunkFJWN7RV4cjs.isFarmMetadataNoIndex.call(void 0, _optionalChain([module, 'optionalAccess', _2 => _2.metadata]))) continue;
|
|
175
175
|
if (_optionalChain([module, 'optionalAccess', _3 => _3.__farmRouteGuard])) continue;
|
|
176
176
|
entries.set(path, {
|
|
177
177
|
url: new URL(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, path, options.basePath), base).href,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXZLZ6YPPcjs = require('./chunk-XZLZ6YPP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
@@ -64,7 +64,7 @@ function findFarmNativeScreenFiles(appDirs) {
|
|
|
64
64
|
}
|
|
65
65
|
function collectFarmNativeServerFns(options) {
|
|
66
66
|
const { root, srcDir } = options;
|
|
67
|
-
const aliases =
|
|
67
|
+
const aliases = _chunkXZLZ6YPPcjs.readAliases.call(void 0, root, srcDir);
|
|
68
68
|
const seen = /* @__PURE__ */ new Set();
|
|
69
69
|
const found = /* @__PURE__ */ new Map();
|
|
70
70
|
const queue = [...options.entries];
|
|
@@ -98,7 +98,7 @@ function collectFarmNativeServerFns(options) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
for (const candidate of _nullishCoalesce(candidates, () => ( []))) {
|
|
101
|
-
const resolved =
|
|
101
|
+
const resolved = _chunkXZLZ6YPPcjs.resolveFile.call(void 0, candidate);
|
|
102
102
|
if (resolved && SCRIPT.test(resolved) && !resolved.includes(`${_path2.default.sep}node_modules${_path2.default.sep}`)) {
|
|
103
103
|
queue.push(resolved);
|
|
104
104
|
break;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -36,10 +36,10 @@ async function handleFarmDefaultMCPRequest(request, context) {
|
|
|
36
36
|
return transportError(403, "Cross-origin requests are not allowed.");
|
|
37
37
|
}
|
|
38
38
|
const protocolHeader = request.headers.get("mcp-protocol-version");
|
|
39
|
-
if (protocolHeader && !
|
|
39
|
+
if (protocolHeader && !_chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(protocolHeader.trim())) {
|
|
40
40
|
return transportError(
|
|
41
41
|
400,
|
|
42
|
-
`Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${
|
|
42
|
+
`Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${_chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.join(", ")}.`
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
const contentType = _nullishCoalesce(request.headers.get("content-type"), () => ( ""));
|
|
@@ -95,7 +95,7 @@ async function dispatch(method, params, request, context) {
|
|
|
95
95
|
switch (method) {
|
|
96
96
|
case "initialize": {
|
|
97
97
|
const requested = isRecord(params) ? params.protocolVersion : void 0;
|
|
98
|
-
const protocolVersion = typeof requested === "string" &&
|
|
98
|
+
const protocolVersion = typeof requested === "string" && _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS[0];
|
|
99
99
|
return {
|
|
100
100
|
protocolVersion,
|
|
101
101
|
capabilities: { tools: { listChanged: false } },
|
|
@@ -103,7 +103,7 @@ async function dispatch(method, params, request, context) {
|
|
|
103
103
|
name: context.server.name,
|
|
104
104
|
version: context.server.version,
|
|
105
105
|
...context.server.title ? { title: context.server.title } : {},
|
|
106
|
-
description:
|
|
106
|
+
description: _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_DESCRIPTION
|
|
107
107
|
},
|
|
108
108
|
instructions: INSTRUCTIONS
|
|
109
109
|
};
|
|
@@ -111,7 +111,7 @@ async function dispatch(method, params, request, context) {
|
|
|
111
111
|
case "ping":
|
|
112
112
|
return {};
|
|
113
113
|
case "tools/list":
|
|
114
|
-
return { tools:
|
|
114
|
+
return { tools: _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_TOOLS };
|
|
115
115
|
case "tools/call":
|
|
116
116
|
return callTool(params, request, context);
|
|
117
117
|
default:
|
|
@@ -122,7 +122,7 @@ async function callTool(params, request, context) {
|
|
|
122
122
|
if (!isRecord(params) || typeof params.name !== "string") {
|
|
123
123
|
throw new FarmMCPRequestError(INVALID_PARAMS, "tools/call needs a tool name.");
|
|
124
124
|
}
|
|
125
|
-
const tool =
|
|
125
|
+
const tool = _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_TOOLS.find(({ name }) => name === params.name);
|
|
126
126
|
if (!tool) {
|
|
127
127
|
throw new FarmMCPRequestError(INVALID_PARAMS, `Unknown tool: ${params.name.slice(0, 64)}`);
|
|
128
128
|
}
|
|
@@ -31,14 +31,14 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
collectFarmNativeServerFns,
|
|
33
33
|
findFarmNativeScreenFiles
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-6NHSGVVA.mjs";
|
|
35
35
|
import {
|
|
36
36
|
assertFarmDocsAdapterServesNoGuardedPages,
|
|
37
37
|
compileFarmDocsAdapterEdgeManifest,
|
|
38
38
|
createFarmDocsAPIHandler,
|
|
39
39
|
hasFarmDocsRuntimeAdapter,
|
|
40
40
|
listFarmDocsAdapterPages
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-FH45OB37.mjs";
|
|
42
42
|
import {
|
|
43
43
|
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
44
44
|
createFarmDocsHandler,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
loadFarmDocsPage,
|
|
51
51
|
resolveFarmDocsContentDir,
|
|
52
52
|
toFarmDocsMarkdownPage
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-ZEXE4TGY.mjs";
|
|
54
54
|
import {
|
|
55
55
|
generateFarmDocsSearchClientRuntime,
|
|
56
56
|
isFarmDocsSearchEnabled,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
} from "./chunk-ALEUMLJN.mjs";
|
|
59
59
|
import {
|
|
60
60
|
FARM_PRERENDER_ENV
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-NNLFW3P4.mjs";
|
|
62
62
|
import {
|
|
63
63
|
loadFarmDocsEngine
|
|
64
64
|
} from "./chunk-VE3FWJBO.mjs";
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
getDeployTargetForPreset,
|
|
68
68
|
hasCustomFarmRouteContext,
|
|
69
69
|
resolveDeployOutputPath
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-O4FWNLQK.mjs";
|
|
71
71
|
import {
|
|
72
72
|
resolveFarmInstrumentationFile
|
|
73
73
|
} from "./chunk-N35YPV4N.mjs";
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
usePackageClientBoundaryCacheFile,
|
|
112
112
|
usesFarmServerTree,
|
|
113
113
|
withPackageClientBoundaryCache
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-WNYRYI4D.mjs";
|
|
115
115
|
import {
|
|
116
116
|
loadTailwindVitePlugin
|
|
117
117
|
} from "./chunk-OM7WILES.mjs";
|
|
@@ -135,16 +135,13 @@ import {
|
|
|
135
135
|
layoutsCanCoverSamePage,
|
|
136
136
|
routeBoundaryCoversDirectory,
|
|
137
137
|
stripRouteGroups
|
|
138
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-TNBJ4LZG.mjs";
|
|
139
139
|
import {
|
|
140
140
|
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
141
141
|
} from "./chunk-LLZSYFOM.mjs";
|
|
142
142
|
import {
|
|
143
143
|
farmPluginMayAffectRuntimePath
|
|
144
144
|
} from "./chunk-UUMKLGUU.mjs";
|
|
145
|
-
import {
|
|
146
|
-
isFarmPreviewDeploymentEnvironment
|
|
147
|
-
} from "./chunk-CSLUBKGG.mjs";
|
|
148
145
|
import {
|
|
149
146
|
FARM_API_CATALOG_PATH,
|
|
150
147
|
FARM_APP_MANIFEST_LEGACY_PATH,
|
|
@@ -152,12 +149,15 @@ import {
|
|
|
152
149
|
listFarmBuiltInRoutePaths,
|
|
153
150
|
resolveFarmApiCatalogInput,
|
|
154
151
|
resolveFarmAppManifestInput
|
|
155
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-SLYDIHLW.mjs";
|
|
156
153
|
import {
|
|
157
154
|
FARM_DEFAULT_MCP_PATH,
|
|
158
155
|
createFarmDefaultMCPServer,
|
|
159
156
|
farmConfigMountsMCP
|
|
160
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-MESQF2JC.mjs";
|
|
158
|
+
import {
|
|
159
|
+
isFarmPreviewDeploymentEnvironment
|
|
160
|
+
} from "./chunk-SNFTMSHX.mjs";
|
|
161
161
|
import {
|
|
162
162
|
FARM_NATIVE_SERVER_FN_PLUGIN
|
|
163
163
|
} from "./chunk-L4RTTTVE.mjs";
|
|
@@ -199,14 +199,14 @@ import {
|
|
|
199
199
|
} from "./chunk-N33DLJBC.mjs";
|
|
200
200
|
import {
|
|
201
201
|
isFarmMarkdownPageFile
|
|
202
|
-
} from "./chunk-
|
|
202
|
+
} from "./chunk-RVGSVQWT.mjs";
|
|
203
203
|
import {
|
|
204
204
|
resolveFarmMdxComponentsModulePath,
|
|
205
205
|
resolveMdxConfig
|
|
206
206
|
} from "./chunk-UIJOLBUL.mjs";
|
|
207
207
|
import {
|
|
208
208
|
getFarmMarkdownAlternatePath
|
|
209
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-K7OZAVOI.mjs";
|
|
210
210
|
import {
|
|
211
211
|
applyFarmWorkflowVercelCrons,
|
|
212
212
|
prepareFarmWorkflowsForNitro
|
|
@@ -264,7 +264,7 @@ import {
|
|
|
264
264
|
} from "./chunk-2I6PUKWJ.mjs";
|
|
265
265
|
import {
|
|
266
266
|
FARM_VERSION
|
|
267
|
-
} from "./chunk-
|
|
267
|
+
} from "./chunk-LQDLEWPO.mjs";
|
|
268
268
|
import {
|
|
269
269
|
getFarmPresetRuntime
|
|
270
270
|
} from "./chunk-UAQD67HM.mjs";
|
|
@@ -9340,8 +9340,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9340
9340
|
// The mobile app's native-tier screens: the page, rendered as for a browser, read into a
|
|
9341
9341
|
// tree of native views.
|
|
9342
9342
|
const farmNativeStylesheets = JSON.parse(${JSON.stringify(FARM_NATIVE_STYLESHEETS_PLACEHOLDER)});
|
|
9343
|
+
// A POST is a form a native-tier screen submitted (native-tree.ts).
|
|
9343
9344
|
if (
|
|
9344
|
-
(request.method === "GET" || request.method === "HEAD") &&
|
|
9345
|
+
(request.method === "GET" || request.method === "HEAD" || request.method === "POST") &&
|
|
9345
9346
|
request.headers.get("accept")?.includes(${JSON.stringify(FARM_NATIVE_TREE_CONTENT_TYPE)})
|
|
9346
9347
|
) {
|
|
9347
9348
|
const treeResponse = await createFarmNativeTreeResponse({
|