@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
@@ -1,16 +1,16 @@
1
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 _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
- var _chunkE36C43IXcjs = require('./chunk-E36C43IX.cjs');
4
+ var _chunkU4BJKNIRcjs = require('./chunk-U4BJKNIR.cjs');
5
5
 
6
6
 
7
7
  var _chunkSYW346ZNcjs = require('./chunk-SYW346ZN.cjs');
8
8
 
9
9
 
10
- var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
10
+ var _chunkQISW423Scjs = require('./chunk-QISW423S.cjs');
11
11
 
12
12
 
13
- var _chunkQISW423Scjs = require('./chunk-QISW423S.cjs');
13
+ var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
14
14
 
15
15
 
16
16
 
@@ -799,7 +799,7 @@ async function generateFarmTypeArtifacts(options) {
799
799
  componentExtensions: options.componentExtensions,
800
800
  sourceRoots
801
801
  };
802
- unifiedSections.push(await _chunkE36C43IXcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
802
+ unifiedSections.push(await _chunkU4BJKNIRcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
803
803
  result.routeTypesPath = unifiedTypesPath;
804
804
  } else if (shouldGenerateRoutes) {
805
805
  const routeOptions = {
@@ -813,11 +813,11 @@ async function generateFarmTypeArtifacts(options) {
813
813
  };
814
814
  if (options.check) {
815
815
  const routeTypesPath = resolveGeneratedPath(root, srcDir, options.routeTypesOutFile);
816
- const content = await _chunkE36C43IXcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
816
+ const content = await _chunkU4BJKNIRcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
817
817
  checkGeneratedFile(routeTypesPath, content, result.stalePaths);
818
818
  result.routeTypesPath = routeTypesPath;
819
819
  } else {
820
- result.routeTypesPath = await _chunkE36C43IXcjs.generateRouteTypes.call(void 0, routeOptions);
820
+ result.routeTypesPath = await _chunkU4BJKNIRcjs.generateRouteTypes.call(void 0, routeOptions);
821
821
  }
822
822
  }
823
823
  if (shouldGenerateApi) {
@@ -927,6 +927,12 @@ async function generateFarmTypeArtifacts(options) {
927
927
  const syncModelTypes = createSyncModelTypeDeclarations(options.plugins);
928
928
  if (syncModelTypes) unifiedSections.push(syncModelTypes);
929
929
  }
930
+ if (shouldRefreshUnifiedTypes && _fs.existsSync.call(void 0, _path.join.call(void 0, root, srcDir, "native"))) {
931
+ const [{ scanFarmMobileAppModules }, { createFarmNativeModuleTypeDeclarations }] = await Promise.all([import("./modules-WT5D3AWY.cjs"), import("./native-specs-IQQRJOOW.cjs")]);
932
+ const appModules = scanFarmMobileAppModules({ root, srcDir });
933
+ const nativeTypes = appModules && createFarmNativeModuleTypeDeclarations(appModules.specs, { root });
934
+ if (nativeTypes) unifiedSections.push(nativeTypes);
935
+ }
930
936
  if (shouldRefreshUnifiedTypes) {
931
937
  unifiedSections.push(
932
938
  createContentTypeDeclarations(
@@ -0,0 +1,251 @@
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 _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; }// src/mobile/native-specs.ts
2
+ var _fs = require('fs');
3
+ var _module = require('module');
4
+ var _path = require('path'); var path = _interopRequireWildcard(_path);
5
+ var UnsupportedType = class extends Error {
6
+ };
7
+ var parsers = /* @__PURE__ */ new Map();
8
+ function loadCodegen(root) {
9
+ const cached = parsers.get(root);
10
+ if (cached) return cached;
11
+ let codegenDir;
12
+ let load;
13
+ try {
14
+ let reactNative;
15
+ for (let dir = root; ; dir = path.dirname(dir)) {
16
+ const candidate = path.join(dir, "node_modules", "react-native", "package.json");
17
+ if (_fs.existsSync.call(void 0, candidate)) {
18
+ reactNative = _fs.realpathSync.call(void 0, candidate);
19
+ break;
20
+ }
21
+ if (path.dirname(dir) === dir) throw new Error(`react-native is not installed in ${root}.`);
22
+ }
23
+ load = _module.createRequire.call(void 0, reactNative);
24
+ codegenDir = path.dirname(load.resolve("@react-native/codegen/package.json"));
25
+ } catch (error) {
26
+ throw Object.assign(
27
+ new Error(
28
+ "Reading a native module spec needs React Native's Codegen (@react-native/codegen, installed with react-native). Add react-native to the app's dependencies and install them."
29
+ ),
30
+ { cause: error }
31
+ );
32
+ }
33
+ const typescript = load(path.join(codegenDir, "lib/parsers/typescript/parser.js"));
34
+ const flow = load(path.join(codegenDir, "lib/parsers/flow/parser.js"));
35
+ const loaded = { typescript: new typescript.TypeScriptParser(), flow: new flow.FlowParser() };
36
+ parsers.set(root, loaded);
37
+ return loaded;
38
+ }
39
+ function hasFarmNativeCodegen(root) {
40
+ try {
41
+ loadCodegen(root);
42
+ return true;
43
+ } catch (e) {
44
+ return false;
45
+ }
46
+ }
47
+ function describe(annotation) {
48
+ switch (annotation.type) {
49
+ case "FunctionTypeAnnotation":
50
+ return "a callback";
51
+ case "MixedTypeAnnotation":
52
+ return "a mixed value";
53
+ case "ReservedTypeAnnotation":
54
+ return String(_nullishCoalesce(annotation.name, () => ( "a reserved type")));
55
+ case "EventEmitterTypeAnnotation":
56
+ return "an event emitter";
57
+ default:
58
+ return annotation.type.replace(/TypeAnnotation$/, "");
59
+ }
60
+ }
61
+ function toType(annotation, module, options = {}) {
62
+ switch (annotation.type) {
63
+ case "NullableTypeAnnotation":
64
+ return {
65
+ ...toType(annotation.typeAnnotation, module, options),
66
+ nullable: true
67
+ };
68
+ case "StringTypeAnnotation":
69
+ return { type: "string" };
70
+ case "NumberTypeAnnotation":
71
+ case "DoubleTypeAnnotation":
72
+ case "FloatTypeAnnotation":
73
+ return { type: "number" };
74
+ case "Int32TypeAnnotation":
75
+ return { type: "number", integer: true };
76
+ case "BooleanTypeAnnotation":
77
+ return { type: "boolean" };
78
+ case "StringLiteralTypeAnnotation":
79
+ case "NumberLiteralTypeAnnotation":
80
+ return { type: "literal", values: [annotation.value] };
81
+ case "UnionTypeAnnotation":
82
+ case "StringLiteralUnionTypeAnnotation": {
83
+ const types = _nullishCoalesce(annotation.types, () => ( []));
84
+ const values = types.map((member) => member.value);
85
+ if (types.length > 0 && types.every(
86
+ (member) => member.type === "StringLiteralTypeAnnotation" || member.type === "NumberLiteralTypeAnnotation"
87
+ ) && (values.every((value) => typeof value === "string") || values.every((value) => typeof value === "number"))) {
88
+ return { type: "literal", values };
89
+ }
90
+ throw new UnsupportedType("a union that is not all string or all number literals");
91
+ }
92
+ case "EnumDeclaration": {
93
+ const members = _nullishCoalesce(_optionalChain([module, 'access', _ => _.enumMap, 'optionalAccess', _2 => _2[String(annotation.name)], 'optionalAccess', _3 => _3.members]), () => ( []));
94
+ const values = members.map((member) => _optionalChain([member, 'access', _4 => _4.value, 'optionalAccess', _5 => _5.value]));
95
+ if (values.length > 0 && (values.every((value) => typeof value === "string") || values.every((value) => typeof value === "number"))) {
96
+ return { type: "literal", values };
97
+ }
98
+ throw new UnsupportedType(`the enum ${String(annotation.name)}`);
99
+ }
100
+ case "ObjectTypeAnnotation": {
101
+ const properties = _nullishCoalesce(annotation.properties, () => ( []));
102
+ return {
103
+ type: "object",
104
+ properties: properties.map((property) => ({
105
+ name: property.name,
106
+ optional: property.optional === true,
107
+ type: toType(property.typeAnnotation, module, options)
108
+ }))
109
+ };
110
+ }
111
+ case "TypeAliasTypeAnnotation": {
112
+ const alias = _optionalChain([module, 'access', _6 => _6.aliasMap, 'optionalAccess', _7 => _7[String(annotation.name)]]);
113
+ if (!alias) throw new UnsupportedType(`the unknown type ${String(annotation.name)}`);
114
+ return toType(alias, module, options);
115
+ }
116
+ case "GenericObjectTypeAnnotation":
117
+ return { type: "map" };
118
+ case "ArrayTypeAnnotation": {
119
+ const element = annotation.elementType;
120
+ if (!element || element.type === "AnyTypeAnnotation") return { type: "array" };
121
+ return { type: "array", element: toType(element, module, options) };
122
+ }
123
+ case "VoidTypeAnnotation":
124
+ if (options.returns) return { type: "void" };
125
+ break;
126
+ }
127
+ if (options.returns) return { type: "unknown" };
128
+ throw new UnsupportedType(describe(annotation));
129
+ }
130
+ function readFarmNativeWebSpec(options) {
131
+ const codegen = loadCodegen(options.root);
132
+ const parser = /\.tsx?$/.test(options.file) ? codegen.typescript : codegen.flow;
133
+ let schema;
134
+ try {
135
+ schema = parser.parseFile(options.file);
136
+ } catch (error) {
137
+ const shown = path.relative(options.root, options.file).split(path.sep).join("/");
138
+ throw Object.assign(
139
+ new Error(`React Native's Codegen rejected ${shown}: ${error.message}`),
140
+ { cause: error }
141
+ );
142
+ }
143
+ const module = Object.values(schema.modules).find((entry) => entry.type === "NativeModule");
144
+ const result = { methods: [], unsupported: [] };
145
+ for (const method of _nullishCoalesce(_optionalChain([module, 'optionalAccess', _8 => _8.spec, 'optionalAccess', _9 => _9.methods]), () => ( []))) {
146
+ let fn = method.typeAnnotation;
147
+ if (fn.type === "NullableTypeAnnotation") fn = fn.typeAnnotation;
148
+ if (fn.type !== "FunctionTypeAnnotation") continue;
149
+ const returned = fn.returnTypeAnnotation;
150
+ if (_optionalChain([returned, 'optionalAccess', _10 => _10.type]) !== "PromiseTypeAnnotation") continue;
151
+ const params = _nullishCoalesce(fn.params, () => ( []));
152
+ try {
153
+ result.methods.push({
154
+ name: method.name,
155
+ params: params.map((param) => {
156
+ try {
157
+ return {
158
+ name: param.name,
159
+ optional: param.optional === true,
160
+ type: toType(param.typeAnnotation, module)
161
+ };
162
+ } catch (error) {
163
+ if (!(error instanceof UnsupportedType)) throw error;
164
+ throw new UnsupportedType(
165
+ `its parameter ${param.name} is ${error.message}, which a web screen cannot send`
166
+ );
167
+ }
168
+ }),
169
+ returns: toType(
170
+ _nullishCoalesce(returned.elementType, () => ( { type: "VoidTypeAnnotation" })),
171
+ module,
172
+ { returns: true }
173
+ )
174
+ });
175
+ } catch (error) {
176
+ if (!(error instanceof UnsupportedType)) throw error;
177
+ result.unsupported.push({ method: method.name, reason: error.message });
178
+ }
179
+ }
180
+ return result;
181
+ }
182
+ var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
183
+ function renderFarmNativeType(type) {
184
+ let rendered;
185
+ switch (type.type) {
186
+ case "string":
187
+ case "number":
188
+ case "boolean":
189
+ case "void":
190
+ case "unknown":
191
+ rendered = type.type;
192
+ break;
193
+ case "literal":
194
+ rendered = type.values.map((value) => JSON.stringify(value)).join(" | ");
195
+ break;
196
+ case "map":
197
+ rendered = "Record<string, unknown>";
198
+ break;
199
+ case "array": {
200
+ const element = type.element ? renderFarmNativeType(type.element) : "unknown";
201
+ rendered = `Array<${element}>`;
202
+ break;
203
+ }
204
+ case "object":
205
+ rendered = type.properties.length ? `{ ${type.properties.map(
206
+ (property) => `${IDENTIFIER.test(property.name) ? property.name : JSON.stringify(property.name)}${property.optional ? "?" : ""}: ${renderFarmNativeType(property.type)}`
207
+ ).join("; ")} }` : "{}";
208
+ break;
209
+ }
210
+ return type.nullable ? `${rendered} | null` : rendered;
211
+ }
212
+ function renderFarmNativeMethod(method) {
213
+ const lastRequired = method.params.reduce(
214
+ (last, param, index) => param.optional ? last : index,
215
+ -1
216
+ );
217
+ const params = method.params.map((param, index) => {
218
+ const type = renderFarmNativeType(param.type);
219
+ if (!param.optional) return `${param.name}: ${type}`;
220
+ return index > lastRequired ? `${param.name}?: ${type}` : `${param.name}: ${type} | undefined`;
221
+ }).join(", ");
222
+ return `${method.name}(${params}): Promise<${renderFarmNativeType(method.returns)}>;`;
223
+ }
224
+ function createFarmNativeModuleTypeDeclarations(specs, options) {
225
+ if (specs.length === 0 || !hasFarmNativeCodegen(options.root)) return void 0;
226
+ const modules = specs.map((spec) => {
227
+ const { methods } = readFarmNativeWebSpec({ root: options.root, file: spec.file });
228
+ const body = methods.filter((method) => method.name !== "available").map((method) => ` ${renderFarmNativeMethod(method)}`).join("\n");
229
+ return ` ${spec.name}: {${body ? `
230
+ ${body}
231
+ ` : ""}};`;
232
+ });
233
+ return `/**
234
+ * Auto-generated from the Codegen specs in src/native: native.<module> from @farm.js/core/native.
235
+ * Web screens reach a module's Promise methods only when mobile.modules.<name>.web is true, and
236
+ * only inside the Android shell; check native.<module>.available() first.
237
+ */
238
+ declare module "@farm.js/core/native" {
239
+ interface FarmNativeModules {
240
+ ${modules.join("\n")}
241
+ }
242
+ }`;
243
+ }
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+ exports.hasFarmNativeCodegen = hasFarmNativeCodegen; exports.readFarmNativeWebSpec = readFarmNativeWebSpec; exports.renderFarmNativeType = renderFarmNativeType; exports.renderFarmNativeMethod = renderFarmNativeMethod; exports.createFarmNativeModuleTypeDeclarations = createFarmNativeModuleTypeDeclarations;
@@ -0,0 +1,137 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkRAWWCDCTcjs = require('./chunk-RAWWCDCT.cjs');
4
+
5
+
6
+
7
+ var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
8
+
9
+ // src/mobile/shell-response.ts
10
+ var FARM_SHELL_HEADER = "X-Farm-Shell";
11
+ function isFarmMobileShellRequest(request) {
12
+ const value = request.headers.get(FARM_SHELL_HEADER);
13
+ return value !== null && /^[a-z][a-z0-9-]{0,31}$/.test(value);
14
+ }
15
+ function isHtml(response) {
16
+ return _optionalChain([response, 'access', _ => _.headers, 'access', _2 => _2.get, 'call', _3 => _3("content-type"), 'optionalAccess', _4 => _4.toLowerCase, 'call', _5 => _5(), 'access', _6 => _6.includes, 'call', _7 => _7("text/html")]) === true;
17
+ }
18
+ function appendVary(headers, name) {
19
+ const current = headers.get("Vary");
20
+ if (!current) {
21
+ headers.set("Vary", name);
22
+ return;
23
+ }
24
+ const names = current.split(",").map((value) => value.trim().toLowerCase());
25
+ if (names.includes("*") || names.includes(name.toLowerCase())) return;
26
+ headers.set("Vary", `${current}, ${name}`);
27
+ }
28
+ function escapeRegExp(value) {
29
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
30
+ }
31
+ var MAX_HELD_TAG = 4096;
32
+ function createFarmMobileShellRewriter(client) {
33
+ const entry = new RegExp(`(["'])${escapeRegExp(client.webEntry)}\\1`, "g");
34
+ const webOnly = new Set(client.webOnly);
35
+ const preload = /<link rel="modulepreload" href="\/([^"]+)"[^>]*>/g;
36
+ let held = "";
37
+ return (text, final = false) => {
38
+ let input = held + text;
39
+ held = "";
40
+ if (!final) {
41
+ const open = input.lastIndexOf("<");
42
+ if (open !== -1 && input.indexOf(">", open) === -1 && input.length - open <= MAX_HELD_TAG) {
43
+ held = input.slice(open);
44
+ input = input.slice(0, open);
45
+ }
46
+ }
47
+ return input.replace(entry, (_match, quote) => `${quote}${client.entry}${quote}`).replace(preload, (tag, file) => webOnly.has(file) ? "" : tag);
48
+ };
49
+ }
50
+ function _applyFarmMobileShellClient(request, response, client, onPrivate) {
51
+ if (!client || !isHtml(response)) return response;
52
+ if (!isFarmMobileShellRequest(request) || !response.body) {
53
+ return _chunkA25FXJ7Dcjs._withFarmResponseHeaders.call(void 0, response, (headers2) => appendVary(headers2, FARM_SHELL_HEADER));
54
+ }
55
+ _optionalChain([onPrivate, 'optionalCall', _8 => _8()]);
56
+ const headers = new Headers(_chunkRAWWCDCTcjs._withFarmGuardedResponseCache.call(void 0, response).headers);
57
+ appendVary(headers, FARM_SHELL_HEADER);
58
+ headers.delete("content-length");
59
+ headers.delete("etag");
60
+ const rewrite = createFarmMobileShellRewriter(client);
61
+ const decoder = new TextDecoder();
62
+ const encoder = new TextEncoder();
63
+ const body = response.body.pipeThrough(
64
+ new TransformStream({
65
+ transform(chunk, controller) {
66
+ const output = rewrite(decoder.decode(chunk, { stream: true }));
67
+ if (output) controller.enqueue(encoder.encode(output));
68
+ },
69
+ flush(controller) {
70
+ const output = rewrite(decoder.decode(), true);
71
+ if (output) controller.enqueue(encoder.encode(output));
72
+ }
73
+ })
74
+ );
75
+ return _chunkA25FXJ7Dcjs._markFarmOwnedResponse.call(void 0,
76
+ new Response(body, { status: response.status, statusText: response.statusText, headers })
77
+ );
78
+ }
79
+
80
+ // src/mobile/shell-render.ts
81
+ var FARM_SHELL_RENDER_HEADER = "X-Farm-Shell-Render";
82
+ var FARM_SHELL_ROUTE_HEADER = "X-Farm-Shell-Route";
83
+ var FARM_SHELL_PARAM_SEGMENT = "__farm_shell__";
84
+ function constantTimeEqual(left, right) {
85
+ if (left.length !== right.length) return false;
86
+ let difference = 0;
87
+ for (let index = 0; index < left.length; index += 1) {
88
+ difference |= left.charCodeAt(index) ^ right.charCodeAt(index);
89
+ }
90
+ return difference === 0;
91
+ }
92
+ function _isFarmMobileShellRenderRequest(request, token) {
93
+ const value = request.headers.get(FARM_SHELL_RENDER_HEADER);
94
+ return token.length > 0 && value !== null && constantTimeEqual(value, token);
95
+ }
96
+ function stripRouteGroups(pattern) {
97
+ const segments = pattern.split("/").filter((segment) => segment && !(segment.startsWith("(") && segment.endsWith(")")));
98
+ return segments.length === 0 ? "/" : `/${segments.join("/")}`;
99
+ }
100
+ function isDynamicPattern(pattern) {
101
+ return pattern.split("/").some((segment) => segment.startsWith("["));
102
+ }
103
+ function _checkFarmMobileShellRoute(check) {
104
+ const route = stripRouteGroups(check.route);
105
+ if (check.requested === null || stripRouteGroups(check.requested) !== route) {
106
+ return `the request matched ${route}, not ${_nullishCoalesce(check.requested, () => ( "a requested route"))}`;
107
+ }
108
+ if (check.loading === null) return "it has no loading file";
109
+ if (isDynamicPattern(check.loading)) {
110
+ return `its loading file is in a dynamic folder (${stripRouteGroups(check.loading)})`;
111
+ }
112
+ const layout = check.layouts.find(isDynamicPattern);
113
+ if (layout !== void 0) {
114
+ return `a layout is in a dynamic folder (${stripRouteGroups(layout)})`;
115
+ }
116
+ return null;
117
+ }
118
+ function createFarmMobileShellRenderPath(route) {
119
+ const segments = [];
120
+ for (const segment of route.split("/")) {
121
+ if (!segment || segment.startsWith("(") && segment.endsWith(")")) continue;
122
+ if (segment.startsWith("[[...") && segment.endsWith("]]")) continue;
123
+ segments.push(segment.startsWith("[") ? FARM_SHELL_PARAM_SEGMENT : segment);
124
+ }
125
+ return `/${segments.join("/")}`;
126
+ }
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ exports.FARM_SHELL_HEADER = FARM_SHELL_HEADER; exports._applyFarmMobileShellClient = _applyFarmMobileShellClient; exports.FARM_SHELL_RENDER_HEADER = FARM_SHELL_RENDER_HEADER; exports.FARM_SHELL_ROUTE_HEADER = FARM_SHELL_ROUTE_HEADER; exports.FARM_SHELL_PARAM_SEGMENT = FARM_SHELL_PARAM_SEGMENT; exports._isFarmMobileShellRenderRequest = _isFarmMobileShellRenderRequest; exports._checkFarmMobileShellRoute = _checkFarmMobileShellRoute; exports.createFarmMobileShellRenderPath = createFarmMobileShellRenderPath;
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkJ3LBO2O4cjs = require('./chunk-J3LBO2O4.cjs');
3
+ var _chunkDPJ66FSIcjs = require('./chunk-DPJ66FSI.cjs');
4
4
 
5
5
 
6
- var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
6
+ var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
7
7
 
8
8
 
9
9
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
@@ -75,7 +75,7 @@ function resolveFarmInfraAnalytics(env = processEnv()) {
75
75
  };
76
76
  }
77
77
  function classifyFarmInfraAgent(userAgent) {
78
- return _chunkWJFFPXCVcjs.classifyFarmAgent.call(void 0, userAgent);
78
+ return _chunkLT4VAF5Zcjs.classifyFarmAgent.call(void 0, userAgent);
79
79
  }
80
80
  function routeTemplate(pattern) {
81
81
  return typeof pattern === "string" && pattern.length <= 256 && /^\/(?!\/)[a-zA-Z0-9_./:[\]()*-]*$/.test(pattern) ? pattern : "/[unmatched]";
@@ -273,7 +273,7 @@ function requestEvent(metadata, method, status, durationMs) {
273
273
  id: uuid(),
274
274
  requestId: metadata.id,
275
275
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
276
- route: routeTemplate(_chunkJ3LBO2O4cjs.getFarmRouteLabel.call(void 0, metadata.route)),
276
+ route: routeTemplate(_chunkDPJ66FSIcjs.getFarmRouteLabel.call(void 0, metadata.route)),
277
277
  agent: metadata.agent,
278
278
  kind: "request",
279
279
  method,
@@ -286,7 +286,7 @@ function toolEvent(metadata, event) {
286
286
  id: uuid(),
287
287
  requestId: metadata.id,
288
288
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
289
- route: routeTemplate(_chunkJ3LBO2O4cjs.getFarmRouteLabel.call(void 0, metadata.route)),
289
+ route: routeTemplate(_chunkDPJ66FSIcjs.getFarmRouteLabel.call(void 0, metadata.route)),
290
290
  agent: metadata.agent,
291
291
  kind: "mcp.tool",
292
292
  tool: event.tool,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createFarmMarkdownRouteModule
3
- } from "./chunk-GW4YUIHW.mjs";
3
+ } from "./chunk-E72UD6ME.mjs";
4
4
 
5
5
  // src/app-markdown.ts
6
6
  import { readFile } from "fs/promises";
@@ -18,7 +18,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
18
18
  var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
19
19
 
20
20
 
21
- var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
21
+ var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
22
22
 
23
23
 
24
24
  var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
@@ -758,6 +758,23 @@ function titleFromMarkdown(body, fallback) {
758
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()]);
759
759
  return heading || fallback;
760
760
  }
761
+ function createLastModifiedResolver(contentDir, sourcePath, frontmatter) {
762
+ let resolved = false;
763
+ let value;
764
+ return {
765
+ get() {
766
+ if (!resolved) {
767
+ value = resolveFarmDocsPageLastModified(contentDir, sourcePath, frontmatter);
768
+ resolved = true;
769
+ }
770
+ return value;
771
+ },
772
+ set(next) {
773
+ value = next;
774
+ resolved = true;
775
+ }
776
+ };
777
+ }
761
778
  function loadFarmDocsPage(contentDir, docs, slug) {
762
779
  const sourcePath = findDocsPageFile(contentDir, slug);
763
780
  if (!sourcePath) return null;
@@ -765,6 +782,7 @@ function loadFarmDocsPage(contentDir, docs, slug) {
765
782
  const { frontmatter, body } = parseFrontmatter(source);
766
783
  const title = frontmatter.title || titleFromMarkdown(body, titleFromSlug(slug));
767
784
  const href = createDocsHref(docs.entry, slug);
785
+ const lastModified = createLastModifiedResolver(contentDir, sourcePath, frontmatter);
768
786
  return {
769
787
  slug,
770
788
  title,
@@ -772,7 +790,12 @@ function loadFarmDocsPage(contentDir, docs, slug) {
772
790
  section: frontmatter.section,
773
791
  href,
774
792
  sourcePath,
775
- lastModified: resolveFarmDocsPageLastModified(contentDir, sourcePath, frontmatter),
793
+ get lastModified() {
794
+ return lastModified.get();
795
+ },
796
+ set lastModified(value) {
797
+ lastModified.set(value);
798
+ },
776
799
  frontmatter,
777
800
  body
778
801
  };
@@ -817,6 +840,7 @@ function discoverFarmDocsPages(contentDir, docs) {
817
840
  if (slug === null) continue;
818
841
  const source = _fs.readFileSync.call(void 0, absolutePath, "utf8");
819
842
  const { frontmatter, body } = parseFrontmatter(source);
843
+ const lastModified = createLastModifiedResolver(contentDir, absolutePath, frontmatter);
820
844
  pages.push({
821
845
  slug,
822
846
  title: frontmatter.title || titleFromMarkdown(body, titleFromSlug(slug)),
@@ -824,7 +848,12 @@ function discoverFarmDocsPages(contentDir, docs) {
824
848
  section: frontmatter.section,
825
849
  href: createDocsHref(docs.entry, slug),
826
850
  sourcePath: absolutePath,
827
- lastModified: resolveFarmDocsPageLastModified(contentDir, absolutePath, frontmatter)
851
+ get lastModified() {
852
+ return lastModified.get();
853
+ },
854
+ set lastModified(value) {
855
+ lastModified.set(value);
856
+ }
828
857
  });
829
858
  }
830
859
  };
@@ -901,8 +930,9 @@ function formatLastModifiedDate(value) {
901
930
  }
902
931
  function renderLastUpdatedText(page, docs, position) {
903
932
  const config = resolveLastUpdatedDisplayConfig(docs);
933
+ if (!config.enabled || config.position !== position) return "";
904
934
  const formatted = formatLastModifiedDate(page.lastModified);
905
- if (!config.enabled || config.position !== position || !formatted) return "";
935
+ if (!formatted) return "";
906
936
  const time = `<time datetime="${escapeAttribute(page.lastModified || "")}">${escapeHtml(formatted)}</time>`;
907
937
  const label = config.label.trim();
908
938
  return label ? `${escapeHtml(label)} ${time}` : time;
@@ -1149,11 +1179,11 @@ function shouldReturnMarkdown(request) {
1149
1179
  if (url.pathname.endsWith(".md")) return true;
1150
1180
  const accept = request.headers.get("accept");
1151
1181
  const markdown = Math.max(
1152
- _chunkWJFFPXCVcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1153
- _chunkWJFFPXCVcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1182
+ _chunkLT4VAF5Zcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1183
+ _chunkLT4VAF5Zcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1154
1184
  );
1155
1185
  if (markdown <= 0) return false;
1156
- return markdown >= _chunkWJFFPXCVcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1186
+ return markdown >= _chunkLT4VAF5Zcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1157
1187
  }
1158
1188
  function escapeAttribute(value) {
1159
1189
  return escapeHtml(value).replace(/'/g, "&#39;");
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
5
+ var _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
6
6
 
7
7
 
8
8
  var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
@@ -36,10 +36,10 @@ async function handleFarmDefaultMCPRequest(request, context) {
36
36
  return transportError(403, "Cross-origin requests are not allowed.");
37
37
  }
38
38
  const protocolHeader = request.headers.get("mcp-protocol-version");
39
- if (protocolHeader && !_chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(protocolHeader.trim())) {
39
+ if (protocolHeader && !_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(protocolHeader.trim())) {
40
40
  return transportError(
41
41
  400,
42
- `Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${_chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.join(", ")}.`
42
+ `Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${_chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.join(", ")}.`
43
43
  );
44
44
  }
45
45
  const contentType = _nullishCoalesce(request.headers.get("content-type"), () => ( ""));
@@ -95,7 +95,7 @@ async function dispatch(method, params, request, context) {
95
95
  switch (method) {
96
96
  case "initialize": {
97
97
  const requested = isRecord(params) ? params.protocolVersion : void 0;
98
- const protocolVersion = typeof requested === "string" && _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS[0];
98
+ const protocolVersion = typeof requested === "string" && _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS[0];
99
99
  return {
100
100
  protocolVersion,
101
101
  capabilities: { tools: { listChanged: false } },
@@ -103,7 +103,7 @@ async function dispatch(method, params, request, context) {
103
103
  name: context.server.name,
104
104
  version: context.server.version,
105
105
  ...context.server.title ? { title: context.server.title } : {},
106
- description: _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_DESCRIPTION
106
+ description: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_DESCRIPTION
107
107
  },
108
108
  instructions: INSTRUCTIONS
109
109
  };
@@ -111,7 +111,7 @@ async function dispatch(method, params, request, context) {
111
111
  case "ping":
112
112
  return {};
113
113
  case "tools/list":
114
- return { tools: _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_TOOLS };
114
+ return { tools: _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_TOOLS };
115
115
  case "tools/call":
116
116
  return callTool(params, request, context);
117
117
  default:
@@ -122,7 +122,7 @@ async function callTool(params, request, context) {
122
122
  if (!isRecord(params) || typeof params.name !== "string") {
123
123
  throw new FarmMCPRequestError(INVALID_PARAMS, "tools/call needs a tool name.");
124
124
  }
125
- const tool = _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_TOOLS.find(({ name }) => name === params.name);
125
+ const tool = _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_TOOLS.find(({ name }) => name === params.name);
126
126
  if (!tool) {
127
127
  throw new FarmMCPRequestError(INVALID_PARAMS, `Unknown tool: ${params.name.slice(0, 64)}`);
128
128
  }