@farm.js/core 0.1.27 → 0.1.28

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 (219) hide show
  1. package/dist/agent-runtime.d.mts +2 -1
  2. package/dist/agent-runtime.d.ts +2 -1
  3. package/dist/api/client.cjs +4 -6
  4. package/dist/api/client.d.mts +1 -0
  5. package/dist/api/client.d.ts +1 -0
  6. package/dist/api/client.mjs +3 -5
  7. package/dist/api/route-manager.cjs +9 -8
  8. package/dist/api/route-manager.d.mts +2 -1
  9. package/dist/api/route-manager.d.ts +2 -1
  10. package/dist/api/route-manager.mjs +8 -7
  11. package/dist/api/runtime.cjs +7 -6
  12. package/dist/api/runtime.d.mts +2 -1
  13. package/dist/api/runtime.d.ts +2 -1
  14. package/dist/api/runtime.mjs +6 -5
  15. package/dist/api.cjs +12 -11
  16. package/dist/api.d.mts +3 -2
  17. package/dist/api.d.ts +3 -2
  18. package/dist/api.mjs +11 -10
  19. package/dist/{app-BfzZdjgX.d.mts → app-DSSq6wiN.d.mts} +3 -3
  20. package/dist/{app-CXK7Prrt.d.ts → app-M8nVWvNU.d.ts} +3 -3
  21. package/dist/app-markdown.cjs +5 -5
  22. package/dist/app-markdown.d.mts +3 -2
  23. package/dist/app-markdown.d.ts +3 -2
  24. package/dist/app-markdown.mjs +4 -4
  25. package/dist/cache-invalidation-BD0z_lfu.d.mts +4 -0
  26. package/dist/cache-invalidation-BD0z_lfu.d.ts +4 -0
  27. package/dist/cache.cjs +6 -4
  28. package/dist/cache.d.mts +11 -6
  29. package/dist/cache.d.ts +11 -6
  30. package/dist/cache.mjs +7 -5
  31. package/dist/{chunk-4FHDV7VM.mjs → chunk-2CNBR3EB.mjs} +2 -2
  32. package/dist/{chunk-MBFURXAC.mjs → chunk-2DLN6HG4.mjs} +1 -1
  33. package/dist/{chunk-UUYF3CHN.mjs → chunk-2N5PX3LS.mjs} +2 -2
  34. package/dist/{chunk-H6G5INWM.cjs → chunk-2SDO73HK.cjs} +14 -156
  35. package/dist/{chunk-3TQWUUNP.cjs → chunk-3LUF2PE2.cjs} +10 -5
  36. package/dist/{chunk-SYGGPS4A.mjs → chunk-4IEPYMHF.mjs} +3 -3
  37. package/dist/{chunk-WD5PNSOB.mjs → chunk-4V7GIE2U.mjs} +6 -4
  38. package/dist/{chunk-DQMTHWPI.cjs → chunk-55ZY4ZA7.cjs} +4 -4
  39. package/dist/{chunk-I7PUUDGY.cjs → chunk-63H6BKXG.cjs} +2 -2
  40. package/dist/{chunk-FG5H2VCJ.mjs → chunk-6ZCMSZ5U.mjs} +2 -2
  41. package/dist/{chunk-ZMN3H73H.cjs → chunk-75DYEVXI.cjs} +13 -11
  42. package/dist/{chunk-WJKVTJJR.cjs → chunk-A672WZEG.cjs} +2 -2
  43. package/dist/{chunk-NL3ZSMZB.cjs → chunk-BJPBQNIE.cjs} +12 -12
  44. package/dist/{chunk-Q4BHBO6V.mjs → chunk-BXFWA23T.mjs} +2 -2
  45. package/dist/chunk-CNOQY6Z7.mjs +156 -0
  46. package/dist/{chunk-DW34V5SM.cjs → chunk-CTV2TTNP.cjs} +4 -4
  47. package/dist/{chunk-YXM74XOW.cjs → chunk-D4JE5NNV.cjs} +12 -12
  48. package/dist/{chunk-4UNKCNSL.mjs → chunk-E76XC6ZG.mjs} +2 -2
  49. package/dist/{chunk-G3HRIVEY.cjs → chunk-ES4B2IXW.cjs} +2 -2
  50. package/dist/{chunk-TDWFCC2T.cjs → chunk-EWZ3XHKQ.cjs} +2 -2
  51. package/dist/{chunk-JQGDQO2I.cjs → chunk-EXLKRR4U.cjs} +10 -10
  52. package/dist/{chunk-YZBV7733.cjs → chunk-F52CDFJM.cjs} +81 -81
  53. package/dist/{chunk-HG237IEY.mjs → chunk-FB3H4INL.mjs} +1 -1
  54. package/dist/{chunk-UWTQTZFN.mjs → chunk-FVCSLZWT.mjs} +11 -11
  55. package/dist/{chunk-WD4YXVLV.mjs → chunk-GZYH4OER.mjs} +1 -1
  56. package/dist/{chunk-DX4VKYAJ.cjs → chunk-I26CZYPV.cjs} +6 -4
  57. package/dist/{chunk-UNSKL6BI.cjs → chunk-ID6OVSLH.cjs} +163 -129
  58. package/dist/{chunk-F6SJAKFJ.mjs → chunk-IV6CQY7O.mjs} +12 -154
  59. package/dist/{chunk-6D242YGO.mjs → chunk-JATSG2ZO.mjs} +1 -1
  60. package/dist/{chunk-U74A3P2P.cjs → chunk-JLRDISQL.cjs} +7 -7
  61. package/dist/{chunk-LAHZ7LZA.cjs → chunk-JUFRXDTK.cjs} +18 -18
  62. package/dist/{chunk-POXI72VV.mjs → chunk-K3YEZLSY.mjs} +53 -8
  63. package/dist/{chunk-Y4YWHNKU.cjs → chunk-KH7BN726.cjs} +9 -9
  64. package/dist/{chunk-KAERLFD3.cjs → chunk-KOQ555NR.cjs} +16 -13
  65. package/dist/{chunk-O2LV5XDG.mjs → chunk-KXGDXYUC.mjs} +3 -3
  66. package/dist/{chunk-3IL5UC5I.cjs → chunk-KZLND3D2.cjs} +2 -2
  67. package/dist/{chunk-NPFGGBM5.cjs → chunk-MH24QDVJ.cjs} +13 -13
  68. package/dist/{chunk-TKDY6AJP.mjs → chunk-MKMBQSNQ.mjs} +1 -1
  69. package/dist/{chunk-OCE65DDM.mjs → chunk-MNUGPHLN.mjs} +1 -1
  70. package/dist/{chunk-3PTVHMLD.mjs → chunk-NVBS5WSZ.mjs} +1 -1
  71. package/dist/chunk-NYJMY3JA.cjs +156 -0
  72. package/dist/{chunk-VVJCWBIE.mjs → chunk-O3DTUAX2.mjs} +2 -2
  73. package/dist/{chunk-C7OUJ6JI.cjs → chunk-PZNCMPJF.cjs} +3 -3
  74. package/dist/{chunk-WIVTGKLY.mjs → chunk-PZPDGOU5.mjs} +9 -6
  75. package/dist/{chunk-52SH7TKB.mjs → chunk-QG5HNS7P.mjs} +2 -2
  76. package/dist/{chunk-CEYUWDWA.mjs → chunk-QZCT2CQ4.mjs} +10 -5
  77. package/dist/{chunk-JT25KHDI.mjs → chunk-REGFZJEJ.mjs} +1 -1
  78. package/dist/{chunk-QMV4QELL.mjs → chunk-S5GDHOE4.mjs} +4 -2
  79. package/dist/{chunk-CRQPYWLK.cjs → chunk-SORB3MAR.cjs} +14 -14
  80. package/dist/{chunk-FPW4W3VW.mjs → chunk-T7HQ3I4C.mjs} +1 -1
  81. package/dist/{chunk-HF5SIACK.cjs → chunk-TII23GJC.cjs} +3 -3
  82. package/dist/{chunk-QQQNJS2E.mjs → chunk-UX2DD2VK.mjs} +1 -1
  83. package/dist/{chunk-I4J452B7.cjs → chunk-VHJGDMCG.cjs} +3 -3
  84. package/dist/{chunk-QI7WQSMI.cjs → chunk-VQXDC5UV.cjs} +4 -4
  85. package/dist/{chunk-B6ZCT36X.cjs → chunk-WNLBF77X.cjs} +4 -4
  86. package/dist/{chunk-6EG7U4NF.mjs → chunk-X7WVQMIB.mjs} +1 -1
  87. package/dist/{chunk-5SPPCN5J.mjs → chunk-XNPDONUH.mjs} +1 -1
  88. package/dist/{chunk-ZSO5GWGD.cjs → chunk-XSPGWQWA.cjs} +75 -30
  89. package/dist/{chunk-FOT7LZEO.cjs → chunk-Y7GW7J46.cjs} +1 -1
  90. package/dist/{chunk-UOXGA6TO.mjs → chunk-YDQZGSDS.mjs} +1 -1
  91. package/dist/{chunk-C3VRMB6H.cjs → chunk-ZCU4NZ3M.cjs} +6 -6
  92. package/dist/{chunk-OGHTEYXS.mjs → chunk-ZRIE4KMG.mjs} +62 -28
  93. package/dist/{client-plugins-1GS4zubE.d.mts → client-plugins-CgYNY7jF.d.mts} +35 -32
  94. package/dist/{client-plugins-B1Za6F5x.d.ts → client-plugins-Fl9Og3yB.d.ts} +35 -32
  95. package/dist/client-plugins.d.mts +2 -1
  96. package/dist/client-plugins.d.ts +2 -1
  97. package/dist/client.cjs +11 -12
  98. package/dist/client.d.mts +6 -5
  99. package/dist/client.d.ts +6 -5
  100. package/dist/client.mjs +10 -11
  101. package/dist/config.d.mts +2 -1
  102. package/dist/config.d.ts +2 -1
  103. package/dist/{devtools-6RN6KHTW.mjs → devtools-3E7ZANMZ.mjs} +4 -4
  104. package/dist/{devtools-CQJ3H6MX.cjs → devtools-5AREISIA.cjs} +5 -5
  105. package/dist/docs.cjs +7 -7
  106. package/dist/docs.mjs +6 -6
  107. package/dist/index.cjs +56 -54
  108. package/dist/index.d.mts +14 -13
  109. package/dist/index.d.ts +14 -13
  110. package/dist/index.mjs +64 -62
  111. package/dist/integrations.d.mts +2 -1
  112. package/dist/integrations.d.ts +2 -1
  113. package/dist/internal/app-markdown-runtime.cjs +4 -4
  114. package/dist/internal/app-markdown-runtime.d.mts +3 -2
  115. package/dist/internal/app-markdown-runtime.d.ts +3 -2
  116. package/dist/internal/app-markdown-runtime.mjs +3 -3
  117. package/dist/internal/build-runtime.cjs +23 -22
  118. package/dist/internal/build-runtime.d.mts +4 -3
  119. package/dist/internal/build-runtime.d.ts +4 -3
  120. package/dist/internal/build-runtime.mjs +22 -21
  121. package/dist/internal/cli-runtime.cjs +13 -12
  122. package/dist/internal/cli-runtime.mjs +12 -11
  123. package/dist/internal/client-error-overlay.cjs +4 -4
  124. package/dist/internal/client-error-overlay.mjs +1 -1
  125. package/dist/internal/client-runtime.cjs +5 -1
  126. package/dist/internal/client-runtime.d.mts +1 -0
  127. package/dist/internal/client-runtime.d.ts +1 -0
  128. package/dist/internal/client-runtime.mjs +4 -0
  129. package/dist/internal/compression-runtime.d.mts +2 -1
  130. package/dist/internal/compression-runtime.d.ts +2 -1
  131. package/dist/internal/config-runtime.cjs +5 -5
  132. package/dist/internal/config-runtime.d.mts +3 -2
  133. package/dist/internal/config-runtime.d.ts +3 -2
  134. package/dist/internal/config-runtime.mjs +4 -4
  135. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  136. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  137. package/dist/internal/production-runtime.cjs +17 -15
  138. package/dist/internal/production-runtime.d.mts +8 -7
  139. package/dist/internal/production-runtime.d.ts +8 -7
  140. package/dist/internal/production-runtime.mjs +17 -15
  141. package/dist/markdown.cjs +3 -3
  142. package/dist/markdown.d.mts +2 -1
  143. package/dist/markdown.d.ts +2 -1
  144. package/dist/markdown.mjs +2 -2
  145. package/dist/{metadata-B9mCxKgp.d.mts → metadata-B0X-qtcQ.d.mts} +1 -1
  146. package/dist/{metadata-7LKgQEWF.d.ts → metadata-BdDKgd7K.d.ts} +1 -1
  147. package/dist/middleware.cjs +4 -4
  148. package/dist/middleware.d.mts +4 -3
  149. package/dist/middleware.d.ts +4 -3
  150. package/dist/middleware.mjs +3 -3
  151. package/dist/navigation.cjs +5 -5
  152. package/dist/navigation.d.mts +5 -4
  153. package/dist/navigation.d.ts +5 -4
  154. package/dist/navigation.mjs +4 -4
  155. package/dist/plugin.cjs +23 -19
  156. package/dist/plugin.d.mts +2 -1
  157. package/dist/plugin.d.ts +2 -1
  158. package/dist/plugin.mjs +23 -19
  159. package/dist/{production-runtime-DramhI0c.d.mts → production-runtime-BjgFgDIg.d.mts} +1 -1
  160. package/dist/{production-runtime-B3xnY6fI.d.ts → production-runtime-Dx_qMA3t.d.ts} +1 -1
  161. package/dist/query/client.cjs +6 -6
  162. package/dist/query/client.mjs +2 -2
  163. package/dist/{render-plan-CpW32tOL.d.ts → render-plan-B41EWmBb.d.ts} +1 -1
  164. package/dist/{render-plan-CtQB-zHS.d.mts → render-plan-_1TAWODt.d.mts} +1 -1
  165. package/dist/renderer-client.cjs +13 -14
  166. package/dist/renderer-client.d.mts +4 -3
  167. package/dist/renderer-client.d.ts +4 -3
  168. package/dist/renderer-client.mjs +6 -7
  169. package/dist/{request-DlLVBKe3.d.mts → request-BhE4luLv.d.mts} +1 -1
  170. package/dist/{request-BVGGeQv4.d.ts → request-Dbf3G0zM.d.ts} +1 -1
  171. package/dist/request.d.mts +3 -2
  172. package/dist/request.d.ts +3 -2
  173. package/dist/{route-rendering-BdEldajn.d.ts → route-rendering-Z7PveTZE.d.ts} +1 -1
  174. package/dist/{route-rendering-DChYLNdh.d.mts → route-rendering-zzfx_GHf.d.mts} +1 -1
  175. package/dist/{router-D5htHn_M.d.mts → router-BatNMsa1.d.mts} +1 -1
  176. package/dist/{router-D0Az-1Nu.d.ts → router-DtNRhQl3.d.ts} +1 -1
  177. package/dist/routes.cjs +6 -5
  178. package/dist/routes.d.mts +2 -1
  179. package/dist/routes.d.ts +2 -1
  180. package/dist/routes.mjs +5 -4
  181. package/dist/server-fn-client.d.mts +1 -0
  182. package/dist/server-fn-client.d.ts +1 -0
  183. package/dist/server-fn.cjs +6 -5
  184. package/dist/server-fn.d.mts +1 -0
  185. package/dist/server-fn.d.ts +1 -0
  186. package/dist/server-fn.mjs +5 -4
  187. package/dist/server-plugins.d.mts +3 -2
  188. package/dist/server-plugins.d.ts +3 -2
  189. package/dist/server-query-client.cjs +5 -7
  190. package/dist/server-query-client.d.mts +1 -0
  191. package/dist/server-query-client.d.ts +1 -0
  192. package/dist/server-query-client.mjs +4 -6
  193. package/dist/server-query.cjs +7 -6
  194. package/dist/server-query.d.mts +1 -0
  195. package/dist/server-query.d.ts +1 -0
  196. package/dist/server-query.mjs +6 -5
  197. package/dist/server.cjs +64 -54
  198. package/dist/server.d.mts +9 -8
  199. package/dist/server.d.ts +9 -8
  200. package/dist/server.mjs +48 -38
  201. package/dist/{spa-router-DmwP_7QL.d.ts → spa-router-BE3bwU-J.d.ts} +2 -2
  202. package/dist/{spa-router-DVfSJZ5o.d.mts → spa-router-DQOnHZVj.d.mts} +2 -2
  203. package/dist/testing.cjs +14 -13
  204. package/dist/testing.d.mts +2 -1
  205. package/dist/testing.d.ts +2 -1
  206. package/dist/testing.mjs +11 -10
  207. package/dist/{utils-B_Rmr0-n.d.mts → utils-DLK1ERNl.d.mts} +1 -1
  208. package/dist/{utils-Dv0OuLtF.d.ts → utils-u7ZBSWAK.d.ts} +1 -1
  209. package/dist/version.cjs +2 -2
  210. package/dist/version.mjs +1 -1
  211. package/dist/vite.cjs +19 -18
  212. package/dist/vite.d.mts +2 -1
  213. package/dist/vite.d.ts +2 -1
  214. package/dist/vite.mjs +18 -17
  215. package/package.json +1 -1
  216. package/dist/{chunk-YOYF2E4U.mjs → chunk-LNZ7JZUS.mjs} +0 -0
  217. package/dist/{chunk-N4RLRSWW.cjs → chunk-SUIBNSNO.cjs} +0 -0
  218. package/dist/{chunk-TIKNUAU7.mjs → chunk-VUMAE7NC.mjs} +3 -3
  219. package/dist/{chunk-WM6HL7E7.cjs → chunk-ZHVYQL3H.cjs} +2 -2
