@farm.js/core 0.1.66 → 0.1.68

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 (494) 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-Uh5xr7aX.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +6 -5
  6. package/dist/agent-runtime.d.mts +10 -8
  7. package/dist/agent-runtime.d.ts +10 -8
  8. package/dist/agent-runtime.mjs +5 -4
  9. package/dist/{analyzer-4UFP4HVP.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
  10. package/dist/analyzer-PPAHM4AW.cjs +16 -0
  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 +61 -0
  21. package/dist/api/node.d.ts +61 -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 +14 -11
  25. package/dist/api/route-manager.d.ts +14 -11
  26. package/dist/api/route-manager.mjs +10 -10
  27. package/dist/api/runtime.cjs +11 -7
  28. package/dist/api/runtime.d.mts +11 -9
  29. package/dist/api/runtime.d.ts +11 -9
  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 +15 -12
  35. package/dist/api.d.ts +15 -12
  36. package/dist/api.mjs +16 -12
  37. package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
  38. package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
  39. package/dist/app-markdown.cjs +5 -5
  40. package/dist/app-markdown.d.mts +15 -15
  41. package/dist/app-markdown.d.ts +15 -15
  42. package/dist/app-markdown.mjs +4 -4
  43. package/dist/{app.d-x68Cwr0_.d.ts → app.d-BVOpL_f2.d.ts} +52 -11
  44. package/dist/{app.d-kuoVWhWM.d.mts → app.d-BhiDXex_.d.mts} +52 -11
  45. package/dist/{chunk-RY4ABNPE.cjs → chunk-225APHKC.cjs} +3 -3
  46. package/dist/{chunk-JGAE5XPL.cjs → chunk-23VJEGKC.cjs} +4 -2
  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-7XGWBPQQ.cjs → chunk-3EEINK7G.cjs} +24 -10
  51. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  52. package/dist/{chunk-HCGWDRZO.mjs → chunk-3Y52TWYU.mjs} +18 -7
  53. package/dist/{chunk-CBOEJ5Z4.cjs → chunk-437QZIC2.cjs} +133 -46
  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-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
  57. package/dist/{chunk-EMNKZGF4.mjs → chunk-4UAQB5LB.mjs} +556 -462
  58. package/dist/{chunk-BQWBHWEW.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  59. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  60. package/dist/{chunk-ZEXE4TGY.mjs → chunk-5FBZJJGA.mjs} +247 -110
  61. package/dist/{chunk-4OSOLDPL.cjs → chunk-5JKDFRTK.cjs} +2 -2
  62. package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
  63. package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
  64. package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
  65. package/dist/chunk-6I4BFRE7.cjs +51 -0
  66. package/dist/{chunk-UBMHQVWN.mjs → chunk-6OFOIMNS.mjs} +1 -1
  67. package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
  68. package/dist/{chunk-CHYTADNK.cjs → chunk-7LK5CTUM.cjs} +70 -53
  69. package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
  70. package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
  71. package/dist/{chunk-BYRZ5VTH.mjs → chunk-A3T445WK.mjs} +47 -34
  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-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
  76. package/dist/chunk-AQIRXBBY.cjs +26 -0
  77. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  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-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  84. package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
  85. package/dist/{chunk-VQJHT2ND.mjs → chunk-CRVSYDHV.mjs} +2 -2
  86. package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
  87. package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
  88. package/dist/{chunk-AZUUKA66.mjs → chunk-DIXFKAPM.mjs} +1251 -389
  89. package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
  90. package/dist/{chunk-NHQM2Q4I.cjs → chunk-DWLNLU55.cjs} +2 -2
  91. package/dist/chunk-DXZ57EPE.mjs +375 -0
  92. package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
  93. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  94. package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
  95. package/dist/chunk-EIVGPQN5.mjs +51 -0
  96. package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
  97. package/dist/{chunk-E4UDLFWR.cjs → chunk-F36LS2C7.cjs} +796 -702
  98. package/dist/{chunk-MPIGW42F.mjs → chunk-F6CMGWAL.mjs} +1 -1
  99. package/dist/{chunk-GL7N5UHF.cjs → chunk-FJMC24KG.cjs} +21 -10
  100. package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
  101. package/dist/{chunk-3CCAICF7.cjs → chunk-FSODPZRT.cjs} +5 -5
  102. package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
  103. package/dist/{chunk-WMTBBQHY.cjs → chunk-FVYBEMOD.cjs} +288 -151
  104. package/dist/{chunk-BM2LH2JM.mjs → chunk-G7NBPP7H.mjs} +14 -13
  105. package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
  106. package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
  107. package/dist/{chunk-25T5VXOE.mjs → chunk-GFPS7MNE.mjs} +106 -19
  108. package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
  109. package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
  110. package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
  111. package/dist/{chunk-RVGSVQWT.mjs → chunk-HEJM46HQ.mjs} +21 -7
  112. package/dist/chunk-HHLEYA4B.cjs +17 -0
  113. package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
  114. package/dist/{chunk-E552H232.cjs → chunk-I7J5RLGO.cjs} +16 -2
  115. package/dist/chunk-ICFPTHXM.mjs +97 -0
  116. package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
  117. package/dist/{chunk-MPJEIHW2.cjs → chunk-IGDYL2IA.cjs} +2 -2
  118. package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
  119. package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
  120. package/dist/chunk-J6TZRYCO.cjs +22 -0
  121. package/dist/{chunk-E4RDMG3K.mjs → chunk-JL2YW5KX.mjs} +5 -4
  122. package/dist/chunk-JSOCDYER.cjs +375 -0
  123. package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
  124. package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
  125. package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
  126. package/dist/chunk-K63OWRY2.mjs +22 -0
  127. package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
  128. package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
  129. package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
  130. package/dist/{chunk-TKK5QHKZ.mjs → chunk-KDO6T6OB.mjs} +3 -3
  131. package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
  132. package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
  133. package/dist/{chunk-IT6WRNGB.cjs → chunk-KWCZKJYU.cjs} +1541 -679
  134. package/dist/{chunk-DVKH2RVN.cjs → chunk-LDEXTX4I.cjs} +70 -57
  135. package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
  136. package/dist/{chunk-XBSKPLHF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  137. package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
  138. package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
  139. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  140. package/dist/{chunk-TZVUF5JJ.mjs → chunk-MGZVDX4R.mjs} +5 -5
  141. package/dist/{chunk-MGKW5XZE.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  142. package/dist/{chunk-SK7QSNWE.mjs → chunk-MNJDNTGO.mjs} +1 -1
  143. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  144. package/dist/{chunk-FIR62CR3.mjs → chunk-MV7NWU23.mjs} +1 -1
  145. package/dist/{chunk-7ONGIFYX.cjs → chunk-MZ4CRSY7.cjs} +481 -171
  146. package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
  147. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  148. package/dist/{chunk-XBSLKXBL.mjs → chunk-NT4W4H52.mjs} +52 -35
  149. package/dist/{chunk-UAQD67HM.mjs → chunk-NVOMQLI2.mjs} +16 -2
  150. package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
  151. package/dist/{chunk-V56632LA.cjs → chunk-OCNV4CI2.cjs} +39 -6
  152. package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
  153. package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
  154. package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
  155. package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
  156. package/dist/{chunk-27FPUFWR.mjs → chunk-P2NBQ5JI.mjs} +1 -1
  157. package/dist/{chunk-HZPKJRYA.cjs → chunk-PDFFYZAT.cjs} +2 -2
  158. package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
  159. package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
  160. package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
  161. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  162. package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
  163. package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
  164. package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
  165. package/dist/{chunk-X4K7TYN6.cjs → chunk-QOGIZKSO.cjs} +26 -25
  166. package/dist/{chunk-CNNBFGL5.cjs → chunk-QSUYB3RH.cjs} +14 -14
  167. package/dist/chunk-QYNZ3CTI.mjs +17 -0
  168. package/dist/{chunk-X3XUZWRB.mjs → chunk-R2ZHU37O.mjs} +36 -3
  169. package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
  170. package/dist/{chunk-O75GQVUK.mjs → chunk-RLH5AH2M.mjs} +1 -1
  171. package/dist/chunk-RWR7SMD7.cjs +50 -0
  172. package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
  173. package/dist/chunk-SD6JGJOM.mjs +50 -0
  174. package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
  175. package/dist/{chunk-BIF5MLTH.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
  176. package/dist/{chunk-WVYRLP5E.mjs → chunk-T5XFZQCL.mjs} +1 -1
  177. package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
  178. package/dist/{chunk-OP7LHY4Y.cjs → chunk-TNK2TVRS.cjs} +2005 -800
  179. package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
  180. package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
  181. package/dist/{chunk-WYAXRIYP.cjs → chunk-UKZ6AWKZ.cjs} +10 -9
  182. package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
  183. package/dist/{chunk-VBCQ5WOI.cjs → chunk-URN7VFO7.cjs} +105 -16
  184. package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
  185. package/dist/{chunk-435QJNC2.mjs → chunk-VFNAK6A5.mjs} +4 -4
  186. package/dist/{chunk-WFWFECDW.mjs → chunk-VRGY3X2I.mjs} +100 -11
  187. package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
  188. package/dist/chunk-W44X6IC2.cjs +97 -0
  189. package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
  190. package/dist/{chunk-672ISQIG.mjs → chunk-WPB67LE5.mjs} +379 -69
  191. package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
  192. package/dist/chunk-WVQNXXNE.cjs +28 -0
  193. package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
  194. package/dist/{chunk-W2ZXMMHA.mjs → chunk-XCAQTCGK.mjs} +1 -1
  195. package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
  196. package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
  197. package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
  198. package/dist/{chunk-D4MRNBVF.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  199. package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
  200. package/dist/chunk-YFTGIHNC.mjs +26 -0
  201. package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
  202. package/dist/{chunk-752IHQTD.cjs → chunk-YTNBCXCW.cjs} +12 -12
  203. package/dist/{chunk-RFKTJTWZ.mjs → chunk-YVPX5PI5.mjs} +3 -1
  204. package/dist/{chunk-4TVPYN32.cjs → chunk-Z3PW3DIR.cjs} +7 -7
  205. package/dist/{chunk-OB7VKCUZ.mjs → chunk-Z6SOXHAD.mjs} +1851 -646
  206. package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
  207. package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
  208. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  209. package/dist/client/lifecycle.cjs +2 -2
  210. package/dist/client/lifecycle.d.mts +1 -1
  211. package/dist/client/lifecycle.d.ts +1 -1
  212. package/dist/client/lifecycle.mjs +1 -1
  213. package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
  214. package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
  215. package/dist/client-plugins.cjs +2 -2
  216. package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-CE1lVK2R.d.mts} +116 -373
  217. package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CNDqcAuf.d.ts} +116 -373
  218. package/dist/client-plugins.d.mts +10 -8
  219. package/dist/client-plugins.d.ts +10 -8
  220. package/dist/client-plugins.mjs +1 -1
  221. package/dist/client.cjs +11 -9
  222. package/dist/client.d.mts +17 -15
  223. package/dist/client.d.ts +17 -15
  224. package/dist/client.mjs +10 -8
  225. package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
  226. package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
  227. package/dist/config.d.mts +10 -8
  228. package/dist/config.d.ts +10 -8
  229. package/dist/cron.cjs +2 -2
  230. package/dist/cron.mjs +1 -1
  231. package/dist/deferred.cjs +2 -2
  232. package/dist/deferred.mjs +1 -1
  233. package/dist/deployment.cjs +4 -2
  234. package/dist/deployment.d.mts +15 -1
  235. package/dist/deployment.d.ts +15 -1
  236. package/dist/deployment.mjs +3 -1
  237. package/dist/desktop.d.mts +11 -9
  238. package/dist/desktop.d.ts +11 -9
  239. package/dist/{devtools-NZUVNUP3.mjs → devtools-2A2GPC7B.mjs} +33 -29
  240. package/dist/{devtools-N2JQCMXB.cjs → devtools-R27T3BRY.cjs} +38 -34
  241. package/dist/docs.cjs +28 -27
  242. package/dist/docs.d.mts +24 -10
  243. package/dist/docs.d.ts +24 -10
  244. package/dist/docs.mjs +27 -26
  245. package/dist/env-types.cjs +3 -3
  246. package/dist/env-types.mjs +2 -2
  247. package/dist/environment/vite.cjs +7 -7
  248. package/dist/environment/vite.d.mts +1 -1
  249. package/dist/environment/vite.d.ts +1 -1
  250. package/dist/environment/vite.mjs +6 -6
  251. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  252. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  253. package/dist/headers.cjs +3 -3
  254. package/dist/headers.mjs +2 -2
  255. package/dist/image/server.d.mts +1 -1
  256. package/dist/image/server.d.ts +1 -1
  257. package/dist/image/sharp.d.mts +1 -1
  258. package/dist/image/sharp.d.ts +1 -1
  259. package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
  260. package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
  261. package/dist/image.cjs +6 -6
  262. package/dist/image.d.mts +1 -1
  263. package/dist/image.d.ts +1 -1
  264. package/dist/image.mjs +1 -1
  265. package/dist/index.cjs +148 -128
  266. package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
  267. package/dist/{index.d-A_x10zGS.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
  268. package/dist/index.d.mts +39 -87
  269. package/dist/index.d.ts +39 -87
  270. package/dist/index.mjs +224 -204
  271. package/dist/instrumentation.cjs +3 -3
  272. package/dist/instrumentation.mjs +2 -2
  273. package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
  274. package/dist/integrations/orm.d.mts +35 -0
  275. package/dist/integrations/orm.d.ts +35 -0
  276. package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
  277. package/dist/integrations.cjs +6 -5
  278. package/dist/integrations.d.mts +10 -8
  279. package/dist/integrations.d.ts +10 -8
  280. package/dist/integrations.mjs +5 -4
  281. package/dist/internal/app-markdown-runtime.cjs +4 -4
  282. package/dist/internal/app-markdown-runtime.d.mts +27 -11
  283. package/dist/internal/app-markdown-runtime.d.ts +27 -11
  284. package/dist/internal/app-markdown-runtime.mjs +3 -3
  285. package/dist/internal/build-runtime.cjs +76 -71
  286. package/dist/internal/build-runtime.d.mts +12 -10
  287. package/dist/internal/build-runtime.d.ts +12 -10
  288. package/dist/internal/build-runtime.mjs +75 -70
  289. package/dist/internal/cli-runtime.cjs +47 -46
  290. package/dist/internal/cli-runtime.mjs +46 -45
  291. package/dist/internal/client-error-overlay.cjs +6 -6
  292. package/dist/internal/client-error-overlay.mjs +2 -2
  293. package/dist/internal/client-runtime.cjs +85 -36
  294. package/dist/internal/client-runtime.d.mts +44 -13
  295. package/dist/internal/client-runtime.d.ts +44 -13
  296. package/dist/internal/client-runtime.mjs +79 -30
  297. package/dist/internal/compression-runtime.d.mts +10 -8
  298. package/dist/internal/compression-runtime.d.ts +10 -8
  299. package/dist/internal/config-runtime.cjs +27 -26
  300. package/dist/internal/config-runtime.d.mts +14 -12
  301. package/dist/internal/config-runtime.d.ts +14 -12
  302. package/dist/internal/config-runtime.mjs +26 -25
  303. package/dist/internal/docs-precompiled-runtime.cjs +16 -5
  304. package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
  305. package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
  306. package/dist/internal/docs-precompiled-runtime.mjs +15 -4
  307. package/dist/internal/form-actions.cjs +7 -2
  308. package/dist/internal/form-actions.d.mts +10 -3
  309. package/dist/internal/form-actions.d.ts +10 -3
  310. package/dist/internal/form-actions.mjs +8 -3
  311. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  312. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  313. package/dist/internal/islands-boot.cjs +6 -1
  314. package/dist/internal/islands-boot.mjs +6 -1
  315. package/dist/internal/islands-runtime.cjs +33 -4
  316. package/dist/internal/islands-runtime.d.mts +1 -1
  317. package/dist/internal/islands-runtime.d.ts +1 -1
  318. package/dist/internal/islands-runtime.mjs +31 -2
  319. package/dist/internal/native-server-fns.cjs +5 -5
  320. package/dist/internal/native-server-fns.mjs +4 -4
  321. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  322. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  323. package/dist/internal/production-node-env.cjs +4 -2
  324. package/dist/internal/production-node-env.d.mts +22 -1
  325. package/dist/internal/production-node-env.d.ts +22 -1
  326. package/dist/internal/production-node-env.mjs +3 -1
  327. package/dist/internal/production-runtime.cjs +57 -39
  328. package/dist/internal/production-runtime.d.mts +27 -21
  329. package/dist/internal/production-runtime.d.ts +27 -21
  330. package/dist/internal/production-runtime.mjs +72 -54
  331. package/dist/internal/react-cache.cjs +3 -3
  332. package/dist/internal/react-cache.mjs +1 -1
  333. package/dist/internal/server-tree.cjs +2 -2
  334. package/dist/internal/server-tree.d.mts +0 -5
  335. package/dist/internal/server-tree.d.ts +0 -5
  336. package/dist/internal/server-tree.mjs +1 -1
  337. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  338. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  339. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  340. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  341. package/dist/layers-7P4RLKVX.cjs +20 -0
  342. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  343. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  344. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  345. package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
  346. package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
  347. package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
  348. package/dist/manager-JOHU6BQI.cjs +15 -0
  349. package/dist/markdown.cjs +7 -3
  350. package/dist/markdown.d.mts +10 -8
  351. package/dist/markdown.d.ts +10 -8
  352. package/dist/markdown.mjs +6 -2
  353. package/dist/middleware.cjs +11 -11
  354. package/dist/middleware.d.mts +13 -10
  355. package/dist/middleware.d.ts +13 -10
  356. package/dist/middleware.mjs +13 -13
  357. package/dist/mobile.d.mts +6 -6
  358. package/dist/mobile.d.ts +6 -6
  359. package/dist/mount.d-Bki4pOaJ.d.mts +38 -0
  360. package/dist/mount.d-DjR5aerM.d.ts +38 -0
  361. package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
  362. package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
  363. package/dist/{native-tree-7LPH57Z4.cjs → native-tree-W2SSJB3Y.cjs} +4 -4
  364. package/dist/{native-tree-VV6WN3GX.mjs → native-tree-Y5YQANW7.mjs} +3 -3
  365. package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
  366. package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
  367. package/dist/navigation.cjs +8 -7
  368. package/dist/navigation.d.mts +13 -11
  369. package/dist/navigation.d.ts +13 -11
  370. package/dist/navigation.mjs +7 -6
  371. package/dist/{nitro-DD4QCA66.mjs → nitro-NSTXT7LB.mjs} +11 -11
  372. package/dist/{nitro-VRDX2H4M.cjs → nitro-Y3LGITW3.cjs} +13 -13
  373. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  374. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  375. package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
  376. package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
  377. package/dist/plugin.cjs +65 -63
  378. package/dist/plugin.d.mts +12 -10
  379. package/dist/plugin.d.ts +12 -10
  380. package/dist/plugin.mjs +64 -62
  381. package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  382. package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  383. package/dist/query/client.cjs +9 -7
  384. package/dist/query/client.mjs +5 -3
  385. package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
  386. package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
  387. package/dist/renderer/none/server.cjs +35 -0
  388. package/dist/renderer/none/server.d.mts +21 -0
  389. package/dist/renderer/none/server.d.ts +21 -0
  390. package/dist/renderer/none/server.mjs +35 -0
  391. package/dist/renderer/react/server.cjs +3 -3
  392. package/dist/renderer/react/server.mjs +3 -3
  393. package/dist/renderer-client.cjs +8 -6
  394. package/dist/renderer-client.d.mts +13 -11
  395. package/dist/renderer-client.d.ts +13 -11
  396. package/dist/renderer-client.mjs +5 -3
  397. package/dist/renderer.cjs +6 -2
  398. package/dist/renderer.d.mts +25 -2
  399. package/dist/renderer.d.ts +25 -2
  400. package/dist/renderer.mjs +5 -1
  401. package/dist/request.cjs +2 -2
  402. package/dist/{request.d-DarDOCk9.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
  403. package/dist/{request.d-B1RnTLri.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
  404. package/dist/request.d.mts +11 -9
  405. package/dist/request.d.ts +11 -9
  406. package/dist/request.mjs +1 -1
  407. package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
  408. package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
  409. package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
  410. package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
  411. package/dist/{router.d-CMANF6da.d.ts → router.d-B56rMOFm.d.ts} +1 -1
  412. package/dist/{router.d-Cuv1jntg.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
  413. package/dist/routes.cjs +3 -3
  414. package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-9GFFNioh.d.ts} +2 -2
  415. package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-CrEy0lJS.d.mts} +2 -2
  416. package/dist/routes.d.mts +10 -8
  417. package/dist/routes.d.ts +10 -8
  418. package/dist/routes.mjs +2 -2
  419. package/dist/{rsc-pipeline-Z7QBZOIJ.cjs → rsc-pipeline-3T7V6OUT.cjs} +30 -28
  420. package/dist/{rsc-pipeline-7PNVJSTR.mjs → rsc-pipeline-GA4AQWZI.mjs} +29 -27
  421. package/dist/{runtime-FKFCUHSK.cjs → runtime-REUTNTI5.cjs} +72 -46
  422. package/dist/{runtime-QQHX4BP3.mjs → runtime-ZYCKKY7L.mjs} +60 -34
  423. package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-DLRO-ExG.d.mts} +11 -3
  424. package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-H7k9hOQE.d.ts} +11 -3
  425. package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
  426. package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
  427. package/dist/schema.cjs +6 -2
  428. package/dist/schema.d-Dny9pnrm.d.mts +298 -0
  429. package/dist/schema.d-Dny9pnrm.d.ts +298 -0
  430. package/dist/schema.d.mts +1 -115
  431. package/dist/schema.d.ts +1 -115
  432. package/dist/schema.mjs +5 -1
  433. package/dist/server-fn-client.d.mts +2 -2
  434. package/dist/server-fn-client.d.ts +2 -2
  435. package/dist/server-fn.cjs +5 -5
  436. package/dist/server-fn.mjs +4 -4
  437. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  438. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  439. package/dist/server-plugins.cjs +7 -7
  440. package/dist/server-plugins.d.mts +20 -12
  441. package/dist/server-plugins.d.ts +20 -12
  442. package/dist/server-plugins.mjs +8 -8
  443. package/dist/server-query.cjs +6 -6
  444. package/dist/server-query.mjs +5 -5
  445. package/dist/server.cjs +168 -126
  446. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  447. package/dist/server.d-DgC8xew5.d.mts +57 -0
  448. package/dist/server.d.mts +24 -16
  449. package/dist/server.d.ts +24 -16
  450. package/dist/server.mjs +144 -102
  451. package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-Dr7oanhl.d.ts} +15 -5
  452. package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-g4CzhEH1.d.mts} +15 -5
  453. package/dist/testing.cjs +17 -17
  454. package/dist/testing.d.mts +10 -8
  455. package/dist/testing.d.ts +10 -8
  456. package/dist/testing.mjs +13 -13
  457. package/dist/theme/server.cjs +3 -3
  458. package/dist/theme/server.mjs +2 -2
  459. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  460. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  461. package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
  462. package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
  463. package/dist/version.cjs +2 -2
  464. package/dist/version.mjs +1 -1
  465. package/dist/vite.cjs +65 -63
  466. package/dist/vite.d.mts +36 -14
  467. package/dist/vite.d.ts +36 -14
  468. package/dist/vite.mjs +64 -62
  469. package/dist/workflows.cjs +4 -4
  470. package/dist/workflows.d.mts +121 -1
  471. package/dist/workflows.d.ts +121 -1
  472. package/dist/workflows.mjs +3 -3
  473. package/package.json +37 -2
  474. package/dist/analyzer-H7SIX6BJ.cjs +0 -16
  475. package/dist/chunk-5YPBFMBN.cjs +0 -19
  476. package/dist/chunk-CLFEQGET.cjs +0 -60
  477. package/dist/chunk-MK5E44WP.mjs +0 -60
  478. package/dist/chunk-OM7WILES.mjs +0 -100
  479. package/dist/chunk-Q5B4LNON.mjs +0 -19
  480. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  481. package/dist/chunk-R53QDV6T.cjs +0 -100
  482. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  483. package/dist/layers-DMRXRL7F.cjs +0 -18
  484. package/dist/manager-2LUKNX2N.cjs +0 -14
  485. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  486. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  487. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  488. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
  489. /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
  490. /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
  491. /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
  492. /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
  493. /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
  494. /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,17 +239,20 @@ 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);
