@farm.js/core 0.1.35 → 0.1.36

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 (214) hide show
  1. package/dist/{metadata-WGpBYcGn.d.mts → agent-mcp-BVExL8rZ.d.mts} +45 -2
  2. package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
  3. package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
  4. package/dist/{metadata-BnLDsUOS.d.ts → agent-mcp-luzfXK-P.d.ts} +45 -2
  5. package/dist/agent-runtime.cjs +5 -3
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +4 -2
  9. package/dist/api/route-manager.cjs +6 -6
  10. package/dist/api/route-manager.d.mts +10 -4
  11. package/dist/api/route-manager.d.ts +10 -4
  12. package/dist/api/route-manager.mjs +5 -5
  13. package/dist/api/runtime.cjs +4 -4
  14. package/dist/api/runtime.d.mts +4 -62
  15. package/dist/api/runtime.d.ts +4 -62
  16. package/dist/api/runtime.mjs +3 -3
  17. package/dist/api.cjs +8 -8
  18. package/dist/api.d.mts +3 -3
  19. package/dist/api.d.ts +3 -3
  20. package/dist/api.mjs +7 -7
  21. package/dist/{app-D_j9AAVL.d.mts → app-BukwkFIu.d.mts} +17 -3
  22. package/dist/{app-BXB3JZYc.d.ts → app-Yfa2dsFy.d.ts} +17 -3
  23. package/dist/app-markdown.cjs +4 -4
  24. package/dist/app-markdown.d.mts +2 -2
  25. package/dist/app-markdown.d.ts +2 -2
  26. package/dist/app-markdown.mjs +3 -3
  27. package/dist/{chunk-4KU5Q7C2.mjs → chunk-276VJSM6.mjs} +221 -48
  28. package/dist/{chunk-PFQKNERH.cjs → chunk-2YTDKNH3.cjs} +364 -197
  29. package/dist/{chunk-UAORZ7QA.mjs → chunk-35GKZR22.mjs} +2 -2
  30. package/dist/{chunk-QAU5JD57.mjs → chunk-35WV46VL.mjs} +203 -36
  31. package/dist/{chunk-EFCQPQMG.cjs → chunk-42NHY7HW.cjs} +54 -4
  32. package/dist/{chunk-SOMHP6GF.mjs → chunk-4E5AEDKY.mjs} +2 -2
  33. package/dist/{chunk-UJD4PHYB.mjs → chunk-4E5WBPEG.mjs} +72 -354
  34. package/dist/{chunk-2G2NNLE2.mjs → chunk-4GLOOWKE.mjs} +4 -4
  35. package/dist/{chunk-62XKI4Z3.cjs → chunk-4NU4GGTC.cjs} +2 -2
  36. package/dist/{chunk-4JHOT46A.mjs → chunk-4WCZJQUO.mjs} +54 -4
  37. package/dist/chunk-4WQ6PGSJ.cjs +367 -0
  38. package/dist/{chunk-SMHH4VDG.mjs → chunk-4WVJLURN.mjs} +1 -1
  39. package/dist/chunk-6SJ2KJTA.mjs +314 -0
  40. package/dist/{chunk-IPXLADVO.cjs → chunk-ADEA7PN3.cjs} +122 -61
  41. package/dist/{chunk-CP6X4AEU.mjs → chunk-AJQTP4OO.mjs} +1 -1
  42. package/dist/{chunk-4MMGO7YW.cjs → chunk-AO6RYU5N.cjs} +31 -28
  43. package/dist/{chunk-GFHLGIYC.cjs → chunk-BO36SELV.cjs} +6 -6
  44. package/dist/{chunk-6TJOML4E.mjs → chunk-BPOF5U4N.mjs} +4 -4
  45. package/dist/{chunk-JHWOVJ3M.mjs → chunk-BUGNQIHC.mjs} +5 -0
  46. package/dist/{chunk-FTFYRMQQ.cjs → chunk-CBJJH36A.cjs} +50 -25
  47. package/dist/{chunk-7GLPRTTF.cjs → chunk-CGBDNNSM.cjs} +2 -2
  48. package/dist/chunk-CI6E3UOH.cjs +314 -0
  49. package/dist/{chunk-X6W5FFH6.cjs → chunk-D2BB47NB.cjs} +8 -8
  50. package/dist/chunk-DTSROJ5J.mjs +367 -0
  51. package/dist/{chunk-YC6V7PWE.cjs → chunk-DZ5ZVB2K.cjs} +1 -1
  52. package/dist/{chunk-DBNKI4NF.cjs → chunk-ECKF2BAM.cjs} +6 -2
  53. package/dist/{chunk-Q3VLETLE.mjs → chunk-EWET4D2Y.mjs} +1 -1
  54. package/dist/{chunk-HUMR6LSU.mjs → chunk-F5QO4FNE.mjs} +1 -1
  55. package/dist/{chunk-XBML5KMG.cjs → chunk-FO427P6I.cjs} +22 -12
  56. package/dist/{chunk-SAZVVAJH.mjs → chunk-GQRWBCWK.mjs} +8 -5
  57. package/dist/{chunk-F6Z3Y5KL.mjs → chunk-HOXTWRGB.mjs} +1 -1
  58. package/dist/{chunk-3BHT4WMP.cjs → chunk-JNUWCDTF.cjs} +6 -6
  59. package/dist/{chunk-73MC7ZL6.cjs → chunk-JZVADIOD.cjs} +2 -2
  60. package/dist/{chunk-OMVAU7NT.cjs → chunk-KIIMAWOJ.cjs} +11 -1
  61. package/dist/{chunk-43FMW62B.mjs → chunk-KMTGADN3.mjs} +28 -0
  62. package/dist/{chunk-6ETPZTJI.mjs → chunk-LSZAVSGY.mjs} +116 -55
  63. package/dist/{chunk-HMIJDL7S.mjs → chunk-MKYBIIAQ.mjs} +30 -5
  64. package/dist/{chunk-RU3M2FIK.cjs → chunk-MRMI32SN.cjs} +87 -369
  65. package/dist/{chunk-7L5V3KQO.cjs → chunk-N2NAS2AM.cjs} +2 -2
  66. package/dist/{chunk-ICUQICNC.cjs → chunk-NMHWYWDR.cjs} +654 -481
  67. package/dist/{chunk-G5RT7EXW.mjs → chunk-O6I6VWKK.mjs} +20 -5
  68. package/dist/{chunk-PDOCJ6RY.mjs → chunk-O6WAEAX3.mjs} +1 -1
  69. package/dist/{chunk-6DU6UFUE.mjs → chunk-OHLSEQ57.mjs} +16 -8
  70. package/dist/{chunk-3PXS2MHU.mjs → chunk-OO7GXVSR.mjs} +1 -1
  71. package/dist/chunk-PTZ2TVNE.cjs +178 -0
  72. package/dist/{chunk-6WCPV6G2.mjs → chunk-Q2KB32T4.mjs} +1 -1
  73. package/dist/{chunk-XCACDAZZ.cjs → chunk-S6VYG6XU.cjs} +23 -8
  74. package/dist/{chunk-VFQT3LAO.cjs → chunk-SDOTRX3V.cjs} +5 -5
  75. package/dist/{chunk-BMWDEBXO.cjs → chunk-SHLXACIO.cjs} +31 -3
  76. package/dist/{chunk-22LTEMGQ.mjs → chunk-T4OGRVNS.mjs} +13 -3
  77. package/dist/{chunk-ZXGAFZDO.cjs → chunk-T5OJPTVN.cjs} +2 -2
  78. package/dist/{chunk-VZJR7UTG.cjs → chunk-TE2G5ION.cjs} +2 -2
  79. package/dist/chunk-UH6QN5NL.mjs +178 -0
  80. package/dist/{chunk-F7JZENPF.cjs → chunk-UVW64BCB.cjs} +38 -30
  81. package/dist/{chunk-OKZUAXHF.mjs → chunk-VILIPRS6.mjs} +1 -1
  82. package/dist/{chunk-3UH7MRCP.cjs → chunk-VQLJWDVW.cjs} +13 -13
  83. package/dist/{chunk-VPTDD5XF.cjs → chunk-WBKEZXWE.cjs} +5 -0
  84. package/dist/{chunk-EJQT6KZN.cjs → chunk-WC5UV2HQ.cjs} +2 -2
  85. package/dist/{chunk-YULD7ICZ.mjs → chunk-WZ77PUAM.mjs} +1 -1
  86. package/dist/{chunk-C35ZBVRD.mjs → chunk-YWMZUGIS.mjs} +6 -2
  87. package/dist/{chunk-Y7RKTKYI.mjs → chunk-ZMMBIVQM.mjs} +10 -0
  88. package/dist/{chunk-ULAWS2PA.cjs → chunk-ZWM5KGAA.cjs} +6 -6
  89. package/dist/{client-plugins-CvIslxWi.d.mts → client-plugins-C3mK9Pol.d.mts} +98 -5
  90. package/dist/{client-plugins-HIyulDym.d.ts → client-plugins-r1mOtSC1.d.ts} +98 -5
  91. package/dist/client-plugins.d.mts +1 -1
  92. package/dist/client-plugins.d.ts +1 -1
  93. package/dist/client.d.mts +5 -5
  94. package/dist/client.d.ts +5 -5
  95. package/dist/config.d.mts +1 -1
  96. package/dist/config.d.ts +1 -1
  97. package/dist/{devtools-EE5RIBTH.mjs → devtools-ERIKFEXX.mjs} +9 -8
  98. package/dist/{devtools-EAUY43BS.cjs → devtools-JZJJY5CK.cjs} +10 -9
  99. package/dist/docs.cjs +12 -11
  100. package/dist/docs.d.mts +2 -2
  101. package/dist/docs.d.ts +2 -2
  102. package/dist/docs.mjs +11 -10
  103. package/dist/image/server.cjs +3 -3
  104. package/dist/image/server.mjs +2 -2
  105. package/dist/image/sharp.cjs +10 -10
  106. package/dist/image/sharp.mjs +2 -2
  107. package/dist/index.cjs +39 -35
  108. package/dist/index.d.mts +13 -13
  109. package/dist/index.d.ts +13 -13
  110. package/dist/index.mjs +38 -34
  111. package/dist/integrations.cjs +7 -3
  112. package/dist/integrations.d.mts +1 -1
  113. package/dist/integrations.d.ts +1 -1
  114. package/dist/integrations.mjs +6 -2
  115. package/dist/internal/app-markdown-runtime.cjs +3 -3
  116. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  117. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  118. package/dist/internal/app-markdown-runtime.mjs +2 -2
  119. package/dist/internal/build-runtime.cjs +27 -25
  120. package/dist/internal/build-runtime.d.mts +3 -3
  121. package/dist/internal/build-runtime.d.ts +3 -3
  122. package/dist/internal/build-runtime.mjs +26 -24
  123. package/dist/internal/cli-runtime.cjs +14 -13
  124. package/dist/internal/cli-runtime.mjs +13 -12
  125. package/dist/internal/client-error-overlay.cjs +4 -4
  126. package/dist/internal/client-error-overlay.mjs +1 -1
  127. package/dist/internal/compression-runtime.d.mts +1 -1
  128. package/dist/internal/compression-runtime.d.ts +1 -1
  129. package/dist/internal/config-runtime.cjs +10 -9
  130. package/dist/internal/config-runtime.d.mts +2 -2
  131. package/dist/internal/config-runtime.d.ts +2 -2
  132. package/dist/internal/config-runtime.mjs +9 -8
  133. package/dist/internal/isolated-boundary.cjs +2 -2
  134. package/dist/internal/isolated-boundary.d.mts +0 -1
  135. package/dist/internal/isolated-boundary.d.ts +0 -1
  136. package/dist/internal/isolated-boundary.mjs +1 -1
  137. package/dist/internal/metadata-image-runtime.cjs +3 -3
  138. package/dist/internal/metadata-image-runtime.mjs +2 -2
  139. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  140. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  141. package/dist/internal/production-runtime.cjs +23 -9
  142. package/dist/internal/production-runtime.d.mts +67 -27
  143. package/dist/internal/production-runtime.d.ts +67 -27
  144. package/dist/internal/production-runtime.mjs +26 -12
  145. package/dist/{layers-BRQF5ETU.mjs → layers-UTB43B7A.mjs} +1 -1
  146. package/dist/layers-VUWIOFEO.cjs +18 -0
  147. package/dist/markdown.cjs +1 -1
  148. package/dist/markdown.d.mts +1 -1
  149. package/dist/markdown.d.ts +1 -1
  150. package/dist/markdown.mjs +1 -1
  151. package/dist/middleware.cjs +6 -6
  152. package/dist/middleware.d.mts +3 -3
  153. package/dist/middleware.d.ts +3 -3
  154. package/dist/middleware.mjs +5 -5
  155. package/dist/navigation.d.mts +4 -4
  156. package/dist/navigation.d.ts +4 -4
  157. package/dist/{nitro-OVPLKPE2.cjs → nitro-7F65EZZS.cjs} +3 -3
  158. package/dist/{nitro-MXRDCXWZ.mjs → nitro-MPZJGPXK.mjs} +2 -2
  159. package/dist/plugin.cjs +23 -21
  160. package/dist/plugin.d.mts +1 -1
  161. package/dist/plugin.d.ts +1 -1
  162. package/dist/plugin.mjs +22 -20
  163. package/dist/{production-runtime-0sRnuYc-.d.mts → production-runtime-CCeVZXst.d.mts} +1 -1
  164. package/dist/{production-runtime-Crq6CJ-2.d.ts → production-runtime-DPnsggY3.d.ts} +1 -1
  165. package/dist/{render-plan-gs9GGPzw.d.mts → render-plan-BuGaPFe6.d.mts} +1 -1
  166. package/dist/{render-plan-8ozZh2Qv.d.ts → render-plan-Cw4f5E_R.d.ts} +1 -1
  167. package/dist/renderer/react/server.cjs +3 -3
  168. package/dist/renderer/react/server.mjs +1 -1
  169. package/dist/renderer-client.d.mts +3 -3
  170. package/dist/renderer-client.d.ts +3 -3
  171. package/dist/{request-B5G8rLBH.d.ts → request-Bkg-hERy.d.ts} +1 -1
  172. package/dist/{request-fkhiynXe.d.mts → request-CsGARcAw.d.mts} +1 -1
  173. package/dist/request.d.mts +2 -2
  174. package/dist/request.d.ts +2 -2
  175. package/dist/{route-rendering-lS5nUMua.d.ts → route-rendering-BUZMH_64.d.ts} +1 -1
  176. package/dist/{route-rendering-CLnS7AZj.d.mts → route-rendering-f11yh5dp.d.mts} +1 -1
  177. package/dist/{router-4iuiYnOW.d.ts → router-B8CR9GbD.d.ts} +1 -1
  178. package/dist/{router-ifU8Dui1.d.mts → router-Cp6yRE8A.d.mts} +1 -1
  179. package/dist/routes.d.mts +1 -1
  180. package/dist/routes.d.ts +1 -1
  181. package/dist/runtime-CAEv36S_.d.mts +69 -0
  182. package/dist/runtime-CQVsT330.d.ts +69 -0
  183. package/dist/server-action-security.cjs +3 -3
  184. package/dist/server-action-security.mjs +2 -2
  185. package/dist/server-fn.cjs +4 -4
  186. package/dist/server-fn.mjs +3 -3
  187. package/dist/server-plugins.d.mts +2 -2
  188. package/dist/server-plugins.d.ts +2 -2
  189. package/dist/server-query.cjs +5 -5
  190. package/dist/server-query.mjs +4 -4
  191. package/dist/server.cjs +42 -40
  192. package/dist/server.d.mts +7 -7
  193. package/dist/server.d.ts +7 -7
  194. package/dist/server.mjs +25 -23
  195. package/dist/{spa-router-DaJk5Re4.d.ts → spa-router-BuciWGCZ.d.ts} +2 -2
  196. package/dist/{spa-router-Bq7VCOwx.d.mts → spa-router-DwbqGkGj.d.mts} +2 -2
  197. package/dist/testing.cjs +8 -8
  198. package/dist/testing.d.mts +1 -1
  199. package/dist/testing.d.ts +1 -1
  200. package/dist/testing.mjs +6 -6
  201. package/dist/{utils-XJn0c9bj.d.mts → utils-B9V0S_yL.d.mts} +1 -1
  202. package/dist/{utils-BXLmFsVR.d.ts → utils-CaoWKtYM.d.ts} +1 -1
  203. package/dist/version.cjs +2 -2
  204. package/dist/version.mjs +1 -1
  205. package/dist/vite.cjs +23 -21
  206. package/dist/vite.d.mts +1 -1
  207. package/dist/vite.d.ts +1 -1
  208. package/dist/vite.mjs +22 -20
  209. package/dist/workflows.cjs +3 -3
  210. package/dist/workflows.mjs +2 -2
  211. package/package.json +1 -1
  212. package/dist/layers-4PNE2HOY.cjs +0 -18
  213. package/dist/{chunk-2F2ER724.cjs → chunk-BPMATOP2.cjs} +2 -2
  214. package/dist/{chunk-IHNMMXHV.mjs → chunk-OTC5BDGO.mjs} +3 -3