@@ -28,7 +28,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
28
28
 
29
29
 
30
30
 
31
- var _chunkDQMTHWPIcjs = require('./chunk-DQMTHWPI.cjs');
31
+ var _chunk55ZY4ZA7cjs = require('./chunk-55ZY4ZA7.cjs');
32
32
 
33
33
 
34
34
  var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
@@ -47,7 +47,7 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
47
47
  var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
48
48
 
49
49
 
50
- var _chunkZSO5GWGDcjs = require('./chunk-ZSO5GWGD.cjs');
50
+ var _chunkXSPGWQWAcjs = require('./chunk-XSPGWQWA.cjs');
51
51
 
52
52
 
53
53
  var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
@@ -129,13 +129,16 @@ async function resolveFarmMCPPlugin(config, options) {
129
129
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmMCPPlugin, "resolveFarmMCPPlugin");
130
130
 
131
131
  // src/agent-config.ts
132
- function resolveFarmAgentConfig(input) {
132
+ var DEFAULT_JSON_LD = { type: "WebSite" };
133
+ function resolveFarmAgentConfig(input, context = {}) {
133
134
  const jsonLd = _optionalChain([input, 'optionalAccess', _ => _.jsonLd]);
134
135
  return {
135
- jsonLd: !jsonLd ? false : jsonLd === true ? {} : jsonLd,
136
- noindexPreviews: _chunkDQMTHWPIcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
137
- llmsTxt: _chunkDQMTHWPIcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt])),
138
- crawlers: _chunkDQMTHWPIcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _4 => _4.crawlers])),
136
+ jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
137
+ noindexPreviews: _chunk55ZY4ZA7cjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
138
+ // The docs engine answers /llms.txt with its own pages; a default here would replace it.
139
+ // llms-full.txt renders every listed page, so it stays opt-in.
140
+ llmsTxt: _chunk55ZY4ZA7cjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt]), () => ( (context.docs ? false : { full: false })))),
141
+ crawlers: _chunk55ZY4ZA7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _4 => _4.crawlers])),
139
142
  apiCatalog: resolveFarmApiCatalogEnabled(_optionalChain([input, 'optionalAccess', _5 => _5.apiCatalog]))
