@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.
Files changed (194) hide show
  1. package/dist/{agent-mcp-handler-OV4WRFBL.cjs → agent-mcp-handler-OXT73ZBY.cjs} +5 -5
  2. package/dist/{agent-mcp-handler-7QMX2LUY.mjs → agent-mcp-handler-QLFDDTYN.mjs} +4 -4
  3. package/dist/{agent-mcp.d-BKZ3UNbt.d.mts → agent-mcp.d-CO_ABmNK.d.mts} +1 -1
  4. package/dist/{agent-mcp.d-C1zr_nGS.d.ts → agent-mcp.d-QD2WZ9BS.d.ts} +1 -1
  5. package/dist/agent-runtime.d.mts +1 -1
  6. package/dist/agent-runtime.d.ts +1 -1
  7. package/dist/analyzer-ODLF2Z6O.cjs +16 -0
  8. package/dist/{analyzer-YESYU3GK.mjs → analyzer-Q3QXC6PD.mjs} +3 -2
  9. package/dist/api/route-manager.d.mts +3 -3
  10. package/dist/api/route-manager.d.ts +3 -3
  11. package/dist/api/runtime.d.mts +2 -2
  12. package/dist/api/runtime.d.ts +2 -2
  13. package/dist/api.d.mts +3 -3
  14. package/dist/api.d.ts +3 -3
  15. package/dist/{app-manifest.d-ntch_bvA.d.ts → app-manifest.d-BpKxiU_E.d.mts} +9 -1
  16. package/dist/{app-manifest.d-BpvhfKRH.d.mts → app-manifest.d-DDmNkYQQ.d.ts} +9 -1
  17. package/dist/app-markdown.cjs +4 -4
  18. package/dist/app-markdown.d.mts +2 -2
  19. package/dist/app-markdown.d.ts +2 -2
  20. package/dist/app-markdown.mjs +3 -3
  21. package/dist/{app.d-CysWA_8v.d.mts → app.d-kuoVWhWM.d.mts} +4 -4
  22. package/dist/{app.d-AE8_v3Db.d.ts → app.d-x68Cwr0_.d.ts} +4 -4
  23. package/dist/{chunk-LT4VAF5Z.cjs → chunk-2C5L5RPM.cjs} +7 -6
  24. package/dist/{chunk-RMUD75WT.cjs → chunk-3EBHJET2.cjs} +355 -270
  25. package/dist/{chunk-RZNCMRD3.mjs → chunk-6NHSGVVA.mjs} +1 -1
  26. package/dist/{chunk-LVWGURLD.mjs → chunk-6NNYPY5W.mjs} +327 -13
  27. package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
  28. package/dist/{chunk-SG57PX7K.cjs → chunk-BTVDYS4B.cjs} +7 -2
  29. package/dist/{chunk-545WJ5UG.cjs → chunk-DUSHDZQL.cjs} +11 -11
  30. package/dist/{chunk-GVOMPU3Y.cjs → chunk-EL4364S2.cjs} +209 -32
  31. package/dist/{chunk-GGNJAGGE.cjs → chunk-FAP7CX7C.cjs} +1056 -529
  32. package/dist/{chunk-T46NNU4D.mjs → chunk-FH45OB37.mjs} +2 -2
  33. package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
  34. package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
  35. package/dist/chunk-IOEXXZK3.mjs +88 -0
  36. package/dist/{chunk-EXXFSZOC.cjs → chunk-JCPSA4X5.cjs} +135 -134
  37. package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
  38. package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
  39. package/dist/{chunk-NT3QDN2E.mjs → chunk-LQDLEWPO.mjs} +1 -1
  40. package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
  41. package/dist/{chunk-WKJQ2FJA.cjs → chunk-MG356ROI.cjs} +5 -5
  42. package/dist/{chunk-AJB3DHN6.cjs → chunk-N3Z3PLHC.cjs} +2 -2
  43. package/dist/{chunk-2CNKQC3G.mjs → chunk-NNLFW3P4.mjs} +2 -2
  44. package/dist/{chunk-XX32BOMM.cjs → chunk-NXFA7G3Y.cjs} +52 -26
  45. package/dist/{chunk-SM25ZC4S.cjs → chunk-O2XFIPNL.cjs} +1 -1
  46. package/dist/{chunk-VWW4Q3BJ.mjs → chunk-O4FWNLQK.mjs} +4 -4
  47. package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
  48. package/dist/{chunk-UWI3SJAK.cjs → chunk-O7IEMY55.cjs} +3 -3
  49. package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
  50. package/dist/{chunk-OUWRNHTV.mjs → chunk-OYF23QLG.mjs} +17 -16
  51. package/dist/{chunk-IQIKPKFP.mjs → chunk-RAH5MT53.mjs} +110 -25
  52. package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
  53. package/dist/{chunk-ZVIEFTUA.cjs → chunk-S25BQIFW.cjs} +16 -16
  54. package/dist/chunk-S7ZW72JH.cjs +254 -0
  55. package/dist/{chunk-VM7X5CKC.mjs → chunk-SLYDIHLW.mjs} +31 -5
  56. package/dist/chunk-SNFTMSHX.mjs +254 -0
  57. package/dist/{chunk-2WZTGPK6.mjs → chunk-SQ5O7I3L.mjs} +7 -2
  58. package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
  59. package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
  60. package/dist/{chunk-T4TBK5NY.mjs → chunk-VQ4NWOWO.mjs} +2 -2
  61. package/dist/{chunk-ZZ2QKCKW.mjs → chunk-WAY6LOQH.mjs} +1 -1
  62. package/dist/chunk-WBTHHTBO.cjs +88 -0
  63. package/dist/{chunk-ZBUAOGMY.mjs → chunk-WFNAOWH4.mjs} +1 -1
  64. package/dist/{chunk-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
  65. package/dist/{chunk-2JYBLE63.mjs → chunk-WNYRYI4D.mjs} +770 -243
  66. package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
  67. package/dist/{chunk-IOF4KXMP.mjs → chunk-XVWSDSUM.mjs} +201 -24
  68. package/dist/{chunk-JEJQGZI7.cjs → chunk-XZLZ6YPP.cjs} +346 -32
  69. package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
  70. package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
  71. package/dist/{client-component.d-BoqC2MLC.d.mts → client-component.d-D74pqdea.d.mts} +14 -3
  72. package/dist/{client-component.d-Bgt3x5Fu.d.ts → client-component.d-D8VcypQA.d.ts} +14 -3
  73. package/dist/{client-plugins.d-BcqIy4au.d.ts → client-plugins.d-CXElzotB.d.ts} +18 -2
  74. package/dist/{client-plugins.d-CWyYBxXf.d.mts → client-plugins.d-D4-6hNx7.d.mts} +18 -2
  75. package/dist/client-plugins.d.mts +1 -1
  76. package/dist/client-plugins.d.ts +1 -1
  77. package/dist/client.d.mts +6 -6
  78. package/dist/client.d.ts +6 -6
  79. package/dist/config.d.mts +1 -1
  80. package/dist/config.d.ts +1 -1
  81. package/dist/desktop.d.mts +2 -2
  82. package/dist/desktop.d.ts +2 -2
  83. package/dist/{devtools-NUVXYG7I.mjs → devtools-MX3FE733.mjs} +5 -5
  84. package/dist/{devtools-SVRSGPNC.cjs → devtools-WET5NAKO.cjs} +6 -6
  85. package/dist/docs.cjs +8 -8
  86. package/dist/docs.d.mts +2 -2
  87. package/dist/docs.d.ts +2 -2
  88. package/dist/docs.mjs +7 -7
  89. package/dist/index.cjs +21 -20
  90. package/dist/{index.d-nAncqTXz.d.ts → index.d-A_x10zGS.d.ts} +1 -1
  91. package/dist/{index.d-BDaiu2i5.d.mts → index.d-SSgYDv4D.d.mts} +1 -1
  92. package/dist/index.d.mts +16 -16
  93. package/dist/index.d.ts +16 -16
  94. package/dist/index.mjs +20 -19
  95. package/dist/integrations.d.mts +1 -1
  96. package/dist/integrations.d.ts +1 -1
  97. package/dist/internal/app-markdown-runtime.cjs +3 -3
  98. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  99. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  100. package/dist/internal/app-markdown-runtime.mjs +2 -2
  101. package/dist/internal/build-runtime.cjs +22 -21
  102. package/dist/internal/build-runtime.d.mts +3 -3
  103. package/dist/internal/build-runtime.d.ts +3 -3
  104. package/dist/internal/build-runtime.mjs +21 -20
  105. package/dist/internal/cli-runtime.cjs +7 -7
  106. package/dist/internal/cli-runtime.mjs +6 -6
  107. package/dist/internal/client-error-overlay.cjs +4 -4
  108. package/dist/internal/client-error-overlay.mjs +1 -1
  109. package/dist/internal/client-runtime.d.mts +4 -4
  110. package/dist/internal/client-runtime.d.ts +4 -4
  111. package/dist/internal/compression-runtime.d.mts +1 -1
  112. package/dist/internal/compression-runtime.d.ts +1 -1
  113. package/dist/internal/config-runtime.cjs +7 -7
  114. package/dist/internal/config-runtime.d.mts +4 -4
  115. package/dist/internal/config-runtime.d.ts +4 -4
  116. package/dist/internal/config-runtime.mjs +6 -6
  117. package/dist/internal/infra-analytics-runtime.cjs +11 -9
  118. package/dist/internal/infra-analytics-runtime.mjs +9 -7
  119. package/dist/internal/native-server-fns.cjs +5 -4
  120. package/dist/internal/native-server-fns.mjs +4 -3
  121. package/dist/internal/product-telemetry-runtime.cjs +17 -211
  122. package/dist/internal/product-telemetry-runtime.mjs +10 -204
  123. package/dist/internal/production-runtime.cjs +13 -12
  124. package/dist/internal/production-runtime.d.mts +13 -12
  125. package/dist/internal/production-runtime.d.ts +13 -12
  126. package/dist/internal/production-runtime.mjs +14 -13
  127. package/dist/internal/react-cache.cjs +21 -1
  128. package/dist/internal/react-cache.d.mts +8 -1
  129. package/dist/internal/react-cache.d.ts +8 -1
  130. package/dist/internal/react-cache.mjs +21 -1
  131. package/dist/markdown.cjs +2 -2
  132. package/dist/markdown.d.mts +1 -1
  133. package/dist/markdown.d.ts +1 -1
  134. package/dist/markdown.mjs +1 -1
  135. package/dist/middleware.d.mts +3 -3
  136. package/dist/middleware.d.ts +3 -3
  137. package/dist/mobile.d.mts +2 -2
  138. package/dist/mobile.d.ts +2 -2
  139. package/dist/{native-tree-AS5L3ID3.mjs → native-tree-BPEE2LAL.mjs} +2 -2
  140. package/dist/{native-tree-Z2WYUJEV.cjs → native-tree-WOX3JMBG.cjs} +3 -3
  141. package/dist/{navigation-delegate.d-CSCm8ZxL.d.mts → navigation-delegate.d-DQVYKoaZ.d.mts} +1 -1
  142. package/dist/{navigation-delegate.d-BbUHRXxG.d.ts → navigation-delegate.d-GghbHJuK.d.ts} +1 -1
  143. package/dist/navigation.d.mts +4 -4
  144. package/dist/navigation.d.ts +4 -4
  145. package/dist/plugin.cjs +14 -14
  146. package/dist/plugin.d.mts +3 -3
  147. package/dist/plugin.d.ts +3 -3
  148. package/dist/plugin.mjs +13 -13
  149. package/dist/{production-runtime.d-DgT24A0f.d.ts → production-runtime.d-Bzns3NW9.d.ts} +1 -1
  150. package/dist/{production-runtime.d-CcQiDko5.d.mts → production-runtime.d-DiFa5vHW.d.mts} +1 -1
  151. package/dist/{render-plan.d-CyrX6MDs.d.ts → render-plan.d-CL_Ikfg_.d.ts} +1 -1
  152. package/dist/{render-plan.d-BH9WF-JZ.d.mts → render-plan.d-CcF0MeCf.d.mts} +1 -1
  153. package/dist/renderer-client.d.mts +4 -4
  154. package/dist/renderer-client.d.ts +4 -4
  155. package/dist/{request.d-BB8M8bcD.d.ts → request.d-B1RnTLri.d.ts} +1 -1
  156. package/dist/{request.d-CUrPnCW7.d.mts → request.d-DarDOCk9.d.mts} +1 -1
  157. package/dist/request.d.mts +2 -2
  158. package/dist/request.d.ts +2 -2
  159. package/dist/{route-rendering.d-DYqZMIf4.d.ts → route-rendering.d-BTUYCIj4.d.ts} +1 -1
  160. package/dist/{route-rendering.d-CYxlzaFm.d.mts → route-rendering.d-D_2Ual0-.d.mts} +1 -1
  161. package/dist/{router.d-DaKo507j.d.ts → router.d-CMANF6da.d.ts} +1 -1
  162. package/dist/{router.d-7o24CD8u.d.mts → router.d-Cuv1jntg.d.mts} +1 -1
  163. package/dist/{routes.d-BknKQcTu.d.ts → routes.d-B6yFe6jm.d.ts} +1 -1
  164. package/dist/{routes.d-D1IrO9KK.d.mts → routes.d-c2HKfrfL.d.mts} +1 -1
  165. package/dist/routes.d.mts +1 -1
  166. package/dist/routes.d.ts +1 -1
  167. package/dist/{rsc-pipeline-RFLHDAKD.mjs → rsc-pipeline-3LNVP2OO.mjs} +6 -6
  168. package/dist/{rsc-pipeline-OF2I7PCX.cjs → rsc-pipeline-G5WELVW3.cjs} +7 -7
  169. package/dist/{runtime-LBTK62AD.cjs → runtime-DMEULPE7.cjs} +22 -11
  170. package/dist/{runtime-M6UJCSLA.mjs → runtime-HQJ2LLQL.mjs} +20 -9
  171. package/dist/{runtime.d-CN73a-IL.d.ts → runtime.d-C3RQUj6_.d.ts} +1 -1
  172. package/dist/{runtime.d-CcNuzhX6.d.mts → runtime.d-wvh4ngU0.d.mts} +1 -1
  173. package/dist/server-plugins.d.mts +2 -2
  174. package/dist/server-plugins.d.ts +2 -2
  175. package/dist/server.cjs +31 -31
  176. package/dist/server.d.mts +9 -9
  177. package/dist/server.d.ts +9 -9
  178. package/dist/server.mjs +16 -16
  179. package/dist/{spa-router.d-CNi77LZm.d.mts → spa-router.d-WU_qS5gJ.d.mts} +2 -2
  180. package/dist/{spa-router.d-Cvgf5QP4.d.ts → spa-router.d-m8H_Kl_B.d.ts} +2 -2
  181. package/dist/testing.d.mts +1 -1
  182. package/dist/testing.d.ts +1 -1
  183. package/dist/{utils.d-C3H-14_Y.d.ts → utils.d-C9dQD5Zg.d.ts} +1 -1
  184. package/dist/{utils.d-D8VfzZYn.d.mts → utils.d-W9IiEqmW.d.mts} +1 -1
  185. package/dist/version.cjs +2 -2
  186. package/dist/version.mjs +1 -1
  187. package/dist/vite.cjs +18 -14
  188. package/dist/vite.d.mts +23 -5
  189. package/dist/vite.d.ts +23 -5
  190. package/dist/vite.mjs +17 -13
  191. package/package.json +1 -1
  192. package/dist/analyzer-2AHWJJR7.cjs +0 -15
  193. package/dist/chunk-CSLUBKGG.mjs +0 -44
  194. 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;
@@ -3,7 +3,7 @@ import {
3
3
  getFarmMarkdownMirrorPath,
4
4
  isFarmMarkdownMirrorExposed,
5
5
  matchesFarmMarkdownRoutePattern
6
- } from "./chunk-YSXTNSXS.mjs";
6
+ } from "./chunk-K7OZAVOI.mjs";
7
7
  import {
8
8
  applyFarmBasePath
9
9
  } from "./chunk-SF3JB56B.mjs";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.1.62";