@@ -1,13 +1,11 @@
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 _chunk4WQ6PGSJcjs = require('./chunk-4WQ6PGSJ.cjs');
3
4
 
4
5
 
5
6
  var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
6
7
 
7
8
 
8
- var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
9
-
10
-
11
9
 
12
10
  var _chunkFJ3M4CUXcjs = require('./chunk-FJ3M4CUX.cjs');
13
11
 
@@ -17,348 +15,6 @@ var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
17
15
 
18
16
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
19
17
 
20
- // src/llms-txt.ts
21
- function resolveFarmLlmsTxtConfig(input) {
22
- if (!input) return { enabled: false, include: [], exclude: [], full: false };
23
- if (input === true) return { enabled: true, include: [], exclude: [], full: true };
24
- if (typeof input !== "object") {
25
- throw new TypeError("agent.llmsTxt must be true, false, or an options object.");
26
- }
27
- if (input.enabled === false) return { enabled: false, include: [], exclude: [], full: false };
28
- for (const key of ["title", "summary", "details"]) {
29
- if (input[key] !== void 0 && typeof input[key] !== "string") {
30
- throw new TypeError(`agent.llmsTxt.${key} must be a string.`);
31
- }
32
- }
33
- if (input.full !== void 0 && typeof input.full !== "boolean") {
34
- throw new TypeError("agent.llmsTxt.full must be a boolean.");
35
- }
36
- if (input.revalidate !== void 0 && (typeof input.revalidate !== "number" || !Number.isFinite(input.revalidate) || input.revalidate < 0)) {
37
- throw new TypeError("agent.llmsTxt.revalidate must be a number of seconds.");
38
- }
39
- return {
40
- enabled: true,
41
- ...input.title ? { title: input.title } : {},
42
- ...input.summary ? { summary: input.summary } : {},
43
- ...input.details ? { details: input.details } : {},
44
- include: resolveRoutePatterns(input.include, "include"),
45
- exclude: resolveRoutePatterns(input.exclude, "exclude"),
46
- full: input.full !== false,
47
- ...input.revalidate !== void 0 ? { revalidate: input.revalidate } : {}
48
- };
49
- }
50
- _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmLlmsTxtConfig, "resolveFarmLlmsTxtConfig");
51
- function resolveRoutePatterns(value, key) {
52
- if (value === void 0) return [];
53
- if (!Array.isArray(value)) {
54
- throw new TypeError(`agent.llmsTxt.${key} must be an array of route patterns.`);
55
- }
56
- return value.map((pattern, index) => {
57
- if (typeof pattern !== "string" || !pattern.startsWith("/")) {
58
- throw new TypeError(
59
- `agent.llmsTxt.${key}[${index}] must be a route pattern starting with "/", such as "/docs/[...slug]".`
60
- );
61
- }
62
- return pattern;
63
- });
64
- }
65
- _chunkS3JO3N4Hcjs.__name.call(void 0, resolveRoutePatterns, "resolveRoutePatterns");
66
- function collectFarmLlmsTxtPages(sources, options) {
67
- const include = _nullishCoalesce(options.include, () => ( []));
68
- const exclude = _nullishCoalesce(options.exclude, () => ( []));
69
- const pages = /* @__PURE__ */ new Map();
70
- for (const source of sources) {
71
- const path = source.pattern;
72
- if (path.includes("[") || pages.has(path)) continue;
73
- if (include.length && !include.some((pattern) => _chunkEUV4YR3Vcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
74
- continue;
75
- }
76
- if (exclude.some((pattern) => _chunkEUV4YR3Vcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
77
- if (isMetadataNoIndex(source.metadata)) continue;
78
- const target = _chunkEUV4YR3Vcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? _chunkEUV4YR3Vcjs.getFarmMarkdownMirrorPath.call(void 0, path) : path;
79
- const description = readMetadataString(source.metadata, "description");
80
- pages.set(path, {
81
- path,
82
- title: _nullishCoalesce(readMetadataTitle(source.metadata), () => ( fallbackPageTitle(path))),
83
- url: `${options.origin}${_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, target, options.basePath)}`,
84
- ...description ? { description } : {}
85
- });
86
- }
87
- return [...pages.values()].sort((left, right) => left.path.localeCompare(right.path));
88
- }
89
- _chunkS3JO3N4Hcjs.__name.call(void 0, collectFarmLlmsTxtPages, "collectFarmLlmsTxtPages");
90
- function isMetadataNoIndex(metadata) {
91
- if (!metadata || typeof metadata !== "object") return false;
92
- const robots = metadata.robots;
93
- if (typeof robots === "string") {
94
- return robots.split(",").map((directive) => directive.trim().toLowerCase()).some((directive) => directive === "noindex" || directive === "none");
95
- }
96
- return Boolean(
97
- robots && typeof robots === "object" && robots.index === false
98
- );
99
- }
100
- _chunkS3JO3N4Hcjs.__name.call(void 0, isMetadataNoIndex, "isMetadataNoIndex");
101
- function createFarmDefaultLlmsTxt(options) {
102
- const { config, pages } = options;
103
- const mcp = _nullishCoalesce(options.mcp, () => ( []));
104
- const summary = _nullishCoalesce(config.summary, () => ( readMetadataString(options.rootMetadata, "description")));
105
- return {
106
- title: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(config.title, () => ( readMetadataTitle(options.rootMetadata))), () => ( _optionalChain([pages, 'access', _2 => _2.find, 'call', _3 => _3((page) => page.path === "/"), 'optionalAccess', _4 => _4.title]))), () => ( new URL(options.origin).host)),
107
- ...summary ? { summary } : {},
108
- ...config.details ? { details: config.details } : {},
109
- sections: [
110
- ...pages.length ? [
111
- {
112
- title: "Pages",
113
- links: pages.map(({ title, url, description }) => ({
114
- title,
115
- url,
116
- ...description ? { description } : {}
117
- }))
118
- }
119
- ] : [],
120
- ...mcp.length ? [{ title: "MCP", links: mcp }] : []
121
- ]
122
- };
123
- }
124
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDefaultLlmsTxt, "createFarmDefaultLlmsTxt");
125
- function serializeFarmLlmsTxt(value) {
126
- if (typeof value === "string") {
127
- if (!value.trim()) throw new TypeError("llms.ts returned an empty llms.txt");
128
- return value.endsWith("\n") ? value : `${value}
129
- `;
130
- }
131
- if (!isRecord(value)) {
132
- throw new TypeError("llms.ts must return llms.txt text, an llms.txt object, or a Response");
133
- }
134
- const title = requireText(value.title, "llms.ts must return a non-empty title");
135
- const summary = optionalText(value.summary, "llms.ts summary must be a string");
136
- const details = optionalText(value.details, "llms.ts details must be a string");
137
- if (value.sections !== void 0 && !Array.isArray(value.sections)) {
138
- throw new TypeError("llms.ts sections must be an array");
139
- }
140
- const blocks = [`# ${toSingleLine(title)}`];
141
- if (_optionalChain([summary, 'optionalAccess', _5 => _5.trim, 'call', _6 => _6()])) blocks.push(`> ${toSingleLine(summary)}`);
142
- if (_optionalChain([details, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()])) blocks.push(details.trim());
143
- for (const [sectionIndex, section] of (_nullishCoalesce(value.sections, () => ( []))).entries()) {
144
- if (!isRecord(section)) {
145
- throw new TypeError(`llms.ts section ${sectionIndex} must be an object`);
146
- }
147
- const sectionTitle = requireText(
148
- section.title,
149
- `llms.ts section ${sectionIndex} must include a non-empty title`
150
- );
151
- if (!Array.isArray(section.links)) {
152
- throw new TypeError(`llms.ts section "${sectionTitle}" must include a links array`);
153
- }
154
- const links = section.links.map((link, linkIndex) => {
155
- const where = `llms.ts section "${sectionTitle}" link ${linkIndex}`;
156
- if (!isRecord(link)) throw new TypeError(`${where} must be an object`);
157
- const linkTitle = requireText(link.title, `${where} must include a non-empty title`);
158
- const url = requireText(link.url, `${where} must include a non-empty url`);
159
- const description = optionalText(link.description, `${where} description must be a string`);
160
- return `- [${escapeLinkText(linkTitle)}](${escapeLinkUrl(url)})${_optionalChain([description, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]) ? `: ${toSingleLine(description)}` : ""}`;
161
- });
162
- blocks.push(`## ${toSingleLine(sectionTitle)}`, links.join("\n"));
163
- }
164
- return `${blocks.filter(Boolean).join("\n\n")}
165
- `;
166
- }
167
- _chunkS3JO3N4Hcjs.__name.call(void 0, serializeFarmLlmsTxt, "serializeFarmLlmsTxt");
168
- function createFarmLlmsMarkdownReader(fetchMarkdown) {
169
- return async (url) => {
170
- try {
171
- const response = await fetchMarkdown(
172
- new Request(url, {
173
- headers: { accept: "text/markdown", [_chunkJ63ZH5OQcjs.FARM_INTERNAL_READ_HEADER]: "llms-full" }
174
- })
175
- );
176
- const type = _nullishCoalesce(response.headers.get("content-type"), () => ( ""));
177
- if (!response.ok || !type.toLowerCase().startsWith("text/markdown")) {
178
- await _optionalChain([response, 'access', _11 => _11.body, 'optionalAccess', _12 => _12.cancel, 'call', _13 => _13()]);
179
- return null;
180
- }
181
- return await response.text();
182
- } catch (e) {
183
- return null;
184
- }
185
- };
186
- }
187
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmLlmsMarkdownReader, "createFarmLlmsMarkdownReader");
188
- var FARM_LLMS_FULL_PAGE_TIMEOUT_MS = 3e4;
189
- var LLMS_PAGE_TIMED_OUT = /* @__PURE__ */ Symbol("farm.llms.pageTimedOut");
190
- async function renderFarmLlmsFullTxt(value, options) {
191
- const index = serializeFarmLlmsTxt(value);
192
- if (typeof value === "string") return index;
193
- const llms = value;
194
- const links = [];
195
- const seen = /* @__PURE__ */ new Set();
196
- for (const section of _nullishCoalesce(llms.sections, () => ( []))) {
197
- for (const link of section.links) {
198
- if (seen.has(link.url)) continue;
199
- seen.add(link.url);
200
- links.push(link);
201
- }
202
- }
203
- const pageTimeout = _nullishCoalesce(options.pageTimeout, () => ( FARM_LLMS_FULL_PAGE_TIMEOUT_MS));
204
- const readWithinTimeout = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (url) => {
205
- let timer;
206
- const timedOut = new Promise((resolve) => {
207
- timer = setTimeout(resolve, pageTimeout, LLMS_PAGE_TIMED_OUT);
208
- });
209
- try {
210
- const content = await Promise.race([options.readMarkdown(url), timedOut]);
211
- if (content !== LLMS_PAGE_TIMED_OUT) return content;
212
- _optionalChain([options, 'access', _14 => _14.onIncomplete, 'optionalCall', _15 => _15()]);
213
- return null;
214
- } finally {
215
- clearTimeout(timer);
216
- }
217
- }, "readWithinTimeout");
218
- const contents = await mapWithConcurrency(
219
- links,
220
- _nullishCoalesce(options.concurrency, () => ( 4)),
221
- (link) => shouldInlineLlmsLink(link.url, options.origin) ? readWithinTimeout(link.url) : null
222
- );
223
- const blocks = [`# ${toSingleLine(llms.title)}`];
224
- if (_optionalChain([llms, 'access', _16 => _16.summary, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()])) blocks.push(`> ${toSingleLine(llms.summary)}`);
225
- if (_optionalChain([llms, 'access', _19 => _19.details, 'optionalAccess', _20 => _20.trim, 'call', _21 => _21()])) blocks.push(llms.details.trim());
226
- const pages = links.map((link, index2) => {
227
- const parts = [`## ${toSingleLine(link.title)}`, `URL: ${escapeLinkUrl(link.url)}`];
228
- if (_optionalChain([link, 'access', _22 => _22.description, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()])) parts.push(toSingleLine(link.description));
229
- const content = stripFrontmatter(_nullishCoalesce(contents[index2], () => ( ""))).trim();
230
- if (content) parts.push(content);
231
- return parts.join("\n\n");
232
- });
233
- if (pages.length) blocks.push(pages.join("\n\n---\n\n"));
234
- return `${blocks.join("\n\n")}
235
- `;
236
- }
237
- _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmLlmsFullTxt, "renderFarmLlmsFullTxt");
238
- function createFarmLlmsFullRenderer(options = {}) {
239
- const now = _nullishCoalesce(options.now, () => ( Date.now));
240
- const ttl = (_nullishCoalesce(options.revalidate, () => ( 0))) * 1e3;
241
- const maxEntries = _nullishCoalesce(options.maxEntries, () => ( 16));
242
- const entries = /* @__PURE__ */ new Map();
243
- let queue = Promise.resolve();
244
- const settle = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (body, complete, onSettled) => onSettled ? body.then((value) => (onSettled(complete()), value)) : body, "settle");
245
- return (origin, render, onSettled) => {
246
- const entry = entries.get(origin);
247
- if (entry && entry.expires > now()) return settle(entry.body, entry.complete, onSettled);
248
- entries.delete(origin);
249
- let complete = true;
250
- const body = queue.then(
251
- () => render({
252
- incomplete: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
253
- complete = false;
254
- }, "incomplete")
255
- })
256
- );
257
- queue = body.catch(() => {
258
- });
259
- const pending = { body, expires: Number.POSITIVE_INFINITY, complete: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => complete, "complete") };
260
- entries.set(origin, pending);
261
- if (entries.size > maxEntries) entries.delete(entries.keys().next().value);
262
- body.then(
263
- () => {
264
- if (entries.get(origin) !== pending) return;
265
- if (ttl > 0 && complete) pending.expires = now() + ttl;
266
- else entries.delete(origin);
267
- },
268
- () => {
269
- if (entries.get(origin) === pending) entries.delete(origin);
270
- }
271
- );
272
- return settle(body, pending.complete, onSettled);
273
- };
274
- }
275
- _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmLlmsFullRenderer, "createFarmLlmsFullRenderer");
276
- function stripFrontmatter(markdown) {
277
- const match = /^\uFEFF?---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/.exec(markdown);
278
- return match ? markdown.slice(match[0].length) : markdown;
279
- }
280
- _chunkS3JO3N4Hcjs.__name.call(void 0, stripFrontmatter, "stripFrontmatter");
281
- function shouldInlineLlmsLink(url, origin) {
282
- let target;
283
- try {
284
- target = new URL(url, origin);
285
- } catch (e2) {
286
- return false;
287
- }
288
- return target.origin === origin && !/\/llms(-full)?\.txt$/.test(target.pathname);
289
- }
290
- _chunkS3JO3N4Hcjs.__name.call(void 0, shouldInlineLlmsLink, "shouldInlineLlmsLink");
291
- async function mapWithConcurrency(items, limit, run) {
292
- const results = [];
293
- let next = 0;
294
- const worker = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
295
- while (next < items.length) {
296
- const index = next++;
297
- results[index] = await run(items[index]);
298
- }
299
- }, "worker");
300
- await Promise.all(Array.from({ length: Math.min(Math.max(limit, 1), items.length) }, worker));
301
- return results;
302
- }
303
- _chunkS3JO3N4Hcjs.__name.call(void 0, mapWithConcurrency, "mapWithConcurrency");
304
- function readMetadataTitle(metadata) {
305
- if (!isRecord(metadata)) return void 0;
306
- const { title } = metadata;
307
- if (typeof title === "string") return title.trim() || void 0;
308
- if (isRecord(title)) {
309
- for (const key of ["absolute", "default"]) {
310
- const value = title[key];
311
- if (typeof value === "string" && value.trim()) return value.trim();
312
- }
313
- }
314
- return void 0;
315
- }
316
- _chunkS3JO3N4Hcjs.__name.call(void 0, readMetadataTitle, "readMetadataTitle");
317
- function readMetadataString(metadata, key) {
318
- if (!isRecord(metadata)) return void 0;
319
- const value = metadata[key];
320
- return typeof value === "string" && value.trim() ? value.trim() : void 0;
321
- }
322
- _chunkS3JO3N4Hcjs.__name.call(void 0, readMetadataString, "readMetadataString");
323
- function fallbackPageTitle(path) {
324
- if (path === "/") return "Home";
325
- const segments = path.split("/").filter(Boolean);
326
- const segment = _nullishCoalesce(segments[segments.length - 1], () => ( path));
327
- const words = segment.replace(/[-_]+/g, " ").trim();
328
- return words ? words[0].toUpperCase() + words.slice(1) : path;
329
- }
330
- _chunkS3JO3N4Hcjs.__name.call(void 0, fallbackPageTitle, "fallbackPageTitle");
331
- function toSingleLine(value) {
332
- return value.replace(/\s+/g, " ").trim();
333
- }
334
- _chunkS3JO3N4Hcjs.__name.call(void 0, toSingleLine, "toSingleLine");
335
- function escapeLinkText(value) {
336
- return toSingleLine(value).replace(/[\\[\]]/g, "\\$&");
337
- }
338
- _chunkS3JO3N4Hcjs.__name.call(void 0, escapeLinkText, "escapeLinkText");
339
- function escapeLinkUrl(value) {
340
- return value.trim().replace(
341
- /[\s()<>]/g,
342
- (character) => character === "(" ? "%28" : character === ")" ? "%29" : encodeURIComponent(character)
343
- );
344
- }
345
- _chunkS3JO3N4Hcjs.__name.call(void 0, escapeLinkUrl, "escapeLinkUrl");
346
- function requireText(value, message) {
347
- if (typeof value !== "string" || !value.trim()) throw new TypeError(message);
348
- return value;
349
- }
350
- _chunkS3JO3N4Hcjs.__name.call(void 0, requireText, "requireText");
351
- function optionalText(value, message) {
352
- if (value === void 0) return void 0;
353
- if (typeof value !== "string") throw new TypeError(message);
354
- return value;
355
- }
356
- _chunkS3JO3N4Hcjs.__name.call(void 0, optionalText, "optionalText");
357
- function isRecord(value) {
358
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
359
- }
360
- _chunkS3JO3N4Hcjs.__name.call(void 0, isRecord, "isRecord");
361
-
362
18
  // src/agent-crawlers.ts