140
143
  };
141
144
  }
@@ -684,9 +687,9 @@ async function resolveConfig(userConfig, mode) {
684
687
  const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
685
688
  const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
686
689
  const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
687
- const security = _chunkDQMTHWPIcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
688
- const securityHeader = _chunkDQMTHWPIcjs.getFarmSecurityHeader.call(void 0, security);
689
- if (_chunkDQMTHWPIcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
690
+ const security = _chunk55ZY4ZA7cjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
691
+ const securityHeader = _chunk55ZY4ZA7cjs.getFarmSecurityHeader.call(void 0, security);
692
+ if (_chunk55ZY4ZA7cjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
690
693
  _chunk5QIKR7RRcjs.logger.warn(
691
694
  "security.csp blocks the inline scripts Farm injects for theming and hydration. Set security.csp.nonce to true for managed dynamic nonces and prerendered hashes, or make the governing script directive allow 'unsafe-inline' without a nonce, hash, or 'strict-dynamic' source."
692
695
  );
@@ -695,7 +698,7 @@ async function resolveConfig(userConfig, mode) {
695
698
  const root = userConfig.root || process.cwd();
696
699
  const srcDir = userConfig.srcDir || "src";
697
700
  const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
698
- const md = _chunkZSO5GWGDcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
701
+ const md = _chunkXSPGWQWAcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
699
702
  const mdx = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
700
703
  const env = _chunkVEKFLAQMcjs.resolveEnv.call(void 0, userConfig.env, process.env);
701
704
  _chunkVEKFLAQMcjs.setEnv.call(void 0, env);
@@ -769,7 +772,7 @@ async function resolveConfig(userConfig, mode) {
769
772
  ppr: false,
770
773
  ...userConfig.experimental
771
774
  },
772
- agent: resolveFarmAgentConfig(userConfig.agent),
775
+ agent: resolveFarmAgentConfig(userConfig.agent, { docs: docs.enabled }),
773
776
  plugins: [
774
777
  ..._chunkZ5HIWVDPcjs.resolveIntegrationPlugins.call(void 0, integrations),
775
778
  ...nativeMCPPlugin ? [nativeMCPPlugin] : [],
@@ -786,7 +789,7 @@ async function resolveConfig(userConfig, mode) {
786
789
  ], "headers"),
787
790
  routeRules,
788
791
  images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
789
- performance: _chunkDQMTHWPIcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
792
+ performance: _chunk55ZY4ZA7cjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
790
793
  theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
791
794
  publicDir: userConfig.publicDir || "public",
792
795
  i18n: _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-IOEH4VWN.mjs";
7
7
  import {
8
8
  APIRouteConflictError
9
- } from "./chunk-Q4BHBO6V.mjs";
9
+ } from "./chunk-BXFWA23T.mjs";
10
10
  import {
11
11
  findProgrammaticRouteFilesInDir
12
- } from "./chunk-YOYF2E4U.mjs";
12
+ } from "./chunk-LNZ7JZUS.mjs";
13
13
  import {
14
14
  isFarmAPIRouteFileName
15
15
  } from "./chunk-CU625VAY.mjs";
@@ -19,7 +19,7 @@ import {
19
19
  invokeAPIRouteEndpoint,
20
20
  matchAPIRouteAtBasePath,
21
21
  resolveAPIRouteEndpoint
22
- } from "./chunk-6EG7U4NF.mjs";
22
+ } from "./chunk-X7WVQMIB.mjs";
23
23
  import {
24
24
  isProgrammaticRoutesFileName
25
25
  } from "./chunk-EA5K5BKU.mjs";
@@ -1,6 +1,6 @@
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(); } } 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 _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
3
+ var _chunkZHVYQL3Hcjs = require('./chunk-ZHVYQL3H.cjs');
4
4
 
