@farm.js/core 0.1.34 → 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 (282) hide show
  1. package/dist/agent-mcp-BVExL8rZ.d.mts +109 -0
  2. package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
  3. package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
  4. package/dist/agent-mcp-luzfXK-P.d.ts +109 -0
  5. package/dist/agent-runtime.cjs +5 -3
  6. package/dist/agent-runtime.d.mts +4 -5
  7. package/dist/agent-runtime.d.ts +4 -5
  8. package/dist/agent-runtime.mjs +4 -2
  9. package/dist/api/route-manager.cjs +7 -7
  10. package/dist/api/route-manager.d.mts +15 -10
  11. package/dist/api/route-manager.d.ts +15 -10
  12. package/dist/api/route-manager.mjs +6 -6
  13. package/dist/api/runtime.cjs +7 -5
  14. package/dist/api/runtime.d.mts +7 -66
  15. package/dist/api/runtime.d.ts +7 -66
  16. package/dist/api/runtime.mjs +7 -5
  17. package/dist/api.cjs +9 -9
  18. package/dist/api.d.mts +8 -9
  19. package/dist/api.d.ts +8 -9
  20. package/dist/api.mjs +8 -8
  21. package/dist/{app-q4rmZlXK.d.mts → app-BukwkFIu.d.mts} +52 -12
  22. package/dist/{app-DgotYGbq.d.ts → app-Yfa2dsFy.d.ts} +52 -12
  23. package/dist/app-markdown.cjs +6 -6
  24. package/dist/app-markdown.d.mts +5 -6
  25. package/dist/app-markdown.d.ts +5 -6
  26. package/dist/app-markdown.mjs +5 -5
  27. package/dist/{chunk-XV5DJTBX.mjs → chunk-276VJSM6.mjs} +627 -260
  28. package/dist/{chunk-36MK5YCW.cjs → chunk-2YTDKNH3.cjs} +547 -240
  29. package/dist/{chunk-VHANUNEG.mjs → chunk-35GKZR22.mjs} +2 -2
  30. package/dist/{chunk-LR5QSC2P.mjs → chunk-35WV46VL.mjs} +399 -92
  31. package/dist/{chunk-UX5S4JEO.cjs → chunk-42NHY7HW.cjs} +57 -7
  32. package/dist/{chunk-U4PTAHW3.mjs → chunk-4E5AEDKY.mjs} +7 -11
  33. package/dist/{chunk-NGVORZVZ.mjs → chunk-4E5WBPEG.mjs} +73 -351
  34. package/dist/{chunk-AQZFOP7S.mjs → chunk-4GLOOWKE.mjs} +5 -5
  35. package/dist/{chunk-7BT4H4P7.cjs → chunk-4NU4GGTC.cjs} +2 -2
  36. package/dist/{chunk-AGC75XAE.mjs → chunk-4WCZJQUO.mjs} +55 -5
  37. package/dist/chunk-4WQ6PGSJ.cjs +367 -0
  38. package/dist/{chunk-QCFFHV5H.mjs → chunk-4WVJLURN.mjs} +1 -1
  39. package/dist/chunk-6SJ2KJTA.mjs +314 -0
  40. package/dist/chunk-75RZHGLS.cjs +135 -0
  41. package/dist/{chunk-P64MIF5B.cjs → chunk-ADEA7PN3.cjs} +483 -60
  42. package/dist/{chunk-YQVSHTMR.mjs → chunk-AJQTP4OO.mjs} +1 -1
  43. package/dist/{chunk-TA5G2HWD.cjs → chunk-AO6RYU5N.cjs} +31 -28
  44. package/dist/{chunk-MOKLYNHV.cjs → chunk-BO36SELV.cjs} +6 -6
  45. package/dist/{chunk-7Y6ZNFPX.mjs → chunk-BPOF5U4N.mjs} +17 -7
  46. package/dist/{chunk-JHWOVJ3M.mjs → chunk-BUGNQIHC.mjs} +5 -0
  47. package/dist/{chunk-TDFPACVX.cjs → chunk-CBJJH36A.cjs} +50 -25
  48. package/dist/{chunk-VKNHTSAP.cjs → chunk-CGBDNNSM.cjs} +2 -2
  49. package/dist/chunk-CI6E3UOH.cjs +314 -0
  50. package/dist/{chunk-QZCT2CQ4.mjs → chunk-CXEN47J3.mjs} +64 -2
  51. package/dist/{chunk-ATK2R4CH.cjs → chunk-D227TIEN.cjs} +14 -4
  52. package/dist/{chunk-QGYRXFU2.cjs → chunk-D2BB47NB.cjs} +8 -8
  53. package/dist/chunk-DTSROJ5J.mjs +367 -0
  54. package/dist/{chunk-ODBZYBAB.cjs → chunk-DZ5ZVB2K.cjs} +1 -1
  55. package/dist/{chunk-ROUTX2E5.cjs → chunk-ECKF2BAM.cjs} +18 -5
  56. package/dist/{chunk-3LUF2PE2.cjs → chunk-EK4QAEFZ.cjs} +67 -5
  57. package/dist/{chunk-VVBO3QH7.mjs → chunk-ENLZ4R3Y.mjs} +10 -1
  58. package/dist/{chunk-XXJU7FCC.cjs → chunk-EUV4YR3V.cjs} +2 -2
  59. package/dist/{chunk-HR5KPHC2.mjs → chunk-EWET4D2Y.mjs} +1 -1
  60. package/dist/{chunk-PXKIEXZD.mjs → chunk-F5QO4FNE.mjs} +1 -1
  61. package/dist/{chunk-MIDIZJZC.cjs → chunk-FO427P6I.cjs} +22 -12
  62. package/dist/{chunk-AWC4VUZL.cjs → chunk-GQ3Z3IZI.cjs} +14 -14
  63. package/dist/{chunk-JDPAKVS4.mjs → chunk-GQRWBCWK.mjs} +8 -5
  64. package/dist/{chunk-75WGQVQA.cjs → chunk-HITLGIAO.cjs} +10 -1
  65. package/dist/{chunk-WNNYOOIB.mjs → chunk-HOXTWRGB.mjs} +1 -1
  66. package/dist/{chunk-KROWKCUH.cjs → chunk-JGLC4TO3.cjs} +8 -1
  67. package/dist/{chunk-QJ3J6MZT.cjs → chunk-JNUWCDTF.cjs} +8 -8
  68. package/dist/{chunk-BTAG7LI7.cjs → chunk-JZVADIOD.cjs} +2 -2
  69. package/dist/{chunk-EM6SBQKM.cjs → chunk-KIIMAWOJ.cjs} +37 -2
  70. package/dist/{chunk-43FMW62B.mjs → chunk-KMTGADN3.mjs} +28 -0
  71. package/dist/{chunk-GOABMOX3.mjs → chunk-LSZAVSGY.mjs} +468 -45
  72. package/dist/{chunk-2NQQ5H5G.cjs → chunk-M7MKQXAF.cjs} +2 -1
  73. package/dist/{chunk-GNSDTTWZ.mjs → chunk-MKYBIIAQ.mjs} +30 -5
  74. package/dist/{chunk-ZHPHJPQP.cjs → chunk-MRMI32SN.cjs} +88 -366
  75. package/dist/{chunk-7M52YUMY.cjs → chunk-N2NAS2AM.cjs} +2 -2
  76. package/dist/{chunk-SJVKK4JE.cjs → chunk-NMHWYWDR.cjs} +1144 -777
  77. package/dist/chunk-NRDBW4MP.mjs +45 -0
  78. package/dist/{chunk-657WJNRY.mjs → chunk-O6I6VWKK.mjs} +20 -5
  79. package/dist/{chunk-O27L4YAA.mjs → chunk-O6WAEAX3.mjs} +2 -2
  80. package/dist/chunk-OFZUJMCU.mjs +601 -0
  81. package/dist/{chunk-ZKP7C2B6.mjs → chunk-OHLSEQ57.mjs} +22 -13
  82. package/dist/{chunk-X242HVD5.mjs → chunk-OO7GXVSR.mjs} +1 -1
  83. package/dist/chunk-PTZ2TVNE.cjs +178 -0
  84. package/dist/{chunk-3ATMYLLJ.mjs → chunk-Q2KB32T4.mjs} +1 -1
  85. package/dist/{chunk-LHODW25H.mjs → chunk-QORUJDIV.mjs} +2 -2
  86. package/dist/{chunk-UBO4SGH4.mjs → chunk-RHAZ22ZN.mjs} +2 -1
  87. package/dist/{chunk-G26MUMKL.cjs → chunk-S6VYG6XU.cjs} +23 -8
  88. package/dist/{chunk-6VVL3MHY.mjs → chunk-SC2WYWPF.mjs} +1 -1
  89. package/dist/{chunk-MPEYMSCF.cjs → chunk-SDOTRX3V.cjs} +5 -5
  90. package/dist/{chunk-BMWDEBXO.cjs → chunk-SHLXACIO.cjs} +31 -3
  91. package/dist/{chunk-LMJ7VRHZ.mjs → chunk-T4OGRVNS.mjs} +13 -3
  92. package/dist/{chunk-T5CERMEH.cjs → chunk-T5OJPTVN.cjs} +2 -2
  93. package/dist/{chunk-Z2YLTERK.cjs → chunk-TE2G5ION.cjs} +6 -6
  94. package/dist/chunk-UH6QN5NL.mjs +178 -0
  95. package/dist/{chunk-PQDFUSXD.cjs → chunk-UVW64BCB.cjs} +44 -35
  96. package/dist/{chunk-VCCUOMQN.mjs → chunk-VILIPRS6.mjs} +1 -1
  97. package/dist/{chunk-A5FGU2WU.cjs → chunk-VQLJWDVW.cjs} +19 -23
  98. package/dist/{chunk-VPTDD5XF.cjs → chunk-WBKEZXWE.cjs} +5 -0
  99. package/dist/{chunk-K3F2E6GS.cjs → chunk-WC5UV2HQ.cjs} +2 -2
  100. package/dist/chunk-WWFTAUFG.cjs +45 -0
  101. package/dist/{chunk-ZUSJDQ2Q.mjs → chunk-WWIKMBRN.mjs} +1 -1
  102. package/dist/{chunk-3VSKDFAT.mjs → chunk-WZ77PUAM.mjs} +1 -1
  103. package/dist/{chunk-CLJYVZAD.mjs → chunk-XCMCS4DA.mjs} +11 -1
  104. package/dist/{chunk-F6OHXPWR.mjs → chunk-YFILVET3.mjs} +8 -1
  105. package/dist/{chunk-DZ4DTRJ5.cjs → chunk-YKX5BK66.cjs} +7 -7
  106. package/dist/chunk-YSLWRWWP.cjs +601 -0
  107. package/dist/{chunk-LI2LMOLR.mjs → chunk-YWMZUGIS.mjs} +18 -5
  108. package/dist/chunk-ZLAT2CWY.mjs +135 -0
  109. package/dist/{chunk-XF7Q24PF.mjs → chunk-ZMMBIVQM.mjs} +35 -0
  110. package/dist/{chunk-U74I55WB.cjs → chunk-ZWM5KGAA.cjs} +19 -9
  111. package/dist/{client-plugins-CLObcuCq.d.mts → client-plugins-C3mK9Pol.d.mts} +300 -7
  112. package/dist/{client-plugins-DZjHC4Mi.d.ts → client-plugins-r1mOtSC1.d.ts} +300 -7
  113. package/dist/client-plugins.d.mts +4 -5
  114. package/dist/client-plugins.d.ts +4 -5
  115. package/dist/client.cjs +5 -5
  116. package/dist/client.d.mts +8 -9
  117. package/dist/client.d.ts +8 -9
  118. package/dist/client.mjs +4 -4
  119. package/dist/config.d.mts +4 -5
  120. package/dist/config.d.ts +4 -5
  121. package/dist/{devtools-RNXCTS4R.mjs → devtools-ERIKFEXX.mjs} +11 -10
  122. package/dist/{devtools-HU6Y2MNV.cjs → devtools-JZJJY5CK.cjs} +12 -11
  123. package/dist/docs.cjs +15 -14
  124. package/dist/docs.d.mts +41 -4
  125. package/dist/docs.d.ts +41 -4
  126. package/dist/docs.mjs +14 -13
  127. package/dist/i18n/client.d.mts +2 -2
  128. package/dist/i18n/client.d.ts +2 -2
  129. package/dist/i18n/index.d.mts +3 -3
  130. package/dist/i18n/index.d.ts +3 -3
  131. package/dist/i18n/server.d.mts +5 -5
  132. package/dist/i18n/server.d.ts +5 -5
  133. package/dist/image/server.cjs +3 -3
  134. package/dist/image/server.mjs +2 -2
  135. package/dist/image/sharp.cjs +10 -10
  136. package/dist/image/sharp.mjs +2 -2
  137. package/dist/{index-a-8Z5kZU.d.mts → index-BJJfLxJo.d.mts} +2 -2
  138. package/dist/{index-BWVfxIsO.d.ts → index-CwoOP-MW.d.ts} +2 -2
  139. package/dist/index.cjs +51 -44
  140. package/dist/index.d.mts +20 -21
  141. package/dist/index.d.ts +20 -21
  142. package/dist/index.mjs +50 -43
  143. package/dist/integrations.cjs +7 -3
  144. package/dist/integrations.d.mts +4 -5
  145. package/dist/integrations.d.ts +4 -5
  146. package/dist/integrations.mjs +6 -2
  147. package/dist/internal/app-markdown-runtime.cjs +5 -5
  148. package/dist/internal/app-markdown-runtime.d.mts +5 -6
  149. package/dist/internal/app-markdown-runtime.d.ts +5 -6
  150. package/dist/internal/app-markdown-runtime.mjs +4 -4
  151. package/dist/internal/build-runtime.cjs +32 -30
  152. package/dist/internal/build-runtime.d.mts +6 -7
  153. package/dist/internal/build-runtime.d.ts +6 -7
  154. package/dist/internal/build-runtime.mjs +31 -29
  155. package/dist/internal/cli-runtime.cjs +17 -16
  156. package/dist/internal/cli-runtime.mjs +16 -15
  157. package/dist/internal/client-error-overlay.cjs +6 -6
  158. package/dist/internal/client-error-overlay.mjs +2 -2
  159. package/dist/internal/client-runtime.cjs +2 -2
  160. package/dist/internal/client-runtime.mjs +1 -1
  161. package/dist/internal/compression-runtime.d.mts +4 -5
  162. package/dist/internal/compression-runtime.d.ts +4 -5
  163. package/dist/internal/config-runtime.cjs +12 -11
  164. package/dist/internal/config-runtime.d.mts +5 -6
  165. package/dist/internal/config-runtime.d.ts +5 -6
  166. package/dist/internal/config-runtime.mjs +11 -10
  167. package/dist/internal/isolated-boundary.cjs +3 -2
  168. package/dist/internal/isolated-boundary.d.mts +1 -1
  169. package/dist/internal/isolated-boundary.d.ts +1 -1
  170. package/dist/internal/isolated-boundary.mjs +2 -1
  171. package/dist/internal/metadata-image-runtime.cjs +3 -3
  172. package/dist/internal/metadata-image-runtime.mjs +2 -2
  173. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  174. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  175. package/dist/internal/production-runtime.cjs +63 -25
  176. package/dist/internal/production-runtime.d.mts +117 -37
  177. package/dist/internal/production-runtime.d.ts +117 -37
  178. package/dist/internal/production-runtime.mjs +65 -27
  179. package/dist/internal/server-tree.cjs +12 -0
  180. package/dist/internal/server-tree.d.mts +27 -0
  181. package/dist/internal/server-tree.d.ts +27 -0
  182. package/dist/internal/server-tree.mjs +12 -0
  183. package/dist/{layers-BRQF5ETU.mjs → layers-UTB43B7A.mjs} +1 -1
  184. package/dist/layers-VUWIOFEO.cjs +18 -0
  185. package/dist/markdown.cjs +4 -4
  186. package/dist/markdown.d.mts +4 -5
  187. package/dist/markdown.d.ts +4 -5
  188. package/dist/markdown.mjs +3 -3
  189. package/dist/middleware.cjs +7 -7
  190. package/dist/middleware.d.mts +6 -7
  191. package/dist/middleware.d.ts +6 -7
  192. package/dist/middleware.mjs +6 -6
  193. package/dist/navigation.cjs +5 -5
  194. package/dist/navigation.d.mts +7 -8
  195. package/dist/navigation.d.ts +7 -8
  196. package/dist/navigation.mjs +4 -4
  197. package/dist/{nitro-HSAQFXSS.cjs → nitro-7F65EZZS.cjs} +3 -3
  198. package/dist/{nitro-4XGPNIK4.mjs → nitro-MPZJGPXK.mjs} +2 -2
  199. package/dist/{observability-BupkiN0m.d.mts → observability-CoXunYhS.d.mts} +4 -3
  200. package/dist/{observability-BupkiN0m.d.ts → observability-CoXunYhS.d.ts} +4 -3
  201. package/dist/observability.d.mts +1 -1
  202. package/dist/observability.d.ts +1 -1
  203. package/dist/plugin.cjs +28 -26
  204. package/dist/plugin.d.mts +4 -5
  205. package/dist/plugin.d.ts +4 -5
  206. package/dist/plugin.mjs +27 -25
  207. package/dist/{production-runtime-CysZl3EV.d.mts → production-runtime-CCeVZXst.d.mts} +4 -4
  208. package/dist/{production-runtime-BU5ETAK9.d.ts → production-runtime-DPnsggY3.d.ts} +4 -4
  209. package/dist/query/client.cjs +6 -6
  210. package/dist/query/client.mjs +2 -2
  211. package/dist/{render-plan-CKr4ltOd.d.mts → render-plan-BuGaPFe6.d.mts} +1 -1
  212. package/dist/{render-plan-D72O1qm4.d.ts → render-plan-Cw4f5E_R.d.ts} +1 -1
  213. package/dist/renderer/react/server.cjs +10 -4
  214. package/dist/renderer/react/server.d.mts +2 -1
  215. package/dist/renderer/react/server.d.ts +2 -1
  216. package/dist/renderer/react/server.mjs +7 -1
  217. package/dist/renderer-client.cjs +5 -5
  218. package/dist/renderer-client.d.mts +6 -7
  219. package/dist/renderer-client.d.ts +6 -7
  220. package/dist/renderer-client.mjs +2 -2
  221. package/dist/renderer.d.mts +2 -0
  222. package/dist/renderer.d.ts +2 -0
  223. package/dist/{request-DbyOYI2j.d.ts → request-Bkg-hERy.d.ts} +1 -1
  224. package/dist/{request-Be83WafN.d.mts → request-CsGARcAw.d.mts} +1 -1
  225. package/dist/request.d.mts +5 -6
  226. package/dist/request.d.ts +5 -6
  227. package/dist/{resolver-PPEeiJ6M.d.ts → resolver-DadfRL6F.d.ts} +1 -1
  228. package/dist/{resolver-DhW0CqZN.d.mts → resolver-khasx3fU.d.mts} +1 -1
  229. package/dist/{route-rendering-CtVMpV-k.d.ts → route-rendering-BUZMH_64.d.ts} +1 -1
  230. package/dist/{route-rendering-BG56SzvJ.d.mts → route-rendering-f11yh5dp.d.mts} +1 -1
  231. package/dist/{router-D94-SDlW.d.ts → router-B8CR9GbD.d.ts} +1 -1
  232. package/dist/{router-ALUvm8gC.d.mts → router-Cp6yRE8A.d.mts} +1 -1
  233. package/dist/routes.d.mts +4 -5
  234. package/dist/routes.d.ts +4 -5
  235. package/dist/{runtime-BirxPwbZ.d.ts → runtime-BgDQzBiu.d.ts} +2 -2
  236. package/dist/runtime-CAEv36S_.d.mts +69 -0
  237. package/dist/runtime-CQVsT330.d.ts +69 -0
  238. package/dist/{runtime-AOJge4vQ.d.mts → runtime-CV2UCV-5.d.mts} +2 -2
  239. package/dist/server-action-security.cjs +3 -3
  240. package/dist/server-action-security.mjs +2 -2
  241. package/dist/server-fn.cjs +4 -4
  242. package/dist/server-fn.mjs +3 -3
  243. package/dist/server-plugins.d.mts +5 -6
  244. package/dist/server-plugins.d.ts +5 -6
  245. package/dist/server-query.cjs +5 -5
  246. package/dist/server-query.mjs +4 -4
  247. package/dist/server.cjs +47 -45
  248. package/dist/server.d.mts +13 -14
  249. package/dist/server.d.ts +13 -14
  250. package/dist/server.mjs +30 -28
  251. package/dist/{spa-router-CxK3USIz.d.ts → spa-router-BuciWGCZ.d.ts} +3 -3
  252. package/dist/{spa-router-DbxNRKOB.d.mts → spa-router-DwbqGkGj.d.mts} +3 -3
  253. package/dist/testing.cjs +9 -9
  254. package/dist/testing.d.mts +4 -5
  255. package/dist/testing.d.ts +4 -5
  256. package/dist/testing.mjs +7 -7
  257. package/dist/{types-Z0aotQ8w.d.mts → types-CnH8DOqo.d.mts} +1 -1
  258. package/dist/{types-Z0aotQ8w.d.ts → types-CnH8DOqo.d.ts} +1 -1
  259. package/dist/{utils-4wVRcpOw.d.mts → utils-B9V0S_yL.d.mts} +1 -1
  260. package/dist/{utils-311Y8eoK.d.ts → utils-CaoWKtYM.d.ts} +1 -1
  261. package/dist/version.cjs +2 -2
  262. package/dist/version.mjs +1 -1
  263. package/dist/vite.cjs +28 -26
  264. package/dist/vite.d.mts +4 -5
  265. package/dist/vite.d.ts +4 -5
  266. package/dist/vite.mjs +27 -25
  267. package/dist/{workflows-CR9ex-gz.d.ts → workflows-jZ4BcdoZ.d.mts} +1 -1
  268. package/dist/{workflows-CR9ex-gz.d.mts → workflows-jZ4BcdoZ.d.ts} +1 -1
  269. package/dist/workflows.cjs +3 -3
  270. package/dist/workflows.d.mts +1 -1
  271. package/dist/workflows.d.ts +1 -1
  272. package/dist/workflows.mjs +2 -2
  273. package/package.json +9 -1
  274. package/dist/chunk-M64YUMA4.cjs +0 -58
  275. package/dist/chunk-QLQ32WC4.mjs +0 -58
  276. package/dist/layers-4PNE2HOY.cjs +0 -18
  277. package/dist/metadata-2HSU2i_w.d.mts +0 -52
  278. package/dist/metadata-Cjs8JMRM.d.ts +0 -52
  279. package/dist/types-DFbjpjXX.d.mts +0 -105
  280. package/dist/types-DFbjpjXX.d.ts +0 -105
  281. package/dist/{chunk-2F2ER724.cjs → chunk-BPMATOP2.cjs} +2 -2
  282. package/dist/{chunk-IHNMMXHV.mjs → chunk-OTC5BDGO.mjs} +3 -3
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createFarmMarkdownViewResponse,
3
3
  requestAcceptsMarkdown