363
19
  var FARM_AI_CRAWLERS = {
364
20
  search: [
@@ -456,7 +112,7 @@ function toAbsoluteHttpUrl(value) {
456
112
  try {
457
113
  const url = new URL(String(value));
458
114
  return url.protocol === "https:" || url.protocol === "http:" ? url : null;
459
- } catch (e3) {
115
+ } catch (e) {
460
116
  return null;
461
117
  }
462
118
  }
@@ -489,6 +145,73 @@ function resolveDefaultSitemap(options) {
489
145
  }
490
146
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveDefaultSitemap, "resolveDefaultSitemap");
491
147
 
148
+ // src/agent-sitemap.ts
149
+ function resolveFarmAgentSitemap(input) {
150
+ if (!input) return { enabled: false, include: [], exclude: [] };
151
+ if (input === true) return { enabled: true, include: [], exclude: [] };
152
+ if (typeof input !== "object") {
153
+ throw new TypeError("agent.sitemap must be true, false, or an options object.");
154
+ }
155
+ if (input.enabled === false) return { enabled: false, include: [], exclude: [] };
156
+ return {
157
+ enabled: true,
158
+ include: resolveRoutePatterns(input.include, "include"),
159
+ exclude: resolveRoutePatterns(input.exclude, "exclude")
160
+ };
161
+ }
162
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAgentSitemap, "resolveFarmAgentSitemap");
163
+ function resolveRoutePatterns(value, key) {
164
+ if (value === void 0) return [];
165
+ if (!Array.isArray(value)) {
166
+ throw new TypeError(`agent.sitemap.${key} must be an array of route patterns.`);
167
+ }
168
+ return value.map((pattern, index) => {
169
+ if (typeof pattern !== "string" || !pattern.startsWith("/")) {
170
+ throw new TypeError(
171
+ `agent.sitemap.${key}[${index}] must be a route pattern starting with "/", such as "/admin/[...path]".`
172
+ );
173
+ }
174
+ return pattern;
175
+ });
176
+ }
177
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveRoutePatterns, "resolveRoutePatterns");
178
+ function createFarmDefaultSitemap(sources, options) {
179
+ const { include, exclude } = options.config;
180
+ const base = _nullishCoalesce(toAbsoluteHttpOrigin(options.metadataBase), () => ( options.origin));
181
+ const entries = /* @__PURE__ */ new Map();
182
+ for (const source of sources) {
183
+ const path = source.pattern;
184
+ if (path.includes("[") || path.includes("(") || entries.has(path)) continue;
185
+ if (include.length && !include.some((pattern) => _chunkEUV4YR3Vcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
186
+ continue;
187
+ }
188
+ if (exclude.some((pattern) => _chunkEUV4YR3Vcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
189
+ const module = isRecord(source.module) ? source.module : void 0;
190
+ if (_chunk4WQ6PGSJcjs.isFarmMetadataNoIndex.call(void 0, _optionalChain([module, 'optionalAccess', _2 => _2.metadata]))) continue;
191
+ if (_optionalChain([module, 'optionalAccess', _3 => _3.__farmRouteGuard])) continue;
192
+ entries.set(path, {
193
+ url: new URL(_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, path, options.basePath), base).href,
194
+ ...source.lastModified ? { lastModified: source.lastModified } : {}
195
+ });
196
+ }
197
+ return [...entries.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([, entry]) => entry);
198
+ }
199
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDefaultSitemap, "createFarmDefaultSitemap");
200
+ function toAbsoluteHttpOrigin(value) {
201
+ if (typeof value !== "string" && !(value instanceof URL)) return void 0;
202
+ try {
203
+ const url = new URL(String(value));
204
+ return url.protocol === "https:" || url.protocol === "http:" ? url.origin : void 0;
205
+ } catch (e2) {
206
+ return void 0;
207
+ }
208
+ }
209
+ _chunkS3JO3N4Hcjs.__name.call(void 0, toAbsoluteHttpOrigin, "toAbsoluteHttpOrigin");
210
+ function isRecord(value) {
211
+ return Boolean(value && typeof value === "object");
212
+ }
213
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isRecord, "isRecord");
214
+
492
215
  // src/security.ts