5
5
 
6
6
  var _chunkHBTUGXHScjs = require('./chunk-HBTUGXHS.cjs');
@@ -415,7 +415,7 @@ function farmMiddlewarePlugin(options = {}) {
415
415
  mode: server.config.mode === "production" ? "production" : "development",
416
416
  basePath: _nullishCoalesce(options.basePath, () => ( "/"))
417
417
  });
418
- manager = new (0, _chunkWM6HL7E7cjs.MiddlewareManager)(
418
+ manager = new (0, _chunkZHVYQL3Hcjs.MiddlewareManager)(
419
419
  getMiddlewareAppDirectory(server.config.root, srcDir),
420
420
  server,
421
421
  void 0,
@@ -3,14 +3,14 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkQI7WQSMIcjs = require('./chunk-QI7WQSMI.cjs');
6
+ var _chunkVQXDC5UVcjs = require('./chunk-VQXDC5UV.cjs');
7
7
 
8
8
 
9
9
 
10
10
  var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
11
11
 
12
12
 
13
- var _chunkKAERLFD3cjs = require('./chunk-KAERLFD3.cjs');
13
+ var _chunkKOQ555NRcjs = require('./chunk-KOQ555NR.cjs');
14
14
 
15
15
 
16
16
  var _chunk75WGQVQAcjs = require('./chunk-75WGQVQA.cjs');
@@ -39,7 +39,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
39
39
  ...moduleConfig ? { ...moduleConfig, ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
40
40
  entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
41
41
  docsPath: docs.entry,
42
- contentDir: _chunkQI7WQSMIcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
42
+ contentDir: _chunkVQXDC5UVcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
43
43
  };
44
44
  }
45
45
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDocsAdapterRuntimeConfig, "createFarmDocsAdapterRuntimeConfig");
@@ -274,25 +274,25 @@ function getDocsDescription(docs) {
274
274
  }