2
+ var version = "0.1.64";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  collectFarmLlmsTxtPages
3
- } from "./chunk-KVW2M6PI.mjs";
3
+ } from "./chunk-KL7SHLQB.mjs";
4
4
  import {
5
5
  getFarmMarkdownMirrorPath,
6
6
  isFarmMarkdownMirrorExposed
7
- } from "./chunk-YSXTNSXS.mjs";
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 _chunkXX32BOMMcjs = require('./chunk-XX32BOMM.cjs');
3
+ var _chunkNXFA7G3Ycjs = require('./chunk-NXFA7G3Y.cjs');
4
4
 
5
5
 
6
- var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
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 _chunkLT4VAF5Zcjs.classifyFarmAgent.call(void 0, userAgent);
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(_chunkXX32BOMMcjs.getFarmRouteLabel.call(void 0, metadata.route)),
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(_chunkXX32BOMMcjs.getFarmRouteLabel.call(void 0, metadata.route)),
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 _chunk545WJ5UGcjs = require('./chunk-545WJ5UG.cjs');
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 && _chunk545WJ5UGcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
117
+ outputDir: options.outputDir && _chunkDUSHDZQLcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
118
118
  }
119
119
  })
120
120
  ]
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getFarmRouteLabel
3
- } from "./chunk-VM7X5CKC.mjs";
3
+ } from "./chunk-SLYDIHLW.mjs";
4
4
  import {
5
5
  classifyFarmAgent
6
- } from "./chunk-YSXTNSXS.mjs";
6
+ } from "./chunk-K7OZAVOI.mjs";
7
7
  import {
8
8
  onFarmEvent
9
9
  } from "./chunk-2DA7CLY7.mjs";