493
216
  function resolveFarmSecurityConfig(input) {
494
217
  if (input === void 0) return { csp: false };
@@ -661,7 +384,7 @@ async function applyFarmCspHashesToHtml(html, security) {
661
384
  _chunkS3JO3N4Hcjs.__name.call(void 0, applyFarmCspHashesToHtml, "applyFarmCspHashesToHtml");
662
385
  function applyFarmCspNonceToResponse(response, security) {
663
386
  if (!security.csp || !security.csp.nonce) return response;
664
- if (!_optionalChain([response, 'access', _25 => _25.headers, 'access', _26 => _26.get, 'call', _27 => _27("content-type"), 'optionalAccess', _28 => _28.toLowerCase, 'call', _29 => _29(), 'access', _30 => _30.includes, 'call', _31 => _31("text/html")])) return response;
387
+ if (!_optionalChain([response, 'access', _4 => _4.headers, 'access', _5 => _5.get, 'call', _6 => _6("content-type"), 'optionalAccess', _7 => _7.toLowerCase, 'call', _8 => _8(), 'access', _9 => _9.includes, 'call', _10 => _10("text/html")])) return response;
665
388
  const nonce = createFarmCspNonce(security);
666
389
  const securityHeader = getFarmSecurityHeader(security, nonce);
667
390
  if (!response.body) {
@@ -883,7 +606,7 @@ var rawTextElements = /* @__PURE__ */ new Map([
883
606
  ["xmp", /<\/xmp(?=[\s/>]|$)/gi]
884
607
  ]);
885
608
  function stampScriptTag(tag, nonce) {
886
- const opening = _optionalChain([tag, 'access', _32 => _32.match, 'call', _33 => _33(/^<script\b/i), 'optionalAccess', _34 => _34[0]]);
609
+ const opening = _optionalChain([tag, 'access', _11 => _11.match, 'call', _12 => _12(/^<script\b/i), 'optionalAccess', _13 => _13[0]]);
887
610
  if (!opening) return tag;
888
611
  const attributes = stripScriptNonceAttribute(tag).slice(opening.length, -1);
889
612
  return `<script nonce="${nonce}"${attributes}>`;
@@ -939,7 +662,7 @@ function collectFarmInlineScriptContents(html) {
939
662
  }
940
663
  _chunkS3JO3N4Hcjs.__name.call(void 0, collectFarmInlineScriptContents, "collectFarmInlineScriptContents");
941
664
  function findScriptTagAttributeRange(tag, expectedName) {
942
- const opening = _optionalChain([tag, 'access', _35 => _35.match, 'call', _36 => _36(/^<script\b/i), 'optionalAccess', _37 => _37[0]]);
665
+ const opening = _optionalChain([tag, 'access', _14 => _14.match, 'call', _15 => _15(/^<script\b/i), 'optionalAccess', _16 => _16[0]]);
943
666
  if (!opening) return void 0;
944
667
  let offset = opening.length;
945
668
  while (offset < tag.length - 1) {
@@ -969,7 +692,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, findScriptTagAttributeRange, "findScriptTa
969
692
  function findRawTextEnd(input, tagName, offset = 0) {
970
693
  const closing = rawTextElements.get(tagName);
971
694
  closing.lastIndex = offset;
972
- return _nullishCoalesce(_optionalChain([closing, 'access', _38 => _38.exec, 'call', _39 => _39(input), 'optionalAccess', _40 => _40.index]), () => ( -1));
695
+ return _nullishCoalesce(_optionalChain([closing, 'access', _17 => _17.exec, 'call', _18 => _18(input), 'optionalAccess', _19 => _19.index]), () => ( -1));
973
696
  }
974
697
  _chunkS3JO3N4Hcjs.__name.call(void 0, findRawTextEnd, "findRawTextEnd");
975
698
  function matchingSuffixLength(input, token) {
@@ -1015,9 +738,9 @@ var MAX_REPORTED_PRELOAD_WARNINGS = 256;
1015
738
  function resolveFarmPerformanceConfig(config) {
1016
739
  return {
1017
740
  preload: {
1018
- mode: _optionalChain([config, 'optionalAccess', _41 => _41.preload, 'optionalAccess', _42 => _42.mode]) === "warn" ? "warn" : "enforce",
1019
- maxImages: normalizeBudget(_optionalChain([config, 'optionalAccess', _43 => _43.preload, 'optionalAccess', _44 => _44.maxImages]), DEFAULT_PRELOAD_CONFIG.maxImages),
1020
- maxFonts: normalizeBudget(_optionalChain([config, 'optionalAccess', _45 => _45.preload, 'optionalAccess', _46 => _46.maxFonts]), DEFAULT_PRELOAD_CONFIG.maxFonts)
741
+ mode: _optionalChain([config, 'optionalAccess', _20 => _20.preload, 'optionalAccess', _21 => _21.mode]) === "warn" ? "warn" : "enforce",
742
+ maxImages: normalizeBudget(_optionalChain([config, 'optionalAccess', _22 => _22.preload, 'optionalAccess', _23 => _23.maxImages]), DEFAULT_PRELOAD_CONFIG.maxImages),
743
+ maxFonts: normalizeBudget(_optionalChain([config, 'optionalAccess', _24 => _24.preload, 'optionalAccess', _25 => _25.maxFonts]), DEFAULT_PRELOAD_CONFIG.maxFonts)
1021
744
  }
1022
745
  };
1023
746
  }
@@ -1031,7 +754,7 @@ function manageFarmHtmlPreloads(html, config) {
1031
754
  index,
1032
755
  kind,
1033
756
  href: readHtmlAttribute(element.value, "href"),
1034
- highPriority: _optionalChain([readHtmlAttribute, 'call', _47 => _47(element.value, "fetchpriority"), 'optionalAccess', _48 => _48.toLowerCase, 'call', _49 => _49()]) === "high"
757
+ highPriority: _optionalChain([readHtmlAttribute, 'call', _26 => _26(element.value, "fetchpriority"), 'optionalAccess', _27 => _27.toLowerCase, 'call', _28 => _28()]) === "high"
1035
758
  }
1036
759
  ] : [];
1037
760
  });
@@ -1055,7 +778,7 @@ function manageFarmLinkHeaderPreloads(value, config) {
1055
778
  index,
1056
779
  kind,
1057
780
  href: getLinkHeaderTarget(link),
1058
- highPriority: _optionalChain([getLinkHeaderParameter, 'call', _50 => _50(link, "fetchpriority"), 'optionalAccess', _51 => _51.toLowerCase, 'call', _52 => _52()]) === "high"
781
+ highPriority: _optionalChain([getLinkHeaderParameter, 'call', _29 => _29(link, "fetchpriority"), 'optionalAccess', _30 => _30.toLowerCase, 'call', _31 => _31()]) === "high"
1059
782
  }
1060
783
  ] : [];
1061
784
  });
@@ -1078,7 +801,7 @@ function manageFarmDocumentPreloads(html, linkHeader, config) {
1078
801
  index,
1079
802
  kind,
1080
803
  href: readHtmlAttribute(element.value, "href"),
1081
- highPriority: _optionalChain([readHtmlAttribute, 'call', _53 => _53(element.value, "fetchpriority"), 'optionalAccess', _54 => _54.toLowerCase, 'call', _55 => _55()]) === "high"
804
+ highPriority: _optionalChain([readHtmlAttribute, 'call', _32 => _32(element.value, "fetchpriority"), 'optionalAccess', _33 => _33.toLowerCase, 'call', _34 => _34()]) === "high"
1082
805
  });
1083
806
  }