275
275
  _chunkS3JO3N4Hcjs.__name.call(void 0, getDocsDescription, "getDocsDescription");
276
276
  function getLoadedDocsPages(context) {
277
- return _chunkQI7WQSMIcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).map((page) => _chunkQI7WQSMIcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
277
+ return _chunkVQXDC5UVcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).map((page) => _chunkVQXDC5UVcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
278
278
  }
279
279
  _chunkS3JO3N4Hcjs.__name.call(void 0, getLoadedDocsPages, "getLoadedDocsPages");
280
280
  function toDocsSourcePage(page) {
281
281
  return {
282
- ..._chunkQI7WQSMIcjs.toFarmDocsMarkdownPage.call(void 0, page),
282
+ ..._chunkVQXDC5UVcjs.toFarmDocsMarkdownPage.call(void 0, page),
283
283
  sourcePath: page.sourcePath
284
284
  };
285
285
  }
286
286
  _chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSourcePage, "toDocsSourcePage");
287
287
  function toDocsSitemapPage(page) {
288
288
  return {
289
- ..._chunkQI7WQSMIcjs.toFarmDocsMarkdownPage.call(void 0, page),
289
+ ..._chunkVQXDC5UVcjs.toFarmDocsMarkdownPage.call(void 0, page),
290
290
  sourcePath: page.sourcePath
291
291
  };
292
292
  }
293
293
  _chunkS3JO3N4Hcjs.__name.call(void 0, toDocsSitemapPage, "toDocsSitemapPage");
294
294
  function toDocsLlmsPage(page) {
295
- return _chunkQI7WQSMIcjs.toFarmDocsMarkdownPage.call(void 0, page);
295
+ return _chunkVQXDC5UVcjs.toFarmDocsMarkdownPage.call(void 0, page);
296
296
  }
297
297
  _chunkS3JO3N4Hcjs.__name.call(void 0, toDocsLlmsPage, "toDocsLlmsPage");
298
298
  function getDocsLlmsOptions(context, request) {
@@ -386,7 +386,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, renderAgentsDocument, "renderAgentsDocumen
386
386
  function buildAgentSpec(context, request) {
387
387
  const url = new URL(request.url);
388
388
  const origin = url.origin;
389
- const pages = _chunkQI7WQSMIcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
389
+ const pages = _chunkVQXDC5UVcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
390
390
  const spec = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
391
391
  const title = getDocsTitle(context.docs);
392
392
  return {
@@ -428,7 +428,7 @@ function buildAgentSpec(context, request) {
428
428
  }
429
429
  _chunkS3JO3N4Hcjs.__name.call(void 0, buildAgentSpec, "buildAgentSpec");
430
430
  function buildDiagnostics(context) {
431
- const pages = _chunkQI7WQSMIcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
431
+ const pages = _chunkVQXDC5UVcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
432
432
  const diagnostics = _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
433
433
  entry: context.docs.entry,
434
434
  mcp: {
@@ -500,12 +500,12 @@ async function resolveAPIContext(options) {
500
500
  config: options.config,
501
501
  configPath: options.configPath
502
502
  }));
503
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkKAERLFD3cjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
503
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkKOQ555NRcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
504
504
  return {
505
505
  root,
506
506
  srcDir,
507
507
  docs,
508
- contentDir: _chunkQI7WQSMIcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir })
508
+ contentDir: _chunkVQXDC5UVcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir })
509
509
  };
510
510
  }
