@farm.js/core 0.1.65 → 0.1.67

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 (439) hide show
  1. package/dist/{agent-mcp-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
  3. package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-BFu9xHAi.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-DWyWkTSy.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +6 -5
  6. package/dist/agent-runtime.d.mts +6 -6
  7. package/dist/agent-runtime.d.ts +6 -6
  8. package/dist/agent-runtime.mjs +5 -4
  9. package/dist/analyzer-KVZGVY5Q.cjs +16 -0
  10. package/dist/{analyzer-PE33SK5W.mjs → analyzer-TTIIXXMQ.mjs} +3 -3
  11. package/dist/api/client.cjs +12 -2
  12. package/dist/api/client.d.mts +4 -4
  13. package/dist/api/client.d.ts +4 -4
  14. package/dist/api/client.mjs +12 -2
  15. package/dist/api/client.native.cjs +12 -2
  16. package/dist/api/client.native.d.mts +5 -5
  17. package/dist/api/client.native.d.ts +5 -5
  18. package/dist/api/client.native.mjs +12 -2
  19. package/dist/api/node.cjs +223 -0
  20. package/dist/api/node.d.mts +59 -0
  21. package/dist/api/node.d.ts +59 -0
  22. package/dist/api/node.mjs +223 -0
  23. package/dist/api/route-manager.cjs +11 -11
  24. package/dist/api/route-manager.d.mts +10 -9
  25. package/dist/api/route-manager.d.ts +10 -9
  26. package/dist/api/route-manager.mjs +10 -10
  27. package/dist/api/runtime.cjs +11 -7
  28. package/dist/api/runtime.d.mts +7 -7
  29. package/dist/api/runtime.d.ts +7 -7
  30. package/dist/api/runtime.mjs +10 -6
  31. package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
  32. package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
  33. package/dist/api.cjs +17 -13
  34. package/dist/api.d.mts +11 -10
  35. package/dist/api.d.ts +11 -10
  36. package/dist/api.mjs +16 -12
  37. package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-CRmjN5j9.d.mts} +1 -1
  38. package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-CwfhGrVR.d.ts} +1 -1
  39. package/dist/app-markdown.cjs +5 -5
  40. package/dist/app-markdown.d.mts +7 -7
  41. package/dist/app-markdown.d.ts +7 -7
  42. package/dist/app-markdown.mjs +4 -4
  43. package/dist/{app.d-x68Cwr0_.d.ts → app.d-BX9LVTiP.d.ts} +50 -9
  44. package/dist/{app.d-kuoVWhWM.d.mts → app.d-uBBUxwyV.d.mts} +50 -9
  45. package/dist/{chunk-V56632LA.cjs → chunk-22IWL4YD.cjs} +19 -5
  46. package/dist/{chunk-CZF4XIRZ.cjs → chunk-23PVOIPT.cjs} +3 -3
  47. package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
  48. package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
  49. package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
  50. package/dist/{chunk-RVGSVQWT.mjs → chunk-3T5TLFCQ.mjs} +10 -5
  51. package/dist/{chunk-XBSKPLHF.cjs → chunk-3T7ALZJF.cjs} +2 -2
  52. package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
  53. package/dist/{chunk-7QVRWGBL.cjs → chunk-4DRINDGN.cjs} +319 -138
  54. package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
  55. package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
  56. package/dist/{chunk-JGAE5XPL.cjs → chunk-4JX3M4C6.cjs} +2 -1
  57. package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
  58. package/dist/{chunk-IMK32ERL.cjs → chunk-556H7JCE.cjs} +65 -48
  59. package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
  60. package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
  61. package/dist/{chunk-TZVUF5JJ.mjs → chunk-5TA63JD3.mjs} +4 -4
  62. package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
  63. package/dist/chunk-6I4BFRE7.cjs +51 -0
  64. package/dist/{chunk-OSFIUSYK.cjs → chunk-6R53ZWX2.cjs} +7 -7
  65. package/dist/{chunk-MGKW5XZE.cjs → chunk-6SQZXRJ2.cjs} +7 -7
  66. package/dist/{chunk-WNXVWXG3.cjs → chunk-6V5YWI4W.cjs} +2 -2
  67. package/dist/{chunk-BM2LH2JM.mjs → chunk-6YBYX4K4.mjs} +13 -12
  68. package/dist/{chunk-X3XUZWRB.mjs → chunk-724MGMIL.mjs} +17 -3
  69. package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
  70. package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
  71. package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
  72. package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
  73. package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
  74. package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
  75. package/dist/{chunk-ZEXE4TGY.mjs → chunk-AQDLVHNF.mjs} +230 -110
  76. package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
  77. package/dist/chunk-AQIRXBBY.cjs +26 -0
  78. package/dist/chunk-AZ6IW6SF.mjs +28 -0
  79. package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
  80. package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
  81. package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
  82. package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
  83. package/dist/{chunk-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
  84. package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
  85. package/dist/{chunk-ZX2JHEWW.mjs → chunk-CO3YMZFD.mjs} +20 -9
  86. package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
  87. package/dist/{chunk-CNNBFGL5.cjs → chunk-DB2HSHQA.cjs} +14 -14
  88. package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
  89. package/dist/{chunk-32RPJAAS.cjs → chunk-DCXSIEFE.cjs} +40 -41
  90. package/dist/{chunk-D4MRNBVF.cjs → chunk-DGOFR7D5.cjs} +2 -2
  91. package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
  92. package/dist/chunk-DXZ57EPE.mjs +375 -0
  93. package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
  94. package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
  95. package/dist/{chunk-HKNYNSOK.mjs → chunk-E6CD45JK.mjs} +30 -31
  96. package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
  97. package/dist/chunk-EIVGPQN5.mjs +51 -0
  98. package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
  99. package/dist/{chunk-E552H232.cjs → chunk-F43OG25P.cjs} +1 -1
  100. package/dist/{chunk-UAQD67HM.mjs → chunk-F7JKVHU2.mjs} +1 -1
  101. package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
  102. package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
  103. package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
  104. package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
  105. package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
  106. package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
  107. package/dist/{chunk-ZAUOOGER.mjs → chunk-GTV2ABO7.mjs} +218 -37
  108. package/dist/{chunk-72JSHQQQ.mjs → chunk-H37MDCPR.mjs} +1 -1
  109. package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
  110. package/dist/{chunk-25T5VXOE.mjs → chunk-HFHJJXSV.mjs} +106 -19
  111. package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
  112. package/dist/{chunk-A3G5IY2W.cjs → chunk-HM7AGSKU.cjs} +1 -1
  113. package/dist/{chunk-GL7N5UHF.cjs → chunk-HNVAZGQD.cjs} +20 -9
  114. package/dist/{chunk-GRBJ7VKH.mjs → chunk-HP2DQGQH.mjs} +1 -1
  115. package/dist/{chunk-E2TSYUHV.mjs → chunk-HRPTMX5C.mjs} +4 -4
  116. package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
  117. package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
  118. package/dist/{chunk-VQJHT2ND.mjs → chunk-IRA2CZAY.mjs} +2 -2
  119. package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
  120. package/dist/chunk-J6TZRYCO.cjs +22 -0
  121. package/dist/{chunk-WYAXRIYP.cjs → chunk-J7JHVCWA.cjs} +8 -8
  122. package/dist/chunk-JSOCDYER.cjs +375 -0
  123. package/dist/{chunk-YUW7F6SK.mjs → chunk-JVM3DKZE.mjs} +3 -3
  124. package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
  125. package/dist/{chunk-BQWBHWEW.mjs → chunk-JWSI5WO4.mjs} +1 -1
  126. package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
  127. package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
  128. package/dist/chunk-K63OWRY2.mjs +22 -0
  129. package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
  130. package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
  131. package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
  132. package/dist/{chunk-3CCAICF7.cjs → chunk-KCY52OUQ.cjs} +4 -4
  133. package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
  134. package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
  135. package/dist/{chunk-RFKTJTWZ.mjs → chunk-KWFNUODD.mjs} +2 -1
  136. package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
  137. package/dist/{chunk-C7DCMGC4.cjs → chunk-LPIZMU7D.cjs} +12 -12
  138. package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
  139. package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
  140. package/dist/{chunk-3KJPIO5D.cjs → chunk-N5DQMOAG.cjs} +589 -678
  141. package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
  142. package/dist/{chunk-CBOEJ5Z4.cjs → chunk-OB3IFUK6.cjs} +133 -46
  143. package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
  144. package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
  145. package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
  146. package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
  147. package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
  148. package/dist/{chunk-IP2KHSGF.mjs → chunk-P2NBQ5JI.mjs} +57 -4
  149. package/dist/{chunk-ZQQK4U66.cjs → chunk-PDFFYZAT.cjs} +72 -19
  150. package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
  151. package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
  152. package/dist/{chunk-YD4J37RN.cjs → chunk-PL6RTBDE.cjs} +30 -19
  153. package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
  154. package/dist/{chunk-WMTBBQHY.cjs → chunk-PPX7UOFY.cjs} +271 -151
  155. package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
  156. package/dist/{chunk-7XGWBPQQ.cjs → chunk-Q37INCXG.cjs} +13 -8
  157. package/dist/{chunk-T4M52BA5.cjs → chunk-Q5UX55YA.cjs} +1457 -612
  158. package/dist/{chunk-53ZCZ46B.cjs → chunk-QGQP6QKO.cjs} +4 -3
  159. package/dist/{chunk-TZOGZKI7.cjs → chunk-QITSS4TD.cjs} +1381 -626
  160. package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
  161. package/dist/{chunk-HCGWDRZO.mjs → chunk-QJVW76JG.mjs} +17 -6
  162. package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
  163. package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
  164. package/dist/chunk-RWR7SMD7.cjs +50 -0
  165. package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
  166. package/dist/chunk-SD6JGJOM.mjs +50 -0
  167. package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
  168. package/dist/{chunk-E4RDMG3K.mjs → chunk-TEG6HJVF.mjs} +4 -4
  169. package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
  170. package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
  171. package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
  172. package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
  173. package/dist/{chunk-W2ZXMMHA.mjs → chunk-UHE5JUKB.mjs} +1 -1
  174. package/dist/{chunk-6X5NKNBE.mjs → chunk-UHNSY2PQ.mjs} +1304 -459
  175. package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
  176. package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
  177. package/dist/{chunk-Q75QPLBA.mjs → chunk-V5MQMQ2P.mjs} +1 -1
  178. package/dist/{chunk-TRIDJQ6A.cjs → chunk-V5RTHYJB.cjs} +30 -10
  179. package/dist/{chunk-QHRCR44V.mjs → chunk-VK54PDQ6.mjs} +25 -5
  180. package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
  181. package/dist/{chunk-2L54YV25.mjs → chunk-WDD5CTZW.mjs} +49 -32
  182. package/dist/{chunk-7GYCZRTH.mjs → chunk-WGHY3OL5.mjs} +355 -444
  183. package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
  184. package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
  185. package/dist/chunk-WVQNXXNE.cjs +28 -0
  186. package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
  187. package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
  188. package/dist/{chunk-VHHLKIDZ.mjs → chunk-XNZWMXCF.mjs} +1090 -335
  189. package/dist/{chunk-FIR62CR3.mjs → chunk-XUES6OET.mjs} +1 -1
  190. package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
  191. package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
  192. package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
  193. package/dist/chunk-YFTGIHNC.mjs +26 -0
  194. package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
  195. package/dist/{chunk-UYRI6U3P.mjs → chunk-YQYTQJZN.mjs} +3 -2
  196. package/dist/{chunk-X4K7TYN6.cjs → chunk-YVTS3S3F.cjs} +24 -23
  197. package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
  198. package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
  199. package/dist/client/lifecycle.cjs +2 -2
  200. package/dist/client/lifecycle.d.mts +1 -1
  201. package/dist/client/lifecycle.d.ts +1 -1
  202. package/dist/client/lifecycle.mjs +1 -1
  203. package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-CDRvRmbU.d.mts} +2 -2
  204. package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DWRKyAp5.d.ts} +2 -2
  205. package/dist/client-plugins.cjs +2 -2
  206. package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-BNILjfX3.d.mts} +94 -140
  207. package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CrKZiNSN.d.ts} +94 -140
  208. package/dist/client-plugins.d.mts +6 -6
  209. package/dist/client-plugins.d.ts +6 -6
  210. package/dist/client-plugins.mjs +1 -1
  211. package/dist/client.cjs +11 -9
  212. package/dist/client.d.mts +13 -13
  213. package/dist/client.d.ts +13 -13
  214. package/dist/client.mjs +10 -8
  215. package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
  216. package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
  217. package/dist/config.d.mts +6 -6
  218. package/dist/config.d.ts +6 -6
  219. package/dist/cron.cjs +2 -2
  220. package/dist/cron.mjs +1 -1
  221. package/dist/deferred.cjs +2 -2
  222. package/dist/deferred.mjs +1 -1
  223. package/dist/deployment.cjs +2 -2
  224. package/dist/deployment.mjs +1 -1
  225. package/dist/desktop.d.mts +7 -7
  226. package/dist/desktop.d.ts +7 -7
  227. package/dist/{devtools-SGYOG36E.cjs → devtools-RZVT4JVN.cjs} +36 -32
  228. package/dist/{devtools-PUVZB3F2.mjs → devtools-UFQYT3VA.mjs} +31 -27
  229. package/dist/docs.cjs +26 -25
  230. package/dist/docs.d.mts +20 -8
  231. package/dist/docs.d.ts +20 -8
  232. package/dist/docs.mjs +25 -24
  233. package/dist/env-types.cjs +3 -3
  234. package/dist/env-types.mjs +2 -2
  235. package/dist/environment/vite.cjs +5 -5
  236. package/dist/environment/vite.mjs +4 -4
  237. package/dist/headers.cjs +3 -3
  238. package/dist/headers.mjs +2 -2
  239. package/dist/image/server.d.mts +1 -1
  240. package/dist/image/server.d.ts +1 -1
  241. package/dist/image/sharp.d.mts +1 -1
  242. package/dist/image/sharp.d.ts +1 -1
  243. package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
  244. package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
  245. package/dist/image.cjs +6 -6
  246. package/dist/image.d.mts +1 -1
  247. package/dist/image.d.ts +1 -1
  248. package/dist/image.mjs +1 -1
  249. package/dist/index.cjs +143 -128
  250. package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bdm6866n.d.mts} +1 -1
  251. package/dist/{index.d-A_x10zGS.d.ts → index.d-Dey5T14f.d.ts} +1 -1
  252. package/dist/index.d.mts +31 -82
  253. package/dist/index.d.ts +31 -82
  254. package/dist/index.mjs +214 -199
  255. package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
  256. package/dist/integrations/orm.d.mts +33 -0
  257. package/dist/integrations/orm.d.ts +33 -0
  258. package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
  259. package/dist/integrations.cjs +6 -5
  260. package/dist/integrations.d.mts +6 -6
  261. package/dist/integrations.d.ts +6 -6
  262. package/dist/integrations.mjs +5 -4
  263. package/dist/internal/app-markdown-runtime.cjs +4 -4
  264. package/dist/internal/app-markdown-runtime.d.mts +17 -8
  265. package/dist/internal/app-markdown-runtime.d.ts +17 -8
  266. package/dist/internal/app-markdown-runtime.mjs +3 -3
  267. package/dist/internal/build-runtime.cjs +70 -68
  268. package/dist/internal/build-runtime.d.mts +8 -8
  269. package/dist/internal/build-runtime.d.ts +8 -8
  270. package/dist/internal/build-runtime.mjs +69 -67
  271. package/dist/internal/cli-runtime.cjs +45 -44
  272. package/dist/internal/cli-runtime.mjs +44 -43
  273. package/dist/internal/client-error-overlay.cjs +6 -6
  274. package/dist/internal/client-error-overlay.mjs +2 -2
  275. package/dist/internal/client-runtime.cjs +60 -6
  276. package/dist/internal/client-runtime.d.mts +40 -11
  277. package/dist/internal/client-runtime.d.ts +40 -11
  278. package/dist/internal/client-runtime.mjs +58 -4
  279. package/dist/internal/compression-runtime.d.mts +6 -6
  280. package/dist/internal/compression-runtime.d.ts +6 -6
  281. package/dist/internal/config-runtime.cjs +25 -24
  282. package/dist/internal/config-runtime.d.mts +9 -9
  283. package/dist/internal/config-runtime.d.ts +9 -9
  284. package/dist/internal/config-runtime.mjs +24 -23
  285. package/dist/internal/docs-precompiled-runtime.cjs +16 -5
  286. package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
  287. package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
  288. package/dist/internal/docs-precompiled-runtime.mjs +15 -4
  289. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  290. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  291. package/dist/internal/islands-runtime.cjs +33 -4
  292. package/dist/internal/islands-runtime.d.mts +1 -1
  293. package/dist/internal/islands-runtime.d.ts +1 -1
  294. package/dist/internal/islands-runtime.mjs +31 -2
  295. package/dist/internal/native-server-fns.cjs +6 -6
  296. package/dist/internal/native-server-fns.mjs +5 -5
  297. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  298. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  299. package/dist/internal/production-runtime.cjs +54 -40
  300. package/dist/internal/production-runtime.d.mts +23 -15
  301. package/dist/internal/production-runtime.d.ts +23 -15
  302. package/dist/internal/production-runtime.mjs +69 -55
  303. package/dist/internal/react-cache.cjs +3 -3
  304. package/dist/internal/react-cache.mjs +1 -1
  305. package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
  306. package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
  307. package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
  308. package/dist/manager-JOHU6BQI.cjs +15 -0
  309. package/dist/markdown.cjs +7 -3
  310. package/dist/markdown.d.mts +6 -6
  311. package/dist/markdown.d.ts +6 -6
  312. package/dist/markdown.mjs +6 -2
  313. package/dist/middleware.cjs +10 -10
  314. package/dist/middleware.d.mts +8 -8
  315. package/dist/middleware.d.ts +8 -8
  316. package/dist/middleware.mjs +9 -9
  317. package/dist/mobile.d.mts +4 -4
  318. package/dist/mobile.d.ts +4 -4
  319. package/dist/mount.d-BP0nLYQO.d.mts +38 -0
  320. package/dist/mount.d-CkiPky_F.d.ts +38 -0
  321. package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
  322. package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
  323. package/dist/{native-tree-HE2FLS72.cjs → native-tree-W2SSJB3Y.cjs} +5 -5
  324. package/dist/{native-tree-YF2DSPKM.mjs → native-tree-Y5YQANW7.mjs} +4 -4
  325. package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-CdBP-hkZ.d.mts} +1 -1
  326. package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-DchcGzAQ.d.ts} +1 -1
  327. package/dist/navigation.cjs +8 -7
  328. package/dist/navigation.d.mts +9 -9
  329. package/dist/navigation.d.ts +9 -9
  330. package/dist/navigation.mjs +7 -6
  331. package/dist/{nitro-DD4QCA66.mjs → nitro-55YOZWRA.mjs} +11 -11
  332. package/dist/{nitro-VRDX2H4M.cjs → nitro-EEX2J3KB.cjs} +13 -13
  333. package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
  334. package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
  335. package/dist/plugin.cjs +61 -59
  336. package/dist/plugin.d.mts +8 -8
  337. package/dist/plugin.d.ts +8 -8
  338. package/dist/plugin.mjs +60 -58
  339. package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
  340. package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
  341. package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-Dou_Htas.d.ts} +1 -1
  342. package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-VwsBzIee.d.mts} +1 -1
  343. package/dist/query/client.cjs +9 -7
  344. package/dist/query/client.mjs +5 -3
  345. package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-D8UakAIk.d.ts} +1 -1
  346. package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-LKymStDJ.d.mts} +1 -1
  347. package/dist/renderer/none/server.cjs +35 -0
  348. package/dist/renderer/none/server.d.mts +21 -0
  349. package/dist/renderer/none/server.d.ts +21 -0
  350. package/dist/renderer/none/server.mjs +35 -0
  351. package/dist/renderer/react/server.cjs +2 -2
  352. package/dist/renderer/react/server.mjs +3 -3
  353. package/dist/renderer-client.cjs +8 -6
  354. package/dist/renderer-client.d.mts +9 -9
  355. package/dist/renderer-client.d.ts +9 -9
  356. package/dist/renderer-client.mjs +5 -3
  357. package/dist/renderer.cjs +6 -2
  358. package/dist/renderer.d.mts +20 -2
  359. package/dist/renderer.d.ts +20 -2
  360. package/dist/renderer.mjs +5 -1
  361. package/dist/request.cjs +2 -2
  362. package/dist/{request.d-B1RnTLri.d.ts → request.d-B928QjWy.d.ts} +1 -1
  363. package/dist/{request.d-DarDOCk9.d.mts → request.d-KG-4d2eG.d.mts} +1 -1
  364. package/dist/request.d.mts +7 -7
  365. package/dist/request.d.ts +7 -7
  366. package/dist/request.mjs +1 -1
  367. package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-DoEe_w9t.d.ts} +1 -1
  368. package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-NIHQeb4m.d.mts} +1 -1
  369. package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
  370. package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
  371. package/dist/{router.d-Cuv1jntg.d.mts → router.d-B8PkJSGp.d.mts} +1 -1
  372. package/dist/{router.d-CMANF6da.d.ts → router.d-DYnRHQwz.d.ts} +1 -1
  373. package/dist/routes.cjs +3 -3
  374. package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-DgZ_jgGG.d.mts} +1 -1
  375. package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-uUBZyWoK.d.ts} +1 -1
  376. package/dist/routes.d.mts +6 -6
  377. package/dist/routes.d.ts +6 -6
  378. package/dist/routes.mjs +2 -2
  379. package/dist/{rsc-pipeline-T3PWURLJ.mjs → rsc-pipeline-4OJ5ZQNZ.mjs} +26 -25
  380. package/dist/{rsc-pipeline-V4ANLRAA.cjs → rsc-pipeline-7K5H2RPH.cjs} +27 -26
  381. package/dist/{runtime-LRIQ3XH7.mjs → runtime-U7O3HZOZ.mjs} +62 -36
  382. package/dist/{runtime-5AROV2C3.cjs → runtime-X52Q7JFR.cjs} +72 -46
  383. package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-BxQIzwfy.d.mts} +11 -3
  384. package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-DP7mEkEF.d.ts} +11 -3
  385. package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
  386. package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
  387. package/dist/schema.cjs +6 -2
  388. package/dist/schema.d-Dny9pnrm.d.mts +298 -0
  389. package/dist/schema.d-Dny9pnrm.d.ts +298 -0
  390. package/dist/schema.d.mts +1 -115
  391. package/dist/schema.d.ts +1 -115
  392. package/dist/schema.mjs +5 -1
  393. package/dist/server-fn-client.d.mts +2 -2
  394. package/dist/server-fn-client.d.ts +2 -2
  395. package/dist/server-fn.cjs +5 -5
  396. package/dist/server-fn.mjs +4 -4
  397. package/dist/server-plugins.cjs +7 -7
  398. package/dist/server-plugins.d.mts +16 -10
  399. package/dist/server-plugins.d.ts +16 -10
  400. package/dist/server-plugins.mjs +8 -8
  401. package/dist/server-query.cjs +6 -6
  402. package/dist/server-query.mjs +5 -5
  403. package/dist/server.cjs +160 -120
  404. package/dist/server.d.mts +20 -14
  405. package/dist/server.d.ts +20 -14
  406. package/dist/server.mjs +138 -98
  407. package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-BgHPVMhz.d.mts} +15 -5
  408. package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-DsFDHTsv.d.ts} +15 -5
  409. package/dist/testing.cjs +17 -17
  410. package/dist/testing.d.mts +6 -6
  411. package/dist/testing.d.ts +6 -6
  412. package/dist/testing.mjs +13 -13
  413. package/dist/theme/server.cjs +3 -3
  414. package/dist/theme/server.mjs +2 -2
  415. package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-BKyKDBR1.d.mts} +1 -1
  416. package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-zxAVcf_V.d.ts} +1 -1
  417. package/dist/version.cjs +2 -2
  418. package/dist/version.mjs +1 -1
  419. package/dist/vite.cjs +63 -61
  420. package/dist/vite.d.mts +32 -12
  421. package/dist/vite.d.ts +32 -12
  422. package/dist/vite.mjs +62 -60
  423. package/dist/workflows.cjs +4 -4
  424. package/dist/workflows.mjs +3 -3
  425. package/package.json +31 -1
  426. package/dist/analyzer-GHWK46LX.cjs +0 -16
  427. package/dist/chunk-5YPBFMBN.cjs +0 -19
  428. package/dist/chunk-OM7WILES.mjs +0 -100
  429. package/dist/chunk-Q5B4LNON.mjs +0 -19
  430. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  431. package/dist/chunk-R53QDV6T.cjs +0 -100
  432. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  433. package/dist/manager-2LUKNX2N.cjs +0 -14
  434. /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
  435. /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
  436. /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
  437. /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
  438. /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
  439. /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