@@ -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 _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
4
+ var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
5
5
 
6
6
 
7
- var _chunkSG57PX7Kcjs = require('./chunk-SG57PX7K.cjs');
7
+ var _chunkS7ZW72JHcjs = require('./chunk-S7ZW72JH.cjs');
8
8
 
9
9
 
10
+ var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
10
11
 
11
- var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
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 _chunkSM25ZC4Scjs = require('./chunk-SM25ZC4S.cjs');
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
- _chunkLT4VAF5Zcjs.emitFarmAgentRead.call(void 0, request, card ? "mcp-server-card" : "ai-catalog", 200);
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) _chunkLT4VAF5Zcjs.emitFarmAgentRead.call(void 0, request, "api-catalog", 200);
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 = _chunkSG57PX7Kcjs.resolveFarmAppManifestConfig.call(void 0, _optionalChain([config, 'access', _19 => _19.agent, 'optionalAccess', _20 => _20.manifest]));
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 = _chunkSG57PX7Kcjs.resolveFarmAppManifestConfig.call(void 0, void 0);
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: _chunkSM25ZC4Scjs.FARM_VERSION } : {},
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', _29 => _29.public]) === true && !_optionalChain([input, 'access', _30 => _30.guardCoversPath, 'optionalCall', _31 => _31(server.path)]);
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', _32 => _32.resources]), () => ( []))] : [],
310
- prompts: open ? [..._nullishCoalesce(_optionalChain([details, 'optionalAccess', _33 => _33.prompts]), () => ( []))] : [],
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', _34 => _34.schemas, 'optionalAccess', _35 => _35[tool.name]]);
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', _36 => _36.output]) ? { outputSchema: schemas.output } : {}
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', _37 => _37.defaultMCP, 'optionalCall', _38 => _38()]);
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: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_TOOLS.map((tool) => ({
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 ? [_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PATH, `${_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PATH}${FARM_MCP_SERVER_CARD_SUFFIX}`] : [],
412
- ..._optionalChain([agent, 'access', _39 => _39.llmsTxt, 'optionalAccess', _40 => _40.enabled]) ? ["/llms.txt"] : [],
413
- ..._optionalChain([agent, 'access', _41 => _41.llmsTxt, 'optionalAccess', _42 => _42.enabled]) && agent.llmsTxt.full ? ["/llms-full.txt"] : [],
414
- ..._optionalChain([agent, 'access', _43 => _43.sitemap, 'optionalAccess', _44 => _44.enabled]) ? ["/sitemap.xml"] : [],
415
- ..._optionalChain([agent, 'access', _45 => _45.crawlers, 'optionalAccess', _46 => _46.enabled]) ? ["/robots.txt"] : [],
416
- ..._optionalChain([input, 'access', _47 => _47.openapi, 'optionalAccess', _48 => _48.route]) ? [input.openapi.route] : [],
417
- ..._optionalChain([input, 'access', _49 => _49.openapi, 'optionalAccess', _50 => _50.specRoute]) ? [input.openapi.specRoute] : []
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 ? _chunkLT4VAF5Zcjs.getFarmMarkdownMirrorPath.call(void 0, entry) : entry;
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 ? _chunkLT4VAF5Zcjs.getFarmMarkdownMirrorPath.call(void 0, pattern) : null;
496
+ return pattern ? _chunk2C5L5RPMcjs.getFarmMarkdownMirrorPath.call(void 0, pattern) : null;
471
497
  }
472
498
 
473
499
 
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.1.62";
2
+ var version = "0.1.64";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -25,7 +25,7 @@ import {
25
25
  resolveFarmAgentSitemap,
26
26
  resolveFarmNoindexPreviews,
27
27
  resolveFarmPerformanceConfig
28
- } from "./chunk-T4TBK5NY.mjs";
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-2WZTGPK6.mjs";
36
+ } from "./chunk-SQ5O7I3L.mjs";
37
37
  import {
38
38
  resolveFarmLlmsTxtConfig
39
- } from "./chunk-KVW2M6PI.mjs";
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-YSXTNSXS.mjs";
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 _chunkMEQN6DDAcjs = require('./chunk-MEQN6DDA.cjs');
3
+ var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
4
4
 
5
5
 
6
- var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
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) => _chunkLT4VAF5Zcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
169
+ if (include.length && !include.some((pattern) => _chunk2C5L5RPMcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
170
170
  continue;
171
171
  }
172
- if (exclude.some((pattern) => _chunkLT4VAF5Zcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
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 (_chunkMEQN6DDAcjs.isFarmMetadataNoIndex.call(void 0, _optionalChain([module, 'optionalAccess', _2 => _2.metadata]))) continue;
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 _chunkJEJQGZI7cjs = require('./chunk-JEJQGZI7.cjs');
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 = _chunkJEJQGZI7cjs.readAliases.call(void 0, root, srcDir);
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 = _chunkJEJQGZI7cjs.resolveFile.call(void 0, candidate);
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 _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
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 && !_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(protocolHeader.trim())) {
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: ${_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.join(", ")}.`
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" && _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS[0];
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: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_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: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_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 = _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_TOOLS.find(({ name }) => name === params.name);
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-RZNCMRD3.mjs";
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-T46NNU4D.mjs";
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-DPE53XWL.mjs";
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-2CNKQC3G.mjs";
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-VWW4Q3BJ.mjs";
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-2JYBLE63.mjs";
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-PCXIJKPM.mjs";
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-VM7X5CKC.mjs";
152
+ } from "./chunk-SLYDIHLW.mjs";
156
153
  import {
157
154
  FARM_DEFAULT_MCP_PATH,
158
155
  createFarmDefaultMCPServer,
159
156
  farmConfigMountsMCP
160
- } from "./chunk-UZZ6IEQP.mjs";
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-E72UD6ME.mjs";
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-YSXTNSXS.mjs";
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-NT3QDN2E.mjs";
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({