@farm.js/core 0.1.51-beta.2 → 0.1.60

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 (321) hide show
  1. package/dist/{agent-mcp-handler-WWCC4GLG.mjs → agent-mcp-handler-7QMX2LUY.mjs} +7 -7
  2. package/dist/agent-mcp-handler-OV4WRFBL.cjs +18 -0
  3. package/dist/{agent-mcp.d-Z5DuwrqW.d.mts → agent-mcp.d-C-2S9bnP.d.mts} +1 -1
  4. package/dist/{agent-mcp.d-CR5Ov83o.d.ts → agent-mcp.d-SIoCUP1I.d.ts} +1 -1
  5. package/dist/agent-runtime.cjs +5 -5
  6. package/dist/agent-runtime.d.mts +2 -2
  7. package/dist/agent-runtime.d.ts +2 -2
  8. package/dist/agent-runtime.mjs +4 -4
  9. package/dist/{analyzer-Z6TNEAET.mjs → analyzer-22BEYV7S.mjs} +126 -12
  10. package/dist/{analyzer-T76CN3S7.cjs → analyzer-LCSI3NSH.cjs} +132 -18
  11. package/dist/api/client.cjs +5 -4
  12. package/dist/api/client.d.mts +1 -1
  13. package/dist/api/client.d.ts +1 -1
  14. package/dist/api/client.mjs +3 -2
  15. package/dist/api/client.native.cjs +45 -0
  16. package/dist/api/client.native.d.mts +23 -0
  17. package/dist/api/client.native.d.ts +23 -0
  18. package/dist/api/client.native.mjs +45 -0
  19. package/dist/api/route-manager.cjs +7 -7
  20. package/dist/api/route-manager.d.mts +4 -4
  21. package/dist/api/route-manager.d.ts +4 -4
  22. package/dist/api/route-manager.mjs +6 -6
  23. package/dist/api/runtime.cjs +5 -5
  24. package/dist/api/runtime.d.mts +3 -3
  25. package/dist/api/runtime.d.ts +3 -3
  26. package/dist/api/runtime.mjs +4 -4
  27. package/dist/{api-client.d-CeA6tNA6.d.mts → api-client.d-BNLXNCXJ.d.mts} +1 -1
  28. package/dist/{api-client.d-BWcqZciH.d.ts → api-client.d-ddQBNGtu.d.ts} +1 -1
  29. package/dist/api.cjs +11 -11
  30. package/dist/api.d.mts +5 -5
  31. package/dist/api.d.ts +5 -5
  32. package/dist/api.mjs +10 -10
  33. package/dist/{app-manifest.d-CAHkOBFa.d.mts → app-manifest.d-DrSAHskY.d.mts} +1 -1
  34. package/dist/{app-manifest.d-DiWr_Jfx.d.ts → app-manifest.d-Tb3CJpL4.d.ts} +1 -1
  35. package/dist/app-markdown.cjs +7 -7
  36. package/dist/app-markdown.d.mts +3 -3
  37. package/dist/app-markdown.d.ts +3 -3
  38. package/dist/app-markdown.mjs +6 -6
  39. package/dist/{app.d-DmapqkbV.d.ts → app.d-CmWlYpZJ.d.ts} +9 -4
  40. package/dist/{app.d-BfgJCsTQ.d.mts → app.d-D6QQM_kk.d.mts} +9 -4
  41. package/dist/{chunk-SN5VSO3Q.mjs → chunk-25T5VXOE.mjs} +7 -9
  42. package/dist/{chunk-GUJTVM36.cjs → chunk-2FRLSDBT.cjs} +1 -1
  43. package/dist/{chunk-LM2YOGDK.mjs → chunk-2I6PUKWJ.mjs} +1 -1
  44. package/dist/{chunk-EIMK7D2D.mjs → chunk-2KTYMMWT.mjs} +34 -4
  45. package/dist/{chunk-B5BBTPJQ.cjs → chunk-2OF5RPVU.cjs} +14 -14
  46. package/dist/chunk-37PYUEK5.mjs +533 -0
  47. package/dist/chunk-3HLQTOVU.cjs +6 -0
  48. package/dist/{chunk-VSLM6BHX.cjs → chunk-3OJNNCDL.cjs} +9 -9
  49. package/dist/{chunk-X3JNB2TB.mjs → chunk-3PX4AIXO.mjs} +36 -5
  50. package/dist/{chunk-UQHIWZZ6.cjs → chunk-3TL3AH25.cjs} +12 -6
  51. package/dist/chunk-3YMLUNL2.cjs +251 -0
  52. package/dist/chunk-4JTQPOKO.cjs +137 -0
  53. package/dist/{chunk-QXPSWMUD.cjs → chunk-4P23B7DU.cjs} +5 -5
  54. package/dist/{chunk-YVJV7Q2X.mjs → chunk-55U5QIXQ.mjs} +1 -1
  55. package/dist/{chunk-5N7QAGEA.cjs → chunk-5JNUYGNF.cjs} +37 -7
  56. package/dist/{chunk-NJLTQR5P.cjs → chunk-6BJJYOFL.cjs} +7 -7
  57. package/dist/chunk-6UUH4N4J.mjs +251 -0
  58. package/dist/{chunk-2NHOYYUT.mjs → chunk-7H45IJWO.mjs} +2 -2
  59. package/dist/{chunk-NN3MOPSI.mjs → chunk-A2MN5PQJ.mjs} +7 -7
  60. package/dist/{chunk-KY32FWK7.mjs → chunk-BHJAYPYU.mjs} +2 -2
  61. package/dist/{chunk-VAHBCI6X.mjs → chunk-BQWBHWEW.mjs} +26 -1
  62. package/dist/{chunk-KJMWAUKE.mjs → chunk-C7GJDVN4.mjs} +1 -1
  63. package/dist/{chunk-OYNNA4DD.cjs → chunk-CBKRS3M4.cjs} +9 -9
  64. package/dist/{chunk-I2DQGS56.cjs → chunk-CBOEJ5Z4.cjs} +39 -41
  65. package/dist/{chunk-BOVGCUDZ.cjs → chunk-CI4UNQHO.cjs} +2 -2
  66. package/dist/{chunk-S5AQ7CAC.cjs → chunk-CNNBFGL5.cjs} +39 -14
  67. package/dist/chunk-D2X5MUF5.cjs +1457 -0
  68. package/dist/{chunk-LEIXUFJN.cjs → chunk-D4MRNBVF.cjs} +10 -9
  69. package/dist/{chunk-2KVDHNQS.mjs → chunk-D7LTCK3U.mjs} +2 -2
  70. package/dist/{chunk-J3LBO2O4.cjs → chunk-DPJ66FSI.cjs} +22 -22
  71. package/dist/{chunk-NYQSC4DX.cjs → chunk-DZPR2W6U.cjs} +5 -5
  72. package/dist/{chunk-GW4YUIHW.mjs → chunk-E72UD6ME.mjs} +1 -1
  73. package/dist/chunk-EFZGB7JC.cjs +114 -0
  74. package/dist/{chunk-XXXRRVY6.mjs → chunk-EGVC4LIG.mjs} +5 -5
  75. package/dist/{chunk-72NBDVWQ.mjs → chunk-EXUONJYV.mjs} +3 -3
  76. package/dist/{chunk-VS7EHLLW.mjs → chunk-EZ34EHQP.mjs} +1 -1
  77. package/dist/{chunk-FM2UEKS2.mjs → chunk-F6Y7ZAPQ.mjs} +2 -2
  78. package/dist/{chunk-LMFJCXDD.mjs → chunk-FN5UEC7I.mjs} +1 -1
  79. package/dist/{chunk-E6LTONL4.mjs → chunk-FORSVMEJ.mjs} +2 -2
  80. package/dist/{chunk-6CYQQQGR.mjs → chunk-HPWB57PZ.mjs} +1 -1
  81. package/dist/{chunk-Y2G5SJFB.mjs → chunk-IFHPDLIS.mjs} +1 -1
  82. package/dist/{chunk-GNJIYJMS.cjs → chunk-IFXSBJPN.cjs} +16 -16
  83. package/dist/{chunk-74Z5KX4A.mjs → chunk-ILMTRGBG.mjs} +309 -56
  84. package/dist/{chunk-NXBHYO7S.cjs → chunk-JBK7UJOI.cjs} +14 -11
  85. package/dist/chunk-JI5D7MXY.mjs +137 -0
  86. package/dist/{chunk-QXJADAQB.cjs → chunk-JIBEFLQ7.cjs} +6 -2
  87. package/dist/{chunk-LZ4SB57H.mjs → chunk-JPIUGDK4.mjs} +1 -1
  88. package/dist/{chunk-Y3N5BFRJ.mjs → chunk-JSDV2NUN.mjs} +1 -1
  89. package/dist/{chunk-IRSS4HS4.mjs → chunk-K3RU5MOR.mjs} +1 -1
  90. package/dist/chunk-KPOMS5RO.cjs +237 -0
  91. package/dist/{chunk-LAZK6UV7.mjs → chunk-KVW2M6PI.mjs} +1 -1
  92. package/dist/{chunk-5IONBVJY.cjs → chunk-LB3DPQP6.cjs} +22 -22
  93. package/dist/{chunk-CZ35L6PL.mjs → chunk-LJVNMGE3.mjs} +10 -4
  94. package/dist/chunk-LLZSYFOM.mjs +6 -0
  95. package/dist/{chunk-X2AMN2WV.cjs → chunk-LQNW3ABP.cjs} +10 -10
  96. package/dist/{chunk-6ONBZGVH.cjs → chunk-LRB5OVRT.cjs} +3 -3
  97. package/dist/{chunk-WJFFPXCV.cjs → chunk-LT4VAF5Z.cjs} +12 -10
  98. package/dist/{chunk-F6TLUMH7.mjs → chunk-M53MIIXY.mjs} +1 -1
  99. package/dist/{chunk-HIFIG6HL.cjs → chunk-MEQN6DDA.cjs} +5 -5
  100. package/dist/{chunk-XLRLSTJ6.cjs → chunk-MGKW5XZE.cjs} +7 -7
  101. package/dist/{chunk-B3GZAQSC.cjs → chunk-MHLNWRCJ.cjs} +3 -3
  102. package/dist/{chunk-5ENW27SL.mjs → chunk-MMK4MZUN.mjs} +1 -1
  103. package/dist/{chunk-DTU4PX7V.cjs → chunk-MTWXOEI4.cjs} +927 -629
  104. package/dist/chunk-NHD7BAKD.mjs +1457 -0
  105. package/dist/{chunk-NPQLMP7M.cjs → chunk-NQJDO7K7.cjs} +32 -31
  106. package/dist/{chunk-76GHW3WI.cjs → chunk-O27PLNQZ.cjs} +10 -10
  107. package/dist/{chunk-PIHKO25G.mjs → chunk-OM7WILES.mjs} +1 -1
  108. package/dist/{chunk-7UPCJDB5.mjs → chunk-PCXIJKPM.mjs} +8 -8
  109. package/dist/{chunk-IWFV5ZED.cjs → chunk-PMJSG4JS.cjs} +1 -1
  110. package/dist/{chunk-JATTVAHA.cjs → chunk-PRFNLQSP.cjs} +4 -4
  111. package/dist/{chunk-SBABQKPT.cjs → chunk-QAS7KE7J.cjs} +7 -7
  112. package/dist/chunk-QGOZLGVP.mjs +0 -0
  113. package/dist/{chunk-VQJYGZNX.cjs → chunk-QMNWKQL4.cjs} +1 -1
  114. package/dist/{chunk-XB24LZWI.cjs → chunk-QRX4JRBO.cjs} +3 -3
  115. package/dist/{chunk-LNM57D3H.cjs → chunk-R53QDV6T.cjs} +4 -4
  116. package/dist/{chunk-SUV6YO4Q.cjs → chunk-RAWWCDCT.cjs} +5 -5
  117. package/dist/{chunk-LJDIFIJ2.mjs → chunk-RPUJHJHE.mjs} +4 -4
  118. package/dist/{chunk-G2KTRMWA.mjs → chunk-RSEAX5MW.mjs} +4 -0
  119. package/dist/chunk-SJRCWF4Z.mjs +237 -0
  120. package/dist/{chunk-IBSAYAWB.mjs → chunk-SX7EECTS.mjs} +8 -5
  121. package/dist/{chunk-KBRZAYI7.mjs → chunk-T4TBK5NY.mjs} +2 -2
  122. package/dist/{chunk-4SSRBCBR.mjs → chunk-T7I62A4C.mjs} +619 -321
  123. package/dist/{chunk-E36C43IX.cjs → chunk-U4BJKNIR.cjs} +6 -6
  124. package/dist/{chunk-YU42A5MA.cjs → chunk-UDJY2ZGY.cjs} +533 -280
  125. package/dist/{chunk-SHS6KXOZ.mjs → chunk-UR25Z5Z6.mjs} +1 -1
  126. package/dist/{chunk-WZW6LEHM.cjs → chunk-UYSTTPYJ.cjs} +1590 -1019
  127. package/dist/{chunk-KRRZJ77U.mjs → chunk-UZZ6IEQP.mjs} +3 -3
  128. package/dist/{chunk-EKJYE4Y7.cjs → chunk-VGG74PSU.cjs} +25 -25
  129. package/dist/{chunk-CTM4SPB3.mjs → chunk-VPTWKOCY.mjs} +20 -19
  130. package/dist/{chunk-UN6N623E.mjs → chunk-VQJHT2ND.mjs} +2 -2
  131. package/dist/{chunk-SJ23LJ3N.cjs → chunk-VVTJTMGQ.cjs} +3 -3
  132. package/dist/{chunk-KHXAJ2KA.cjs → chunk-W2RZ73IU.cjs} +12 -12
  133. package/dist/{chunk-JWI5PUO2.mjs → chunk-W2ZXMMHA.mjs} +2 -1
  134. package/dist/{chunk-BLD5GVCG.mjs → chunk-W6QLRQ3V.mjs} +1 -1
  135. package/dist/{chunk-AV26KHTG.mjs → chunk-X2CZTWQA.mjs} +2 -2
  136. package/dist/chunk-XPIPMWY3.cjs +1 -0
  137. package/dist/chunk-XTG73QZA.cjs +533 -0
  138. package/dist/{chunk-XPMC4E2G.cjs → chunk-XVSBALOY.cjs} +3 -3
  139. package/dist/{chunk-XYL4HSVC.cjs → chunk-YI6FKTTN.cjs} +38 -7
  140. package/dist/{chunk-N77JBPLC.mjs → chunk-YSXTNSXS.mjs} +10 -8
  141. package/dist/{chunk-EHB77D5U.cjs → chunk-ZDAEHG2O.cjs} +3 -3
  142. package/dist/{chunk-PMKUU273.mjs → chunk-ZFUKPWFC.mjs} +1226 -655
  143. package/dist/{chunk-E73PGHSR.mjs → chunk-ZMHAFH4R.mjs} +8 -8
  144. package/dist/{chunk-ZOWNWHK6.cjs → chunk-ZNH6NR3H.cjs} +2 -2
  145. package/dist/chunk-ZNXTU4YH.mjs +114 -0
  146. package/dist/{chunk-PFV2KPDZ.cjs → chunk-ZOYKJBP5.cjs} +3 -3
  147. package/dist/{chunk-CECUDGXQ.cjs → chunk-ZP32GNJQ.cjs} +13 -13
  148. package/dist/{chunk-72D2NX77.mjs → chunk-ZZ2QKCKW.mjs} +1 -1
  149. package/dist/{client-plugins.d-Bx3FXpqm.d.mts → client-plugins.d-CgQQ-EAv.d.mts} +25 -4
  150. package/dist/{client-plugins.d-TiLbS5j4.d.ts → client-plugins.d-vXrbcfJ1.d.ts} +25 -4
  151. package/dist/client-plugins.d.mts +2 -2
  152. package/dist/client-plugins.d.ts +2 -2
  153. package/dist/client.cjs +9 -9
  154. package/dist/client.d.mts +9 -9
  155. package/dist/client.d.ts +9 -9
  156. package/dist/client.mjs +9 -9
  157. package/dist/{config.d-iRPI16ku.d.mts → config.d-DqZkLwef.d.mts} +146 -1
  158. package/dist/{config.d-iRPI16ku.d.ts → config.d-DqZkLwef.d.ts} +146 -1
  159. package/dist/config.d.mts +2 -2
  160. package/dist/config.d.ts +2 -2
  161. package/dist/cron.cjs +3 -3
  162. package/dist/cron.d.mts +10 -0
  163. package/dist/cron.d.ts +10 -0
  164. package/dist/cron.mjs +2 -2
  165. package/dist/desktop.d.mts +3 -3
  166. package/dist/desktop.d.ts +3 -3
  167. package/dist/{devtools-UQLDAOEI.mjs → devtools-KQZ6SRCJ.mjs} +16 -16
  168. package/dist/{devtools-6XWCZIGO.cjs → devtools-UF6JYHUN.cjs} +18 -18
  169. package/dist/docs.cjs +19 -19
  170. package/dist/docs.d.mts +3 -3
  171. package/dist/docs.d.ts +3 -3
  172. package/dist/docs.mjs +18 -18
  173. package/dist/index.cjs +99 -95
  174. package/dist/{index.d-yueUNipJ.d.ts → index.d-DlCELfhf.d.ts} +1 -1
  175. package/dist/{index.d-YxJ2AiDF.d.mts → index.d-Dmfb7Kb_.d.mts} +1 -1
  176. package/dist/index.d.mts +18 -18
  177. package/dist/index.d.ts +18 -18
  178. package/dist/index.mjs +139 -135
  179. package/dist/integrations.cjs +5 -5
  180. package/dist/integrations.d.mts +2 -2
  181. package/dist/integrations.d.ts +2 -2
  182. package/dist/integrations.mjs +4 -4
  183. package/dist/internal/app-markdown-runtime.cjs +6 -6
  184. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  185. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  186. package/dist/internal/app-markdown-runtime.mjs +5 -5
  187. package/dist/internal/build-runtime.cjs +52 -50
  188. package/dist/internal/build-runtime.d.mts +4 -4
  189. package/dist/internal/build-runtime.d.ts +4 -4
  190. package/dist/internal/build-runtime.mjs +51 -49
  191. package/dist/internal/cli-runtime.cjs +28 -28
  192. package/dist/internal/cli-runtime.mjs +28 -28
  193. package/dist/internal/client-error-overlay.cjs +4 -4
  194. package/dist/internal/client-error-overlay.mjs +1 -1
  195. package/dist/internal/client-runtime.cjs +20 -15
  196. package/dist/internal/client-runtime.d.mts +5 -5
  197. package/dist/internal/client-runtime.d.ts +5 -5
  198. package/dist/internal/client-runtime.mjs +8 -3
  199. package/dist/internal/compression-runtime.d.mts +2 -2
  200. package/dist/internal/compression-runtime.d.ts +2 -2
  201. package/dist/internal/config-runtime.cjs +18 -18
  202. package/dist/internal/config-runtime.d.mts +119 -7
  203. package/dist/internal/config-runtime.d.ts +119 -7
  204. package/dist/internal/config-runtime.mjs +17 -17
  205. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  206. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  207. package/dist/internal/islands-boot.cjs +211 -0
  208. package/dist/internal/islands-boot.d.mts +8 -0
  209. package/dist/internal/islands-boot.d.ts +8 -0
  210. package/dist/internal/islands-boot.mjs +211 -0
  211. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  212. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  213. package/dist/internal/production-runtime.cjs +42 -28
  214. package/dist/internal/production-runtime.d.mts +50 -12
  215. package/dist/internal/production-runtime.d.ts +50 -12
  216. package/dist/internal/production-runtime.mjs +52 -38
  217. package/dist/markdown.cjs +7 -5
  218. package/dist/markdown.d.mts +2 -2
  219. package/dist/markdown.d.ts +2 -2
  220. package/dist/markdown.mjs +6 -4
  221. package/dist/middleware.cjs +10 -10
  222. package/dist/middleware.d.mts +4 -4
  223. package/dist/middleware.d.ts +4 -4
  224. package/dist/middleware.mjs +9 -9
  225. package/dist/mobile.d.mts +43 -5
  226. package/dist/mobile.d.ts +43 -5
  227. package/dist/modules-VHD7BELU.mjs +13 -0
  228. package/dist/modules-WT5D3AWY.cjs +13 -0
  229. package/dist/native-specs-BD7HOTMJ.mjs +15 -0
  230. package/dist/native-specs-IQQRJOOW.cjs +15 -0
  231. package/dist/native-tree-6G5O53O3.cjs +27 -0
  232. package/dist/native-tree-VWNW2MQ2.mjs +27 -0
  233. package/dist/native.cjs +87 -0
  234. package/dist/native.d.mts +72 -0
  235. package/dist/native.d.ts +72 -0
  236. package/dist/native.mjs +87 -0
  237. package/dist/{navigation-delegate.d-HnDXhlyP.d.mts → navigation-delegate.d-CnOTWOyi.d.mts} +1 -1
  238. package/dist/{navigation-delegate.d-BY1e_Xrh.d.ts → navigation-delegate.d-JXx40JzR.d.ts} +1 -1
  239. package/dist/navigation.cjs +5 -5
  240. package/dist/navigation.d.mts +5 -5
  241. package/dist/navigation.d.ts +5 -5
  242. package/dist/navigation.mjs +4 -4
  243. package/dist/{nitro-R444AF3O.mjs → nitro-FLN6DRGJ.mjs} +7 -7
  244. package/dist/{nitro-CK7M4RMY.cjs → nitro-HXAZZQKY.cjs} +12 -12
  245. package/dist/plugin.cjs +43 -42
  246. package/dist/plugin.d.mts +5 -4
  247. package/dist/plugin.d.ts +5 -4
  248. package/dist/plugin.mjs +42 -41
  249. package/dist/port-C6GBH4C6.cjs +419 -0
  250. package/dist/port-WOOQ3V56.mjs +419 -0
  251. package/dist/{production-runtime.d-BpJUDzP8.d.mts → production-runtime.d-CP5s6RuY.d.mts} +1 -1
  252. package/dist/{production-runtime.d-lMjvE9cf.d.ts → production-runtime.d-N-cE3pmy.d.ts} +1 -1
  253. package/dist/{programmatic-routes-client.d-BlFp5hv4.d.ts → programmatic-routes-client.d-CLG2N1yH.d.ts} +2 -2
  254. package/dist/{programmatic-routes-client.d-6CGQ3TCk.d.mts → programmatic-routes-client.d-CPbNqtIi.d.mts} +2 -2
  255. package/dist/query/client.cjs +6 -6
  256. package/dist/query/client.mjs +2 -2
  257. package/dist/{render-plan.d-DhP0mTHF.d.ts → render-plan.d-B9lAP3uX.d.ts} +1 -1
  258. package/dist/{render-plan.d-BH9edqKs.d.mts → render-plan.d-DZ-qjjdG.d.mts} +1 -1
  259. package/dist/renderer/react/server.cjs +2 -2
  260. package/dist/renderer/react/server.mjs +3 -3
  261. package/dist/renderer-client.cjs +6 -6
  262. package/dist/renderer-client.d.mts +5 -5
  263. package/dist/renderer-client.d.ts +5 -5
  264. package/dist/renderer-client.mjs +2 -2
  265. package/dist/{request.d-BVZrsR1v.d.ts → request.d-BiicaNxb.d.ts} +1 -1
  266. package/dist/{request.d-DJFRdKi8.d.mts → request.d-DV0oeUit.d.mts} +1 -1
  267. package/dist/request.d.mts +3 -3
  268. package/dist/request.d.ts +3 -3
  269. package/dist/{route-rendering.d-Bpmw7PED.d.mts → route-rendering.d-BrIKA51A.d.mts} +1 -1
  270. package/dist/{route-rendering.d-B00JtK_-.d.ts → route-rendering.d-Iss0C7GR.d.ts} +1 -1
  271. package/dist/{router.d-Bd1x9XxQ.d.ts → router.d-DjGn_al7.d.ts} +1 -1
  272. package/dist/{router.d-e0jQ3jQ-.d.mts → router.d-mNTbOGV_.d.mts} +1 -1
  273. package/dist/{routes.d-D96Dq9lz.d.ts → routes.d-BKSjHuH9.d.ts} +27 -4
  274. package/dist/{routes.d-Cmv8TgVq.d.mts → routes.d-qd8Qf4LG.d.mts} +27 -4
  275. package/dist/routes.d.mts +2 -2
  276. package/dist/routes.d.ts +2 -2
  277. package/dist/{rsc-pipeline-DX4OC5FN.cjs → rsc-pipeline-SVLBTY7H.cjs} +21 -21
  278. package/dist/{rsc-pipeline-ZQ4CTVEG.mjs → rsc-pipeline-WBLBDQXA.mjs} +20 -20
  279. package/dist/{runtime-NQ3EDSA7.cjs → runtime-DGUOWSMF.cjs} +307 -48
  280. package/dist/{runtime-NPDRDV6R.mjs → runtime-HFZTVNFF.mjs} +298 -39
  281. package/dist/{runtime.d-CgB3IJDq.d.mts → runtime.d-BNVbojF1.d.mts} +1 -1
  282. package/dist/{runtime.d-D-td-RR3.d.ts → runtime.d-Bm_4hP5T.d.ts} +1 -1
  283. package/dist/{schema-dev-notice-F6QYSOAI.mjs → schema-dev-notice-JMXEQWIQ.mjs} +3 -3
  284. package/dist/{schema-dev-notice-UU7DMZEU.cjs → schema-dev-notice-PLBFDTOF.cjs} +6 -6
  285. package/dist/server-fn-client.d.mts +1 -1
  286. package/dist/server-fn-client.d.ts +1 -1
  287. package/dist/server-plugins.cjs +1 -1
  288. package/dist/server-plugins.d.mts +3 -3
  289. package/dist/server-plugins.d.ts +3 -3
  290. package/dist/server-plugins.mjs +1 -1
  291. package/dist/server.cjs +82 -81
  292. package/dist/server.d.mts +12 -11
  293. package/dist/server.d.ts +12 -11
  294. package/dist/server.mjs +65 -64
  295. package/dist/session-2Q72D4QV.cjs +23 -0
  296. package/dist/{session-IGEDQ5PY.mjs → session-QZXZOPR2.mjs} +2 -2
  297. package/dist/shell-render.d-CG6bPiiA.d.mts +41 -0
  298. package/dist/shell-render.d-CG6bPiiA.d.ts +41 -0
  299. package/dist/{spa-router.d-CO01mVOM.d.ts → spa-router.d-DAtnNoBe.d.ts} +11 -2
  300. package/dist/{spa-router.d-BWDhS0FK.d.mts → spa-router.d-DHDoXxDE.d.mts} +11 -2
  301. package/dist/testing.cjs +7 -7
  302. package/dist/testing.d.mts +2 -2
  303. package/dist/testing.d.ts +2 -2
  304. package/dist/testing.mjs +6 -6
  305. package/dist/{utils.d-B77__yh8.d.ts → utils.d-DwZ-KLSB.d.ts} +7 -1
  306. package/dist/{utils.d-DRDazhCA.d.mts → utils.d-uKZcKJk4.d.mts} +7 -1
  307. package/dist/version.cjs +2 -2
  308. package/dist/version.mjs +1 -1
  309. package/dist/vite.cjs +43 -42
  310. package/dist/vite.d.mts +17 -6
  311. package/dist/vite.d.ts +17 -6
  312. package/dist/vite.mjs +42 -41
  313. package/dist/workflows.cjs +3 -3
  314. package/dist/workflows.mjs +2 -2
  315. package/package.json +17 -3
  316. package/dist/agent-mcp-handler-RT3COCEL.cjs +0 -18
  317. package/dist/session-AAU7RNRO.cjs +0 -23
  318. package/dist/{chunk-7FVVQEVL.cjs → chunk-4BS3HSY7.cjs} +2 -2
  319. package/dist/{chunk-N7JQXQAV.cjs → chunk-5OJVKXFV.cjs} +2 -2
  320. package/dist/{chunk-WSDKXV4E.mjs → chunk-72KABRWN.mjs} +4 -4
  321. package/dist/{chunk-C3BOESDW.mjs → chunk-B4CWYGCG.mjs} +3 -3