211
246
  }
247
+ function farmDocsPageUsesRequestOrigin(page, docs) {
248
+ return isFarmDocsSocialImageEnabled(page, docs) && !_optionalChain([getSocialImageConfig, 'call', _7 => _7(docs), 'optionalAccess', _8 => _8.baseUrl]);
249
+ }
212
250
  function getFarmDocsCustomSocialImage(page) {
213
251
  const value = page.frontmatter.socialImage || page.frontmatter.openGraphImage || page.frontmatter.ogImage;
214
252
  return value && !isFalse(value) && isExternalOrRootPath(value) ? value : void 0;
215
253
  }
216
254
  function resolveIllustration(page) {
217
- const explicit = _optionalChain([page, 'access', _4 => _4.frontmatter, 'access', _5 => _5.socialIllustration, 'optionalAccess', _6 => _6.toLowerCase, 'call', _7 => _7()]);
255
+ const explicit = _optionalChain([page, 'access', _9 => _9.frontmatter, 'access', _10 => _10.socialIllustration, 'optionalAccess', _11 => _11.toLowerCase, 'call', _12 => _12()]);
218
256
  if (explicit === "auth" || explicit === "cache" || explicit === "cli" || explicit === "integrations" || explicit === "project" || explicit === "routing" || explicit === "runtime") {
219
257
  return explicit;
220
258
  }
@@ -237,21 +275,21 @@ function createHashValue(value) {
237
275
  return _crypto.createHash.call(void 0, "sha256").update(JSON.stringify(value)).digest("hex").slice(0, 16);
238
276
  }
239
277
  function resolveBaseUrl(requestUrl, config) {
240
- return _optionalChain([config, 'optionalAccess', _8 => _8.baseUrl]) ? new URL(config.baseUrl) : new URL(requestUrl.origin);
278
+ return _optionalChain([config, 'optionalAccess', _13 => _13.baseUrl]) ? new URL(config.baseUrl) : new URL(requestUrl.origin);
241
279
  }
242
- function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
280
+ function createFarmDocsSocialImageDescriptor(page, docs, requestUrl, format = "svg", basePath = "") {
243
281
  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;
282
+ const siteName = _optionalChain([config, 'optionalAccess', _14 => _14.siteName]) || getNavTitle(docs);
283
+ const brand = _optionalChain([config, 'optionalAccess', _15 => _15.brand]) || siteName;
246
284
  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}`;
285
+ const description = page.frontmatter.socialDescription || page.description || _optionalChain([docs, 'access', _16 => _16.config, 'access', _17 => _17.metadata, 'optionalAccess', _18 => _18.description]) || `Documentation for ${siteName}`;
248
286
  const section = page.frontmatter.section || page.section || "Documentation";
249
287
  const illustration = resolveIllustration(page);
250
288
  const entry = normalizeEntry(docs.entry);
251
289
  const slugPath = encodeSlugPath(page.slug) || "index";
252
- const imagePath = `${entry}/_social/${slugPath}/opengraph-image.svg`;
290
+ const imagePath = `${entry}/_social/${slugPath}/opengraph-image.${format}`;
253
291
  const baseUrl = resolveBaseUrl(requestUrl, config);
254
- const pageUrl = new URL(page.href, baseUrl).href;
292
+ const pageUrl = new URL(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, page.href, basePath), baseUrl).href;
255
293
  const imageAlt = `${title} \u2014 ${siteName} documentation`;
256
294
  const hash = createHashValue({
257
295
  version: FARM_DOCS_SOCIAL_IMAGE_VERSION,
@@ -262,7 +300,7 @@ function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
262
300
  brand,
263
301
  pageHref: page.href,
264
302
  illustration,
265
- fonts: _optionalChain([config, 'optionalAccess', _14 => _14.fonts])
303
+ fonts: _optionalChain([config, 'optionalAccess', _19 => _19.fonts])
266
304
  });
267
305
  return {
268
306
  title,
@@ -273,32 +311,55 @@ function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
273
311
  pageHref: page.href,
274
312
  pageUrl,
275
313
  imagePath,
276
- imageUrl: new URL(`${imagePath}?v=${hash}`, baseUrl).href,
314
+ imageUrl: new URL(`${_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, imagePath, basePath)}?v=${hash}`, baseUrl).href,
277
315
  imageAlt,
278
316
  illustration,
279
- fonts: _optionalChain([config, 'optionalAccess', _15 => _15.fonts]),
317
+ fonts: _optionalChain([config, 'optionalAccess', _20 => _20.fonts]),
318
+ format,
280
319
  hash
281
320
  };
282
321
  }
283
322
  function getFarmDocsSocialImageSlug(docs, requestUrl) {
284
323
  const entry = normalizeEntry(docs.entry);
285
324
  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);
325
+ const format = requestUrl.pathname.endsWith("/opengraph-image.png") ? "png" : requestUrl.pathname.endsWith("/opengraph-image.svg") ? "svg" : null;
326
+ if (!format || !requestUrl.pathname.startsWith(prefix)) return null;
327
+ const rawSlug = requestUrl.pathname.slice(prefix.length, -"/opengraph-image.svg".length);
291
328
  if (!rawSlug) return null;
292
329
  try {
293
330
  const slug = rawSlug.split("/").map((segment) => decodeURIComponent(segment)).join("/");
294
331
  if (slug.split("/").some((segment) => !segment || segment === ".." || segment === ".")) {
295
332
  return null;
296
333
  }
297
- return slug === "index" ? "" : slug;
334
+ return { slug: slug === "index" ? "" : slug, format };
298
335
  } catch (e4) {
299
336
  return null;
300
337
  }
301
338
  }
339
+ var sharpLoad;
340
+ function loadSharp() {
341
+ _nullishCoalesce(sharpLoad, () => ( (sharpLoad = import("sharp").then(
342
+ (module) => module.default,
343
+ (error) => {
344
+ if (!_chunkKORZ6PREcjs.isMissingPackageError.call(void 0, error, "sharp")) {
345
+ console.warn(
346
+ `[farm] Docs social images fall back to SVG because sharp failed to load: ${error instanceof Error ? error.message : String(error)}`
347
+ );
348
+ }
349
+ return null;
350
+ }
351
+ ))));
352
+ return sharpLoad;
353
+ }
354
+ async function resolveFarmDocsSocialImageFormat() {
355
+ return await loadSharp() ? "png" : "svg";
356
+ }
357
+ async function renderFarmDocsSocialImagePng(descriptor) {
358
+ const sharp = await loadSharp();
359
+ if (!sharp) return null;
360
+ const png = await sharp(Buffer.from(renderFarmDocsSocialImageSvg(descriptor))).png({ compressionLevel: 9, palette: true }).toBuffer();
361
+ return new Uint8Array(png);
362
+ }
302
363
  function escapeXml(value) {
303
364
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
304
365
  }
@@ -468,7 +529,11 @@ function renderFarmDocsSocialImageSvg(descriptor) {
468
529
  const routeY = Math.max(418, descriptionY + descriptionLines.length * 29 + 24);
469
530
  const section = truncate(descriptor.section.toUpperCase(), 27);
470
531
  const route = truncate(descriptor.pageHref, 42);
471
- const footerUrl = truncate(descriptor.pageUrl.replace(/^https?:\/\//, ""), 70);
532
+ const pageUrl = new URL(descriptor.pageUrl);
533
+ const footerUrl = truncate(
534
+ pageUrl.hostname.endsWith(".invalid") ? pageUrl.pathname : descriptor.pageUrl.replace(/^https?:\/\//, ""),
535
+ 70
536
+ );
472
537
  const brand = truncate(descriptor.brand.toUpperCase(), 25);
473
538
  const titleId = `farm-docs-og-${descriptor.hash}`;
474
539
  return `<?xml version="1.0" encoding="UTF-8"?>