@@ -1,4 +1,4 @@
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; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
3
 
4
4
  var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
@@ -18,11 +18,19 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
18
18
  var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
19
19
 
20
20
 
21
- var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
21
+ var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
22
+
23
+
24
+ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
22
25
 
23
26
 
24
27
  var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
25
28
 
29
+
30
+
31
+
32
+ var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
33
+
26
34
  // src/docs/handler.ts
27
35
 
28
36
 
@@ -74,13 +82,25 @@ function discoverDocsSourceFiles(contentDir) {
74
82
  if (_fs.existsSync.call(void 0, contentDir)) visit(contentDir);
75
83
  return files;
76
84
  }
85
+ function readShallowBoundaryCommits(gitRoot) {
86
+ const shallowFile = _child_process.execFileSync.call(void 0, "git", ["-C", gitRoot, "rev-parse", "--git-path", "shallow"], {
87
+ encoding: "utf8",
88
+ stdio: ["ignore", "pipe", "ignore"]
89
+ }).trim();
90
+ const shallowPath = _path2.default.resolve(gitRoot, shallowFile);
91
+ if (!_fs.existsSync.call(void 0, shallowPath)) return /* @__PURE__ */ new Set();
92
+ return new Set(
93
+ _fs.readFileSync.call(void 0, shallowPath, "utf8").split(/\r?\n/).map((line) => line.trim()).filter(Boolean)
94
+ );
95
+ }
77
96
  function getGitLastModifiedDates(contentDir) {
78
97
  try {
79
98
  const gitRoot = _child_process.execFileSync.call(void 0, "git", ["-C", contentDir, "rev-parse", "--show-toplevel"], {
80
99
  encoding: "utf8",
81
100
  stdio: ["ignore", "pipe", "ignore"]
82
101
  }).trim();
83
- if (!gitRoot) return {};
102
+ if (!gitRoot) return { pages: {}, unknown: /* @__PURE__ */ new Set() };
103
+ const boundaryCommits = readShallowBoundaryCommits(gitRoot);
84
104
  const contentPathspec = normalizeRelativePath(_path2.default.relative(gitRoot, contentDir)) || ".";
85
105
  const contentPrefix = contentPathspec === "." ? "" : `${contentPathspec}/`;
86
106
  const history = _child_process.execFileSync.call(void 0,
@@ -91,7 +111,7 @@ function getGitLastModifiedDates(contentDir) {
91
111
  "-c",
92
112
  "core.quotePath=false",
93
113
  "log",
94
- `--format=${COMMIT_MARKER}%cI`,
114
+ `--format=${COMMIT_MARKER}%H %cI`,
95
115
  "--name-only",
96
116
  "--",
97
117
  contentPathspec
@@ -103,23 +123,28 @@ function getGitLastModifiedDates(contentDir) {
103
123
  }
104
124
  );
105
125
  const pages = {};
126
+ const unknown = /* @__PURE__ */ new Set();
106
127
  let commitDate;
128
+ let isBoundaryCommit = false;
107
129
  for (const rawLine of history.split(/\r?\n/)) {
108
130
  const line = normalizeRelativePath(rawLine.trim());
109
131
  if (!line) continue;
110
132
  if (line.startsWith(COMMIT_MARKER)) {
111
- commitDate = line.slice(COMMIT_MARKER.length);
133
+ const [hash, date] = line.slice(COMMIT_MARKER.length).split(" ");
134
+ commitDate = date;
135
+ isBoundaryCommit = boundaryCommits.has(hash);
112
136
  continue;
113
137
  }
114
138
  if (!commitDate || contentPrefix && !line.startsWith(contentPrefix)) continue;
115
139
  const relativePath = contentPrefix ? line.slice(contentPrefix.length) : line;
116
- if (isDocsSourceFile(relativePath) && !pages[relativePath]) {
117
- pages[relativePath] = commitDate;
118
- }
140
+ if (!isDocsSourceFile(relativePath) || pages[relativePath]) continue;
141
+ if (isBoundaryCommit) unknown.add(relativePath);
142
+ else pages[relativePath] = commitDate;
119
143
  }
120
- return pages;
144
+ for (const relativePath of Object.keys(pages)) unknown.delete(relativePath);
145
+ return { pages, unknown };
121
146
  } catch (e2) {
122
- return {};
147
+ return { pages: {}, unknown: /* @__PURE__ */ new Set() };
123
148
  }
124
149
  }
125
150
  function readManifest(contentDir) {
@@ -135,7 +160,8 @@ function readManifest(contentDir) {
135
160
  (entry) => typeof entry[1] === "string" && entry[1].length > 0
136
161
  )
137
162
  );
138
- return { version: 1, pages };
163
+ const unknown = Array.isArray(parsed.unknown) ? parsed.unknown.filter((page) => typeof page === "string") : [];
164
+ return { version: 1, pages, ...unknown.length > 0 ? { unknown } : {} };
139
165
  } catch (e3) {
140
166
  return null;
141
167
  }