@@ -0,0 +1,533 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkD2X5MUF5cjs = require('./chunk-D2X5MUF5.cjs');
8
+
9
+
10
+ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
11
+
12
+
13
+ var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
14
+
15
+ // src/mobile/native-tree.ts
16
+ var VIEW_TAGS = new Set(
17
+ "div section main article header footer nav aside figure ul ol li hr".split(" ")
18
+ );
19
+ var BLOCK_TEXT_TAGS = new Set("p h1 h2 h3 h4 h5 h6".split(" "));
20
+ var INLINE_TAGS = new Set("span strong em b i small label code br a".split(" "));
21
+ var VOID_TAGS = new Set(
22
+ "area base br col embed hr img input link meta source track wbr".split(" ")
23
+ );
24
+ var SKIPPED_TAGS = new Set("link meta template title".split(" "));
25
+ var INLINE_DEFAULTS = {
26
+ strong: { fontWeight: 700 },
27
+ b: { fontWeight: 700 },
28
+ em: { fontStyle: "italic" },
29
+ i: { fontStyle: "italic" },
30
+ code: { fontFamily: "mono" }
31
+ };
32
+ var ENTITIES = {
33
+ amp: "&",
34
+ lt: "<",
35
+ gt: ">",
36
+ quot: '"',
37
+ apos: "'",
38
+ nbsp: "\xA0"
39
+ };
40
+ function decode(text) {
41
+ return text.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi, (entity, name) => {
42
+ if (name[0] === "#") {
43
+ const code = name[1] === "x" || name[1] === "X" ? parseInt(name.slice(2), 16) : Number(name.slice(1));
44
+ return Number.isFinite(code) ? String.fromCodePoint(code) : entity;
45
+ }
46
+ return _nullishCoalesce(ENTITIES[name.toLowerCase()], () => ( entity));
47
+ });
48
+ }
49
+ function parseHtml(html) {
50
+ const root = { tag: "#root", attributes: {}, children: [] };
51
+ const stack = [root];
52
+ const tag = /<(\/?)([a-zA-Z][\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g;
53
+ let cursor = 0;
54
+ let match;
55
+ while (match = tag.exec(html)) {
56
+ if (match.index > cursor) stack.at(-1).children.push(decode(html.slice(cursor, match.index)));
57
+ cursor = tag.lastIndex;
58
+ const name = match[2].toLowerCase();
59
+ if (match[1]) {
60
+ let open = stack.length - 1;
61
+ while (open > 0 && stack[open].tag !== name) open -= 1;
62
+ if (open > 0) stack.length = open;
63
+ continue;
64
+ }
65
+ const attributes = {};
66
+ for (const attribute of match[3].matchAll(
67
+ /([^\s=/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g
68
+ )) {
69
+ attributes[attribute[1].toLowerCase()] = decode(
70
+ _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(attribute[2], () => ( attribute[3])), () => ( attribute[4])), () => ( ""))
71
+ );
72
+ }
73
+ const parent = stack.at(-1);
74
+ let previous;
75
+ for (let index = parent.children.length - 1; index >= 0 && !previous; index -= 1) {
76
+ const child = parent.children[index];
77
+ if (typeof child !== "string") previous = child;
78
+ }
79
+ const element = { tag: name, attributes, children: [], parent, previous };
80
+ parent.children.push(element);
81
+ if (!match[4] && !VOID_TAGS.has(name)) stack.push(element);
82
+ }
83
+ if (cursor < html.length) stack.at(-1).children.push(decode(html.slice(cursor)));
84
+ const markLast = (element) => {
85
+ const elements = element.children.filter(
86
+ (child) => typeof child !== "string"
87
+ );
88
+ const last = elements[elements.length - 1];
89
+ if (last) last.last = true;
90
+ elements.forEach(markLast);
91
+ };
92
+ markLast(root);
93
+ return root;
94
+ }
95
+ function find(element, test) {
96
+ if (test(element)) return element;
97
+ for (const child of element.children) {
98
+ if (typeof child === "string") continue;
99
+ const found = find(child, test);
100
+ if (found) return found;
101
+ }
102
+ return void 0;
103
+ }
104
+ function textOnly(style) {
105
+ return Object.fromEntries(
106
+ Object.entries(style).filter(([key]) => _chunkD2X5MUF5cjs.FARM_NATIVE_TEXT_KEYS.has(key))
107
+ );
108
+ }
109
+ function withoutText(style) {
110
+ const rest = Object.entries(style).filter(([key]) => !_chunkD2X5MUF5cjs.FARM_NATIVE_TEXT_KEYS.has(key));
111
+ return rest.length > 0 ? Object.fromEntries(rest) : void 0;
112
+ }
113
+ function settleLineHeight(style) {
114
+ const { lineHeightScale, lineHeightPx, ...rest } = style;
115
+ if (lineHeightPx !== void 0) rest.lineHeight = lineHeightPx;
116
+ else if (typeof lineHeightScale === "number") {
117
+ rest.lineHeight = Math.round(lineHeightScale * Number(_nullishCoalesce(rest.fontSize, () => ( 16))) * 100) / 100;
118
+ }
119
+ return rest;
120
+ }
121
+ var Converter = class {
122
+ /**
123
+ * `sheets`: the page's stylesheets. Without them, a class the Tailwind table does not know is
124
+ * reported; with them, only one a layered (Tailwind) rule styles is, since a class no rule
125
+ * styles has no effect in a browser either.
126
+ */
127
+ constructor(pageUrl, sheets) {
128
+ this.pageUrl = pageUrl;
129
+ this.sheets = sheets;
130
+ this.unsupported = [];
131
+ /** Off while reading the ancestors above the page, which pass down text styles only. */
132
+ this.reporting = true;
133
+ }
134
+ problem(message) {
135
+ if (this.reporting && !this.unsupported.includes(message)) this.unsupported.push(message);
136
+ }
137
+ stylesOf(element) {
138
+ const classes = _chunkD2X5MUF5cjs.resolveFarmNativeClasses.call(void 0, _nullishCoalesce(element.attributes.class, () => ( "")));
139
+ const cascade = this.sheets ? _chunkD2X5MUF5cjs.cascadeFarmNativeStylesheets.call(void 0, this.sheets, element) : void 0;
140
+ for (const token of classes.unsupported) {
141
+ if (!cascade || cascade.layered.includes(token.split(":").pop())) {
142
+ this.problem(`<${element.tag}> class "${token}"`);
143
+ }
144
+ }
145
+ for (const problem of _nullishCoalesce(_optionalChain([cascade, 'optionalAccess', _ => _.unsupported]), () => ( []))) {
146
+ this.problem(`<${element.tag}> ${problem}`);
147
+ }
148
+ const inline = _chunkD2X5MUF5cjs.resolveFarmNativeInlineStyle.call(void 0, _nullishCoalesce(element.attributes.style, () => ( "")));
149
+ for (const declaration of inline.unsupported) {
150
+ this.problem(`<${element.tag}> style "${declaration}"`);
151
+ }
152
+ const style = {
153
+ ...INLINE_DEFAULTS[element.tag],
154
+ ...classes.style,
155
+ ..._optionalChain([cascade, 'optionalAccess', _2 => _2.style]),
156
+ ...inline.style
157
+ };
158
+ const dark = { ...classes.dark, ..._optionalChain([cascade, 'optionalAccess', _3 => _3.dark]) };
159
+ for (const target of [style, dark]) {
160
+ if (target.display === "flex" && target.flexDirection === void 0 && !style.flexDirection) {
161
+ target.flexDirection = "row";
162
+ }
163
+ }
164
+ return { style, dark };
165
+ }
166
+ url(value) {
167
+ if (!value) return void 0;
168
+ try {
169
+ return new URL(value, this.pageUrl).href;
170
+ } catch (e) {
171
+ this.problem(`URL "${value}"`);
172
+ return void 0;
173
+ }
174
+ }
175
+ node(type, element, style, dark) {
176
+ const changed = dark && Object.fromEntries(Object.entries(dark).filter(([key, value]) => _optionalChain([style, 'optionalAccess', _4 => _4[key]]) !== value));
177
+ return {
178
+ type,
179
+ tag: element.tag,
180
+ ...style && Object.keys(style).length > 0 ? { style } : {},
181
+ ...changed && Object.keys(changed).length > 0 ? { dark: changed } : {}
182
+ };
183
+ }
184
+ /** Inline content: runs of text, nested inline elements, and line breaks. */
185
+ inline(content, inherited) {
186
+ const runs = [];
187
+ for (const child of content) {
188
+ if (typeof child === "string") {
189
+ runs.push(child);
190
+ continue;
191
+ }
192
+ if (SKIPPED_TAGS.has(child.tag)) continue;
193
+ if (child.tag === "br") {
194
+ runs.push("\n");
195
+ continue;
196
+ }
197
+ if (!INLINE_TAGS.has(child.tag)) {
198
+ this.problem(`<${child.tag}> inside text`);
199
+ continue;
200
+ }
201
+ const own = this.stylesOf(child);
202
+ if (own.style.display === "none") continue;
203
+ const run = this.node(
204
+ "Text",
205
+ child,
206
+ settleLineHeight(textOnly(own.style)),
207
+ textOnly(own.dark)
208
+ );
209
+ if (withoutText(own.style)) this.problem(`<${child.tag}> inside text has box styles`);
210
+ if (child.tag === "a") run.href = this.url(child.attributes.href);
211
+ const children = this.inline(child.children, inherited);
212
+ if (children.length > 0) run.children = children;
213
+ runs.push(run);
214
+ }
215
+ return runs;
216
+ }
217
+ /** A text block: its runs, with the text style its ancestors pass down. */
218
+ text(element, content, inherited, box) {
219
+ const runs = this.inline(content, inherited);
220
+ const trimmed = collapse(runs);
221
+ if (trimmed.length === 0) return void 0;
222
+ const style = settleLineHeight({ ...inherited.style, ..._optionalChain([box, 'optionalAccess', _5 => _5.style]) });
223
+ const dark = {
224
+ ...inherited.dark,
225
+ ...box ? textOnly(box.style) : {},
226
+ ..._optionalChain([box, 'optionalAccess', _6 => _6.dark])
227
+ };
228
+ const node = this.node("Text", element, style, dark);
229
+ node.children = trimmed;
230
+ return node;
231
+ }
232
+ /** A link drawn as a box: it holds blocks, or has a box style such as a background. */
233
+ isBlockLink(element) {
234
+ if (element.tag !== "a") return false;
235
+ if (element.children.some((child) => typeof child !== "string" && !INLINE_TAGS.has(child.tag))) {
236
+ return true;
237
+ }
238
+ const reporting = this.reporting;
239
+ this.reporting = false;
240
+ const { style } = this.stylesOf(element);
241
+ this.reporting = reporting;
242
+ return withoutText(style) !== void 0;
243
+ }
244
+ /**
245
+ * Block content: each element a view, and each run of inline content a text block. In a flex
246
+ * container every child is its own item, as CSS blockifies them: a `<span>` pill there is a box.
247
+ */
248
+ blocks(content, inherited, flex = false) {
249
+ if (flex) {
250
+ const items = [];
251
+ for (const child of content) {
252
+ const item = typeof child === "string" ? this.text({ tag: "#text", attributes: {}, children: [] }, [child], inherited) : this.element(child, inherited, true);
253
+ if (item) items.push(item);
254
+ }
255
+ return items;
256
+ }
257
+ const nodes = [];
258
+ let pending = [];
259
+ const flush = () => {
260
+ const block = this.text({ tag: "#text", attributes: {}, children: [] }, pending, inherited);
261
+ if (block) nodes.push(block);
262
+ pending = [];
263
+ };
264
+ for (const child of content) {
265
+ if (typeof child === "string" || INLINE_TAGS.has(child.tag) && !this.isBlockLink(child)) {
266
+ pending.push(child);
267
+ continue;
268
+ }
269
+ flush();
270
+ const node = this.element(child, inherited);
271
+ if (node) nodes.push(node);
272
+ }
273
+ flush();
274
+ return nodes;
275
+ }
276
+ element(element, inherited, flexItem = false) {
277
+ if (SKIPPED_TAGS.has(element.tag)) return void 0;
278
+ const own = this.stylesOf(element);
279
+ if (own.style.display === "none") return void 0;
280
+ const passed = {
281
+ style: { ...inherited.style, ...textOnly(own.style) },
282
+ // An element's own text style holds in both themes unless it sets a dark one: it overrides
283
+ // what the dark theme passes down, as CSS does.
284
+ dark: { ...inherited.dark, ...textOnly(own.style), ...textOnly(own.dark) }
285
+ };
286
+ const current = (style, color) => style && Object.fromEntries(
287
+ Object.entries(style).map(([key, value]) => [
288
+ key,
289
+ value === "currentColor" && typeof color === "string" ? color : value
290
+ ])
291
+ );
292
+ const box = current(withoutText(own.style), passed.style.color);
293
+ const boxDark = current(withoutText(own.dark), _nullishCoalesce(passed.dark.color, () => ( passed.style.color)));
294
+ const flex = own.style.display === "flex";
295
+ const textBox = flexItem && INLINE_TAGS.has(element.tag) && element.tag !== "a" && element.tag !== "br";
296
+ if (BLOCK_TEXT_TAGS.has(element.tag) || textBox) {
297
+ if (element.children.some((child) => typeof child !== "string" && !INLINE_TAGS.has(child.tag))) {
298
+ this.problem(`<${element.tag}> holds block elements`);
299
+ }
300
+ const node = this.text(element, element.children, inherited, own);
301
+ return _nullishCoalesce(node, () => ( this.node("View", element, box, boxDark)));
302
+ }
303
+ if (element.tag === "img") {
304
+ const node = this.node("Image", element, box, boxDark);
305
+ node.src = this.url(element.attributes.src);
306
+ if (element.attributes.alt) node.alt = element.attributes.alt;
307
+ if (!node.src) this.problem("<img> without src");
308
+ return node;
309
+ }
310
+ if (element.tag === "input" || element.tag === "textarea") {
311
+ const node = this.node(
312
+ "TextInput",
313
+ element,
314
+ settleLineHeight({ ...passed.style, ...box }),
315
+ boxDark
316
+ );
317
+ if (element.attributes.placeholder) node.placeholder = element.attributes.placeholder;
318
+ const value = element.tag === "textarea" ? textContent(element) : element.attributes.value;
319
+ if (value) node.value = value;
320
+ return node;
321
+ }
322
+ if (element.tag === "a" || element.tag === "button") {
323
+ const node = this.node("Pressable", element, box, boxDark);
324
+ if (element.tag === "a") node.href = this.url(element.attributes.href);
325
+ node.children = this.blocks(element.children, passed, flex);
326
+ return node;
327
+ }
328
+ if (element.tag === "hr") {
329
+ return this.node(
330
+ "View",
331
+ element,
332
+ {
333
+ borderTopWidth: 1,
334
+ borderTopColor: String(_nullishCoalesce(passed.style.color, () => ( "currentColor"))),
335
+ ...box
336
+ },
337
+ boxDark
338
+ );
339
+ }
340
+ if (VIEW_TAGS.has(element.tag)) {
341
+ const node = this.node("View", element, box, boxDark);
342
+ const children = this.blocks(element.children, passed, flex);
343
+ if (children.length > 0) node.children = children;
344
+ return node;
345
+ }
346
+ if (INLINE_TAGS.has(element.tag)) {
347
+ return this.text(element, [element], inherited);
348
+ }
349
+ this.problem(`<${element.tag}>`);
350
+ return void 0;
351
+ }
352
+ };
353
+ function textContent(element) {
354
+ return element.children.map((child) => typeof child === "string" ? child : textContent(child)).join("");
355
+ }
356
+ function collapse(runs) {
357
+ let previousSpace = true;
358
+ const walk = (items) => {
359
+ const out2 = [];
360
+ for (const item of items) {
361
+ if (typeof item === "string") {
362
+ if (item === "\n") {
363
+ out2.push(item);
364
+ previousSpace = true;
365
+ continue;
366
+ }
367
+ let text = item.replace(/[ \t\r\n\f]+/g, " ");
368
+ if (previousSpace) text = text.replace(/^ /, "");
369
+ if (text) {
370
+ previousSpace = text.endsWith(" ");
371
+ out2.push(text);
372
+ }
373
+ continue;
374
+ }
375
+ const children = item.children ? walk(item.children) : [];
376
+ if (children.length > 0 || item.href) out2.push({ ...item, children });
377
+ }
378
+ return out2;
379
+ };
380
+ const out = walk(runs);
381
+ for (let index = out.length - 1; index >= 0; index -= 1) {
382
+ const item = out[index];
383
+ if (typeof item !== "string") break;
384
+ const trimmed = item.replace(/ $/, "");
385
+ if (trimmed) {
386
+ out[index] = trimmed;
387
+ break;
388
+ }
389
+ out.splice(index, 1);
390
+ }
391
+ return out;
392
+ }
393
+ function firstHeading(node) {
394
+ if (node.tag === "h1") {
395
+ const text = (_nullishCoalesce(node.children, () => ( []))).map(function flatten(child) {
396
+ return typeof child === "string" ? child : (_nullishCoalesce(child.children, () => ( []))).map(flatten).join("");
397
+ }).join("").trim();
398
+ return text || void 0;
399
+ }
400
+ for (const child of _nullishCoalesce(node.children, () => ( []))) {
401
+ if (typeof child === "string") continue;
402
+ const found = firstHeading(child);
403
+ if (found) return found;
404
+ }
405
+ return void 0;
406
+ }
407
+ var parsedSheets = /* @__PURE__ */ new Map();
408
+ function parsedStylesheet(css) {
409
+ let sheet = parsedSheets.get(css);
410
+ if (!sheet) {
411
+ sheet = _chunkD2X5MUF5cjs.parseFarmNativeStylesheet.call(void 0, css);
412
+ if (parsedSheets.size >= 16) parsedSheets.delete(parsedSheets.keys().next().value);
413
+ parsedSheets.set(css, sheet);
414
+ }
415
+ return sheet;
416
+ }
417
+ function createFarmNativeTree(html, pageUrl, stylesheets) {
418
+ const title = _optionalChain([/<title\b[^>]*>([\s\S]*?)<\/title>/i, 'access', _7 => _7.exec, 'call', _8 => _8(html), 'optionalAccess', _9 => _9[1]]);
419
+ const document = parseHtml(_chunkLT4VAF5Zcjs._readFarmRenderedHtml.call(void 0, html));
420
+ const page = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(find(document, (element) => element.attributes.id === "__farm_page__"), () => ( find(document, (element) => element.attributes.id === "root"))), () => ( find(document, (element) => element.tag === "body"))), () => ( document));
421
+ const converter = new Converter(pageUrl, _optionalChain([stylesheets, 'optionalAccess', _10 => _10.map, 'call', _11 => _11(parsedStylesheet)]));
422
+ const ancestors = [];
423
+ for (let element = page.parent; element; element = element.parent) ancestors.unshift(element);
424
+ const inherited = { style: {}, dark: {} };
425
+ let background = {};
426
+ converter.reporting = false;
427
+ for (const element of [...ancestors, page]) {
428
+ if (element.tag === "#root") continue;
429
+ const own = converter.stylesOf(element);
430
+ Object.assign(inherited.style, textOnly(own.style));
431
+ Object.assign(inherited.dark, textOnly(own.dark));
432
+ if (own.style.backgroundColor) background = { backgroundColor: own.style.backgroundColor };
433
+ if (own.dark.backgroundColor)
434
+ background = { ...background, darkBackground: own.dark.backgroundColor };
435
+ }
436
+ converter.reporting = true;
437
+ const { darkBackground, ...light } = background;
438
+ const root = {
439
+ type: "View",
440
+ tag: page.tag,
441
+ ...Object.keys(light).length > 0 ? { style: light } : {},
442
+ ...darkBackground ? { dark: { backgroundColor: darkBackground } } : {}
443
+ };
444
+ const children = converter.blocks(page.children, inherited);
445
+ if (children.length > 0) root.children = children;
446
+ return {
447
+ version: 1,
448
+ ..._optionalChain([title, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13()]) ? { title: decode(title.trim()) } : firstHeading(root) ? { title: firstHeading(root) } : {},
449
+ root,
450
+ unsupported: converter.unsupported
451
+ };
452
+ }
453
+ function readFarmPageStylesheets(html, pageUrl) {
454
+ const out = [];
455
+ const head = _nullishCoalesce(_optionalChain([/<head\b[^>]*>([\s\S]*?)<\/head>/i, 'access', _14 => _14.exec, 'call', _15 => _15(html), 'optionalAccess', _16 => _16[1]]), () => ( html));
456
+ for (const match of head.matchAll(/<link\b([^>]*)>|<style\b[^>]*>([\s\S]*?)<\/style>/gi)) {
457
+ if (match[2] !== void 0) {
458
+ out.push({ inline: match[2] });
459
+ continue;
460
+ }
461
+ const attributes = match[1];
462
+ if (!/\brel\s*=\s*["']?stylesheet\b/i.test(attributes)) continue;
463
+ const href = _optionalChain([/\bhref\s*=\s*["']([^"']+)["']/i, 'access', _17 => _17.exec, 'call', _18 => _18(attributes), 'optionalAccess', _19 => _19[1]]);
464
+ if (!href) continue;
465
+ const resolved = new URL(decode(href), pageUrl);
466
+ if (resolved.origin === pageUrl.origin) out.push({ href: resolved.pathname + resolved.search });
467
+ }
468
+ return out;
469
+ }
470
+ function farmRequestWantsNativeTree(request) {
471
+ return (_nullishCoalesce(request.headers.get("accept"), () => ( ""))).includes(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE);
472
+ }
473
+ async function createFarmNativeTreeResponse(options) {
474
+ const headers = new Headers(options.request.headers);
475
+ headers.set("accept", "text/html");
476
+ headers.delete("accept-encoding");
477
+ const page = await options.renderPage(
478
+ new Request(options.request.url, {
479
+ method: "GET",
480
+ headers,
481
+ signal: options.request.signal
482
+ })
483
+ );
484
+ const type = _nullishCoalesce(page.headers.get("content-type"), () => ( ""));
485
+ if (page.status !== 200 || !type.includes("text/html")) return page;
486
+ const html = await page.text();
487
+ const pageUrl = new URL(options.request.url);
488
+ const load = _nullishCoalesce(options.loadStylesheet, () => ( (async (href) => {
489
+ const response = await options.renderPage(
490
+ new Request(new URL(href, pageUrl), {
491
+ headers: { accept: "text/css,*/*;q=0.1", cookie: _nullishCoalesce(headers.get("cookie"), () => ( "")) },
492
+ signal: options.request.signal
493
+ })
494
+ );
495
+ return response.status === 200 && _optionalChain([response, 'access', _20 => _20.headers, 'access', _21 => _21.get, 'call', _22 => _22("content-type"), 'optionalAccess', _23 => _23.includes, 'call', _24 => _24("text/css")]) ? response.text() : void 0;
496
+ })));
497
+ const stylesheets = [];
498
+ for (const source of readFarmPageStylesheets(html, pageUrl)) {
499
+ const css = await _asyncNullishCoalesce(source.inline, async () => ( await load(source.href)));
500
+ if (css === void 0) {
501
+ const tree2 = {
502
+ version: 1,
503
+ root: { type: "View", tag: "#root" },
504
+ unsupported: [`stylesheet "${source.href}" could not be read`]
505
+ };
506
+ return new Response(JSON.stringify(tree2), {
507
+ headers: {
508
+ "Content-Type": `${_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE}; charset=utf-8`,
509
+ Vary: "Accept"
510
+ }
511
+ });
512
+ }
513
+ stylesheets.push(css);
514
+ }
515
+ const tree = createFarmNativeTree(html, pageUrl, stylesheets);
516
+ const out = new Headers({
517
+ "Content-Type": `${_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE}; charset=utf-8`,
518
+ Vary: "Accept",
519
+ "Cache-Control": _nullishCoalesce(page.headers.get("cache-control"), () => ( "no-store"))
520
+ });
521
+ for (const cookie of _nullishCoalesce(_optionalChain([page, 'access', _25 => _25.headers, 'access', _26 => _26.getSetCookie, 'optionalCall', _27 => _27()]), () => ( []))) out.append("Set-Cookie", cookie);
522
+ return new Response(options.request.method === "HEAD" ? null : JSON.stringify(tree), {
523
+ status: 200,
524
+ headers: out
525
+ });
526
+ }
527
+
528
+
529
+
530
+
531
+
532
+
533
+ exports.createFarmNativeTree = createFarmNativeTree; exports.readFarmPageStylesheets = readFarmPageStylesheets; exports.farmRequestWantsNativeTree = farmRequestWantsNativeTree; exports.createFarmNativeTreeResponse = createFarmNativeTreeResponse;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
3
+ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
4
4
 
5
5
  // src/server/dev-loopback.ts
6
6
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
@@ -30,7 +30,7 @@ async function listenOnOtherLoopback(server) {
30
30
  const listening = await new Promise((resolve) => {
31
31
  const onError = (error) => {
32
32
  if (error.code === "EADDRINUSE") {
33
- _chunkVQJYGZNXcjs.logger.warn(
33
+ _chunkQMNWKQL4cjs.logger.warn(
34
34
  `Another process is listening on ${formatHost(other)}:${address.port}; the dev server answers on ${formatHost(address.address)}:${address.port} only.`
35
35
  );
36
36
  }
@@ -43,7 +43,7 @@ async function listenOnOtherLoopback(server) {
43
43
  });
44
44
  });
45
45
  if (!listening) return;
46
- loopback.on("error", (error) => _chunkVQJYGZNXcjs.logger.warn(`Dev loopback listener failed: ${String(error)}`));
46
+ loopback.on("error", (error) => _chunkQMNWKQL4cjs.logger.warn(`Dev loopback listener failed: ${String(error)}`));
47
47
  httpServer.once("close", () => loopback.close());
48
48
  }
49
49
  function formatHost(address) {
@@ -7,7 +7,7 @@ var _chunk2KMIJDY6cjs = require('./chunk-2KMIJDY6.cjs');
7
7
  var _chunkSHIWRBFIcjs = require('./chunk-SHIWRBFI.cjs');
8
8
 
9
9
 
10
- var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
10
+ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
11
11
 
12
12
  // src/cron.ts
13
13
  var DEFAULT_FARM_CRON_SECRET_ENV = "CRON_SECRET";
@@ -67,7 +67,7 @@ async function prepareFarmCronForNitro(config) {
67
67
  const wrapperNames = resolveCronWrapperFileNames(cron.jobs.map((job) => job.name));
68
68
  for (const job of cron.jobs) {
69
69
  const taskName = getFarmCronTaskName(job.name);
70
- const wrapperPath = _chunkVQJYGZNXcjs.toPosixPath.call(void 0, path.join(generatedDir, `${wrapperNames.get(job.name)}.mjs`));
70
+ const wrapperPath = _chunkQMNWKQL4cjs.toPosixPath.call(void 0, path.join(generatedDir, `${wrapperNames.get(job.name)}.mjs`));
71
71
  await fs.writeFile(wrapperPath, createNitroCronTaskWrapper(job, cron.secretEnv), "utf8");
72
72
  tasks[taskName] = {
73
73
  handler: wrapperPath,
@@ -164,14 +164,45 @@ function isCronRequestAuthorized(request, options = {}) {
164
164
  return _chunkSHIWRBFIcjs.farmSecretsMatch.call(void 0, bearer, secret) || _chunkSHIWRBFIcjs.farmSecretsMatch.call(void 0, headerSecret, secret);
165
165
  }
166
166
  function cronRoute(handler, options = {}) {
167
+ if (isFarmEndpoint(handler)) return guardCronEndpoint(handler, options);
168
+ const route = handler;
167
169
  return (request, ...args) => {
168
170
  if (!isCronRequestAuthorized(request, options)) {
169
- return Promise.resolve(
170
- Response.json({ error: "Unauthorized cron request." }, { status: 401 })
171
- );
171
+ return Promise.resolve(unauthorizedCronResponse());
172
172
  }
173
- return handler(request, ...args);
173
+ return route(request, ...args);
174
+ };
175
+ }
176
+ function unauthorizedCronResponse() {
177
+ return Response.json({ error: "Unauthorized cron request." }, { status: 401 });
178
+ }
179
+ function isFarmEndpoint(value) {
180
+ return typeof value === "function" && typeof value.__handler === "function";
181
+ }
182
+ var FUNCTION_OWN_KEYS = /* @__PURE__ */ new Set(["length", "name", "prototype", "arguments", "caller"]);
183
+ function guardCronEndpoint(endpoint, options) {
184
+ const allowed = (context) => {
185
+ const request = _optionalChain([context, 'optionalAccess', _4 => _4.request]);
186
+ return typeof _optionalChain([request, 'optionalAccess', _5 => _5.headers, 'optionalAccess', _6 => _6.get]) === "function" && isCronRequestAuthorized(request, options);
174
187
  };
188
+ const guarded = function(context) {
189
+ return allowed(context) ? endpoint.call(this, context) : Promise.resolve(unauthorizedCronResponse());
190
+ };
191
+ for (const key of Reflect.ownKeys(endpoint)) {
192
+ if (typeof key === "string" && FUNCTION_OWN_KEYS.has(key)) continue;
193
+ Object.defineProperty(guarded, key, Object.getOwnPropertyDescriptor(endpoint, key));
194
+ }
195
+ guarded.__handler = (context) => allowed(context) ? endpoint.__handler(context) : unauthorizedCronResponse();
196
+ const invoke = endpoint.__farmInvoke;
197
+ if (invoke) {
198
+ guarded.__farmInvoke = (context) => allowed(context) ? invoke(context) : {
199
+ result: unauthorizedCronResponse(),
200
+ context: context.context,
201
+ handlerExecuted: false,
202
+ invalidations: []
203
+ };
204
+ }
205
+ return guarded;
175
206
  }
176
207
  function normalizeCronJob(name, job) {
177
208
  if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(name)) {
@@ -192,7 +223,7 @@ function normalizeCronJob(name, job) {
192
223
  name,
193
224
  schedule,
194
225
  path,
195
- description: _optionalChain([job, 'access', _4 => _4.description, 'optionalAccess', _5 => _5.trim, 'call', _6 => _6()]) || void 0
226
+ description: _optionalChain([job, 'access', _7 => _7.description, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) || void 0
196
227
  };
197
228
  }
198
229
  function normalizeCronPath(name, value) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  _findFarmMCPEndpointTool
3
- } from "./chunk-KJMWAUKE.mjs";
3
+ } from "./chunk-C7GJDVN4.mjs";
4
4
  import {
5
5
  emitFarmEvent
6
6
  } from "./chunk-2DA7CLY7.mjs";
@@ -890,14 +890,15 @@ function extractHtmlTitle(html) {
890
890
  return match ? decodeHtml(stripTags(match[1])).trim() : void 0;
891
891
  }
892
892
  function readHtmlContentRegion(html) {
893
+ return extractHtmlBody(_readFarmRenderedHtml(html));
894
+ }
895
+ function _readFarmRenderedHtml(html) {
893
896
  const streamed = readStreamedBoundaryInstructions(html);
894
- return extractHtmlBody(
895
- removeHiddenElements(
896
- resolveStreamedBoundaries(
897
- html.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, "").replace(/<noscript\b[^>]*>[\s\S]*?<\/noscript>/gi, ""),
898
- streamed
899
- ).replace(/<!--[\s\S]*?-->/g, "")
900
- )
897
+ return removeHiddenElements(
898
+ resolveStreamedBoundaries(
899
+ html.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi, "").replace(/<noscript\b[^>]*>[\s\S]*?<\/noscript>/gi, ""),
900
+ streamed
901
+ ).replace(/<!--[\s\S]*?-->/g, "")
901
902
  );
902
903
  }
903
904
  function extractHtmlBody(html) {
@@ -1353,5 +1354,6 @@ export {
1353
1354
  getFarmMarkdownAlternatePath,
1354
1355
  isFarmMarkdownMirrorExposed,
1355
1356
  matchesFarmMarkdownRoutePattern,
1357
+ _readFarmRenderedHtml,
1356
1358
  extractFarmPageActions
1357
1359
  };