1084
807
  for (const [index, link] of links.entries()) {
@@ -1088,7 +811,7 @@ function manageFarmDocumentPreloads(html, linkHeader, config) {
1088
811
  index: headerOffset + index,
1089
812
  kind,
1090
813
  href: getLinkHeaderTarget(link),
1091
- highPriority: _optionalChain([getLinkHeaderParameter, 'call', _56 => _56(link, "fetchpriority"), 'optionalAccess', _57 => _57.toLowerCase, 'call', _58 => _58()]) === "high"
814
+ highPriority: _optionalChain([getLinkHeaderParameter, 'call', _35 => _35(link, "fetchpriority"), 'optionalAccess', _36 => _36.toLowerCase, 'call', _37 => _37()]) === "high"
1092
815
  });
1093
816
  }
1094
817
  const budget = selectPreloadsWithinBudget(candidates, config);
@@ -1169,13 +892,13 @@ function selectPreloadsWithinBudget(candidates, config) {
1169
892
  }
1170
893
  _chunkS3JO3N4Hcjs.__name.call(void 0, selectPreloadsWithinBudget, "selectPreloadsWithinBudget");
1171
894
  function getHtmlPreloadKind(link) {
1172
- const rel = _optionalChain([readHtmlAttribute, 'call', _59 => _59(link, "rel"), 'optionalAccess', _60 => _60.toLowerCase, 'call', _61 => _61(), 'access', _62 => _62.split, 'call', _63 => _63(/\s+/)]) || [];
895
+ const rel = _optionalChain([readHtmlAttribute, 'call', _38 => _38(link, "rel"), 'optionalAccess', _39 => _39.toLowerCase, 'call', _40 => _40(), 'access', _41 => _41.split, 'call', _42 => _42(/\s+/)]) || [];
1173
896
  if (!rel.includes("preload")) return void 0;
1174
897
  return normalizePreloadKind(readHtmlAttribute(link, "as"));
1175
898
  }