511
511
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveAPIContext, "resolveAPIContext");
@@ -568,10 +568,10 @@ async function handleDocsAPIGet(request, context) {
568
568
  if (format === "markdown" || url.pathname.endsWith(".md")) {
569
569
  const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
570
570
  const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
571
- const page = _chunkQI7WQSMIcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
571
+ const page = _chunkVQXDC5UVcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
572
572
  if (!page) return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
573
573
  return text(
574
- _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkQI7WQSMIcjs.toFarmDocsMarkdownPage.call(void 0, page), {
574
+ _chunkIK6LVLKCcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkVQXDC5UVcjs.toFarmDocsMarkdownPage.call(void 0, page), {
575
575
  origin: new URL(request.url).origin,
576
576
  llms: getDocsLlmsOptions(context, request),
577
577
  sitemap: context.docs.config.sitemap
@@ -7,7 +7,7 @@ import {
7
7
  notifyHistoryChange,
8
8
  readPageState,
9
9
  subscribeHistoryChange
10
- } from "./chunk-6D242YGO.mjs";
10
+ } from "./chunk-JATSG2ZO.mjs";
11
11
  import {
12
12
  getFarmI18nClientState
13
13
  } from "./chunk-TOVMYGYW.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MiddlewareManager
3
- } from "./chunk-TIKNUAU7.mjs";
3
+ } from "./chunk-VUMAE7NC.mjs";
4
4
  import {
5
5
  resolveFarmI18nConfig
6
6
  } from "./chunk-YMCXWPWK.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createFarmMarkdownRouteModule
3
- } from "./chunk-MBFURXAC.mjs";
3
+ } from "./chunk-2DLN6HG4.mjs";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-LPEX4YW6.mjs";
@@ -0,0 +1,156 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
+
3
+ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
4
+
5
+ // src/cache-key.ts
6
+ function createRouteDataCacheKey(key) {
7
+ return createFarmCacheKey(Array.isArray(key) ? key : [key]);
8
+ }
9
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteDataCacheKey, "createRouteDataCacheKey");
10
+ function createFarmCacheKey(parts) {
11
+ return stableSerialize(parts);
12
+ }
13
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmCacheKey, "createFarmCacheKey");
14
+ function getFunctionCacheIdentity(fn) {
15
+ const name = fn.name || "anonymous";
16
+ return `${name}:${hashFunctionSource(String(fn))}`;
17
+ }
18
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getFunctionCacheIdentity, "getFunctionCacheIdentity");
19
+ function hashFunctionSource(source) {
20
+ let hash = 2166136261;
21
+ for (let index = 0; index < source.length; index++) {
22
+ hash ^= source.charCodeAt(index);
23
+ hash = Math.imul(hash, 16777619);
24
+ }
25
+ return (hash >>> 0).toString(36);
26
+ }
27
+ _chunkS3JO3N4Hcjs.__name.call(void 0, hashFunctionSource, "hashFunctionSource");
28
+ function compareCodepoint(a, b) {
29
+ return a < b ? -1 : a > b ? 1 : 0;
30
+ }
31
+ _chunkS3JO3N4Hcjs.__name.call(void 0, compareCodepoint, "compareCodepoint");
32
+ function serializeBinaryBytes(bytes) {
33
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
34
+ }
35
+ _chunkS3JO3N4Hcjs.__name.call(void 0, serializeBinaryBytes, "serializeBinaryBytes");
36
+ function serializeCanonicalStringEntries(entries, seen) {
37
+ const valuesByKey = /* @__PURE__ */ new Map();
38
+ for (const [key, item] of entries) {
39
+ const values = valuesByKey.get(key);
40
+ if (values) values.push(item);
41
+ else valuesByKey.set(key, [item]);
42
+ }
43
+ return Array.from(valuesByKey.keys()).sort(compareCodepoint).flatMap(
44
+ (key) => valuesByKey.get(key).map((item) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`)
45
+ ).join(",");
46
+ }
47
+ _chunkS3JO3N4Hcjs.__name.call(void 0, serializeCanonicalStringEntries, "serializeCanonicalStringEntries");
48
+ function isPlainCacheKeyObject(value) {
49
+ const prototype = Object.getPrototypeOf(value);
50
+ if (prototype === null) return true;
51
+ const constructor = _optionalChain([Object, 'access', _ => _.getOwnPropertyDescriptor, 'call', _2 => _2(prototype, "constructor"), 'optionalAccess', _3 => _3.value]);
52
+ return Object.getPrototypeOf(prototype) === null && typeof constructor === "function" && constructor.name === "Object";
53
+ }
54
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isPlainCacheKeyObject, "isPlainCacheKeyObject");
55
+ function getCacheKeyValueType(value) {
56
+ const prototype = Object.getPrototypeOf(value);
57
+ const constructor = prototype ? _optionalChain([Object, 'access', _4 => _4.getOwnPropertyDescriptor, 'call', _5 => _5(prototype, "constructor"), 'optionalAccess', _6 => _6.value]) : void 0;
58
+ if (typeof constructor === "function" && constructor.name) {
59
+ return constructor.name;
60
+ }
61
+ return Object.prototype.toString.call(value).slice(8, -1) || "object";
62
+ }
63
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getCacheKeyValueType, "getCacheKeyValueType");
64
+ function stableSerialize(value, seen = /* @__PURE__ */ new WeakSet()) {
65
+ if (value === null) return "null";
66
+ if (value === void 0) return "undefined";
67
+ const valueType = typeof value;
68
+ if (valueType === "string") return JSON.stringify(value);
69
+ if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
70
+ return `${valueType}:${String(value)}`;
71
+ }
72
+ if (valueType === "symbol") {
73
+ return `symbol:${String(value)}`;
74
+ }
75
+ if (valueType === "function") {
76
+ return `function:${getFunctionCacheIdentity(value)}`;
77
+ }
78
+ if (value instanceof Date) {
79
+ return Number.isNaN(value.getTime()) ? "date:invalid" : `date:${value.toISOString()}`;
80
+ }
81
+ if (value instanceof URL) {
82
+ return `url:${value.toString()}`;
83
+ }
84
+ if (value instanceof RegExp) {
85
+ return `regexp:${value.toString()}`;
86
+ }
87
+ if (value instanceof ArrayBuffer) {
88
+ return `arraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
89
+ }
90
+ if (typeof SharedArrayBuffer !== "undefined" && value instanceof SharedArrayBuffer) {
91
+ return `sharedarraybuffer:${serializeBinaryBytes(new Uint8Array(value))}`;
92
+ }
93
+ if (ArrayBuffer.isView(value)) {
94
+ const viewType = Object.prototype.toString.call(value).slice(8, -1);
95
+ const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
96
+ return `binary:${viewType}:${serializeBinaryBytes(bytes)}`;
97
+ }
98
+ if (value && typeof value === "object") {
99
+ if (seen.has(value)) {
100
+ return "[Circular]";
101
+ }
102
+ seen.add(value);
103
+ if (Array.isArray(value)) {
104
+ const items = [];
105
+ for (let index = 0; index < value.length; index++) {
106
+ items.push(
107
+ Object.prototype.hasOwnProperty.call(value, index) ? stableSerialize(value[index], seen) : "[Hole]"
108
+ );
109
+ }
110
+ seen.delete(value);
111
+ return `[${items.join(",")}]`;
112
+ }
113
+ if (value instanceof Set) {
114
+ const items = Array.from(value, (item) => stableSerialize(item, seen)).sort(compareCodepoint);
115
+ seen.delete(value);
116
+ return `set:[${items.join(",")}]`;
117
+ }
118
+ if (value instanceof Map) {
119
+ const items = Array.from(
120
+ value,
121
+ ([key, item]) => `[${stableSerialize(key, seen)},${stableSerialize(item, seen)}]`
122
+ ).sort(compareCodepoint);
123
+ seen.delete(value);
124
+ return `map:[${items.join(",")}]`;
125
+ }
126
+ if (value instanceof URLSearchParams) {
127
+ const serialized2 = serializeCanonicalStringEntries(value, seen);
128
+ seen.delete(value);
129
+ return `urlsearchparams:[${serialized2}]`;
130
+ }
131
+ if (value instanceof Headers) {
132
+ const serialized2 = serializeCanonicalStringEntries(value, seen);
133
+ seen.delete(value);
134
+ return `headers:[${serialized2}]`;
135
+ }
136
+ if (!isPlainCacheKeyObject(value)) {
137
+ throw new TypeError(
138
+ `Cache keys do not support ${getCacheKeyValueType(value)} values. Convert the value to an explicit stable string or structured key before caching.`
139
+ );
140
+ }
141
+ const entries = Object.entries(value).sort(
142
+ ([a], [b]) => compareCodepoint(a, b)
143
+ );
144
+ const serialized = entries.map(([key, item]) => `${JSON.stringify(key)}:${stableSerialize(item, seen)}`).join(",");
145
+ seen.delete(value);
146
+ return `{${serialized}}`;
147
+ }
148
+ return String(value);
149
+ }
150
+ _chunkS3JO3N4Hcjs.__name.call(void 0, stableSerialize, "stableSerialize");
151
+
152
+
153
+
154
+
155
+
156
+ exports.createRouteDataCacheKey = createRouteDataCacheKey; exports.createFarmCacheKey = createFarmCacheKey; exports.getFunctionCacheIdentity = getFunctionCacheIdentity;
@@ -26,13 +26,13 @@ import {
26
26
  } from "./chunk-DAATZTKJ.mjs";
27
27
  import {
28
28
  discoverProgrammaticRoutePaths
29
- } from "./chunk-YOYF2E4U.mjs";
29
+ } from "./chunk-LNZ7JZUS.mjs";
30
30
  import {
31
31
  readFarmI18nCatalogs
32
32
  } from "./chunk-FV45CKBC.mjs";