4
- } from "./chunk-ZUSJDQ2Q.mjs";
4
+ } from "./chunk-WWIKMBRN.mjs";
5
5
  import {
6
6
  __name
7
7
  } from "./chunk-LPEX4YW6.mjs";
@@ -112,6 +112,55 @@ function isFarmMarkdownPublicSourceResponse(response) {
112
112
  return publicSourceResponses.has(response);
113
113
  }
114
114
  __name(isFarmMarkdownPublicSourceResponse, "isFarmMarkdownPublicSourceResponse");
115
+ var ANONYMOUS_REQUEST_HEADERS = /* @__PURE__ */ new Set([
116
+ "accept",
117
+ "accept-encoding",
118
+ "accept-language",
119
+ "cache-control",
120
+ "connection",
121
+ "dnt",
122
+ "forwarded",
123
+ "host",
124
+ "if-match",
125
+ "if-modified-since",
126
+ "if-none-match",
127
+ "if-range",
128
+ "if-unmodified-since",
129
+ "keep-alive",
130
+ "origin",
131
+ "pragma",
132
+ "priority",
133
+ "purpose",
134
+ "range",
135
+ "referer",
136
+ "save-data",
137
+ "sec-gpc",
138
+ "sec-purpose",
139
+ "te",
140
+ "traceparent",
141
+ "tracestate",
142
+ "upgrade-insecure-requests",
143
+ "user-agent",
144
+ "via",
145
+ "x-forwarded-for",
146
+ "x-forwarded-host",
147
+ "x-forwarded-port",
148
+ "x-forwarded-proto",
149
+ "x-real-ip",
150
+ "x-request-id"
151
+ ]);
152
+ function isAnonymousRequestHeader(name) {
153
+ const lower = name.toLowerCase();
154
+ return ANONYMOUS_REQUEST_HEADERS.has(lower) || lower.startsWith("sec-fetch-") || lower.startsWith("sec-ch-");
155
+ }
156
+ __name(isAnonymousRequestHeader, "isAnonymousRequestHeader");
157
+ function hasOnlyAnonymousHeaders(headers) {
158
+ for (const name of headers.keys()) {
159
+ if (!isAnonymousRequestHeader(name)) return false;
160
+ }
161
+ return true;
162
+ }
163
+ __name(hasOnlyAnonymousHeaders, "hasOnlyAnonymousHeaders");
115
164
  async function createFarmMarkdownSourceResponse(options) {
116
165
  if (options.request.method !== "GET" && options.request.method !== "HEAD") {
117
166
  return null;
@@ -129,13 +178,14 @@ async function createFarmMarkdownSourceResponse(options) {
129
178
  if (!source) {
130
179
  return null;
131
180
  }
132
- const anonymous = !options.request.headers.has("cookie") && !options.request.headers.has("authorization");
181
+ const anonymous = hasOnlyAnonymousHeaders(options.request.headers);
133
182
  if (options.renderPage && (hasMarkdownExtension || !anonymous)) {
134
183
  const publicUrl = new URL(url);
135
184
  publicUrl.pathname = targetPathname;
136
- const publicHeaders = new Headers(options.request.headers);
137
- publicHeaders.delete("cookie");
138
- publicHeaders.delete("authorization");
185
+ const publicHeaders = new Headers();
186
+ for (const [name, value] of options.request.headers) {
187
+ if (isAnonymousRequestHeader(name)) publicHeaders.append(name, value);
188
+ }
139
189
  publicHeaders.set("accept", "text/markdown");
140
190
  const publicResponse = await options.renderPage(
141
191
  new Request(publicUrl, {
@@ -0,0 +1,367 @@
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
+
3
+
4
+
5
+ var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
6
+
7
+
8
+ var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
9
+
10
+
11
+ var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
12
+
13
+
14
+ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
15
+
16
+ // src/llms-txt.ts
17
+ function resolveFarmLlmsTxtConfig(input) {
18
+ if (!input) return { enabled: false, include: [], exclude: [], full: false };
19
+ if (input === true) return { enabled: true, include: [], exclude: [], full: true };
20
+ if (typeof input !== "object") {
21
+ throw new TypeError("agent.llmsTxt must be true, false, or an options object.");
22
+ }
23
+ if (input.enabled === false) return { enabled: false, include: [], exclude: [], full: false };
24
+ for (const key of ["title", "summary", "details"]) {
25
+ if (input[key] !== void 0 && typeof input[key] !== "string") {
26
+ throw new TypeError(`agent.llmsTxt.${key} must be a string.`);
27
+ }
28
+ }
29
+ if (input.full !== void 0 && typeof input.full !== "boolean") {
30
+ throw new TypeError("agent.llmsTxt.full must be a boolean.");
31
+ }
32
+ if (input.revalidate !== void 0 && (typeof input.revalidate !== "number" || !Number.isFinite(input.revalidate) || input.revalidate < 0)) {
33
+ throw new TypeError("agent.llmsTxt.revalidate must be a number of seconds.");
34
+ }
35
+ return {
36
+ enabled: true,
37
+ ...input.title ? { title: input.title } : {},
38
+ ...input.summary ? { summary: input.summary } : {},
39
+ ...input.details ? { details: input.details } : {},
40
+ include: resolveRoutePatterns(input.include, "include"),
41
+ exclude: resolveRoutePatterns(input.exclude, "exclude"),
42
+ full: input.full !== false,
43
+ ...input.revalidate !== void 0 ? { revalidate: input.revalidate } : {}
44
+ };
45
+ }
46
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmLlmsTxtConfig, "resolveFarmLlmsTxtConfig");
47
+ function resolveRoutePatterns(value, key) {
48
+ if (value === void 0) return [];
49
+ if (!Array.isArray(value)) {
50
+ throw new TypeError(`agent.llmsTxt.${key} must be an array of route patterns.`);
51
+ }
52
+ return value.map((pattern, index) => {
53
+ if (typeof pattern !== "string" || !pattern.startsWith("/")) {
54
+ throw new TypeError(
55
+ `agent.llmsTxt.${key}[${index}] must be a route pattern starting with "/", such as "/docs/[...slug]".`
56
+ );
57
+ }
58
+ return pattern;
59
+ });
60
+ }
61
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveRoutePatterns, "resolveRoutePatterns");
62
+ function collectFarmLlmsTxtPages(sources, options) {
63
+ const include = _nullishCoalesce(options.include, () => ( []));
64
+ const exclude = _nullishCoalesce(options.exclude, () => ( []));
65
+ const pages = /* @__PURE__ */ new Map();
66
+ for (const source of sources) {
67
+ const path = source.pattern;
68
+ if (path.includes("[") || pages.has(path)) continue;
69
+ if (include.length && !include.some((pattern) => _chunkEUV4YR3Vcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
70
+ continue;
71
+ }
72
+ if (exclude.some((pattern) => _chunkEUV4YR3Vcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
73
+ if (isFarmMetadataNoIndex(source.metadata)) continue;
74
+ const target = _chunkEUV4YR3Vcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? _chunkEUV4YR3Vcjs.getFarmMarkdownMirrorPath.call(void 0, path) : path;
75
+ const description = readMetadataString(source.metadata, "description");
76
+ pages.set(path, {
77
+ path,
78
+ title: _nullishCoalesce(readMetadataTitle(source.metadata), () => ( fallbackPageTitle(path))),
79
+ url: `${options.origin}${_chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, target, options.basePath)}`,
80
+ ...description ? { description } : {}
81
+ });
82
+ }
83
+ return [...pages.values()].sort((left, right) => left.path.localeCompare(right.path));
84
+ }
85
+ _chunkS3JO3N4Hcjs.__name.call(void 0, collectFarmLlmsTxtPages, "collectFarmLlmsTxtPages");
86
+ function isFarmMetadataNoIndex(metadata) {
87
+ if (!metadata || typeof metadata !== "object") return false;
88
+ const robots = metadata.robots;
89
+ if (typeof robots === "string") {
90
+ return robots.split(",").map((directive) => directive.trim().toLowerCase()).some((directive) => directive === "noindex" || directive === "none");
91
+ }
92
+ return Boolean(
93
+ robots && typeof robots === "object" && robots.index === false
94
+ );
95
+ }
96
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmMetadataNoIndex, "isFarmMetadataNoIndex");
97
+ function createFarmDefaultLlmsTxt(options) {
98
+ const { config, pages } = options;
99
+ const mcp = _nullishCoalesce(options.mcp, () => ( []));
100
+ const summary = _nullishCoalesce(config.summary, () => ( readMetadataString(options.rootMetadata, "description")));
101
+ return {
102
+ title: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(config.title, () => ( readMetadataTitle(options.rootMetadata))), () => ( _optionalChain([pages, 'access', _ => _.find, 'call', _2 => _2((page) => page.path === "/"), 'optionalAccess', _3 => _3.title]))), () => ( new URL(options.origin).host)),
103
+ ...summary ? { summary } : {},
104
+ ...config.details ? { details: config.details } : {},
105
+ sections: [
106
+ ...pages.length ? [
107
+ {
108
+ title: "Pages",
109
+ links: pages.map(({ title, url, description }) => ({
110
+ title,
111
+ url,
112
+ ...description ? { description } : {}
113
+ }))
114
+ }
115
+ ] : [],
116
+ ...mcp.length ? [{ title: "MCP", links: mcp }] : []
117
+ ]
118
+ };
119
+ }
120
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDefaultLlmsTxt, "createFarmDefaultLlmsTxt");
121
+ function serializeFarmLlmsTxt(value) {
122
+ if (typeof value === "string") {
123
+ if (!value.trim()) throw new TypeError("llms.ts returned an empty llms.txt");
124
+ return value.endsWith("\n") ? value : `${value}
125
+ `;
126
+ }
127
+ if (!isRecord(value)) {
128
+ throw new TypeError("llms.ts must return llms.txt text, an llms.txt object, or a Response");
129
+ }
130
+ const title = requireText(value.title, "llms.ts must return a non-empty title");
131
+ const summary = optionalText(value.summary, "llms.ts summary must be a string");
132
+ const details = optionalText(value.details, "llms.ts details must be a string");
133
+ if (value.sections !== void 0 && !Array.isArray(value.sections)) {
134
+ throw new TypeError("llms.ts sections must be an array");
135
+ }
136
+ const blocks = [`# ${toSingleLine(title)}`];
137
+ if (_optionalChain([summary, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5()])) blocks.push(`> ${toSingleLine(summary)}`);
138
+ if (_optionalChain([details, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()])) blocks.push(details.trim());
139
+ for (const [sectionIndex, section] of (_nullishCoalesce(value.sections, () => ( []))).entries()) {
140
+ if (!isRecord(section)) {
141
+ throw new TypeError(`llms.ts section ${sectionIndex} must be an object`);
142
+ }
143
+ const sectionTitle = requireText(
144
+ section.title,
145
+ `llms.ts section ${sectionIndex} must include a non-empty title`
146
+ );
147
+ if (!Array.isArray(section.links)) {
148
+ throw new TypeError(`llms.ts section "${sectionTitle}" must include a links array`);
149
+ }
150
+ const links = section.links.map((link, linkIndex) => {
151
+ const where = `llms.ts section "${sectionTitle}" link ${linkIndex}`;
152
+ if (!isRecord(link)) throw new TypeError(`${where} must be an object`);
153
+ const linkTitle = requireText(link.title, `${where} must include a non-empty title`);
154
+ const url = requireText(link.url, `${where} must include a non-empty url`);
155
+ const description = optionalText(link.description, `${where} description must be a string`);
156
+ return `- [${escapeLinkText(linkTitle)}](${escapeLinkUrl(url)})${_optionalChain([description, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) ? `: ${toSingleLine(description)}` : ""}`;
157
+ });
158
+ blocks.push(`## ${toSingleLine(sectionTitle)}`, links.join("\n"));
159
+ }
160
+ return `${blocks.filter(Boolean).join("\n\n")}
161
+ `;
162
+ }
163
+ _chunkS3JO3N4Hcjs.__name.call(void 0, serializeFarmLlmsTxt, "serializeFarmLlmsTxt");
164
+ function createFarmLlmsMarkdownReader(fetchMarkdown) {
165
+ return async (url) => {
166
+ try {
167
+ const response = await fetchMarkdown(
168
+ new Request(url, {
169
+ headers: { accept: "text/markdown", [_chunkJ63ZH5OQcjs.FARM_INTERNAL_READ_HEADER]: "llms-full" }
170
+ })
171
+ );
172
+ const type = _nullishCoalesce(response.headers.get("content-type"), () => ( ""));
173
+ if (!response.ok || !type.toLowerCase().startsWith("text/markdown")) {
174
+ await _optionalChain([response, 'access', _10 => _10.body, 'optionalAccess', _11 => _11.cancel, 'call', _12 => _12()]);
175
+ return null;
176
+ }
177
+ return await response.text();
178
+ } catch (e) {
179
+ return null;
180
+ }
181
+ };
182
+ }
183
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmLlmsMarkdownReader, "createFarmLlmsMarkdownReader");
184
+ var FARM_LLMS_FULL_PAGE_TIMEOUT_MS = 3e4;
185
+ var LLMS_PAGE_TIMED_OUT = /* @__PURE__ */ Symbol("farm.llms.pageTimedOut");
186
+ async function renderFarmLlmsFullTxt(value, options) {
187
+ const index = serializeFarmLlmsTxt(value);
188
+ if (typeof value === "string") return index;
189
+ const llms = value;
190
+ const links = [];
191
+ const seen = /* @__PURE__ */ new Set();
192
+ for (const section of _nullishCoalesce(llms.sections, () => ( []))) {
193
+ for (const link of section.links) {
194
+ if (seen.has(link.url)) continue;
195
+ seen.add(link.url);
196
+ links.push(link);
197
+ }
198
+ }
199
+ const pageTimeout = _nullishCoalesce(options.pageTimeout, () => ( FARM_LLMS_FULL_PAGE_TIMEOUT_MS));
200
+ const readWithinTimeout = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (url) => {
201
+ let timer;
202
+ const timedOut = new Promise((resolve) => {
203
+ timer = setTimeout(resolve, pageTimeout, LLMS_PAGE_TIMED_OUT);
204
+ });
205
+ try {
206
+ const content = await Promise.race([options.readMarkdown(url), timedOut]);
207
+ if (content !== LLMS_PAGE_TIMED_OUT) return content;
208
+ _optionalChain([options, 'access', _13 => _13.onIncomplete, 'optionalCall', _14 => _14()]);
209
+ return null;
210
+ } finally {
211
+ clearTimeout(timer);
212
+ }
213
+ }, "readWithinTimeout");
214
+ const contents = await mapWithConcurrency(
215
+ links,
216
+ _nullishCoalesce(options.concurrency, () => ( 4)),
217
+ (link) => shouldInlineLlmsLink(link.url, options.origin) ? readWithinTimeout(link.url) : null
218
+ );
219
+ const blocks = [`# ${toSingleLine(llms.title)}`];
220
+ if (_optionalChain([llms, 'access', _15 => _15.summary, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()])) blocks.push(`> ${toSingleLine(llms.summary)}`);
221
+ if (_optionalChain([llms, 'access', _18 => _18.details, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()])) blocks.push(llms.details.trim());
222
+ const pages = links.map((link, index2) => {
223
+ const parts = [`## ${toSingleLine(link.title)}`, `URL: ${escapeLinkUrl(link.url)}`];
224
+ if (_optionalChain([link, 'access', _21 => _21.description, 'optionalAccess', _22 => _22.trim, 'call', _23 => _23()])) parts.push(toSingleLine(link.description));
225
+ const content = stripFrontmatter(_nullishCoalesce(contents[index2], () => ( ""))).trim();
226
+ if (content) parts.push(content);
227
+ return parts.join("\n\n");
228
+ });
229
+ if (pages.length) blocks.push(pages.join("\n\n---\n\n"));
230
+ return `${blocks.join("\n\n")}
231
+ `;
232
+ }
233
+ _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmLlmsFullTxt, "renderFarmLlmsFullTxt");
234
+ function createFarmLlmsFullRenderer(options = {}) {
235
+ const now = _nullishCoalesce(options.now, () => ( Date.now));
236
+ const ttl = (_nullishCoalesce(options.revalidate, () => ( 0))) * 1e3;
237
+ const maxEntries = _nullishCoalesce(options.maxEntries, () => ( 16));
238
+ const entries = /* @__PURE__ */ new Map();
239
+ let queue = Promise.resolve();
240
+ const settle = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (body, complete, onSettled) => onSettled ? body.then((value) => (onSettled(complete()), value)) : body, "settle");
241
+ return (origin, render, onSettled) => {
242
+ const entry = entries.get(origin);
243
+ if (entry && entry.expires > now()) return settle(entry.body, entry.complete, onSettled);
244
+ entries.delete(origin);
245
+ let complete = true;
246
+ const body = queue.then(
247
+ () => render({
248
+ incomplete: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
249
+ complete = false;
250
+ }, "incomplete")
251
+ })
252
+ );
253
+ queue = body.catch(() => {
254
+ });
255
+ const pending = { body, expires: Number.POSITIVE_INFINITY, complete: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => complete, "complete") };
256
+ entries.set(origin, pending);
257
+ if (entries.size > maxEntries) entries.delete(entries.keys().next().value);
258
+ body.then(
259
+ () => {
260
+ if (entries.get(origin) !== pending) return;
261
+ if (ttl > 0 && complete) pending.expires = now() + ttl;
262
+ else entries.delete(origin);
263
+ },
264
+ () => {
265
+ if (entries.get(origin) === pending) entries.delete(origin);
266
+ }
267
+ );
268
+ return settle(body, pending.complete, onSettled);
269
+ };
270
+ }
271
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmLlmsFullRenderer, "createFarmLlmsFullRenderer");
272
+ function stripFrontmatter(markdown) {
273
+ const match = /^\uFEFF?---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/.exec(markdown);
274
+ return match ? markdown.slice(match[0].length) : markdown;
275
+ }
276
+ _chunkS3JO3N4Hcjs.__name.call(void 0, stripFrontmatter, "stripFrontmatter");
277
+ function shouldInlineLlmsLink(url, origin) {
278
+ let target;
279
+ try {
280
+ target = new URL(url, origin);
281
+ } catch (e2) {
282
+ return false;
283
+ }
284
+ return target.origin === origin && !/\/llms(-full)?\.txt$/.test(target.pathname);
285
+ }
286
+ _chunkS3JO3N4Hcjs.__name.call(void 0, shouldInlineLlmsLink, "shouldInlineLlmsLink");
287
+ async function mapWithConcurrency(items, limit, run) {
288
+ const results = [];
289
+ let next = 0;
290
+ const worker = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
291
+ while (next < items.length) {
292
+ const index = next++;
293
+ results[index] = await run(items[index]);
294
+ }
295
+ }, "worker");
296
+ await Promise.all(Array.from({ length: Math.min(Math.max(limit, 1), items.length) }, worker));
297
+ return results;
298
+ }
299
+ _chunkS3JO3N4Hcjs.__name.call(void 0, mapWithConcurrency, "mapWithConcurrency");
300
+ function readMetadataTitle(metadata) {
301
+ if (!isRecord(metadata)) return void 0;
302
+ const { title } = metadata;
303
+ if (typeof title === "string") return title.trim() || void 0;
304
+ if (isRecord(title)) {
305
+ for (const key of ["absolute", "default"]) {
306
+ const value = title[key];
307
+ if (typeof value === "string" && value.trim()) return value.trim();
308
+ }
309
+ }
310
+ return void 0;
311
+ }
312
+ _chunkS3JO3N4Hcjs.__name.call(void 0, readMetadataTitle, "readMetadataTitle");
313
+ function readMetadataString(metadata, key) {
314
+ if (!isRecord(metadata)) return void 0;
315
+ const value = metadata[key];
316
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
317
+ }
318
+ _chunkS3JO3N4Hcjs.__name.call(void 0, readMetadataString, "readMetadataString");
319
+ function fallbackPageTitle(path) {
320
+ if (path === "/") return "Home";
321
+ const segments = path.split("/").filter(Boolean);
322
+ const segment = _nullishCoalesce(segments[segments.length - 1], () => ( path));
323
+ const words = segment.replace(/[-_]+/g, " ").trim();
324
+ return words ? words[0].toUpperCase() + words.slice(1) : path;
325
+ }
326
+ _chunkS3JO3N4Hcjs.__name.call(void 0, fallbackPageTitle, "fallbackPageTitle");
327
+ function toSingleLine(value) {
328
+ return value.replace(/\s+/g, " ").trim();
329
+ }
330
+ _chunkS3JO3N4Hcjs.__name.call(void 0, toSingleLine, "toSingleLine");
331
+ function escapeLinkText(value) {
332
+ return toSingleLine(value).replace(/[\\[\]]/g, "\\$&");
333
+ }
334
+ _chunkS3JO3N4Hcjs.__name.call(void 0, escapeLinkText, "escapeLinkText");
335
+ function escapeLinkUrl(value) {
336
+ return value.trim().replace(
337
+ /[\s()<>]/g,
338
+ (character) => character === "(" ? "%28" : character === ")" ? "%29" : encodeURIComponent(character)
339
+ );
340
+ }
341
+ _chunkS3JO3N4Hcjs.__name.call(void 0, escapeLinkUrl, "escapeLinkUrl");
342
+ function requireText(value, message) {
343
+ if (typeof value !== "string" || !value.trim()) throw new TypeError(message);
344
+ return value;
345
+ }
346
+ _chunkS3JO3N4Hcjs.__name.call(void 0, requireText, "requireText");
347
+ function optionalText(value, message) {
348
+ if (value === void 0) return void 0;
349
+ if (typeof value !== "string") throw new TypeError(message);
350
+ return value;
351
+ }
352
+ _chunkS3JO3N4Hcjs.__name.call(void 0, optionalText, "optionalText");
353
+ function isRecord(value) {
354
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
355
+ }
356
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isRecord, "isRecord");
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+ exports.resolveFarmLlmsTxtConfig = resolveFarmLlmsTxtConfig; exports.collectFarmLlmsTxtPages = collectFarmLlmsTxtPages; exports.isFarmMetadataNoIndex = isFarmMetadataNoIndex; exports.createFarmDefaultLlmsTxt = createFarmDefaultLlmsTxt; exports.serializeFarmLlmsTxt = serializeFarmLlmsTxt; exports.createFarmLlmsMarkdownReader = createFarmLlmsMarkdownReader; exports.renderFarmLlmsFullTxt = renderFarmLlmsFullTxt; exports.createFarmLlmsFullRenderer = createFarmLlmsFullRenderer;
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-FP2INE7H.mjs";
7
7
  import {
8
8
  parseBodySizeLimit
9
- } from "./chunk-XF7Q24PF.mjs";
9
+ } from "./chunk-ZMMBIVQM.mjs";
10
10
  import {
11
11
  subscribeFarmCacheInvalidation,
12
12
  subscribeFarmCacheTask