@@ -145,11 +171,18 @@ function createFarmDocsLastModifiedManifest(contentDir, options = {}) {
145
171
  const gitDates = getGitLastModifiedDates(resolvedContentDir);
146
172
  const fallbackDate = (_nullishCoalesce(options.now, () => ( /* @__PURE__ */ new Date()))).toISOString();
147
173
  const pages = {};
174
+ const unknown = [];
148
175
  for (const sourcePath of discoverDocsSourceFiles(resolvedContentDir)) {
149
176
  const relativePath = normalizeRelativePath(_path2.default.relative(resolvedContentDir, sourcePath));
150
- pages[relativePath] = gitDates[relativePath] || (options.fallback === "now" ? fallbackDate : _fs.statSync.call(void 0, sourcePath).mtime.toISOString());
177
+ if (gitDates.pages[relativePath]) {
178
+ pages[relativePath] = gitDates.pages[relativePath];
179
+ } else if (gitDates.unknown.has(relativePath)) {
180
+ unknown.push(relativePath);
181
+ } else {
182
+ pages[relativePath] = options.fallback === "now" ? fallbackDate : _fs.statSync.call(void 0, sourcePath).mtime.toISOString();
183
+ }
151
184
  }
152
- return { version: 1, pages };
185
+ return { version: 1, pages, ...unknown.length > 0 ? { unknown } : {} };
153
186
  }