33
33
  import {
34
34
  resolvePluginRoutes
35
- } from "./chunk-SYGGPS4A.mjs";
35
+ } from "./chunk-4IEPYMHF.mjs";
36
36
  import {
37
37
  parseRoutePath
38
38
  } from "./chunk-KI3MESHB.mjs";
@@ -1,7 +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
3
 
4
- var _chunkI4J452B7cjs = require('./chunk-I4J452B7.cjs');
4
+ var _chunkVHJGDMCGcjs = require('./chunk-VHJGDMCG.cjs');
5
5
 
6
6
 
7
7
  var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
@@ -64,7 +64,7 @@ function mergePluginAPIRoutes(existing, plugins, expected, options = {}) {
64
64
  });
65
65
  }
66
66
  const api = createPluginLocalAPI(existing, options.bodySizeLimit);
67
- for (const definition of _chunkI4J452B7cjs.resolvePluginRoutes.call(void 0, plugins, { api })) {
67
+ for (const definition of _chunkVHJGDMCGcjs.resolvePluginRoutes.call(void 0, plugins, { api })) {
68
68
  _chunkWMAPPDMMcjs.registerAPIRouteShape.call(void 0, shapes, definition.path, `plugin:${definition.path}`, "app");
69
69
  let route = routes.get(definition.path);
70
70
  if (_optionalChain([route, 'optionalAccess', _ => _.methods, 'access', _2 => _2.includes, 'call', _3 => _3(definition.method)])) {
@@ -256,7 +256,7 @@ async function invokeAPIRouteEndpointInContext(endpoint, request, params) {
256
256
  invalidations: []
257
257
  };
258
258
  } catch (error) {
259
- if (_chunkI4J452B7cjs.isEndpointFailure.call(void 0, error)) {
259
+ if (_chunkVHJGDMCGcjs.isEndpointFailure.call(void 0, error)) {
260
260
  return createEndpointFailureResponse(error);
261
261
  }
262
262
  throw error;
@@ -28,7 +28,7 @@ import {
28
28
  resolveFarmNoindexPreviews,
29
29
  resolveFarmPerformanceConfig,
30
30
  resolveFarmSecurityConfig
31
- } from "./chunk-JT25KHDI.mjs";
31
+ } from "./chunk-REGFZJEJ.mjs";
32
32
  import {
33
33
  resolveFarmImageConfig
34
34
  } from "./chunk-G2KY33I6.mjs";
@@ -47,7 +47,7 @@ import {
47
47
  } from "./chunk-FA2W42OV.mjs";
48
48
  import {
49
49
  resolveMarkdownConfig
50
- } from "./chunk-POXI72VV.mjs";
50
+ } from "./chunk-K3YEZLSY.mjs";
51
51
  import {
52
52
  bundleNodeModule
53
53
  } from "./chunk-SFGWNC43.mjs";
@@ -129,12 +129,15 @@ async function resolveFarmMCPPlugin(config, options) {
129
129
  __name(resolveFarmMCPPlugin, "resolveFarmMCPPlugin");
130
130
 
131
131
  // src/agent-config.ts
132
- function resolveFarmAgentConfig(input) {
132
+ var DEFAULT_JSON_LD = { type: "WebSite" };
133
+ function resolveFarmAgentConfig(input, context = {}) {
133
134
  const jsonLd = input?.jsonLd;
134
135
  return {
135
- jsonLd: !jsonLd ? false : jsonLd === true ? {} : jsonLd,
136
+ jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
136
137
  noindexPreviews: resolveFarmNoindexPreviews(input?.noindexPreviews),
137
- llmsTxt: resolveFarmLlmsTxtConfig(input?.llmsTxt),
138
+ // The docs engine answers /llms.txt with its own pages; a default here would replace it.
139
+ // llms-full.txt renders every listed page, so it stays opt-in.
140
+ llmsTxt: resolveFarmLlmsTxtConfig(input?.llmsTxt ?? (context.docs ? false : { full: false })),
138
141
  crawlers: resolveFarmAgentCrawlers(input?.crawlers),
139
142
  apiCatalog: resolveFarmApiCatalogEnabled(input?.apiCatalog)
140
143
  };
@@ -769,7 +772,7 @@ async function resolveConfig(userConfig, mode) {
769
772
  ppr: false,
770
773
  ...userConfig.experimental
771
774
  },
772
- agent: resolveFarmAgentConfig(userConfig.agent),
775
+ agent: resolveFarmAgentConfig(userConfig.agent, { docs: docs.enabled }),
773
776
  plugins: [
774
777
  ...resolveIntegrationPlugins(integrations),
775
778
  ...nativeMCPPlugin ? [nativeMCPPlugin] : [],
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useRouter
3
- } from "./chunk-TKDY6AJP.mjs";
3
+ } from "./chunk-MKMBQSNQ.mjs";
4
4
  import {
5
5
  getRouter
6
- } from "./chunk-6D242YGO.mjs";
6
+ } from "./chunk-JATSG2ZO.mjs";
7
7
  import {
8
8
  applyFarmBasePath
9
9
  } from "./chunk-4RB44K6Z.mjs";
@@ -182,7 +182,10 @@ function renderMetadataHead(metadata, options = {}) {
182
182
  );
183
183
  }
184
184
  appendNamedMetaRecord(tags, resolvedMetadata.other);
185
- appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase);
185
+ appendOpenGraph(tags, resolvedMetadata.openGraph, metadataBase, {
186
+ title: explicitTitle,
187
+ description: resolvedMetadata.description
188
+ });
186
189
  appendTwitter(tags, resolvedMetadata.twitter, metadataBase);
187
190
  appendVerification(tags, resolvedMetadata.verification);
188
191
  if (options.jsonLd) {
@@ -220,10 +223,12 @@ function mergeNestedMetadata(base, next) {
220
223
  return next ?? base;
221
224
  }
222
225
  __name(mergeNestedMetadata, "mergeNestedMetadata");
223
- function appendOpenGraph(tags, openGraph, metadataBase) {
224
- if (!isRecord(openGraph)) return;
225
- appendMetaProperty(tags, "og:title", openGraph.title);
226
- appendMetaProperty(tags, "og:description", openGraph.description);
226
+ function appendOpenGraph(tags, input, metadataBase, page) {
227
+ const description = typeof page.description === "string" ? page.description : void 0;
228
+ if (!isRecord(input) && !page.title && !description) return;
229
+ const openGraph = isRecord(input) ? input : {};
230
+ appendMetaProperty(tags, "og:title", openGraph.title ?? page.title);
231
+ appendMetaProperty(tags, "og:description", openGraph.description ?? description);
227
232
  appendMetaProperty(tags, "og:url", resolveMetadataUrl(openGraph.url, metadataBase));
228
233
  appendMetaProperty(tags, "og:site_name", openGraph.siteName);
229
234
  appendMetaProperty(tags, "og:type", openGraph.type ?? "website");
@@ -2,7 +2,7 @@ import {
2
2
  getFarmMarkdownMirrorPath,
3
3
  isFarmMarkdownMirrorExposed,
4
4
  matchesFarmMarkdownRoutePattern
5
- } from "./chunk-POXI72VV.mjs";
5
+ } from "./chunk-K3YEZLSY.mjs";
6
6
  import {
7
7
  FARM_INTERNAL_READ_HEADER
8
8
  } from "./chunk-MVL2RAJW.mjs";
@@ -9,10 +9,12 @@ import {
9
9
  normalizeFarmRouteRuntimeConfig
10
10
  } from "./chunk-2J7W2WND.mjs";
11
11
  import {
12
- createFarmCacheKey,
13
12
  createRouteDataCacheTag,
14
13
  getFarmDataCache
15
- } from "./chunk-F6SJAKFJ.mjs";
14
+ } from "./chunk-IV6CQY7O.mjs";
15
+ import {
16
+ createFarmCacheKey
17
+ } from "./chunk-CNOQY6Z7.mjs";
16
18
  import {
17
19
  __name
18
20
  } from "./chunk-LPEX4YW6.mjs";