1176
899
  _chunkS3JO3N4Hcjs.__name.call(void 0, getHtmlPreloadKind, "getHtmlPreloadKind");
1177
900
  function getLinkHeaderPreloadKind(link) {
1178
- const relations = _nullishCoalesce(_optionalChain([getLinkHeaderParameter, 'call', _64 => _64(link, "rel"), 'optionalAccess', _65 => _65.toLowerCase, 'call', _66 => _66(), 'access', _67 => _67.split, 'call', _68 => _68(/\s+/)]), () => ( []));
901
+ const relations = _nullishCoalesce(_optionalChain([getLinkHeaderParameter, 'call', _43 => _43(link, "rel"), 'optionalAccess', _44 => _44.toLowerCase, 'call', _45 => _45(), 'access', _46 => _46.split, 'call', _47 => _47(/\s+/)]), () => ( []));
1179
902
  if (!relations.includes("preload")) return void 0;
1180
903
  return normalizePreloadKind(getLinkHeaderParameter(link, "as"));
1181
904
  }
@@ -1221,7 +944,7 @@ function splitLinkParameters(value) {
1221
944
  }
1222
945
  _chunkS3JO3N4Hcjs.__name.call(void 0, splitLinkParameters, "splitLinkParameters");
1223
946
  function normalizePreloadKind(value) {
1224
- const normalized = _optionalChain([value, 'optionalAccess', _69 => _69.toLowerCase, 'call', _70 => _70()]);
947
+ const normalized = _optionalChain([value, 'optionalAccess', _48 => _48.toLowerCase, 'call', _49 => _49()]);
1225
948
  return normalized === "image" || normalized === "font" ? normalized : void 0;
1226
949
  }