154
187
  function getLastModifiedManifest(contentDir) {
155
188
  const resolvedContentDir = resolveExistingPath(contentDir);
@@ -170,8 +203,10 @@ function resolveFarmDocsPageLastModified(contentDir, sourcePath, frontmatter) {
170
203
  const relativePath = normalizeRelativePath(_path2.default.relative(resolvedContentDir, resolvedSourcePath));
171
204
  const isInsideContentDir = relativePath !== ".." && !relativePath.startsWith("../") && !_path2.default.isAbsolute(relativePath);
172
205
  if (isInsideContentDir) {
173
- const generated = getLastModifiedManifest(resolvedContentDir).pages[relativePath];
206
+ const manifest = getLastModifiedManifest(resolvedContentDir);
207
+ const generated = manifest.pages[relativePath];
174
208
  if (generated) return generated;
209
+ if (_optionalChain([manifest, 'access', _2 => _2.unknown, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(relativePath)])) return void 0;
175
210
  }
176
211
  return _fs.statSync.call(void 0, resolvedSourcePath).mtime.toISOString();
177
212
  }
@@ -204,7 +239,7 @@ function isExternalOrRootPath(value) {
204
239
  return /^(https?:)?\/\//i.test(value) || value.startsWith("/");
205
240
  }
206
241
  function isFarmDocsSocialImageEnabled(page, docs) {
207
- if (docs.config.socialImage === false || _optionalChain([getSocialImageConfig, 'call', _2 => _2(docs), 'optionalAccess', _3 => _3.enabled]) === false) {
242
+ if (docs.config.socialImage === false || _optionalChain([getSocialImageConfig, 'call', _5 => _5(docs), 'optionalAccess', _6 => _6.enabled]) === false) {
208
243
  return false;
209
244
  }
210
245
  return !isFalse(page.frontmatter.socialImage);
@@ -214,7 +249,7 @@ function getFarmDocsCustomSocialImage(page) {
214
249
  return value && !isFalse(value) && isExternalOrRootPath(value) ? value : void 0;
215
250
  }
216
251
  function resolveIllustration(page) {
217
- const explicit = _optionalChain([page, 'access', _4 => _4.frontmatter, 'access', _5 => _5.socialIllustration, 'optionalAccess', _6 => _6.toLowerCase, 'call', _7 => _7()]);
252
+ const explicit = _optionalChain([page, 'access', _7 => _7.frontmatter, 'access', _8 => _8.socialIllustration, 'optionalAccess', _9 => _9.toLowerCase, 'call', _10 => _10()]);
218
253
  if (explicit === "auth" || explicit === "cache" || explicit === "cli" || explicit === "integrations" || explicit === "project" || explicit === "routing" || explicit === "runtime") {
219
254
  return explicit;
220
255
  }
@@ -237,21 +272,21 @@ function createHashValue(value) {
237
272
  return _crypto.createHash.call(void 0, "sha256").update(JSON.stringify(value)).digest("hex").slice(0, 16);
238
273
  }
239
274
  function resolveBaseUrl(requestUrl, config) {
240
- return _optionalChain([config, 'optionalAccess', _8 => _8.baseUrl]) ? new URL(config.baseUrl) : new URL(requestUrl.origin);
275
+ return _optionalChain([config, 'optionalAccess', _11 => _11.baseUrl]) ? new URL(config.baseUrl) : new URL(requestUrl.origin);
241
276
  }
242
- function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
277
+ function createFarmDocsSocialImageDescriptor(page, docs, requestUrl, format = "svg", basePath = "") {
243
278
  const config = getSocialImageConfig(docs);
244
- const siteName = _optionalChain([config, 'optionalAccess', _9 => _9.siteName]) || getNavTitle(docs);
245
- const brand = _optionalChain([config, 'optionalAccess', _10 => _10.brand]) || siteName;
279
+ const siteName = _optionalChain([config, 'optionalAccess', _12 => _12.siteName]) || getNavTitle(docs);
280
+ const brand = _optionalChain([config, 'optionalAccess', _13 => _13.brand]) || siteName;
246
281
  const title = page.frontmatter.socialTitle || page.title;
247
- const description = page.frontmatter.socialDescription || page.description || _optionalChain([docs, 'access', _11 => _11.config, 'access', _12 => _12.metadata, 'optionalAccess', _13 => _13.description]) || `Documentation for ${siteName}`;
282
+ const description = page.frontmatter.socialDescription || page.description || _optionalChain([docs, 'access', _14 => _14.config, 'access', _15 => _15.metadata, 'optionalAccess', _16 => _16.description]) || `Documentation for ${siteName}`;
248
283
  const section = page.frontmatter.section || page.section || "Documentation";
249
284
  const illustration = resolveIllustration(page);
250
285
  const entry = normalizeEntry(docs.entry);
251
286
  const slugPath = encodeSlugPath(page.slug) || "index";
252
- const imagePath = `${entry}/_social/${slugPath}/opengraph-image.svg`;
287
+ const imagePath = `${entry}/_social/${slugPath}/opengraph-image.${format}`;
253
288
  const baseUrl = resolveBaseUrl(requestUrl, config);
254
- const pageUrl = new URL(page.href, baseUrl).href;
289
+ const pageUrl = new URL(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, page.href, basePath), baseUrl).href;
255
290
  const imageAlt = `${title} \u2014 ${siteName} documentation`;
256
291
  const hash = createHashValue({
257
292
  version: FARM_DOCS_SOCIAL_IMAGE_VERSION,
@@ -262,7 +297,7 @@ function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
262
297
  brand,
263
298
  pageHref: page.href,
264
299
  illustration,
265
- fonts: _optionalChain([config, 'optionalAccess', _14 => _14.fonts])
300
+ fonts: _optionalChain([config, 'optionalAccess', _17 => _17.fonts])
266
301
  });
267
302
  return {
268
303
  title,
@@ -273,32 +308,55 @@ function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
273
308
  pageHref: page.href,
274
309
  pageUrl,
275
310
  imagePath,
276
- imageUrl: new URL(`${imagePath}?v=${hash}`, baseUrl).href,
311
+ imageUrl: new URL(`${_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, imagePath, basePath)}?v=${hash}`, baseUrl).href,
277
312
  imageAlt,
278
313
  illustration,
279
- fonts: _optionalChain([config, 'optionalAccess', _15 => _15.fonts]),
314
+ fonts: _optionalChain([config, 'optionalAccess', _18 => _18.fonts]),
315
+ format,
280
316
  hash
281
317
  };
282
318
  }
283
319
  function getFarmDocsSocialImageSlug(docs, requestUrl) {
284
320
  const entry = normalizeEntry(docs.entry);
285
321
  const prefix = `${entry}/_social/`;
286
- const suffix = "/opengraph-image.svg";
287
- if (!requestUrl.pathname.startsWith(prefix) || !requestUrl.pathname.endsWith(suffix)) {
288
- return null;
289
- }
290
- const rawSlug = requestUrl.pathname.slice(prefix.length, -suffix.length);
322
+ const format = requestUrl.pathname.endsWith("/opengraph-image.png") ? "png" : requestUrl.pathname.endsWith("/opengraph-image.svg") ? "svg" : null;
323
+ if (!format || !requestUrl.pathname.startsWith(prefix)) return null;
324
+ const rawSlug = requestUrl.pathname.slice(prefix.length, -"/opengraph-image.svg".length);
291
325
  if (!rawSlug) return null;
292
326
  try {
293
327
  const slug = rawSlug.split("/").map((segment) => decodeURIComponent(segment)).join("/");
294
328
  if (slug.split("/").some((segment) => !segment || segment === ".." || segment === ".")) {
295
329
  return null;
296
330
  }
297
- return slug === "index" ? "" : slug;
331
+ return { slug: slug === "index" ? "" : slug, format };
298
332
  } catch (e4) {
299
333
  return null;
300
334
  }
301
335
  }
336
+ var sharpLoad;
337
+ function loadSharp() {
338
+ _nullishCoalesce(sharpLoad, () => ( (sharpLoad = import("sharp").then(
339
+ (module) => module.default,
340
+ (error) => {
341
+ if (!_chunkKORZ6PREcjs.isMissingPackageError.call(void 0, error, "sharp")) {
342
+ console.warn(
343
+ `[farm] Docs social images fall back to SVG because sharp failed to load: ${error instanceof Error ? error.message : String(error)}`
344
+ );
345
+ }
346
+ return null;
347
+ }
348
+ ))));
349
+ return sharpLoad;
350
+ }
351
+ async function resolveFarmDocsSocialImageFormat() {
352
+ return await loadSharp() ? "png" : "svg";
353
+ }
354
+ async function renderFarmDocsSocialImagePng(descriptor) {
355
+ const sharp = await loadSharp();
356
+ if (!sharp) return null;
357
+ const png = await sharp(Buffer.from(renderFarmDocsSocialImageSvg(descriptor))).png({ compressionLevel: 9, palette: true }).toBuffer();
358
+ return new Uint8Array(png);
359
+ }
302
360
  function escapeXml(value) {
303
361
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
304
362
  }
@@ -468,7 +526,11 @@ function renderFarmDocsSocialImageSvg(descriptor) {
468
526
  const routeY = Math.max(418, descriptionY + descriptionLines.length * 29 + 24);
469
527
  const section = truncate(descriptor.section.toUpperCase(), 27);
470
528
  const route = truncate(descriptor.pageHref, 42);
471
- const footerUrl = truncate(descriptor.pageUrl.replace(/^https?:\/\//, ""), 70);
529
+ const pageUrl = new URL(descriptor.pageUrl);
530
+ const footerUrl = truncate(
531
+ pageUrl.hostname.endsWith(".invalid") ? pageUrl.pathname : descriptor.pageUrl.replace(/^https?:\/\//, ""),
532
+ 70
533
+ );
472
534
  const brand = truncate(descriptor.brand.toUpperCase(), 25);
473
535
  const titleId = `farm-docs-og-${descriptor.hash}`;
474
536
  return `<?xml version="1.0" encoding="UTF-8"?>
@@ -477,9 +539,9 @@ function renderFarmDocsSocialImageSvg(descriptor) {
477
539
  <desc id="${titleId}-description">${escapeXml(descriptor.description)}</desc>
478
540
  <metadata>${escapeXml(JSON.stringify({ generator: "Farm.js docs", page: descriptor.pageUrl, illustration: descriptor.illustration }))}</metadata>
479
541
  <style type="text/css">
480
- ${renderEmbeddedFont("Farm Sans", _optionalChain([descriptor, 'access', _16 => _16.fonts, 'optionalAccess', _17 => _17.sans]), "100 900")}
481
- ${renderEmbeddedFont("Farm Mono", _optionalChain([descriptor, 'access', _18 => _18.fonts, 'optionalAccess', _19 => _19.mono]), "100 900")}
482
- ${renderEmbeddedFont("Farm Pixel", _optionalChain([descriptor, 'access', _20 => _20.fonts, 'optionalAccess', _21 => _21.display]), "400 700")}
542
+ ${renderEmbeddedFont("Farm Sans", _optionalChain([descriptor, 'access', _19 => _19.fonts, 'optionalAccess', _20 => _20.sans]), "100 900")}
543
+ ${renderEmbeddedFont("Farm Mono", _optionalChain([descriptor, 'access', _21 => _21.fonts, 'optionalAccess', _22 => _22.mono]), "100 900")}
544
+ ${renderEmbeddedFont("Farm Pixel", _optionalChain([descriptor, 'access', _23 => _23.fonts, 'optionalAccess', _24 => _24.display]), "400 700")}
483
545
  .sans{font-family:"Farm Sans","Arial",sans-serif}.mono,.label,.code,.diagram-title,.micro{font-family:"Farm Mono","Menlo","DejaVu Sans Mono",monospace}.pixel{font-family:"Farm Pixel","Farm Mono",monospace}.label{fill:#8b8b8b;font-size:10px;font-weight:600;letter-spacing:1.2px}.code{fill:#8b8b8b;font-size:11px}.diagram-title{fill:#e7e7e7;font-size:11px;font-weight:650}.micro{fill:#777;font-size:8px;letter-spacing:.45px}.bright{fill:#f5f5f4}.ink{fill:#050505}.ink-muted{fill:#4c4c4c}
484
546
  </style>
485
547
  <defs>
@@ -523,8 +585,8 @@ function renderFarmDocsSocialImageSvg(descriptor) {
523
585
  }
524
586
  function renderFarmDocsSocialMetadata(descriptor, customImage) {
525
587
  const imageUrl = customImage ? new URL(customImage, descriptor.pageUrl).href : descriptor.imageUrl;
526
- const customExtension = _optionalChain([customImage, 'optionalAccess', _22 => _22.toLowerCase, 'call', _23 => _23(), 'access', _24 => _24.split, 'call', _25 => _25(/[?#]/, 1), 'access', _26 => _26[0]]);
527
- const imageType = _optionalChain([customExtension, 'optionalAccess', _27 => _27.endsWith, 'call', _28 => _28(".webp")]) ? "image/webp" : _optionalChain([customExtension, 'optionalAccess', _29 => _29.endsWith, 'call', _30 => _30(".png")]) ? "image/png" : _optionalChain([customExtension, 'optionalAccess', _31 => _31.match, 'call', _32 => _32(/\.jpe?g$/)]) ? "image/jpeg" : "image/svg+xml";
588
+ const customExtension = _optionalChain([customImage, 'optionalAccess', _25 => _25.toLowerCase, 'call', _26 => _26(), 'access', _27 => _27.split, 'call', _28 => _28(/[?#]/, 1), 'access', _29 => _29[0]]);
589
+ const imageType = !customExtension ? descriptor.format === "png" ? "image/png" : "image/svg+xml" : customExtension.endsWith(".webp") ? "image/webp" : customExtension.endsWith(".png") ? "image/png" : customExtension.match(/\.jpe?g$/) ? "image/jpeg" : "image/svg+xml";
528
590
  const tag = (property, content, name = false) => `<meta ${name ? "name" : "property"}="${property}" content="${escapeXml(content)}">`;
529
591
  return [
530
592
  tag("og:type", "article"),
@@ -570,7 +632,7 @@ function normalizeSlug(value) {
570
632
  return trimSlashes(decodeDocsPath(value)).replace(/\.(mdx?|markdown)$/i, "");
571
633
  }
572
634
  function resolveFarmDocsFavicon(docs, options) {
573
- const configuredFavicon = _optionalChain([docs, 'optionalAccess', _33 => _33.config, 'access', _34 => _34.favicon]);
635
+ const configuredFavicon = _optionalChain([docs, 'optionalAccess', _30 => _30.config, 'access', _31 => _31.favicon]);
574
636
  if (typeof configuredFavicon === "string" && configuredFavicon.trim()) {
575
637
  return configuredFavicon.trim();
576
638
  }
@@ -584,7 +646,7 @@ function resolveFarmDocsFavicon(docs, options) {
584
646
  return FARM_DOCS_FALLBACK_FAVICON;
585
647
  }
586
648
  function renderFarmDocsFaviconLink(faviconHref) {
587
- const normalizedHref = _optionalChain([faviconHref, 'access', _35 => _35.split, 'call', _36 => _36(/[?#]/, 1), 'access', _37 => _37[0], 'optionalAccess', _38 => _38.toLowerCase, 'call', _39 => _39()]) || "";
649
+ const normalizedHref = _optionalChain([faviconHref, 'access', _32 => _32.split, 'call', _33 => _33(/[?#]/, 1), 'access', _34 => _34[0], 'optionalAccess', _35 => _35.toLowerCase, 'call', _36 => _36()]) || "";
588
650
  const type = normalizedHref.endsWith(".svg") || faviconHref.startsWith("data:image/svg+xml") ? "image/svg+xml" : normalizedHref.endsWith(".png") ? "image/png" : normalizedHref.endsWith(".ico") ? "image/x-icon" : void 0;
589
651
  const metadata = type === "image/svg+xml" ? ' sizes="any" type="image/svg+xml"' : type ? ` type="${type}"` : "";
590
652
  return `<link rel="icon" href="${escapeAttribute(faviconHref)}"${metadata}>`;
@@ -600,7 +662,7 @@ function renderFarmDocsBrandMark() {
600
662
  </svg>`;
601
663
  }
602
664
  function renderFarmDocsBrandTitle(navTitle) {
603
- const suffix = _optionalChain([navTitle, 'access', _40 => _40.match, 'call', _41 => _41(/\.js$/i), 'optionalAccess', _42 => _42[0]]);
665
+ const suffix = _optionalChain([navTitle, 'access', _37 => _37.match, 'call', _38 => _38(/\.js$/i), 'optionalAccess', _39 => _39[0]]);
604
666
  if (!suffix) {
605
667
  return `<span class="sidebar-brand-title">${escapeHtml(navTitle)}</span>`;
606
668
  }
@@ -632,7 +694,7 @@ function resolveExistingFileInside(root, target) {
632
694
  }
633
695
  }
634
696
  function isFarmDocsRequest(docs, request) {
635
- if (!_optionalChain([docs, 'optionalAccess', _43 => _43.enabled])) return false;
697
+ if (!_optionalChain([docs, 'optionalAccess', _40 => _40.enabled])) return false;
636
698
  if (request.method !== "GET" && request.method !== "HEAD") return false;
637
699
  const pathname = new URL(request.url).pathname;
638
700
  const entry = normalizeEntry2(docs.entry);
@@ -666,7 +728,7 @@ function getFarmDocsRoots(docs) {
666
728
  ];
667
729
  }
668
730
  function getFarmDocsRouteTypeEntries(docs) {
669
- if (!_optionalChain([docs, 'optionalAccess', _44 => _44.enabled])) return [];
731
+ if (!_optionalChain([docs, 'optionalAccess', _41 => _41.enabled])) return [];
670
732
  return getFarmDocsRoots(docs).flatMap((root) => {
671
733
  const entry = normalizeEntry2(root.entry);
672
734
  if (entry === "/") return ["/", "/[...docs]"];
@@ -674,7 +736,7 @@ function getFarmDocsRouteTypeEntries(docs) {
674
736
  });
675
737
  }
676
738
  function getFarmDocsDocumentNavigationMatchers(docs) {
677
- if (!_optionalChain([docs, 'optionalAccess', _45 => _45.enabled])) return [];
739
+ if (!_optionalChain([docs, 'optionalAccess', _42 => _42.enabled])) return [];
678
740
  return getFarmDocsRoots(docs).map((root) => {
679
741
  const entry = normalizeEntry2(root.entry);
680
742
  return entry === "/" ? "/(.*)" : `${entry}(.*)`;
@@ -755,7 +817,7 @@ function titleFromSlug(slug) {
755
817
  return lastSegment.split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
756
818
  }
757
819
  function titleFromMarkdown(body, fallback) {
758
- const heading = _optionalChain([body, 'access', _46 => _46.match, 'call', _47 => _47(/^#\s+(.+)$/m), 'optionalAccess', _48 => _48[1], 'optionalAccess', _49 => _49.trim, 'call', _50 => _50()]);
820
+ const heading = _optionalChain([body, 'access', _43 => _43.match, 'call', _44 => _44(/^#\s+(.+)$/m), 'optionalAccess', _45 => _45[1], 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()]);
759
821
  return heading || fallback;
760
822
  }
761
823
  function createLastModifiedResolver(contentDir, sourcePath, frontmatter) {
@@ -860,11 +922,11 @@ function discoverFarmDocsPages(contentDir, docs) {
860
922
  visit(contentDir);
861
923
  return pages.sort((a, b) => a.href.localeCompare(b.href));
862
924
  }
863
- function toFarmDocsMarkdownPage(page) {
925
+ function toFarmDocsMarkdownPage(page, basePath = "") {
864
926
  const lastModified = page.lastModified || page.frontmatter.lastModified || page.frontmatter.lastmod;
865
927
  return {
866
928
  slug: page.slug,
867
- url: page.href,
929
+ url: _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, page.href, basePath),
868
930
  title: page.title,
869
931
  description: page.description,
870
932
  lastModified,
@@ -873,24 +935,59 @@ function toFarmDocsMarkdownPage(page) {
873
935
  rawContent: page.body
874
936
  };
875
937
  }
938
+ function toFarmDocsRouteRequest(request, basePath) {
939
+ if (!basePath) return request;
940
+ const url = new URL(request.url);
941
+ const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, url.pathname, basePath);
942
+ if (routePathname === url.pathname) return request;
943
+ url.pathname = routePathname;
944
+ return new Request(url, request);
945
+ }
946
+ function getFarmDocsSiteUrl(request, basePath) {
947
+ return `${new URL(request.url).origin}${basePath}`;
948
+ }
949
+ function getFarmDocsPublicEntry(docs, basePath) {
950
+ return basePath ? _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, normalizeEntry2(docs.entry), basePath) : docs.entry;
951
+ }
952
+ function toFarmDocsPublicSitemapConfig(sitemap, basePath) {
953
+ if (!basePath || sitemap === false) return sitemap;
954
+ const configured = typeof sitemap === "object" ? sitemap : {};
955
+ return {
956
+ ...configured,
957
+ routePrefix: `${basePath}/${trimSlashes(_nullishCoalesce(configured.routePrefix, () => ( "")))}`
958
+ };
959
+ }
960
+ function buildFarmDocsSitemapManifest(pages, docs, origin, basePath) {
961
+ return _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsSitemapManifest({
962
+ pages: pages.map((page) => ({
963
+ ...toFarmDocsMarkdownPage(page, basePath),
964
+ sourcePath: page.sourcePath
965
+ })),
966
+ entry: getFarmDocsPublicEntry(docs, basePath),
967
+ siteTitle: getDocsTitle(docs),
968
+ baseUrl: origin
969
+ });
970
+ }
971
+ function renderFarmDocsRobotsTxt(docs, origin, basePath) {
972
+ return _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsRobotsTxt({
973
+ entry: getFarmDocsPublicEntry(docs, basePath),
974
+ sitemap: toFarmDocsPublicSitemapConfig(_nullishCoalesce(docs.config.sitemap, () => ( true)), basePath),
975
+ robots: _nullishCoalesce(docs.config.robots, () => ( true)),
976
+ baseUrl: origin
977
+ });
978
+ }
876
979
  function getDocsTitle(docs) {
877
980
  return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
878
981
  }
879
982
  function getDocsDescription(docs) {
880
- return _optionalChain([docs, 'access', _51 => _51.config, 'access', _52 => _52.metadata, 'optionalAccess', _53 => _53.description]);
983
+ return _optionalChain([docs, 'access', _48 => _48.config, 'access', _49 => _49.metadata, 'optionalAccess', _50 => _50.description]);
881
984
  }
882
985
  function getLoadedDocsPages(contentDir, docs, isPathGuarded) {
883
- return discoverFarmDocsPages(contentDir, docs).filter((page) => !_optionalChain([isPathGuarded, 'optionalCall', _54 => _54(page.href)])).map((page) => loadFarmDocsPage(contentDir, docs, page.slug)).filter((page) => Boolean(page));
986
+ return discoverFarmDocsPages(contentDir, docs).filter((page) => !_optionalChain([isPathGuarded, 'optionalCall', _51 => _51(page.href)])).map((page) => loadFarmDocsPage(contentDir, docs, page.slug)).filter((page) => Boolean(page));
884
987
  }
885
988
  function toDocsLlmsPage(page) {
886
989
  return toFarmDocsMarkdownPage(page);
887
990
  }
888
- function toDocsSitemapPage(page) {
889
- return {
890
- ...toFarmDocsMarkdownPage(page),
891
- sourcePath: page.sourcePath
892
- };
893
- }
894
991
  function resolvePageActionsConfig(docs) {
895
992
  return isObjectRecord(docs.config.pageActions) ? docs.config.pageActions : {};
896
993
  }
@@ -951,7 +1048,7 @@ function resolveReadingTimeDisplayConfig(docs) {
951
1048
  }
952
1049
  function countMarkdownWords(body, includeCode) {
953
1050
  const readable = (includeCode ? body : body.replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ")).replace(/!\[[^\]]*]\([^)]*\)/g, " ").replace(/\[([^\]]+)]\([^)]*\)/g, "$1").replace(/<[^>]+>/g, " ").replace(/[#>*_~`|:-]/g, " ");
954
- return _nullishCoalesce(_optionalChain([readable, 'access', _55 => _55.match, 'call', _56 => _56(/[A-Za-z0-9]+(?:[-'][A-Za-z0-9]+)*/g), 'optionalAccess', _57 => _57.length]), () => ( 0));
1051
+ return _nullishCoalesce(_optionalChain([readable, 'access', _52 => _52.match, 'call', _53 => _53(/[A-Za-z0-9]+(?:[-'][A-Za-z0-9]+)*/g), 'optionalAccess', _54 => _54.length]), () => ( 0));
955
1052
  }
956
1053
  function renderReadingTimeMeta(page, docs) {
957
1054
  const config = resolveReadingTimeDisplayConfig(docs);
@@ -964,10 +1061,10 @@ function renderReadingTimeMeta(page, docs) {
964
1061
  <span class="fd-page-meta-item">${escapeHtml(label)}</span>
965
1062
  </div>`;
966
1063
  }
967
- function renderPixelPageActions(page, docs) {
1064
+ function renderPixelPageActions(page, docs, basePath) {
968
1065
  const copyMarkdown = resolveCopyMarkdownActionConfig(docs);
969
1066
  if (!copyMarkdown) return "";
970
- const markdownUrl = `${page.href}.md`;
1067
+ const markdownUrl = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, `${page.href}.md`, basePath);
971
1068
  const includeTitle = copyMarkdown.includeTitle ? "true" : "false";
972
1069
  return `<div class="fd-page-actions" data-page-actions data-actions-alignment="${resolvePageActionsAlignment(docs)}">
973
1070
  <button
@@ -989,9 +1086,9 @@ function renderPixelPageActions(page, docs) {
989
1086
  </button>
990
1087
  </div>`;
991
1088
  }
992
- function renderBelowTitleMeta(page, docs) {
1089
+ function renderBelowTitleMeta(page, docs, basePath) {
993
1090
  const lastUpdated = renderLastUpdatedText(page, docs, "below-title");
994
- const actions = renderPixelPageActions(page, docs);
1091
+ const actions = renderPixelPageActions(page, docs, basePath);
995
1092
  const readingTime = renderReadingTimeMeta(page, docs);
996
1093
  if (!lastUpdated && !actions && !readingTime) return "";
997
1094
  return `<div class="fd-below-title-block not-prose">
@@ -1000,8 +1097,8 @@ function renderBelowTitleMeta(page, docs) {
1000
1097
  ${readingTime}
1001
1098
  </div>`;
1002
1099
  }
1003
- function renderMarkdownHtmlWithTitleMeta(page, docs, html) {
1004
- const meta = renderBelowTitleMeta(page, docs);
1100
+ function renderMarkdownHtmlWithTitleMeta(page, docs, html, basePath) {
1101
+ const meta = renderBelowTitleMeta(page, docs, basePath);
1005
1102
  if (!meta) return html;
1006
1103
  const withTitleMeta = html.replace(/(<h1\b[\s\S]*?<\/h1>)/, `$1
1007
1104
  ${meta}`);
@@ -1015,18 +1112,20 @@ function renderPixelPageFooter(page, docs) {
1015
1112
  <span class="fd-last-updated-footer">${lastUpdated}</span>
1016
1113
  </div>`;
1017
1114
  }
1018
- function getDocsLlmsOptions(docs, request) {
1115
+ function getDocsLlmsOptions(docs, request, basePath) {
1019
1116
  const configured = typeof docs.config.llmsTxt === "object" && docs.config.llmsTxt !== null ? docs.config.llmsTxt : {};
1020
1117
  return {
1021
1118
  enabled: true,
1022
- baseUrl: new URL(request.url).origin,
1119
+ baseUrl: getFarmDocsSiteUrl(request, basePath),
1023
1120
  siteTitle: getDocsTitle(docs),
1024
1121
  siteDescription: getDocsDescription(docs),
1025
1122
  ...configured
1026
1123
  };
1027
1124
  }
1028
- function getDocsDiscoveryOptions(docs, request) {
1125
+ function getDocsDiscoveryOptions(docs, request, basePath) {
1029
1126
  return {
1127
+ // The discovery files list the docs engine's routes as root-relative paths, which answer at
1128
+ // the origin root too. `llms.baseUrl` gives the site's own URL, below the basePath.
1030
1129
  origin: new URL(request.url).origin,
1031
1130
  entry: docs.entry,
1032
1131
  i18n: null,
@@ -1048,7 +1147,7 @@ function getDocsDiscoveryOptions(docs, request) {
1048
1147
  }
1049
1148
  },
1050
1149
  feedback: void 0,
1051
- llms: getDocsLlmsOptions(docs, request),
1150
+ llms: getDocsLlmsOptions(docs, request, basePath),
1052
1151
  sitemap: _nullishCoalesce(docs.config.sitemap, () => ( true)),
1053
1152
  robots: _nullishCoalesce(docs.config.robots, () => ( true)),
1054
1153
  openapi: void 0,
@@ -1058,16 +1157,11 @@ function getDocsDiscoveryOptions(docs, request) {
1058
1157
  }
1059
1158
  };
1060
1159
  }
1061
- function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded) {
1160
+ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded, basePath) {
1062
1161
  const url = new URL(request.url);
1063
1162
  let loadedPages;
1064
1163
  const getPages = () => _nullishCoalesce(loadedPages, () => ( (loadedPages = getLoadedDocsPages(contentDir, docs, isPathGuarded))));
1065
- const sitemapManifest = () => _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsSitemapManifest({
1066
- pages: getPages().map(toDocsSitemapPage),
1067
- entry: docs.entry,
1068
- siteTitle: getDocsTitle(docs),
1069
- baseUrl: url.origin
1070
- });
1164
+ const sitemapManifest = () => buildFarmDocsSitemapManifest(getPages(), docs, url.origin, basePath);
1071
1165
  const textHeaders = (contentType) => ({
1072
1166
  "Content-Type": contentType,
1073
1167
  "Cache-Control": "public, max-age=60"
@@ -1076,7 +1170,7 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1076
1170
  if (llmsFormat) {
1077
1171
  const generated = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsLlmsTxt(
1078
1172
  getPages().map(toDocsLlmsPage),
1079
- getDocsLlmsOptions(docs, request)
1173
+ getDocsLlmsOptions(docs, request, basePath)
1080
1174
  );
1081
1175
  return new Response(llmsFormat === "llms-full" ? generated.llmsFullTxt : generated.llmsTxt, {
1082
1176
  status: 200,
@@ -1108,21 +1202,15 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1108
1202
  );
1109
1203
  }
1110
1204
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).resolveDocsRobotsRequest(url, _nullishCoalesce(docs.config.robots, () => ( true)))) {
1111
- return new Response(
1112
- _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsRobotsTxt({
1113
- entry: docs.entry,
1114
- sitemap: _nullishCoalesce(docs.config.sitemap, () => ( true)),
1115
- robots: _nullishCoalesce(docs.config.robots, () => ( true)),
1116
- baseUrl: url.origin
1117
- }),
1118
- {
1119
- status: 200,
1120
- headers: textHeaders("text/plain; charset=utf-8")
1121
- }
1122
- );
1205
+ return new Response(renderFarmDocsRobotsTxt(docs, url.origin, basePath), {
1206
+ status: 200,
1207
+ headers: textHeaders("text/plain; charset=utf-8")
1208
+ });
1123
1209
  }
1124
1210
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).isDocsAgentDiscoveryRequest(url)) {
1125
- const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(docs, request));
1211
+ const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(
1212
+ getDocsDiscoveryOptions(docs, request, basePath)
1213
+ );
1126
1214
  const title = getDocsTitle(docs);
1127
1215
  return new Response(
1128
1216
  JSON.stringify({
@@ -1143,7 +1231,7 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1143
1231
  }
1144
1232
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).isDocsAgentsRequest(url)) {
1145
1233
  return new Response(
1146
- `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsAgentsDocument(getDocsDiscoveryOptions(docs, request)).trim()}
1234
+ `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsAgentsDocument(getDocsDiscoveryOptions(docs, request, basePath)).trim()}
1147
1235
  `,
1148
1236
  {
1149
1237
  status: 200,
@@ -1153,7 +1241,7 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1153
1241
  }
1154
1242
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).isDocsSkillRequest(url)) {
1155
1243
  return new Response(
1156
- `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsSkillDocument(getDocsDiscoveryOptions(docs, request)).trim()}
1244
+ `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsSkillDocument(getDocsDiscoveryOptions(docs, request, basePath)).trim()}
1157
1245
  `,
1158
1246
  {
1159
1247
  status: 200,
@@ -1179,11 +1267,11 @@ function shouldReturnMarkdown(request) {
1179
1267
  if (url.pathname.endsWith(".md")) return true;
1180
1268
  const accept = request.headers.get("accept");
1181
1269
  const markdown = Math.max(
1182
- _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1183
- _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1270
+ _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1271
+ _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1184
1272
  );
1185
1273
  if (markdown <= 0) return false;
1186
- return markdown >= _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1274
+ return markdown >= _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1187
1275
  }
1188
1276
  function escapeAttribute(value) {
1189
1277
  return escapeHtml(value).replace(/'/g, "&#39;");
@@ -1205,7 +1293,7 @@ function stripHtml(value) {
1205
1293
  }
1206
1294
  function getCodeFence(line) {
1207
1295
  const match = /^(?: {0,3})(`{3,}|~{3,})/.exec(line);
1208
- const value = _optionalChain([match, 'optionalAccess', _58 => _58[1]]);
1296
+ const value = _optionalChain([match, 'optionalAccess', _55 => _55[1]]);
1209
1297
  if (!value) return null;
1210
1298
  return { marker: value[0], length: value.length };
1211
1299
  }
@@ -1285,15 +1373,15 @@ function isCodePathLabel(label) {
1285
1373
  }
1286
1374
  function parseCodeInfo(info) {
1287
1375
  const source = (info || "").trim();
1288
- const language = _optionalChain([source, 'access', _59 => _59.match, 'call', _60 => _60(/^\S+/), 'optionalAccess', _61 => _61[0]]) || "text";
1289
- const explicitLabel = _optionalChain([source, 'access', _62 => _62.match, 'call', _63 => _63(/\b(?:title|filename|file|label|name)=["']([^"']+)["']/), 'optionalAccess', _64 => _64[1], 'optionalAccess', _65 => _65.trim, 'call', _66 => _66()]);
1376
+ const language = _optionalChain([source, 'access', _56 => _56.match, 'call', _57 => _57(/^\S+/), 'optionalAccess', _58 => _58[0]]) || "text";
1377
+ const explicitLabel = _optionalChain([source, 'access', _59 => _59.match, 'call', _60 => _60(/\b(?:title|filename|file|label|name)=["']([^"']+)["']/), 'optionalAccess', _61 => _61[1], 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]);
1290
1378
  return { language, label: explicitLabel || language, hasExplicitLabel: Boolean(explicitLabel) };
1291
1379
  }
1292
1380
  function getStandaloneCodeLabel(line) {
1293
1381
  const trimmed = line.trim();
1294
1382
  const match = /^(?:\*\*([^*]+)\*\*|__([^_]+)__|`([^`]+)`)$/u.exec(trimmed);
1295
- const label = _optionalChain([match, 'optionalAccess', _67 => _67[1]]) || _optionalChain([match, 'optionalAccess', _68 => _68[2]]) || _optionalChain([match, 'optionalAccess', _69 => _69[3]]);
1296
- return _optionalChain([label, 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()]) || null;
1383
+ const label = _optionalChain([match, 'optionalAccess', _64 => _64[1]]) || _optionalChain([match, 'optionalAccess', _65 => _65[2]]) || _optionalChain([match, 'optionalAccess', _66 => _66[3]]);
1384
+ return _optionalChain([label, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()]) || null;
1297
1385
  }
1298
1386
  function hasCodeFenceTitle(info) {
1299
1387
  return /\b(?:title|filename|file|label|name)=["'][^"']+["']/.test(info);
@@ -1423,7 +1511,7 @@ function getThemeName(docs) {
1423
1511
  return theme && typeof theme === "object" && "name" in theme ? String(theme.name || "farm-docs") : "farm-docs";
1424
1512
  }
1425
1513
  function getThemeTocDepth(docs) {
1426
- const toc = _optionalChain([getThemeUI, 'call', _72 => _72(docs), 'access', _73 => _73.layout, 'optionalAccess', _74 => _74.toc]);
1514
+ const toc = _optionalChain([getThemeUI, 'call', _69 => _69(docs), 'access', _70 => _70.layout, 'optionalAccess', _71 => _71.toc]);
1427
1515
  return toc && typeof toc === "object" && typeof toc.depth === "number" ? toc.depth : 3;
1428
1516
  }
1429
1517
  var SIDEBAR_SECTION_ORDER = [
@@ -1561,7 +1649,7 @@ function renderSidebarLabel(docs, icon, label, className) {
1561
1649
  return `<span class="${className}">${renderSidebarIcon(docs, icon)}<span class="sidebar-label-text">${escapeHtml(label)}</span></span>`;
1562
1650
  }
1563
1651
  function getSidebarPageLabel(item, configured) {
1564
- if (_optionalChain([configured, 'optionalAccess', _75 => _75.label])) return configured.label;
1652
+ if (_optionalChain([configured, 'optionalAccess', _72 => _72.label])) return configured.label;
1565
1653
  if (item.slug === "") return "Why?";
1566
1654
  if (item.slug === "integrations") return "Overview";
1567
1655
  if (item.slug === "integrations/ui-registry") return "UI Registry";
@@ -1571,9 +1659,9 @@ function getSidebarPageLabel(item, configured) {
1571
1659
  }
1572
1660
  return item.title;
1573
1661
  }
1574
- function renderSidebarLink(item, activeHref, docs, configured) {
1662
+ function renderSidebarLink(item, activeHref, docs, basePath, configured) {
1575
1663
  const active = item.href === activeHref;
1576
- return `<a class="fd-sidebar-link${active ? " fd-sidebar-link-active" : ""}" data-active="${active ? "true" : "false"}" href="${escapeAttribute(item.href)}">${renderSidebarLabel(docs, _optionalChain([configured, 'optionalAccess', _76 => _76.icon]), getSidebarPageLabel(item, configured), "sidebar-link-label fd-sidebar-link-label")}</a>`;
1664
+ return `<a class="fd-sidebar-link${active ? " fd-sidebar-link-active" : ""}" data-active="${active ? "true" : "false"}" href="${escapeAttribute(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, item.href, basePath))}">${renderSidebarLabel(docs, _optionalChain([configured, 'optionalAccess', _73 => _73.icon]), getSidebarPageLabel(item, configured), "sidebar-link-label fd-sidebar-link-label")}</a>`;
1577
1665
  }
1578
1666
  function collectConfiguredSidebarPages(items, maps, seen = /* @__PURE__ */ new Set()) {
1579
1667
  const ordered = [];
@@ -1611,24 +1699,24 @@ ${childHtml}
1611
1699
  </div>
1612
1700
  </div>`;
1613
1701
  }
1614
- function renderConfiguredSidebarItems(items, maps, activeHref, docs) {
1702
+ function renderConfiguredSidebarItems(items, maps, activeHref, docs, basePath) {
1615
1703
  const renderedItems = [];
1616
1704
  for (const item of items) {
1617
1705
  const page = resolveConfiguredSidebarPage(item, maps);
1618
- const childHtml = renderConfiguredSidebarItems(item.children, maps, activeHref, docs);
1706
+ const childHtml = renderConfiguredSidebarItems(item.children, maps, activeHref, docs, basePath);
1619
1707
  if (item.children.length > 0) {
1620
1708
  renderedItems.push(renderConfiguredSidebarSubgroup(item, childHtml, docs));
1621
1709
  continue;
1622
1710
  }
1623
- const linkHtml = page ? renderSidebarLink(page, activeHref, docs, item) : renderExternalSidebarLink(item, activeHref, docs);
1711
+ const linkHtml = page ? renderSidebarLink(page, activeHref, docs, basePath, item) : renderExternalSidebarLink(item, activeHref, docs);
1624
1712
  if (linkHtml) renderedItems.push(linkHtml);
1625
1713
  }
1626
1714
  return renderedItems.join("\n");
1627
1715
  }
1628
- function renderConfiguredSidebarSection(section, maps, activeHref, docs) {
1716
+ function renderConfiguredSidebarSection(section, maps, activeHref, docs, basePath) {
1629
1717
  const label = section.label || "Docs";
1630
1718
  const id = sidebarIdFor(label);
1631
- const links = renderConfiguredSidebarItems(section.children, maps, activeHref, docs);
1719
+ const links = renderConfiguredSidebarItems(section.children, maps, activeHref, docs, basePath);
1632
1720
  return `<div class="sidebar-folder fd-sidebar-folder" data-state="open">
1633
1721
  <button class="text-fd-muted-foreground sidebar-folder-trigger fd-sidebar-folder-trigger" type="button" aria-controls="${escapeAttribute(id)}" aria-expanded="true">${renderSidebarLabel(docs, section.icon, label, "sidebar-folder-label")}</button>
1634
1722
  <div id="${escapeAttribute(id)}" class="overflow-hidden sidebar-folder-content fd-sidebar-folder-content" data-state="open">
@@ -1636,19 +1724,19 @@ ${links}
1636
1724
  </div>
1637
1725
  </div>`;
1638
1726
  }
1639
- function renderAutoSidebarSectionItems(items, activeHref, docs) {
1640
- return [...items].sort(compareSidebarPages).map((item) => renderSidebarLink(item, activeHref, docs)).join("\n");
1727
+ function renderAutoSidebarSectionItems(items, activeHref, docs, basePath) {
1728
+ return [...items].sort(compareSidebarPages).map((item) => renderSidebarLink(item, activeHref, docs, basePath)).join("\n");
1641
1729
  }
1642
- function renderPixelNavItems(pages, activeHref, docs) {
1730
+ function renderPixelNavItems(pages, activeHref, docs, basePath) {
1643
1731
  const configuredSidebar = getSidebarNavigation(docs);
1644
1732
  if (configuredSidebar.length > 0) {
1645
1733
  const maps = createSidebarPageMaps(pages);
1646
1734
  const renderedSections2 = configuredSidebar.map((section) => {
1647
1735
  if (section.children.length > 0) {
1648
- return renderConfiguredSidebarSection(section, maps, activeHref, docs);
1736
+ return renderConfiguredSidebarSection(section, maps, activeHref, docs, basePath);
1649
1737
  }
1650
1738
  const page = resolveConfiguredSidebarPage(section, maps);
1651
- return page ? renderSidebarLink(page, activeHref, docs, section) : renderExternalSidebarLink(section, activeHref, docs);
1739
+ return page ? renderSidebarLink(page, activeHref, docs, basePath, section) : renderExternalSidebarLink(section, activeHref, docs);
1652
1740
  }).filter(Boolean).join("\n");
1653
1741
  return `<div class="sidebar-scroll overscroll-contain fd-sidebar-nav">
1654
1742
  <div class="sidebar-tree">
@@ -1669,7 +1757,7 @@ ${renderedSections2}
1669
1757
  return (aOrder === -1 ? 100 : aOrder) - (bOrder === -1 ? 100 : bOrder) || a.localeCompare(b);
1670
1758
  }).map(([section, items]) => {
1671
1759
  const id = sidebarIdFor(section);
1672
- const links = renderAutoSidebarSectionItems(items, activeHref, docs);
1760
+ const links = renderAutoSidebarSectionItems(items, activeHref, docs, basePath);
1673
1761
  return `<div class="sidebar-folder fd-sidebar-folder" data-state="open">
1674
1762
  <button class="text-fd-muted-foreground sidebar-folder-trigger fd-sidebar-folder-trigger" type="button" aria-controls="${escapeAttribute(id)}" aria-expanded="true">${renderSidebarLabel(docs, void 0, section, "sidebar-folder-label")}</button>
1675
1763
  <div id="${escapeAttribute(id)}" class="overflow-hidden sidebar-folder-content fd-sidebar-folder-content" data-state="open">
@@ -1683,7 +1771,7 @@ ${renderedSections}
1683
1771
  </div>
1684
1772
  </div>`;
1685
1773
  }
1686
- function renderPixelPageNav(pages, activeHref, docs) {
1774
+ function renderPixelPageNav(pages, activeHref, docs, basePath) {
1687
1775
  const orderedPages = getOrderedSidebarPages(pages, docs);
1688
1776
  const activeIndex = orderedPages.findIndex((item) => item.href === activeHref);
1689
1777
  if (activeIndex === -1) return "";
@@ -1691,7 +1779,7 @@ function renderPixelPageNav(pages, activeHref, docs) {
1691
1779
  const next = orderedPages[activeIndex + 1];
1692
1780
  if (!previous && !next) return "";
1693
1781
  const renderChevron = (direction) => `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="${direction === "prev" ? "15 18 9 12 15 6" : "9 18 15 12 9 6"}" /></svg>`;
1694
- const renderCard = (item, direction) => `<a class="fd-page-nav-card fd-page-nav-${direction}" href="${escapeAttribute(item.href)}">
1782
+ const renderCard = (item, direction) => `<a class="fd-page-nav-card fd-page-nav-${direction}" href="${escapeAttribute(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, item.href, basePath))}">
1695
1783
  <span class="fd-page-nav-title fd-page-nav-title-${direction}">${direction === "prev" ? `${renderChevron(direction)}${escapeHtml(item.title)}` : `${escapeHtml(item.title)}${renderChevron(direction)}`}</span>
1696
1784
  <span class="fd-page-nav-description">${direction === "prev" ? "Previous Page" : "Next Page"}</span>
1697
1785
  </a>`;
@@ -1711,7 +1799,7 @@ function isBreadcrumbEnabled(docs) {
1711
1799
  }
1712
1800
  return true;
1713
1801
  }
1714
- function renderPixelBreadcrumb(page, docs) {
1802
+ function renderPixelBreadcrumb(page, docs, basePath) {
1715
1803
  if (!isBreadcrumbEnabled(docs)) return "";
1716
1804
  const segments = trimSlashes(page.slug).split("/").filter(Boolean);
1717
1805
  if (segments.length < 2) return "";
@@ -1720,7 +1808,10 @@ function renderPixelBreadcrumb(page, docs) {
1720
1808
  const currentSegment = segments[segments.length - 1];
1721
1809
  const entry = normalizeEntry2(docs.entry);
1722
1810
  const parentPath = parentSegments.join("/");
1723
- const parentHref = entry === "/" ? `/${parentPath}` : `${entry}/${parentPath}`;
1811
+ const parentHref = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0,
1812
+ entry === "/" ? `/${parentPath}` : `${entry}/${parentPath}`,
1813
+ basePath
1814
+ );
1724
1815
  return `<nav class="fd-breadcrumb" aria-label="Breadcrumb">
1725
1816
  <span class="fd-breadcrumb-item">
1726
1817
  <a class="fd-breadcrumb-parent fd-breadcrumb-link" href="${escapeAttribute(parentHref)}">${escapeHtml(titleizePathSegment(parentSegment))}</a>
@@ -1755,8 +1846,8 @@ ${items.map(
1755
1846
  </div>
1756
1847
  </div>`;
1757
1848
  }
1758
- function renderDocsRuntimeScript(docs) {
1759
- const docsEntry = JSON.stringify(normalizeEntry2(docs.entry));
1849
+ function renderDocsRuntimeScript(docs, basePath) {
1850
+ const docsEntry = JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, normalizeEntry2(docs.entry), basePath));
1760
1851
  const reconcileHeadRuntime = `const farmNavigationHeadSelector=${JSON.stringify(_chunkOOJBBHYWcjs.FARM_NAVIGATION_HEAD_SELECTOR)};const reconcileDocsHead=(nextDoc)=>{const nextTitle=nextDoc.querySelector("title");document.title=nextTitle?.textContent||"";document.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>node.remove());nextDoc.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>document.head.appendChild(document.importNode(node,true)))}`;
1761
1852
  return `<script>(()=>{if(window.__farmDocsRuntime)return;window.__farmDocsRuntime=true;document.documentElement.dataset.farmDocsRuntime="true";document.documentElement.dataset.farmDocsRuntimeId=Math.random().toString(36).slice(2);${reconcileHeadRuntime};const docsEntry=${docsEntry};let cleanupToc=()=>{};let closeMobileSidebar=()=>{};const normalizePath=(path)=>path.length>1?path.replace(/\\/+$/,""):path;const isDocsPath=(path)=>{const next=normalizePath(path);const entry=normalizePath(docsEntry);if(next.endsWith(".md"))return false;if(entry==="/")return true;return next===entry||next.startsWith(entry+"/")};const initToc=()=>{cleanupToc();const toc=document.getElementById("nd-toc");if(!toc){cleanupToc=()=>{};return}const links=Array.from(toc.querySelectorAll("[data-toc-item]"));const thumb=toc.querySelector("[data-toc-thumb]");const pairs=links.map((link)=>{let id=link.hash.slice(1);try{id=decodeURIComponent(id)}catch{}return{link,heading:document.getElementById(id)}}).filter((item)=>item.heading);const setActive=(active)=>{for(const {link} of pairs){const selected=link===active.link;link.dataset.active=selected?"true":"false";link.classList.toggle("fd-toc-link-active",selected)}if(!thumb)return;const styles=getComputedStyle(active.link);const top=active.link.offsetTop+parseFloat(styles.paddingTop||"0");const bottom=active.link.offsetTop+active.link.clientHeight-parseFloat(styles.paddingBottom||"0");thumb.style.clipPath="polygon(0 "+top+"px,100% "+top+"px,100% "+bottom+"px,0 "+bottom+"px)"};const update=()=>{if(pairs.length===0)return;const offset=Math.min(window.innerHeight*0.3,160);let active=pairs[0];for(const pair of pairs){if(pair.heading.getBoundingClientRect().top<=offset)active=pair;else break}setActive(active)};let frame=0;const schedule=()=>{if(frame)return;frame=requestAnimationFrame(()=>{frame=0;update()})};const onHashChange=()=>setTimeout(schedule,0);window.addEventListener("scroll",schedule,{passive:true});window.addEventListener("resize",schedule);window.addEventListener("hashchange",onHashChange);cleanupToc=()=>{window.removeEventListener("scroll",schedule);window.removeEventListener("resize",schedule);window.removeEventListener("hashchange",onHashChange);if(frame)cancelAnimationFrame(frame);frame=0};update()};const getSidebar=()=>document.getElementById("nd-sidebar");const ensureActiveVisible=()=>{const sidebar=getSidebar();if(!sidebar)return;const active=sidebar.querySelector('a[data-active="true"]');if(!(active instanceof HTMLElement))return;const activeRect=active.getBoundingClientRect();const sidebarRect=sidebar.getBoundingClientRect();if(activeRect.top<sidebarRect.top||activeRect.bottom>sidebarRect.bottom)sidebar.scrollTop+=activeRect.top-sidebarRect.top-(sidebar.clientHeight-activeRect.height)/2};const setSidebarActive=(path)=>{const sidebar=getSidebar();if(!sidebar)return;const current=normalizePath(path);for(const link of Array.from(sidebar.querySelectorAll("a[href]"))){try{link.dataset.active=normalizePath(new URL(link.href,location.href).pathname)===current?"true":"false"}catch{}}ensureActiveVisible()};const initMobileSidebar=()=>{const layout=document.getElementById("nd-docs-layout");const sidebar=getSidebar();const toggle=document.querySelector("[data-sidebar-toggle]");const backdrop=document.querySelector("[data-sidebar-backdrop]");if(!layout||!sidebar||!(toggle instanceof HTMLButtonElement))return;const setOpen=(open)=>{layout.dataset.sidebarOpen=open?"true":"false";sidebar.classList.toggle("fd-sidebar-open",open);document.documentElement.dataset.farmDocsSidebar=open?"open":"closed";toggle.setAttribute("aria-expanded",open?"true":"false");toggle.setAttribute("aria-label",open?"Close menu":"Open menu")};const toggleOpen=()=>setOpen(layout.dataset.sidebarOpen!=="true");closeMobileSidebar=()=>setOpen(false);toggle.addEventListener("click",(event)=>{event.preventDefault();toggleOpen()});backdrop?.addEventListener("click",()=>closeMobileSidebar());document.addEventListener("keydown",(event)=>{if(event.key==="Escape")closeMobileSidebar()});sidebar.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(target)closeMobileSidebar()});closeMobileSidebar()};const initSidebarScroll=()=>{const sidebar=getSidebar();if(!sidebar)return;const key="farmdocs:sidebar-scroll:"+location.origin;const getStorage=()=>{try{return window.sessionStorage}catch{return null}};const readSaved=()=>{try{const raw=getStorage()?.getItem(key);if(!raw)return null;const parsed=JSON.parse(raw);return parsed&&typeof parsed==="object"?parsed:null}catch{return null}};const save=(path=location.pathname)=>{try{getStorage()?.setItem(key,JSON.stringify({path,scrollTop:sidebar.scrollTop}))}catch{}};const saved=readSaved();if(saved?.path===location.pathname&&Number.isFinite(Number(saved.scrollTop)))sidebar.scrollTop=Number(saved.scrollTop);ensureActiveVisible();save();sidebar.addEventListener("scroll",()=>save(),{passive:true});sidebar.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(!target)return;try{save(new URL(target.href,location.href).pathname)}catch{save()}});window.addEventListener("beforeunload",()=>save())};let navigateController=null;const getPageKey=(root)=>{const article=root.getElementById("nd-page");if(!article)return"";return article.querySelector("h1")?.textContent?.trim()||article.textContent?.replace(/\\s+/g," ").trim().slice(0,160)||""};const swapDocsPage=(html,url)=>{const nextDoc=new DOMParser().parseFromString(html,"text/html");const nextArticle=nextDoc.getElementById("nd-page");const currentArticle=document.getElementById("nd-page");if(!nextArticle||!currentArticle)return false;const nextKey=getPageKey(nextDoc);const importedArticle=document.importNode(nextArticle,true);currentArticle.replaceWith(importedArticle);const renderedArticle=document.getElementById("nd-page");if(!renderedArticle||renderedArticle===currentArticle||(nextKey&&getPageKey(document)!==nextKey))return false;const nextToc=nextDoc.getElementById("nd-toc");const currentToc=document.getElementById("nd-toc");if(nextToc&&currentToc)currentToc.replaceWith(document.importNode(nextToc,true));reconcileDocsHead(nextDoc);setSidebarActive(url.pathname);initToc();closeMobileSidebar();return true};const navigateDocs=async(url,{replace=false,scroll=true}={})=>{if(!isDocsPath(url.pathname))return false;if(navigateController)navigateController.abort();const controller=new AbortController();navigateController=controller;document.documentElement.dataset.farmDocsNavigating="true";try{const response=await fetch(url.href,{cache:"no-store",headers:{accept:"text/html","x-farm-docs-navigate":"1"},signal:controller.signal});if(!response.ok||!((response.headers.get("content-type")||"").includes("text/html")))return false;const html=await response.text();if(!swapDocsPage(html,url))return false;if(replace)history.replaceState({farmDocs:true},"",url.href);else history.pushState({farmDocs:true},"",url.href);if(scroll){if(url.hash){let id=url.hash.slice(1);try{id=decodeURIComponent(id)}catch{}document.getElementById(id)?.scrollIntoView({block:"start"})}else window.scrollTo({top:0,left:0})}return true}catch(error){if(error?.name==="AbortError")return true;return false}finally{if(navigateController===controller){delete document.documentElement.dataset.farmDocsNavigating;navigateController=null}}};const initClientNavigation=()=>{document.addEventListener("click",(event)=>{if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(!target||target.target||target.hasAttribute("download"))return;let url;try{url=new URL(target.href,location.href)}catch{return}if(url.origin!==location.origin||!isDocsPath(url.pathname))return;if(normalizePath(url.pathname)===normalizePath(location.pathname)&&url.hash)return;event.preventDefault();navigateDocs(url).then((handled)=>{if(!handled)location.href=url.href})});window.addEventListener("popstate",()=>{navigateDocs(new URL(location.href),{replace:true,scroll:false}).then((handled)=>{if(!handled)location.reload()})})};const init=()=>{initToc();initMobileSidebar();initSidebarScroll();initClientNavigation()};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",init,{once:true});else init()})();</script>`;
1762
1853
  }
@@ -1766,8 +1857,8 @@ function renderDocsPageActionsRuntimeScript() {
1766
1857
  function renderDocsHashRuntimeScript() {
1767
1858
  return `<script>(()=>{if(window.__farmDocsHashRuntime)return;window.__farmDocsHashRuntime=true;const scrollToHash=()=>{if(!location.hash)return;let id=location.hash.slice(1);try{id=decodeURIComponent(id)}catch{}document.getElementById(id)?.scrollIntoView({block:"start"})};const schedule=()=>requestAnimationFrame(()=>requestAnimationFrame(scrollToHash));if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",schedule,{once:true});else schedule();window.addEventListener("load",schedule,{once:true});window.addEventListener("hashchange",schedule)})();</script>`;
1768
1859
  }
1769
- function renderDocsRuntimeScripts(docs) {
1770
- return _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, `${renderDocsRuntimeScript(docs)}
1860
+ function renderDocsRuntimeScripts(docs, basePath) {
1861
+ return _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, `${renderDocsRuntimeScript(docs, basePath)}
1771
1862
  ${renderDocsHashRuntimeScript()}
1772
1863
  ${renderDocsPageActionsRuntimeScript()}`);
1773
1864
  }
@@ -1781,8 +1872,8 @@ function renderFarmDocsFontPreloadHeader(fontAssets) {
1781
1872
  }
1782
1873
  function getFarmLayoutFontPreloads(layoutFonts) {
1783
1874
  const seen = /* @__PURE__ */ new Set();
1784
- return [_optionalChain([layoutFonts, 'optionalAccess', _77 => _77.body]), _optionalChain([layoutFonts, 'optionalAccess', _78 => _78.code])].flatMap(
1785
- (font) => (_optionalChain([font, 'optionalAccess', _79 => _79.preloads]) || []).filter(({ href }) => {
1875
+ return [_optionalChain([layoutFonts, 'optionalAccess', _74 => _74.body]), _optionalChain([layoutFonts, 'optionalAccess', _75 => _75.code])].flatMap(
1876
+ (font) => (_optionalChain([font, 'optionalAccess', _76 => _76.preloads]) || []).filter(({ href }) => {
1786
1877
  if (seen.has(href)) return false;
1787
1878
  seen.add(href);
1788
1879
  return true;
@@ -1792,17 +1883,18 @@ function getFarmLayoutFontPreloads(layoutFonts) {
1792
1883
  function renderFarmLayoutFontPreloadHeader(layoutFonts) {
1793
1884
  return getFarmLayoutFontPreloads(layoutFonts).map(({ href, type }) => `<${href}>; rel=preload; as=font; type=${type}; crossorigin`).join(", ");
1794
1885
  }
1795
- function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, requestUrl, fontAssets, fontStylesheetHref, globalStylesheetHref) {
1886
+ function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, requestUrl, fontAssets, basePath, fontStylesheetHref, globalStylesheetHref, socialImageFormat = "svg") {
1796
1887
  const navTitle = typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Docs") : "Docs";
1797
- const description = page.description || _optionalChain([docs, 'access', _80 => _80.config, 'access', _81 => _81.metadata, 'optionalAccess', _82 => _82.description]) || "";
1888
+ const description = page.description || _optionalChain([docs, 'access', _77 => _77.config, 'access', _78 => _78.metadata, 'optionalAccess', _79 => _79.description]) || "";
1798
1889
  const renderedMarkdown = renderMarkdownDocument(page.body, getThemeTocDepth(docs));
1799
1890
  const tocItems = renderedMarkdown.tocItems;
1800
1891
  const themeName = getThemeName(docs);
1801
1892
  const searchEnabled = _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, docs);
1802
1893
  const socialMetadata = isFarmDocsSocialImageEnabled(page, docs) ? renderFarmDocsSocialMetadata(
1803
- createFarmDocsSocialImageDescriptor(page, docs, requestUrl),
1894
+ createFarmDocsSocialImageDescriptor(page, docs, requestUrl, socialImageFormat, basePath),
1804
1895
  getFarmDocsCustomSocialImage(page)
1805
1896
  ) : "";
1897
+ const homeHref = escapeAttribute(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, "/", basePath));
1806
1898
  return `<!DOCTYPE html>
1807
1899
  <html class="dark" lang="en" data-docs-theme="${escapeAttribute(themeName)}">
1808
1900
  <head>
@@ -1824,28 +1916,28 @@ function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, reques
1824
1916
  <button class="fd-mobile-nav-btn fd-menu-btn" type="button" data-sidebar-toggle aria-controls="nd-sidebar" aria-expanded="false" aria-label="Open menu">
1825
1917
  <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
1826
1918
  </button>
1827
- <a class="fd-header-title" href="/">${escapeHtml(navTitle)}</a>
1919
+ <a class="fd-header-title" href="${homeHref}">${escapeHtml(navTitle)}</a>
1828
1920
  <div class="mobile-topbar-actions">
1829
1921
  ${searchEnabled ? renderDocsSearchTrigger(true, "fd-search-trigger-mobile") : ""}
1830
- <a class="mobile-topbar-link" href="/llms.txt">llms.txt</a>
1922
+ <a class="mobile-topbar-link" href="${escapeAttribute(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, "/llms.txt", basePath))}">llms.txt</a>
1831
1923
  </div>
1832
1924
  </header>
1833
1925
  <aside id="nd-sidebar" class="fd-sidebar">
1834
1926
  <div class="sidebar-brand fd-sidebar-header">
1835
- <a class="fd-sidebar-title" href="/">${renderFarmDocsBrandMark()}${renderFarmDocsBrandTitle(navTitle)}</a>
1927
+ <a class="fd-sidebar-title" href="${homeHref}">${renderFarmDocsBrandMark()}${renderFarmDocsBrandTitle(navTitle)}</a>
1836
1928
  <span>/ docs</span>
1837
1929
  </div>
1838
1930
  ${searchEnabled ? `<div class="fd-sidebar-search">${renderDocsSearchTrigger(true, "fd-sidebar-search-btn")}</div>` : ""}
1839
- ${renderPixelNavItems(pages, page.href, docs)}
1931
+ ${renderPixelNavItems(pages, page.href, docs, basePath)}
1840
1932
  </aside>
1841
1933
  <div class="sidebar-backdrop fd-sidebar-overlay" data-sidebar-backdrop></div>
1842
1934
  <main class="fd-main">
1843
1935
  <div class="fd-page">
1844
1936
  <article id="nd-page" class="prose fd-page-article fd-page-body fd-docs-content">
1845
- ${renderPixelBreadcrumb(page, docs)}
1846
- ${renderMarkdownHtmlWithTitleMeta(page, docs, renderedMarkdown.html)}
1937
+ ${renderPixelBreadcrumb(page, docs, basePath)}
1938
+ ${renderMarkdownHtmlWithTitleMeta(page, docs, renderedMarkdown.html, basePath)}
1847
1939
  ${renderPixelPageFooter(page, docs)}
1848
- ${renderPixelPageNav(pages, page.href, docs)}
1940
+ ${renderPixelPageNav(pages, page.href, docs, basePath)}
1849
1941
  </article>
1850
1942
  <nav id="nd-toc" class="fd-toc sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 max-xl:hidden" data-toc aria-labelledby="toc-title">
1851
1943
  <div class="fd-toc-inner">
@@ -1859,7 +1951,7 @@ ${renderMarkdownHtmlWithTitleMeta(page, docs, renderedMarkdown.html)}
1859
1951
  </main>
1860
1952
  </div>
1861
1953
  ${searchEnabled ? renderDocsSearchMount(clientEntry) : ""}
1862
- ${renderDocsRuntimeScripts(docs)}
1954
+ ${renderDocsRuntimeScripts(docs, basePath)}
1863
1955
  </body>
1864
1956
  </html>`;
1865
1957
  }
@@ -1867,25 +1959,40 @@ function createFarmDocsHandler(docs, options) {
1867
1959
  const faviconHref = resolveFarmDocsFavicon(docs, options);
1868
1960
  const fontAssets = _nullishCoalesce(options.fontAssets, () => ( _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, options.root))));
1869
1961
  const fallbackFontPreloadHeader = renderFarmDocsFontPreloadHeader(fontAssets);
1870
- return async function handleFarmDocsRequest(request) {
1871
- if (!_optionalChain([docs, 'optionalAccess', _83 => _83.enabled]) || request.method !== "GET" && request.method !== "HEAD") return null;
1962
+ const basePath = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, options.basePath);
1963
+ return async function handleFarmDocsRequest(incomingRequest) {
1964
+ if (!_optionalChain([docs, 'optionalAccess', _80 => _80.enabled]) || incomingRequest.method !== "GET" && incomingRequest.method !== "HEAD") {
1965
+ return null;
1966
+ }
1872
1967
  await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
1873
- const contentDir = resolveFarmDocsContentDir(docs, options);
1968
+ const request = toFarmDocsRouteRequest(incomingRequest, basePath);
1874
1969
  const requestUrl = new URL(request.url);
1875
- const socialImageSlug = getFarmDocsSocialImageSlug(docs, requestUrl);
1876
- if (socialImageSlug !== null) {
1877
- const socialImagePage = loadFarmDocsPage(contentDir, docs, socialImageSlug);
1970
+ if (request !== incomingRequest && (requestUrl.pathname === "/api/docs" || requestUrl.pathname.startsWith("/api/docs/"))) {
1971
+ return null;
1972
+ }
1973
+ const contentDir = resolveFarmDocsContentDir(docs, options);
1974
+ const socialImageTarget = getFarmDocsSocialImageSlug(docs, requestUrl);
1975
+ if (socialImageTarget !== null) {
1976
+ const socialImagePage = loadFarmDocsPage(contentDir, docs, socialImageTarget.slug);
1878
1977
  if (!socialImagePage || // The image sits outside the page's URL, where its guard does not reach, and
1879
1978
  // draws the page's title.
1880
- _optionalChain([options, 'access', _84 => _84.isPathGuarded, 'optionalCall', _85 => _85(socialImagePage.href)]) || !isFarmDocsSocialImageEnabled(socialImagePage, docs) || getFarmDocsCustomSocialImage(socialImagePage)) {
1979
+ _optionalChain([options, 'access', _81 => _81.isPathGuarded, 'optionalCall', _82 => _82(socialImagePage.href)]) || !isFarmDocsSocialImageEnabled(socialImagePage, docs) || getFarmDocsCustomSocialImage(socialImagePage)) {
1881
1980
  return null;
1882
1981
  }
1883
- const descriptor = createFarmDocsSocialImageDescriptor(socialImagePage, docs, requestUrl);
1982
+ const descriptor = createFarmDocsSocialImageDescriptor(
1983
+ socialImagePage,
1984
+ docs,
1985
+ requestUrl,
1986
+ socialImageTarget.format,
1987
+ basePath
1988
+ );
1884
1989
  if (requestUrl.pathname !== descriptor.imagePath) return null;
1885
- const etag = `"${descriptor.hash}"`;
1990
+ const png = descriptor.format === "png";
1991
+ if (png && await resolveFarmDocsSocialImageFormat() !== "png") return null;
1992
+ const etag = `"${descriptor.hash}${png ? "-png" : ""}"`;
1886
1993
  const immutable = requestUrl.searchParams.get("v") === descriptor.hash;
1887
1994
  const headers = new Headers({
1888
- "Content-Type": "image/svg+xml; charset=utf-8",
1995
+ "Content-Type": png ? "image/png" : "image/svg+xml; charset=utf-8",
1889
1996
  "Cache-Control": immutable ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate",
1890
1997
  ETag: etag,
1891
1998
  "X-Content-Type-Options": "nosniff"
@@ -1894,20 +2001,25 @@ function createFarmDocsHandler(docs, options) {
1894
2001
  return new Response(null, { status: 304, headers });
1895
2002
  }
1896
2003
  if (request.method === "HEAD") return new Response(null, { status: 200, headers });
2004
+ if (png) {
2005
+ const image = await renderFarmDocsSocialImagePng(descriptor);
2006
+ return image ? new Response(image, { status: 200, headers }) : null;
2007
+ }
1897
2008
  return new Response(renderFarmDocsSocialImageSvg(descriptor), { status: 200, headers });
1898
2009
  }
1899
2010
  const publicResponse = createFarmDocsPublicResponse(
1900
2011
  contentDir,
1901
2012
  docs,
1902
2013
  request,
1903
- options.isPathGuarded
2014
+ options.isPathGuarded,
2015
+ basePath
1904
2016
  );
1905
2017
  if (publicResponse) return omitFarmDocsHeadBody(request, publicResponse);
1906
2018
  if (!isFarmDocsRequest(docs, request)) return null;
1907
2019
  const page = loadPage(contentDir, docs, request);
1908
2020
  if (!page) return null;
1909
2021
  const negotiatesAccept = !requestUrl.pathname.endsWith(".md");
1910
- if (!negotiatesAccept && _optionalChain([options, 'access', _86 => _86.isPathGuarded, 'optionalCall', _87 => _87(page.href)]) && !options.isPathGuarded(getFarmDocsMarkdownPath(page.href))) {
2022
+ if (!negotiatesAccept && _optionalChain([options, 'access', _83 => _83.isPathGuarded, 'optionalCall', _84 => _84(page.href)]) && !options.isPathGuarded(getFarmDocsMarkdownPath(page.href))) {
1911
2023
  return null;
1912
2024
  }
1913
2025
  if (shouldReturnMarkdown(request)) {
@@ -1915,10 +2027,10 @@ function createFarmDocsHandler(docs, options) {
1915
2027
  return omitFarmDocsHeadBody(
1916
2028
  request,
1917
2029
  new Response(
1918
- _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page), {
2030
+ _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page, basePath), {
1919
2031
  origin,
1920
2032
  llms: _nullishCoalesce(docs.config.llmsTxt, () => ( true)),
1921
- sitemap: docs.config.sitemap
2033
+ sitemap: toFarmDocsPublicSitemapConfig(docs.config.sitemap, basePath)
1922
2034
  }),
1923
2035
  {
1924
2036
  status: 200,
@@ -1932,8 +2044,9 @@ function createFarmDocsHandler(docs, options) {
1932
2044
  );
1933
2045
  }
1934
2046
  const pathname = new URL(request.url).pathname;
1935
- const layoutFonts = await _optionalChain([options, 'access', _88 => _88.resolveLayoutFonts, 'optionalCall', _89 => _89(pathname)]);
1936
- const usesLayoutFonts = Boolean(_optionalChain([layoutFonts, 'optionalAccess', _90 => _90.body]) || _optionalChain([layoutFonts, 'optionalAccess', _91 => _91.code]));
2047
+ const socialImageFormat = isFarmDocsSocialImageEnabled(page, docs) && !getFarmDocsCustomSocialImage(page) ? await resolveFarmDocsSocialImageFormat() : "svg";
2048
+ const layoutFonts = await _optionalChain([options, 'access', _85 => _85.resolveLayoutFonts, 'optionalCall', _86 => _86(pathname)]);
2049
+ const usesLayoutFonts = Boolean(_optionalChain([layoutFonts, 'optionalAccess', _87 => _87.body]) || _optionalChain([layoutFonts, 'optionalAccess', _88 => _88.code]));
1937
2050
  const activeFontAssets = usesLayoutFonts ? [] : fontAssets;
1938
2051
  const fontPreloadHeader = usesLayoutFonts ? renderFarmLayoutFontPreloadHeader(layoutFonts) : fallbackFontPreloadHeader;
1939
2052
  return omitFarmDocsHeadBody(
@@ -1947,8 +2060,10 @@ function createFarmDocsHandler(docs, options) {
1947
2060
  faviconHref,
1948
2061
  requestUrl,
1949
2062
  activeFontAssets,
2063
+ basePath,
1950
2064
  usesLayoutFonts ? options.fontStylesheetHref : void 0,
1951
- options.globalStylesheetHref
2065
+ options.globalStylesheetHref,
2066
+ socialImageFormat
1952
2067
  ),
1953
2068
  {
1954
2069
  status: 200,
@@ -1977,4 +2092,9 @@ function createFarmDocsHandler(docs, options) {
1977
2092
 
1978
2093
 
1979
2094
 
1980
- exports.FARM_DOCS_LAST_MODIFIED_MANIFEST = FARM_DOCS_LAST_MODIFIED_MANIFEST; exports.createFarmDocsLastModifiedManifest = createFarmDocsLastModifiedManifest; exports.isFarmDocsRequest = isFarmDocsRequest; exports.resolveFarmDocsContentDir = resolveFarmDocsContentDir; exports.getFarmDocsRoots = getFarmDocsRoots; exports.getFarmDocsRouteTypeEntries = getFarmDocsRouteTypeEntries; exports.getFarmDocsDocumentNavigationMatchers = getFarmDocsDocumentNavigationMatchers; exports.loadFarmDocsPage = loadFarmDocsPage; exports.getFarmDocsMarkdownPath = getFarmDocsMarkdownPath; exports.discoverFarmDocsPages = discoverFarmDocsPages; exports.toFarmDocsMarkdownPage = toFarmDocsMarkdownPage; exports.createFarmDocsHandler = createFarmDocsHandler;
2095
+
2096
+
2097
+
2098
+
2099
+
2100
+ exports.FARM_DOCS_LAST_MODIFIED_MANIFEST = FARM_DOCS_LAST_MODIFIED_MANIFEST; exports.createFarmDocsLastModifiedManifest = createFarmDocsLastModifiedManifest; exports.isFarmDocsRequest = isFarmDocsRequest; exports.resolveFarmDocsContentDir = resolveFarmDocsContentDir; exports.getFarmDocsRoots = getFarmDocsRoots; exports.getFarmDocsRouteTypeEntries = getFarmDocsRouteTypeEntries; exports.getFarmDocsDocumentNavigationMatchers = getFarmDocsDocumentNavigationMatchers; exports.loadFarmDocsPage = loadFarmDocsPage; exports.getFarmDocsMarkdownPath = getFarmDocsMarkdownPath; exports.discoverFarmDocsPages = discoverFarmDocsPages; exports.toFarmDocsMarkdownPage = toFarmDocsMarkdownPage; exports.getFarmDocsSiteUrl = getFarmDocsSiteUrl; exports.getFarmDocsPublicEntry = getFarmDocsPublicEntry; exports.toFarmDocsPublicSitemapConfig = toFarmDocsPublicSitemapConfig; exports.buildFarmDocsSitemapManifest = buildFarmDocsSitemapManifest; exports.renderFarmDocsRobotsTxt = renderFarmDocsRobotsTxt; exports.createFarmDocsHandler = createFarmDocsHandler;