@@ -477,9 +542,9 @@ function renderFarmDocsSocialImageSvg(descriptor) {
477
542
  <desc id="${titleId}-description">${escapeXml(descriptor.description)}</desc>
478
543
  <metadata>${escapeXml(JSON.stringify({ generator: "Farm.js docs", page: descriptor.pageUrl, illustration: descriptor.illustration }))}</metadata>
479
544
  <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")}
545
+ ${renderEmbeddedFont("Farm Sans", _optionalChain([descriptor, 'access', _21 => _21.fonts, 'optionalAccess', _22 => _22.sans]), "100 900")}
546
+ ${renderEmbeddedFont("Farm Mono", _optionalChain([descriptor, 'access', _23 => _23.fonts, 'optionalAccess', _24 => _24.mono]), "100 900")}
547
+ ${renderEmbeddedFont("Farm Pixel", _optionalChain([descriptor, 'access', _25 => _25.fonts, 'optionalAccess', _26 => _26.display]), "400 700")}
483
548
  .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
549
  </style>
485
550
  <defs>
@@ -523,8 +588,8 @@ function renderFarmDocsSocialImageSvg(descriptor) {
523
588
  }
524
589
  function renderFarmDocsSocialMetadata(descriptor, customImage) {
525
590
  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";
591
+ const customExtension = _optionalChain([customImage, 'optionalAccess', _27 => _27.toLowerCase, 'call', _28 => _28(), 'access', _29 => _29.split, 'call', _30 => _30(/[?#]/, 1), 'access', _31 => _31[0]]);
592
+ 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
593
  const tag = (property, content, name = false) => `<meta ${name ? "name" : "property"}="${property}" content="${escapeXml(content)}">`;
529
594
  return [
530
595
  tag("og:type", "article"),
@@ -570,7 +635,7 @@ function normalizeSlug(value) {
570
635
  return trimSlashes(decodeDocsPath(value)).replace(/\.(mdx?|markdown)$/i, "");
571
636
  }
572
637
  function resolveFarmDocsFavicon(docs, options) {
573
- const configuredFavicon = _optionalChain([docs, 'optionalAccess', _33 => _33.config, 'access', _34 => _34.favicon]);
638
+ const configuredFavicon = _optionalChain([docs, 'optionalAccess', _32 => _32.config, 'access', _33 => _33.favicon]);
574
639
  if (typeof configuredFavicon === "string" && configuredFavicon.trim()) {
575
640
  return configuredFavicon.trim();
576
641
  }
@@ -584,7 +649,7 @@ function resolveFarmDocsFavicon(docs, options) {
584
649
  return FARM_DOCS_FALLBACK_FAVICON;
585
650
  }
586
651
  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()]) || "";
652
+ const normalizedHref = _optionalChain([faviconHref, 'access', _34 => _34.split, 'call', _35 => _35(/[?#]/, 1), 'access', _36 => _36[0], 'optionalAccess', _37 => _37.toLowerCase, 'call', _38 => _38()]) || "";
588
653
  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
654
  const metadata = type === "image/svg+xml" ? ' sizes="any" type="image/svg+xml"' : type ? ` type="${type}"` : "";
590
655
  return `<link rel="icon" href="${escapeAttribute(faviconHref)}"${metadata}>`;
@@ -600,7 +665,7 @@ function renderFarmDocsBrandMark() {
600
665
  </svg>`;
601
666
  }
602
667
  function renderFarmDocsBrandTitle(navTitle) {
603
- const suffix = _optionalChain([navTitle, 'access', _40 => _40.match, 'call', _41 => _41(/\.js$/i), 'optionalAccess', _42 => _42[0]]);
668
+ const suffix = _optionalChain([navTitle, 'access', _39 => _39.match, 'call', _40 => _40(/\.js$/i), 'optionalAccess', _41 => _41[0]]);
604
669
  if (!suffix) {
605
670
  return `<span class="sidebar-brand-title">${escapeHtml(navTitle)}</span>`;
606
671
  }
@@ -632,7 +697,7 @@ function resolveExistingFileInside(root, target) {
632
697
  }
633
698
  }
634
699
  function isFarmDocsRequest(docs, request) {
635
- if (!_optionalChain([docs, 'optionalAccess', _43 => _43.enabled])) return false;
700
+ if (!_optionalChain([docs, 'optionalAccess', _42 => _42.enabled])) return false;
636
701
  if (request.method !== "GET" && request.method !== "HEAD") return false;
637
702
  const pathname = new URL(request.url).pathname;
638
703
  const entry = normalizeEntry2(docs.entry);
@@ -666,7 +731,7 @@ function getFarmDocsRoots(docs) {
666
731
  ];
667
732
  }
668
733
  function getFarmDocsRouteTypeEntries(docs) {
669
- if (!_optionalChain([docs, 'optionalAccess', _44 => _44.enabled])) return [];
734
+ if (!_optionalChain([docs, 'optionalAccess', _43 => _43.enabled])) return [];
670
735
  return getFarmDocsRoots(docs).flatMap((root) => {
671
736
  const entry = normalizeEntry2(root.entry);
672
737
  if (entry === "/") return ["/", "/[...docs]"];
@@ -674,7 +739,7 @@ function getFarmDocsRouteTypeEntries(docs) {
674
739
  });
675
740
  }
676
741
  function getFarmDocsDocumentNavigationMatchers(docs) {
677
- if (!_optionalChain([docs, 'optionalAccess', _45 => _45.enabled])) return [];
742
+ if (!_optionalChain([docs, 'optionalAccess', _44 => _44.enabled])) return [];
678
743
  return getFarmDocsRoots(docs).map((root) => {
679
744
  const entry = normalizeEntry2(root.entry);
680
745
  return entry === "/" ? "/(.*)" : `${entry}(.*)`;
@@ -755,7 +820,7 @@ function titleFromSlug(slug) {
755
820
  return lastSegment.split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
756
821
  }
757
822
  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()]);
823
+ const heading = _optionalChain([body, 'access', _45 => _45.match, 'call', _46 => _46(/^#\s+(.+)$/m), 'optionalAccess', _47 => _47[1], 'optionalAccess', _48 => _48.trim, 'call', _49 => _49()]);
759
824
  return heading || fallback;
760
825
  }
761
826
  function createLastModifiedResolver(contentDir, sourcePath, frontmatter) {
@@ -860,11 +925,24 @@ function discoverFarmDocsPages(contentDir, docs) {
860
925
  visit(contentDir);
861
926
  return pages.sort((a, b) => a.href.localeCompare(b.href));
862
927
  }
863
- function toFarmDocsMarkdownPage(page) {
928
+ function listFarmDocsBuiltInPrerenderPages(docs, options) {
929
+ const pages = [];
930
+ const originDependent = [];
931
+ for (const root of getFarmDocsRoots(docs)) {
932
+ const contentDir = resolveFarmDocsContentDir(root, options);
933
+ for (const page of discoverFarmDocsPages(contentDir, root)) {
934
+ const loaded = loadFarmDocsPage(contentDir, root, page.slug);
935
+ if (!loaded) continue;
936
+ (farmDocsPageUsesRequestOrigin(loaded, root) ? originDependent : pages).push(loaded.href);
937
+ }
938
+ }
939
+ return { pages: [...new Set(pages)], originDependent: [...new Set(originDependent)] };
940
+ }
941
+ function toFarmDocsMarkdownPage(page, basePath = "") {
864
942
  const lastModified = page.lastModified || page.frontmatter.lastModified || page.frontmatter.lastmod;
865
943
  return {
866
944
  slug: page.slug,
867
- url: page.href,
945
+ url: _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, page.href, basePath),
868
946
  title: page.title,
869
947
  description: page.description,
870
948
  lastModified,
@@ -873,24 +951,59 @@ function toFarmDocsMarkdownPage(page) {
873
951
  rawContent: page.body
874
952
  };
875
953
  }
954
+ function toFarmDocsRouteRequest(request, basePath) {
955
+ if (!basePath) return request;
956
+ const url = new URL(request.url);
957
+ const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, url.pathname, basePath);
958
+ if (routePathname === url.pathname) return request;
959
+ url.pathname = routePathname;
960
+ return new Request(url, request);
961
+ }
962
+ function getFarmDocsSiteUrl(request, basePath) {
963
+ return `${new URL(request.url).origin}${basePath}`;
964
+ }
965
+ function getFarmDocsPublicEntry(docs, basePath) {
966
+ return basePath ? _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, normalizeEntry2(docs.entry), basePath) : docs.entry;
967
+ }
968
+ function toFarmDocsPublicSitemapConfig(sitemap, basePath) {
969
+ if (!basePath || sitemap === false) return sitemap;
970
+ const configured = typeof sitemap === "object" ? sitemap : {};
971
+ return {
972
+ ...configured,
973
+ routePrefix: `${basePath}/${trimSlashes(_nullishCoalesce(configured.routePrefix, () => ( "")))}`
974
+ };
975
+ }
976
+ function buildFarmDocsSitemapManifest(pages, docs, origin, basePath) {
977
+ return _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsSitemapManifest({
978
+ pages: pages.map((page) => ({
979
+ ...toFarmDocsMarkdownPage(page, basePath),
980
+ sourcePath: page.sourcePath
981
+ })),
982
+ entry: getFarmDocsPublicEntry(docs, basePath),
983
+ siteTitle: getDocsTitle(docs),
984
+ baseUrl: origin
985
+ });
986
+ }
987
+ function renderFarmDocsRobotsTxt(docs, origin, basePath) {
988
+ return _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsRobotsTxt({
989
+ entry: getFarmDocsPublicEntry(docs, basePath),
990
+ sitemap: toFarmDocsPublicSitemapConfig(_nullishCoalesce(docs.config.sitemap, () => ( true)), basePath),
991
+ robots: _nullishCoalesce(docs.config.robots, () => ( true)),
992
+ baseUrl: origin
993
+ });
994
+ }
876
995
  function getDocsTitle(docs) {
877
996
  return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
878
997
  }
879
998
  function getDocsDescription(docs) {
880
- return _optionalChain([docs, 'access', _51 => _51.config, 'access', _52 => _52.metadata, 'optionalAccess', _53 => _53.description]);
999
+ return _optionalChain([docs, 'access', _50 => _50.config, 'access', _51 => _51.metadata, 'optionalAccess', _52 => _52.description]);
881
1000
  }
882
1001
  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));
1002
+ return discoverFarmDocsPages(contentDir, docs).filter((page) => !_optionalChain([isPathGuarded, 'optionalCall', _53 => _53(page.href)])).map((page) => loadFarmDocsPage(contentDir, docs, page.slug)).filter((page) => Boolean(page));
884
1003
  }
885
1004
  function toDocsLlmsPage(page) {
886
1005
  return toFarmDocsMarkdownPage(page);
887
1006
  }
888
- function toDocsSitemapPage(page) {
889
- return {
890
- ...toFarmDocsMarkdownPage(page),
891
- sourcePath: page.sourcePath
892
- };
893
- }
894
1007
  function resolvePageActionsConfig(docs) {
895
1008
  return isObjectRecord(docs.config.pageActions) ? docs.config.pageActions : {};
896
1009
  }
@@ -951,7 +1064,7 @@ function resolveReadingTimeDisplayConfig(docs) {
951
1064
  }
952
1065
  function countMarkdownWords(body, includeCode) {
953
1066
  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));
1067
+ return _nullishCoalesce(_optionalChain([readable, 'access', _54 => _54.match, 'call', _55 => _55(/[A-Za-z0-9]+(?:[-'][A-Za-z0-9]+)*/g), 'optionalAccess', _56 => _56.length]), () => ( 0));
955
1068
  }
956
1069
  function renderReadingTimeMeta(page, docs) {
957
1070
  const config = resolveReadingTimeDisplayConfig(docs);
@@ -964,10 +1077,10 @@ function renderReadingTimeMeta(page, docs) {
964
1077
  <span class="fd-page-meta-item">${escapeHtml(label)}</span>
965
1078
  </div>`;
966
1079
  }
967
- function renderPixelPageActions(page, docs) {
1080
+ function renderPixelPageActions(page, docs, basePath) {
968
1081
  const copyMarkdown = resolveCopyMarkdownActionConfig(docs);
969
1082
  if (!copyMarkdown) return "";
970
- const markdownUrl = `${page.href}.md`;
1083
+ const markdownUrl = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, `${page.href}.md`, basePath);
971
1084
  const includeTitle = copyMarkdown.includeTitle ? "true" : "false";
972
1085
  return `<div class="fd-page-actions" data-page-actions data-actions-alignment="${resolvePageActionsAlignment(docs)}">
973
1086
  <button
@@ -989,9 +1102,9 @@ function renderPixelPageActions(page, docs) {
989
1102
  </button>
990
1103
  </div>`;
991
1104
  }
992
- function renderBelowTitleMeta(page, docs) {
1105
+ function renderBelowTitleMeta(page, docs, basePath) {
993
1106
  const lastUpdated = renderLastUpdatedText(page, docs, "below-title");
994
- const actions = renderPixelPageActions(page, docs);
1107
+ const actions = renderPixelPageActions(page, docs, basePath);
995
1108
  const readingTime = renderReadingTimeMeta(page, docs);
996
1109
  if (!lastUpdated && !actions && !readingTime) return "";
997
1110
  return `<div class="fd-below-title-block not-prose">
@@ -1000,8 +1113,8 @@ function renderBelowTitleMeta(page, docs) {
1000
1113
  ${readingTime}
1001
1114
  </div>`;
1002
1115
  }
1003
- function renderMarkdownHtmlWithTitleMeta(page, docs, html) {
1004
- const meta = renderBelowTitleMeta(page, docs);
1116
+ function renderMarkdownHtmlWithTitleMeta(page, docs, html, basePath) {
1117
+ const meta = renderBelowTitleMeta(page, docs, basePath);
1005
1118
  if (!meta) return html;
1006
1119
  const withTitleMeta = html.replace(/(<h1\b[\s\S]*?<\/h1>)/, `$1
1007
1120
  ${meta}`);
@@ -1015,18 +1128,20 @@ function renderPixelPageFooter(page, docs) {
1015
1128
  <span class="fd-last-updated-footer">${lastUpdated}</span>
1016
1129
  </div>`;
1017
1130
  }
1018
- function getDocsLlmsOptions(docs, request) {
1131
+ function getDocsLlmsOptions(docs, request, basePath) {
1019
1132
  const configured = typeof docs.config.llmsTxt === "object" && docs.config.llmsTxt !== null ? docs.config.llmsTxt : {};
1020
1133
  return {
1021
1134
  enabled: true,
1022
- baseUrl: new URL(request.url).origin,
1135
+ baseUrl: getFarmDocsSiteUrl(request, basePath),
1023
1136
  siteTitle: getDocsTitle(docs),
1024
1137
  siteDescription: getDocsDescription(docs),
1025
1138
  ...configured
1026
1139
  };
1027
1140
  }
1028
- function getDocsDiscoveryOptions(docs, request) {
1141
+ function getDocsDiscoveryOptions(docs, request, basePath) {
1029
1142
  return {
1143
+ // The discovery files list the docs engine's routes as root-relative paths, which answer at
1144
+ // the origin root too. `llms.baseUrl` gives the site's own URL, below the basePath.
1030
1145
  origin: new URL(request.url).origin,
1031
1146
  entry: docs.entry,
1032
1147
  i18n: null,
@@ -1048,7 +1163,7 @@ function getDocsDiscoveryOptions(docs, request) {
1048
1163
  }
1049
1164
  },
1050
1165
  feedback: void 0,
1051
- llms: getDocsLlmsOptions(docs, request),
1166
+ llms: getDocsLlmsOptions(docs, request, basePath),
1052
1167
  sitemap: _nullishCoalesce(docs.config.sitemap, () => ( true)),
1053
1168
  robots: _nullishCoalesce(docs.config.robots, () => ( true)),
1054
1169
  openapi: void 0,
@@ -1058,16 +1173,11 @@ function getDocsDiscoveryOptions(docs, request) {
1058
1173
  }
1059
1174
  };
1060
1175
  }
1061
- function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded) {
1176
+ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded, basePath) {
1062
1177
  const url = new URL(request.url);
1063
1178
  let loadedPages;
1064
1179
  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
- });
1180
+ const sitemapManifest = () => buildFarmDocsSitemapManifest(getPages(), docs, url.origin, basePath);
1071
1181
  const textHeaders = (contentType) => ({
1072
1182
  "Content-Type": contentType,
1073
1183
  "Cache-Control": "public, max-age=60"
@@ -1076,7 +1186,7 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1076
1186
  if (llmsFormat) {
1077
1187
  const generated = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsLlmsTxt(
1078
1188
  getPages().map(toDocsLlmsPage),
1079
- getDocsLlmsOptions(docs, request)
1189
+ getDocsLlmsOptions(docs, request, basePath)
1080
1190
  );
1081
1191
  return new Response(llmsFormat === "llms-full" ? generated.llmsFullTxt : generated.llmsTxt, {
1082
1192
  status: 200,
@@ -1108,21 +1218,15 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1108
1218
  );
1109
1219
  }
1110
1220
  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
- );
1221
+ return new Response(renderFarmDocsRobotsTxt(docs, url.origin, basePath), {
1222
+ status: 200,
1223
+ headers: textHeaders("text/plain; charset=utf-8")
1224
+ });
1123
1225
  }
1124
1226
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).isDocsAgentDiscoveryRequest(url)) {
1125
- const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(docs, request));
1227
+ const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(
1228
+ getDocsDiscoveryOptions(docs, request, basePath)
1229
+ );
1126
1230
  const title = getDocsTitle(docs);
1127
1231
  return new Response(
1128
1232
  JSON.stringify({
@@ -1143,7 +1247,7 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1143
1247
  }
1144
1248
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).isDocsAgentsRequest(url)) {
1145
1249
  return new Response(
1146
- `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsAgentsDocument(getDocsDiscoveryOptions(docs, request)).trim()}
1250
+ `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsAgentsDocument(getDocsDiscoveryOptions(docs, request, basePath)).trim()}
1147
1251
  `,
1148
1252
  {
1149
1253
  status: 200,
@@ -1153,7 +1257,7 @@ function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded)
1153
1257
  }
1154
1258
  if (_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).isDocsSkillRequest(url)) {
1155
1259
  return new Response(
1156
- `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsSkillDocument(getDocsDiscoveryOptions(docs, request)).trim()}
1260
+ `${_chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsSkillDocument(getDocsDiscoveryOptions(docs, request, basePath)).trim()}
1157
1261
  `,
1158
1262
  {
1159
1263
  status: 200,
@@ -1179,11 +1283,11 @@ function shouldReturnMarkdown(request) {
1179
1283
  if (url.pathname.endsWith(".md")) return true;
1180
1284
  const accept = request.headers.get("accept");
1181
1285
  const markdown = Math.max(
1182
- _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1183
- _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1286
+ _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1287
+ _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1184
1288
  );
1185
1289
  if (markdown <= 0) return false;
1186
- return markdown >= _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1290
+ return markdown >= _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1187
1291
  }
1188
1292
  function escapeAttribute(value) {
1189
1293
  return escapeHtml(value).replace(/'/g, "&#39;");
@@ -1205,7 +1309,7 @@ function stripHtml(value) {
1205
1309
  }
1206
1310
  function getCodeFence(line) {
1207
1311
  const match = /^(?: {0,3})(`{3,}|~{3,})/.exec(line);
1208
- const value = _optionalChain([match, 'optionalAccess', _58 => _58[1]]);
1312
+ const value = _optionalChain([match, 'optionalAccess', _57 => _57[1]]);
1209
1313
  if (!value) return null;
1210
1314
  return { marker: value[0], length: value.length };
1211
1315
  }
@@ -1285,15 +1389,15 @@ function isCodePathLabel(label) {
1285
1389
  }
1286
1390
  function parseCodeInfo(info) {
1287
1391
  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()]);
1392
+ const language = _optionalChain([source, 'access', _58 => _58.match, 'call', _59 => _59(/^\S+/), 'optionalAccess', _60 => _60[0]]) || "text";
1393
+ const explicitLabel = _optionalChain([source, 'access', _61 => _61.match, 'call', _62 => _62(/\b(?:title|filename|file|label|name)=["']([^"']+)["']/), 'optionalAccess', _63 => _63[1], 'optionalAccess', _64 => _64.trim, 'call', _65 => _65()]);
1290
1394
  return { language, label: explicitLabel || language, hasExplicitLabel: Boolean(explicitLabel) };
1291
1395
  }
1292
1396
  function getStandaloneCodeLabel(line) {
1293
1397
  const trimmed = line.trim();
1294
1398
  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;
1399
+ const label = _optionalChain([match, 'optionalAccess', _66 => _66[1]]) || _optionalChain([match, 'optionalAccess', _67 => _67[2]]) || _optionalChain([match, 'optionalAccess', _68 => _68[3]]);
1400
+ return _optionalChain([label, 'optionalAccess', _69 => _69.trim, 'call', _70 => _70()]) || null;
1297
1401
  }
1298
1402
  function hasCodeFenceTitle(info) {
1299
1403
  return /\b(?:title|filename|file|label|name)=["'][^"']+["']/.test(info);
@@ -1423,7 +1527,7 @@ function getThemeName(docs) {
1423
1527
  return theme && typeof theme === "object" && "name" in theme ? String(theme.name || "farm-docs") : "farm-docs";
1424
1528
  }
1425
1529
  function getThemeTocDepth(docs) {
1426
- const toc = _optionalChain([getThemeUI, 'call', _72 => _72(docs), 'access', _73 => _73.layout, 'optionalAccess', _74 => _74.toc]);
1530
+ const toc = _optionalChain([getThemeUI, 'call', _71 => _71(docs), 'access', _72 => _72.layout, 'optionalAccess', _73 => _73.toc]);
1427
1531
  return toc && typeof toc === "object" && typeof toc.depth === "number" ? toc.depth : 3;
1428
1532
  }
1429
1533
  var SIDEBAR_SECTION_ORDER = [
@@ -1561,7 +1665,7 @@ function renderSidebarLabel(docs, icon, label, className) {
1561
1665
  return `<span class="${className}">${renderSidebarIcon(docs, icon)}<span class="sidebar-label-text">${escapeHtml(label)}</span></span>`;
1562
1666
  }
1563
1667
  function getSidebarPageLabel(item, configured) {
1564
- if (_optionalChain([configured, 'optionalAccess', _75 => _75.label])) return configured.label;
1668
+ if (_optionalChain([configured, 'optionalAccess', _74 => _74.label])) return configured.label;
1565
1669
  if (item.slug === "") return "Why?";
1566
1670
  if (item.slug === "integrations") return "Overview";
1567
1671
  if (item.slug === "integrations/ui-registry") return "UI Registry";
@@ -1571,9 +1675,9 @@ function getSidebarPageLabel(item, configured) {
1571
1675
  }
1572
1676
  return item.title;
1573
1677
  }
1574
- function renderSidebarLink(item, activeHref, docs, configured) {
1678
+ function renderSidebarLink(item, activeHref, docs, basePath, configured) {
1575
1679
  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>`;
1680
+ 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', _75 => _75.icon]), getSidebarPageLabel(item, configured), "sidebar-link-label fd-sidebar-link-label")}</a>`;
1577
1681
  }
1578
1682
  function collectConfiguredSidebarPages(items, maps, seen = /* @__PURE__ */ new Set()) {
1579
1683
  const ordered = [];
@@ -1611,24 +1715,24 @@ ${childHtml}
1611
1715
  </div>
1612
1716
  </div>`;
1613
1717
  }
1614
- function renderConfiguredSidebarItems(items, maps, activeHref, docs) {
1718
+ function renderConfiguredSidebarItems(items, maps, activeHref, docs, basePath) {
1615
1719
  const renderedItems = [];
1616
1720
  for (const item of items) {
1617
1721
  const page = resolveConfiguredSidebarPage(item, maps);
1618
- const childHtml = renderConfiguredSidebarItems(item.children, maps, activeHref, docs);
1722
+ const childHtml = renderConfiguredSidebarItems(item.children, maps, activeHref, docs, basePath);
1619
1723
  if (item.children.length > 0) {
1620
1724
  renderedItems.push(renderConfiguredSidebarSubgroup(item, childHtml, docs));
1621
1725
  continue;
1622
1726
  }
1623
- const linkHtml = page ? renderSidebarLink(page, activeHref, docs, item) : renderExternalSidebarLink(item, activeHref, docs);
1727
+ const linkHtml = page ? renderSidebarLink(page, activeHref, docs, basePath, item) : renderExternalSidebarLink(item, activeHref, docs);
1624
1728
  if (linkHtml) renderedItems.push(linkHtml);
1625
1729
  }
1626
1730
  return renderedItems.join("\n");
1627
1731
  }
1628
- function renderConfiguredSidebarSection(section, maps, activeHref, docs) {
1732
+ function renderConfiguredSidebarSection(section, maps, activeHref, docs, basePath) {
1629
1733
  const label = section.label || "Docs";
1630
1734
  const id = sidebarIdFor(label);
1631
- const links = renderConfiguredSidebarItems(section.children, maps, activeHref, docs);
1735
+ const links = renderConfiguredSidebarItems(section.children, maps, activeHref, docs, basePath);
1632
1736
  return `<div class="sidebar-folder fd-sidebar-folder" data-state="open">
1633
1737
  <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
1738
  <div id="${escapeAttribute(id)}" class="overflow-hidden sidebar-folder-content fd-sidebar-folder-content" data-state="open">
@@ -1636,19 +1740,19 @@ ${links}
1636
1740
  </div>
1637
1741
  </div>`;
1638
1742
  }
1639
- function renderAutoSidebarSectionItems(items, activeHref, docs) {
1640
- return [...items].sort(compareSidebarPages).map((item) => renderSidebarLink(item, activeHref, docs)).join("\n");
1743
+ function renderAutoSidebarSectionItems(items, activeHref, docs, basePath) {
1744
+ return [...items].sort(compareSidebarPages).map((item) => renderSidebarLink(item, activeHref, docs, basePath)).join("\n");
1641
1745
  }
1642
- function renderPixelNavItems(pages, activeHref, docs) {
1746
+ function renderPixelNavItems(pages, activeHref, docs, basePath) {
1643
1747
  const configuredSidebar = getSidebarNavigation(docs);
1644
1748
  if (configuredSidebar.length > 0) {
1645
1749
  const maps = createSidebarPageMaps(pages);
1646
1750
  const renderedSections2 = configuredSidebar.map((section) => {
1647
1751
  if (section.children.length > 0) {
1648
- return renderConfiguredSidebarSection(section, maps, activeHref, docs);
1752
+ return renderConfiguredSidebarSection(section, maps, activeHref, docs, basePath);
1649
1753
  }
1650
1754
  const page = resolveConfiguredSidebarPage(section, maps);
1651
- return page ? renderSidebarLink(page, activeHref, docs, section) : renderExternalSidebarLink(section, activeHref, docs);
1755
+ return page ? renderSidebarLink(page, activeHref, docs, basePath, section) : renderExternalSidebarLink(section, activeHref, docs);
1652
1756
  }).filter(Boolean).join("\n");
1653
1757
  return `<div class="sidebar-scroll overscroll-contain fd-sidebar-nav">
1654
1758
  <div class="sidebar-tree">
@@ -1669,7 +1773,7 @@ ${renderedSections2}
1669
1773
  return (aOrder === -1 ? 100 : aOrder) - (bOrder === -1 ? 100 : bOrder) || a.localeCompare(b);
1670
1774
  }).map(([section, items]) => {
1671
1775
  const id = sidebarIdFor(section);
1672
- const links = renderAutoSidebarSectionItems(items, activeHref, docs);
1776
+ const links = renderAutoSidebarSectionItems(items, activeHref, docs, basePath);
1673
1777
  return `<div class="sidebar-folder fd-sidebar-folder" data-state="open">
1674
1778
  <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
1779
  <div id="${escapeAttribute(id)}" class="overflow-hidden sidebar-folder-content fd-sidebar-folder-content" data-state="open">
@@ -1683,7 +1787,7 @@ ${renderedSections}
1683
1787
  </div>
1684
1788
  </div>`;
1685
1789
  }
1686
- function renderPixelPageNav(pages, activeHref, docs) {
1790
+ function renderPixelPageNav(pages, activeHref, docs, basePath) {
1687
1791
  const orderedPages = getOrderedSidebarPages(pages, docs);
1688
1792
  const activeIndex = orderedPages.findIndex((item) => item.href === activeHref);
1689
1793
  if (activeIndex === -1) return "";
@@ -1691,7 +1795,7 @@ function renderPixelPageNav(pages, activeHref, docs) {
1691
1795
  const next = orderedPages[activeIndex + 1];
1692
1796
  if (!previous && !next) return "";
1693
1797
  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)}">
1798
+ 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
1799
  <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
1800
  <span class="fd-page-nav-description">${direction === "prev" ? "Previous Page" : "Next Page"}</span>
1697
1801
  </a>`;
@@ -1711,7 +1815,7 @@ function isBreadcrumbEnabled(docs) {
1711
1815
  }
1712
1816
  return true;
1713
1817
  }
1714
- function renderPixelBreadcrumb(page, docs) {
1818
+ function renderPixelBreadcrumb(page, docs, basePath) {
1715
1819
  if (!isBreadcrumbEnabled(docs)) return "";
1716
1820
  const segments = trimSlashes(page.slug).split("/").filter(Boolean);
1717
1821
  if (segments.length < 2) return "";
@@ -1720,7 +1824,10 @@ function renderPixelBreadcrumb(page, docs) {
1720
1824
  const currentSegment = segments[segments.length - 1];
1721
1825
  const entry = normalizeEntry2(docs.entry);
1722
1826
  const parentPath = parentSegments.join("/");
1723
- const parentHref = entry === "/" ? `/${parentPath}` : `${entry}/${parentPath}`;
1827
+ const parentHref = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0,
1828
+ entry === "/" ? `/${parentPath}` : `${entry}/${parentPath}`,
1829
+ basePath
1830
+ );
1724
1831
  return `<nav class="fd-breadcrumb" aria-label="Breadcrumb">
1725
1832
  <span class="fd-breadcrumb-item">
1726
1833
  <a class="fd-breadcrumb-parent fd-breadcrumb-link" href="${escapeAttribute(parentHref)}">${escapeHtml(titleizePathSegment(parentSegment))}</a>
@@ -1755,8 +1862,8 @@ ${items.map(
1755
1862
  </div>
1756
1863
  </div>`;
1757
1864
  }
1758
- function renderDocsRuntimeScript(docs) {
1759
- const docsEntry = JSON.stringify(normalizeEntry2(docs.entry));
1865
+ function renderDocsRuntimeScript(docs, basePath) {
1866
+ const docsEntry = JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, normalizeEntry2(docs.entry), basePath));
1760
1867
  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
1868
  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
1869
  }
@@ -1766,8 +1873,8 @@ function renderDocsPageActionsRuntimeScript() {
1766
1873
  function renderDocsHashRuntimeScript() {
1767
1874
  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
1875
  }
1769
- function renderDocsRuntimeScripts(docs) {
1770
- return _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, `${renderDocsRuntimeScript(docs)}
1876
+ function renderDocsRuntimeScripts(docs, basePath) {
1877
+ return _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, `${renderDocsRuntimeScript(docs, basePath)}
1771
1878
  ${renderDocsHashRuntimeScript()}
1772
1879
  ${renderDocsPageActionsRuntimeScript()}`);
1773
1880
  }
@@ -1781,8 +1888,8 @@ function renderFarmDocsFontPreloadHeader(fontAssets) {
1781
1888
  }
1782
1889
  function getFarmLayoutFontPreloads(layoutFonts) {
1783
1890
  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 }) => {
1891
+ return [_optionalChain([layoutFonts, 'optionalAccess', _76 => _76.body]), _optionalChain([layoutFonts, 'optionalAccess', _77 => _77.code])].flatMap(
1892
+ (font) => (_optionalChain([font, 'optionalAccess', _78 => _78.preloads]) || []).filter(({ href }) => {
1786
1893
  if (seen.has(href)) return false;
1787
1894
  seen.add(href);
1788
1895
  return true;
@@ -1792,17 +1899,18 @@ function getFarmLayoutFontPreloads(layoutFonts) {
1792
1899
  function renderFarmLayoutFontPreloadHeader(layoutFonts) {
1793
1900
  return getFarmLayoutFontPreloads(layoutFonts).map(({ href, type }) => `<${href}>; rel=preload; as=font; type=${type}; crossorigin`).join(", ");
1794
1901
  }
1795
- function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, requestUrl, fontAssets, fontStylesheetHref, globalStylesheetHref) {
1902
+ function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, requestUrl, fontAssets, basePath, fontStylesheetHref, globalStylesheetHref, socialImageFormat = "svg") {
1796
1903
  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]) || "";
1904
+ const description = page.description || _optionalChain([docs, 'access', _79 => _79.config, 'access', _80 => _80.metadata, 'optionalAccess', _81 => _81.description]) || "";
1798
1905
  const renderedMarkdown = renderMarkdownDocument(page.body, getThemeTocDepth(docs));
1799
1906
  const tocItems = renderedMarkdown.tocItems;
1800
1907
  const themeName = getThemeName(docs);
1801
1908
  const searchEnabled = _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, docs);
1802
1909
  const socialMetadata = isFarmDocsSocialImageEnabled(page, docs) ? renderFarmDocsSocialMetadata(
1803
- createFarmDocsSocialImageDescriptor(page, docs, requestUrl),
1910
+ createFarmDocsSocialImageDescriptor(page, docs, requestUrl, socialImageFormat, basePath),
1804
1911
  getFarmDocsCustomSocialImage(page)
1805
1912
  ) : "";
1913
+ const homeHref = escapeAttribute(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, "/", basePath));
1806
1914
  return `<!DOCTYPE html>
1807
1915
  <html class="dark" lang="en" data-docs-theme="${escapeAttribute(themeName)}">
1808
1916
  <head>
@@ -1824,28 +1932,28 @@ function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, reques
1824
1932
  <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
1933
  <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
1934
  </button>
1827
- <a class="fd-header-title" href="/">${escapeHtml(navTitle)}</a>
1935
+ <a class="fd-header-title" href="${homeHref}">${escapeHtml(navTitle)}</a>
1828
1936
  <div class="mobile-topbar-actions">
1829
1937
  ${searchEnabled ? renderDocsSearchTrigger(true, "fd-search-trigger-mobile") : ""}
1830
- <a class="mobile-topbar-link" href="/llms.txt">llms.txt</a>
1938
+ <a class="mobile-topbar-link" href="${escapeAttribute(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, "/llms.txt", basePath))}">llms.txt</a>
1831
1939
  </div>
1832
1940
  </header>
1833
1941
  <aside id="nd-sidebar" class="fd-sidebar">
1834
1942
  <div class="sidebar-brand fd-sidebar-header">
1835
- <a class="fd-sidebar-title" href="/">${renderFarmDocsBrandMark()}${renderFarmDocsBrandTitle(navTitle)}</a>
1943
+ <a class="fd-sidebar-title" href="${homeHref}">${renderFarmDocsBrandMark()}${renderFarmDocsBrandTitle(navTitle)}</a>
1836
1944
  <span>/ docs</span>
1837
1945
  </div>
1838
1946
  ${searchEnabled ? `<div class="fd-sidebar-search">${renderDocsSearchTrigger(true, "fd-sidebar-search-btn")}</div>` : ""}
1839
- ${renderPixelNavItems(pages, page.href, docs)}
1947
+ ${renderPixelNavItems(pages, page.href, docs, basePath)}
1840
1948
  </aside>
1841
1949
  <div class="sidebar-backdrop fd-sidebar-overlay" data-sidebar-backdrop></div>
1842
1950
  <main class="fd-main">
1843
1951
  <div class="fd-page">
1844
1952
  <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)}
1953
+ ${renderPixelBreadcrumb(page, docs, basePath)}
1954
+ ${renderMarkdownHtmlWithTitleMeta(page, docs, renderedMarkdown.html, basePath)}
1847
1955
  ${renderPixelPageFooter(page, docs)}
1848
- ${renderPixelPageNav(pages, page.href, docs)}
1956
+ ${renderPixelPageNav(pages, page.href, docs, basePath)}
1849
1957
  </article>
1850
1958
  <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
1959
  <div class="fd-toc-inner">
@@ -1859,7 +1967,7 @@ ${renderMarkdownHtmlWithTitleMeta(page, docs, renderedMarkdown.html)}
1859
1967
  </main>
1860
1968
  </div>
1861
1969
  ${searchEnabled ? renderDocsSearchMount(clientEntry) : ""}
1862
- ${renderDocsRuntimeScripts(docs)}
1970
+ ${renderDocsRuntimeScripts(docs, basePath)}
1863
1971
  </body>
1864
1972
  </html>`;
1865
1973
  }
@@ -1867,25 +1975,40 @@ function createFarmDocsHandler(docs, options) {
1867
1975
  const faviconHref = resolveFarmDocsFavicon(docs, options);
1868
1976
  const fontAssets = _nullishCoalesce(options.fontAssets, () => ( _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, options.root))));
1869
1977
  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;
1978
+ const basePath = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, options.basePath);
1979
+ return async function handleFarmDocsRequest(incomingRequest) {
1980
+ if (!_optionalChain([docs, 'optionalAccess', _82 => _82.enabled]) || incomingRequest.method !== "GET" && incomingRequest.method !== "HEAD") {
1981
+ return null;
1982
+ }
1872
1983
  await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
1873
- const contentDir = resolveFarmDocsContentDir(docs, options);
1984
+ const request = toFarmDocsRouteRequest(incomingRequest, basePath);
1874
1985
  const requestUrl = new URL(request.url);
1875
- const socialImageSlug = getFarmDocsSocialImageSlug(docs, requestUrl);
1876
- if (socialImageSlug !== null) {
1877
- const socialImagePage = loadFarmDocsPage(contentDir, docs, socialImageSlug);
1986
+ if (request !== incomingRequest && (requestUrl.pathname === "/api/docs" || requestUrl.pathname.startsWith("/api/docs/"))) {
1987
+ return null;
1988
+ }
1989
+ const contentDir = resolveFarmDocsContentDir(docs, options);
1990
+ const socialImageTarget = getFarmDocsSocialImageSlug(docs, requestUrl);
1991
+ if (socialImageTarget !== null) {
1992
+ const socialImagePage = loadFarmDocsPage(contentDir, docs, socialImageTarget.slug);
1878
1993
  if (!socialImagePage || // The image sits outside the page's URL, where its guard does not reach, and
1879
1994
  // draws the page's title.
1880
- _optionalChain([options, 'access', _84 => _84.isPathGuarded, 'optionalCall', _85 => _85(socialImagePage.href)]) || !isFarmDocsSocialImageEnabled(socialImagePage, docs) || getFarmDocsCustomSocialImage(socialImagePage)) {
1995
+ _optionalChain([options, 'access', _83 => _83.isPathGuarded, 'optionalCall', _84 => _84(socialImagePage.href)]) || !isFarmDocsSocialImageEnabled(socialImagePage, docs) || getFarmDocsCustomSocialImage(socialImagePage)) {
1881
1996
  return null;
1882
1997
  }
1883
- const descriptor = createFarmDocsSocialImageDescriptor(socialImagePage, docs, requestUrl);
1998
+ const descriptor = createFarmDocsSocialImageDescriptor(
1999
+ socialImagePage,
2000
+ docs,
2001
+ requestUrl,
2002
+ socialImageTarget.format,
2003
+ basePath
2004
+ );
1884
2005
  if (requestUrl.pathname !== descriptor.imagePath) return null;
1885
- const etag = `"${descriptor.hash}"`;
2006
+ const png = descriptor.format === "png";
2007
+ if (png && await resolveFarmDocsSocialImageFormat() !== "png") return null;
2008
+ const etag = `"${descriptor.hash}${png ? "-png" : ""}"`;
1886
2009
  const immutable = requestUrl.searchParams.get("v") === descriptor.hash;
1887
2010
  const headers = new Headers({
1888
- "Content-Type": "image/svg+xml; charset=utf-8",
2011
+ "Content-Type": png ? "image/png" : "image/svg+xml; charset=utf-8",
1889
2012
  "Cache-Control": immutable ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate",
1890
2013
  ETag: etag,
1891
2014
  "X-Content-Type-Options": "nosniff"
@@ -1894,20 +2017,25 @@ function createFarmDocsHandler(docs, options) {
1894
2017
  return new Response(null, { status: 304, headers });
1895
2018
  }
1896
2019
  if (request.method === "HEAD") return new Response(null, { status: 200, headers });
2020
+ if (png) {
2021
+ const image = await renderFarmDocsSocialImagePng(descriptor);
2022
+ return image ? new Response(image, { status: 200, headers }) : null;
2023
+ }
1897
2024
  return new Response(renderFarmDocsSocialImageSvg(descriptor), { status: 200, headers });
1898
2025
  }
1899
2026
  const publicResponse = createFarmDocsPublicResponse(
1900
2027
  contentDir,
1901
2028
  docs,
1902
2029
  request,
1903
- options.isPathGuarded
2030
+ options.isPathGuarded,
2031
+ basePath
1904
2032
  );
1905
2033
  if (publicResponse) return omitFarmDocsHeadBody(request, publicResponse);
1906
2034
  if (!isFarmDocsRequest(docs, request)) return null;
1907
2035
  const page = loadPage(contentDir, docs, request);
1908
2036
  if (!page) return null;
1909
2037
  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))) {
2038
+ if (!negotiatesAccept && _optionalChain([options, 'access', _85 => _85.isPathGuarded, 'optionalCall', _86 => _86(page.href)]) && !options.isPathGuarded(getFarmDocsMarkdownPath(page.href))) {
1911
2039
  return null;
1912
2040
  }
1913
2041
  if (shouldReturnMarkdown(request)) {
@@ -1915,10 +2043,10 @@ function createFarmDocsHandler(docs, options) {
1915
2043
  return omitFarmDocsHeadBody(
1916
2044
  request,
1917
2045
  new Response(
1918
- _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page), {
2046
+ _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page, basePath), {
1919
2047
  origin,
1920
2048
  llms: _nullishCoalesce(docs.config.llmsTxt, () => ( true)),
1921
- sitemap: docs.config.sitemap
2049
+ sitemap: toFarmDocsPublicSitemapConfig(docs.config.sitemap, basePath)
1922
2050
  }),
1923
2051
  {
1924
2052
  status: 200,
@@ -1932,8 +2060,9 @@ function createFarmDocsHandler(docs, options) {
1932
2060
  );
1933
2061
  }
1934
2062
  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]));
2063
+ const socialImageFormat = isFarmDocsSocialImageEnabled(page, docs) && !getFarmDocsCustomSocialImage(page) ? await resolveFarmDocsSocialImageFormat() : "svg";
2064
+ const layoutFonts = await _optionalChain([options, 'access', _87 => _87.resolveLayoutFonts, 'optionalCall', _88 => _88(pathname)]);
2065
+ const usesLayoutFonts = Boolean(_optionalChain([layoutFonts, 'optionalAccess', _89 => _89.body]) || _optionalChain([layoutFonts, 'optionalAccess', _90 => _90.code]));
1937
2066
  const activeFontAssets = usesLayoutFonts ? [] : fontAssets;
1938
2067
  const fontPreloadHeader = usesLayoutFonts ? renderFarmLayoutFontPreloadHeader(layoutFonts) : fallbackFontPreloadHeader;
1939
2068
  return omitFarmDocsHeadBody(
@@ -1947,8 +2076,10 @@ function createFarmDocsHandler(docs, options) {
1947
2076
  faviconHref,
1948
2077
  requestUrl,
1949
2078
  activeFontAssets,
2079
+ basePath,
1950
2080
  usesLayoutFonts ? options.fontStylesheetHref : void 0,
1951
- options.globalStylesheetHref
2081
+ options.globalStylesheetHref,
2082
+ socialImageFormat
1952
2083
  ),
1953
2084
  {
1954
2085
  status: 200,
@@ -1977,4 +2108,10 @@ function createFarmDocsHandler(docs, options) {
1977
2108
 
1978
2109
 
1979
2110
 
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;
2111
+
2112
+
2113
+
2114
+
2115
+
2116
+
2117
+ 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.listFarmDocsBuiltInPrerenderPages = listFarmDocsBuiltInPrerenderPages; exports.toFarmDocsMarkdownPage = toFarmDocsMarkdownPage; exports.getFarmDocsSiteUrl = getFarmDocsSiteUrl; exports.getFarmDocsPublicEntry = getFarmDocsPublicEntry; exports.toFarmDocsPublicSitemapConfig = toFarmDocsPublicSitemapConfig; exports.buildFarmDocsSitemapManifest = buildFarmDocsSitemapManifest; exports.renderFarmDocsRobotsTxt = renderFarmDocsRobotsTxt; exports.createFarmDocsHandler = createFarmDocsHandler;