1227
950
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizePreloadKind, "normalizePreloadKind");
@@ -1229,7 +952,7 @@ function readHtmlAttribute(element, name) {
1229
952
  const match = element.match(
1230
953
  new RegExp(`\\s${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i")
1231
954
  );
1232
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([match, 'optionalAccess', _71 => _71[1]]), () => ( _optionalChain([match, 'optionalAccess', _72 => _72[2]]))), () => ( _optionalChain([match, 'optionalAccess', _73 => _73[3]])));
955
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([match, 'optionalAccess', _50 => _50[1]]), () => ( _optionalChain([match, 'optionalAccess', _51 => _51[2]]))), () => ( _optionalChain([match, 'optionalAccess', _52 => _52[3]])));
1233
956
  }
1234
957
  _chunkS3JO3N4Hcjs.__name.call(void 0, readHtmlAttribute, "readHtmlAttribute");
1235
958
  function findHtmlLinkElements(html) {
@@ -1253,7 +976,7 @@ function findHtmlLinkElements(html) {
1253
976
  }
1254
977
  rawTextTag.lastIndex = start;
1255
978
  const rawText = rawTextTag.exec(lowerHtml);
1256
- if (_optionalChain([rawText, 'optionalAccess', _74 => _74[1]])) {
979
+ if (_optionalChain([rawText, 'optionalAccess', _53 => _53[1]])) {
1257
980
  const openingEnd = findHtmlTagEnd2(html, start);
1258
981
  if (openingEnd === -1) break;
1259
982
  if (rawText[1] === "svg" && html[openingEnd - 2] === "/") {
@@ -1398,7 +1121,7 @@ function applyFarmPreviewRobotsTag(response) {
1398
1121
  try {
1399
1122
  response.headers.set("X-Robots-Tag", FARM_PREVIEW_ROBOTS_TAG);
1400
1123
  return response;
1401
- } catch (e4) {
1124
+ } catch (e3) {
1402
1125
  const headers = new Headers(response.headers);
1403
1126
  headers.set("X-Robots-Tag", FARM_PREVIEW_ROBOTS_TAG);
1404
1127
  return new Response(response.body, {
@@ -1431,9 +1154,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, applyFarmPreviewRobotsTag, "applyFarmPrevi
1431
1154
 
1432
1155
 
1433
1156
 
1434
-
1435
-
1436
-
1437
-
1438
-
1439
- exports.resolveFarmLlmsTxtConfig = resolveFarmLlmsTxtConfig; exports.collectFarmLlmsTxtPages = collectFarmLlmsTxtPages; exports.createFarmDefaultLlmsTxt = createFarmDefaultLlmsTxt; exports.serializeFarmLlmsTxt = serializeFarmLlmsTxt; exports.createFarmLlmsMarkdownReader = createFarmLlmsMarkdownReader; exports.renderFarmLlmsFullTxt = renderFarmLlmsFullTxt; exports.createFarmLlmsFullRenderer = createFarmLlmsFullRenderer; exports.resolveFarmAgentCrawlers = resolveFarmAgentCrawlers; exports.createFarmAgentRobots = createFarmAgentRobots; exports.resolveFarmSecurityConfig = resolveFarmSecurityConfig; exports.getFarmSecurityHeader = getFarmSecurityHeader; exports.createFarmCspNonce = createFarmCspNonce; exports.addFarmCspNonceToScriptTags = addFarmCspNonceToScriptTags; exports.applyFarmCspHashesToHtml = applyFarmCspHashesToHtml; exports.applyFarmCspNonceToResponse = applyFarmCspNonceToResponse; exports.farmCspBlocksFrameworkInlineScripts = farmCspBlocksFrameworkInlineScripts; exports.createFarmCspNonceRewriter = createFarmCspNonceRewriter; exports.resolveFarmPerformanceConfig = resolveFarmPerformanceConfig; exports.manageFarmHtmlPreloads = manageFarmHtmlPreloads; exports.manageFarmLinkHeaderPreloads = manageFarmLinkHeaderPreloads; exports.manageFarmDocumentPreloads = manageFarmDocumentPreloads; exports.reportFarmPreloadWarnings = reportFarmPreloadWarnings; exports.FARM_PREVIEW_ROBOTS_TAG = FARM_PREVIEW_ROBOTS_TAG; exports.resolveFarmNoindexPreviews = resolveFarmNoindexPreviews; exports.applyFarmPreviewRobotsTag = applyFarmPreviewRobotsTag;
1157
+ exports.resolveFarmAgentCrawlers = resolveFarmAgentCrawlers; exports.createFarmAgentRobots = createFarmAgentRobots; exports.resolveFarmAgentSitemap = resolveFarmAgentSitemap; exports.createFarmDefaultSitemap = createFarmDefaultSitemap; exports.resolveFarmSecurityConfig = resolveFarmSecurityConfig; exports.getFarmSecurityHeader = getFarmSecurityHeader; exports.createFarmCspNonce = createFarmCspNonce; exports.addFarmCspNonceToScriptTags = addFarmCspNonceToScriptTags; exports.applyFarmCspHashesToHtml = applyFarmCspHashesToHtml; exports.applyFarmCspNonceToResponse = applyFarmCspNonceToResponse; exports.farmCspBlocksFrameworkInlineScripts = farmCspBlocksFrameworkInlineScripts; exports.createFarmCspNonceRewriter = createFarmCspNonceRewriter; exports.resolveFarmPerformanceConfig = resolveFarmPerformanceConfig; exports.manageFarmHtmlPreloads = manageFarmHtmlPreloads; exports.manageFarmLinkHeaderPreloads = manageFarmLinkHeaderPreloads; exports.manageFarmDocumentPreloads = manageFarmDocumentPreloads; exports.reportFarmPreloadWarnings = reportFarmPreloadWarnings; exports.FARM_PREVIEW_ROBOTS_TAG = FARM_PREVIEW_ROBOTS_TAG; exports.resolveFarmNoindexPreviews = resolveFarmNoindexPreviews; exports.applyFarmPreviewRobotsTag = applyFarmPreviewRobotsTag;
@@ -27,7 +27,7 @@ var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
27
27
  var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
28
28
 
29
29
 
30
- var _chunkFTFYRMQQcjs = require('./chunk-FTFYRMQQ.cjs');
30
+ var _chunkCBJJH36Acjs = require('./chunk-CBJJH36A.cjs');
31
31
 
32
32
 
33
33
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -119,7 +119,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, withTimeout, "withTimeout");
119
119
  var formatSeconds = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`, "formatSeconds");
120
120
  function collectSchemaOwners(config) {
121
121
  const owners = [];
122
- const integrationSchemas = _chunkFTFYRMQQcjs.getIntegrationSchemas.call(void 0, config.integrations);
122
+ const integrationSchemas = _chunkCBJJH36Acjs.getIntegrationSchemas.call(void 0, config.integrations);
123
123
  let integrationClient;
124
124
  for (const [name, schema] of Object.entries(integrationSchemas)) {
125
125
  owners.push({