@farm.js/core 0.1.60 → 0.1.62

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 (265) hide show
  1. package/dist/{agent-mcp.d-C-2S9bnP.d.mts → agent-mcp.d-BKZ3UNbt.d.mts} +1 -1
  2. package/dist/{agent-mcp.d-SIoCUP1I.d.ts → agent-mcp.d-C1zr_nGS.d.ts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -3
  4. package/dist/agent-runtime.d.mts +2 -2
  5. package/dist/agent-runtime.d.ts +2 -2
  6. package/dist/agent-runtime.mjs +2 -2
  7. package/dist/analyzer-2AHWJJR7.cjs +15 -0
  8. package/dist/analyzer-YESYU3GK.mjs +15 -0
  9. package/dist/api/route-manager.cjs +4 -4
  10. package/dist/api/route-manager.d.mts +4 -4
  11. package/dist/api/route-manager.d.ts +4 -4
  12. package/dist/api/route-manager.mjs +3 -3
  13. package/dist/api/runtime.cjs +3 -3
  14. package/dist/api/runtime.d.mts +3 -3
  15. package/dist/api/runtime.d.ts +3 -3
  16. package/dist/api/runtime.mjs +2 -2
  17. package/dist/api.cjs +5 -5
  18. package/dist/api.d.mts +4 -4
  19. package/dist/api.d.ts +4 -4
  20. package/dist/api.mjs +4 -4
  21. package/dist/{app-manifest.d-DrSAHskY.d.mts → app-manifest.d-BpvhfKRH.d.mts} +1 -1
  22. package/dist/{app-manifest.d-Tb3CJpL4.d.ts → app-manifest.d-ntch_bvA.d.ts} +1 -1
  23. package/dist/app-markdown.d.mts +3 -3
  24. package/dist/app-markdown.d.ts +3 -3
  25. package/dist/{app.d-CmWlYpZJ.d.ts → app.d-AE8_v3Db.d.ts} +4 -10
  26. package/dist/{app.d-D6QQM_kk.d.mts → app.d-CysWA_8v.d.mts} +4 -10
  27. package/dist/{chunk-FORSVMEJ.mjs → chunk-2CNKQC3G.mjs} +1 -1
  28. package/dist/{chunk-ZFUKPWFC.mjs → chunk-2JYBLE63.mjs} +416 -208
  29. package/dist/{chunk-QRX4JRBO.cjs → chunk-3CCAICF7.cjs} +5 -5
  30. package/dist/{chunk-ANHZ6SUL.mjs → chunk-3TXKFRSO.mjs} +1 -1
  31. package/dist/{chunk-BHJAYPYU.mjs → chunk-3UZVPO72.mjs} +1 -1
  32. package/dist/{chunk-6UUH4N4J.mjs → chunk-43V3ANPQ.mjs} +1 -1
  33. package/dist/chunk-4EBC7EMW.cjs +8 -0
  34. package/dist/{chunk-VZY7MAVS.cjs → chunk-4IHMHFQB.cjs} +27 -1
  35. package/dist/{chunk-FK25QSVC.cjs → chunk-4P5634G6.cjs} +2 -2
  36. package/dist/{chunk-4JTQPOKO.cjs → chunk-53ZCZ46B.cjs} +2 -2
  37. package/dist/{chunk-NQJDO7K7.cjs → chunk-545WJ5UG.cjs} +321 -37
  38. package/dist/{chunk-VU3MYZPO.mjs → chunk-5FE5YT2N.mjs} +26 -0
  39. package/dist/{chunk-A5BJKSZE.cjs → chunk-5IQ2ERQA.cjs} +2 -2
  40. package/dist/{chunk-SJRCWF4Z.mjs → chunk-5Y22WNTO.mjs} +2 -2
  41. package/dist/{chunk-U4BJKNIR.cjs → chunk-752XUZIM.cjs} +11 -6
  42. package/dist/{chunk-JBK7UJOI.cjs → chunk-AJB3DHN6.cjs} +2 -2
  43. package/dist/{chunk-YB44NKC2.cjs → chunk-AXVRUDMB.cjs} +2 -2
  44. package/dist/{chunk-LJVNMGE3.mjs → chunk-BM2LH2JM.mjs} +8 -3
  45. package/dist/{chunk-YI6FKTTN.cjs → chunk-BT4SEFLC.cjs} +261 -38
  46. package/dist/{chunk-LIFUPCXW.cjs → chunk-CFG4QERR.cjs} +13 -2
  47. package/dist/{chunk-3OWVWZ6R.cjs → chunk-CLFEQGET.cjs} +6 -6
  48. package/dist/{chunk-OZK2DS44.mjs → chunk-CROAFCMW.mjs} +1 -1
  49. package/dist/{chunk-2KTYMMWT.mjs → chunk-DPE53XWL.mjs} +1 -1
  50. package/dist/{chunk-3PX4AIXO.mjs → chunk-DQF3QLOH.mjs} +258 -35
  51. package/dist/{chunk-FSQMN2MQ.mjs → chunk-E46NXBNJ.mjs} +1 -1
  52. package/dist/{chunk-EGVC4LIG.mjs → chunk-E4RDMG3K.mjs} +1 -1
  53. package/dist/{chunk-X2CZTWQA.mjs → chunk-ECKQFEX2.mjs} +1 -1
  54. package/dist/{chunk-MTWXOEI4.cjs → chunk-EXXFSZOC.cjs} +246 -193
  55. package/dist/{chunk-UYSTTPYJ.cjs → chunk-GGNJAGGE.cjs} +643 -435
  56. package/dist/{chunk-XTG73QZA.cjs → chunk-GVOMPU3Y.cjs} +12 -8
  57. package/dist/{chunk-ZP32GNJQ.cjs → chunk-I32V5CZL.cjs} +14 -13
  58. package/dist/{chunk-37PYUEK5.mjs → chunk-IOF4KXMP.mjs} +7 -3
  59. package/dist/{chunk-ILMTRGBG.mjs → chunk-IQIKPKFP.mjs} +157 -45
  60. package/dist/{chunk-5JNUYGNF.cjs → chunk-IWRLV46X.cjs} +2 -2
  61. package/dist/{chunk-KPOMS5RO.cjs → chunk-J3GFOQOL.cjs} +3 -3
  62. package/dist/{chunk-NHD7BAKD.mjs → chunk-JCEFKP5M.mjs} +41 -25
  63. package/dist/{analyzer-LCSI3NSH.cjs → chunk-JEJQGZI7.cjs} +16 -13
  64. package/dist/{chunk-LB3DPQP6.cjs → chunk-JLDNXURZ.cjs} +23 -23
  65. package/dist/{chunk-VGG74PSU.cjs → chunk-L2JG337G.cjs} +2 -2
  66. package/dist/chunk-L4RTTTVE.mjs +8 -0
  67. package/dist/chunk-LEJDW34D.cjs +115 -0
  68. package/dist/{analyzer-22BEYV7S.mjs → chunk-LVWGURLD.mjs} +6 -3
  69. package/dist/{chunk-Z5A6CNV2.mjs → chunk-MK5E44WP.mjs} +1 -1
  70. package/dist/{chunk-T4EW7AAD.mjs → chunk-NKRZLQUK.mjs} +2 -2
  71. package/dist/{chunk-HPWB57PZ.mjs → chunk-NT3QDN2E.mjs} +1 -1
  72. package/dist/{chunk-T7I62A4C.mjs → chunk-OUWRNHTV.mjs} +81 -28
  73. package/dist/{chunk-GFT5AHAT.mjs → chunk-QDWMCFTH.mjs} +12 -1
  74. package/dist/{chunk-AER5I65K.mjs → chunk-QTD6EMN2.mjs} +1 -1
  75. package/dist/{chunk-UDJY2ZGY.cjs → chunk-RMUD75WT.cjs} +413 -301
  76. package/dist/chunk-RZNCMRD3.mjs +141 -0
  77. package/dist/{chunk-D7LTCK3U.mjs → chunk-SA7MLSP4.mjs} +11 -6
  78. package/dist/{chunk-2FRLSDBT.cjs → chunk-SM25ZC4S.cjs} +1 -1
  79. package/dist/{chunk-3YMLUNL2.cjs → chunk-SVXOCTQ2.cjs} +1 -1
  80. package/dist/{chunk-W2RZ73IU.cjs → chunk-SYXPWJ7N.cjs} +8 -8
  81. package/dist/{chunk-F6Y7ZAPQ.mjs → chunk-T46NNU4D.mjs} +6 -3
  82. package/dist/{chunk-IFHPDLIS.mjs → chunk-TGULJSHD.mjs} +5 -4
  83. package/dist/{chunk-JPIUGDK4.mjs → chunk-TZVUF5JJ.mjs} +1 -1
  84. package/dist/chunk-UWI3SJAK.cjs +141 -0
  85. package/dist/{chunk-JI5D7MXY.mjs → chunk-UYRI6U3P.mjs} +1 -1
  86. package/dist/{chunk-D2X5MUF5.cjs → chunk-V727H3RI.cjs} +47 -31
  87. package/dist/{chunk-ZMHAFH4R.mjs → chunk-VM7X5CKC.mjs} +2 -2
  88. package/dist/{chunk-VPTWKOCY.mjs → chunk-VWW4Q3BJ.mjs} +287 -6
  89. package/dist/{chunk-4P23B7DU.cjs → chunk-WKJQ2FJA.cjs} +3 -3
  90. package/dist/{chunk-HASX6DC7.cjs → chunk-WKPBIT5Q.cjs} +8 -8
  91. package/dist/{chunk-RAWWCDCT.cjs → chunk-WYAXRIYP.cjs} +3 -3
  92. package/dist/{chunk-3TL3AH25.cjs → chunk-X4K7TYN6.cjs} +12 -7
  93. package/dist/chunk-XCXHQBMM.mjs +115 -0
  94. package/dist/{chunk-DPJ66FSI.cjs → chunk-XX32BOMM.cjs} +7 -7
  95. package/dist/{chunk-2IAPKPEB.cjs → chunk-YN6BHOYY.cjs} +6 -6
  96. package/dist/{chunk-CBKRS3M4.cjs → chunk-Z7P2BTZ3.cjs} +7 -6
  97. package/dist/{chunk-SX7EECTS.mjs → chunk-ZBUAOGMY.mjs} +1 -1
  98. package/dist/{chunk-RPUJHJHE.mjs → chunk-ZFWYCVKS.mjs} +4 -3
  99. package/dist/{chunk-IFXSBJPN.cjs → chunk-ZVIEFTUA.cjs} +20 -17
  100. package/dist/{chunk-EXUONJYV.mjs → chunk-ZZI56IUY.mjs} +3 -3
  101. package/dist/{programmatic-routes-client.d-CLG2N1yH.d.ts → client-component.d-Bgt3x5Fu.d.ts} +18 -3
  102. package/dist/{programmatic-routes-client.d-CPbNqtIi.d.mts → client-component.d-BoqC2MLC.d.mts} +18 -3
  103. package/dist/{client-plugins.d-vXrbcfJ1.d.ts → client-plugins.d-BcqIy4au.d.ts} +1 -1
  104. package/dist/{client-plugins.d-CgQQ-EAv.d.mts → client-plugins.d-CWyYBxXf.d.mts} +1 -1
  105. package/dist/client-plugins.d.mts +2 -2
  106. package/dist/client-plugins.d.ts +2 -2
  107. package/dist/client.d.mts +7 -7
  108. package/dist/client.d.ts +7 -7
  109. package/dist/{config.d-DqZkLwef.d.ts → config.d-qt-mE8O5.d.mts} +6 -2
  110. package/dist/{config.d-DqZkLwef.d.mts → config.d-qt-mE8O5.d.ts} +6 -2
  111. package/dist/config.d.mts +2 -2
  112. package/dist/config.d.ts +2 -2
  113. package/dist/cron.cjs +12 -2
  114. package/dist/cron.d.mts +101 -3
  115. package/dist/cron.d.ts +101 -3
  116. package/dist/cron.mjs +11 -1
  117. package/dist/desktop.d.mts +3 -3
  118. package/dist/desktop.d.ts +3 -3
  119. package/dist/{devtools-KQZ6SRCJ.mjs → devtools-NUVXYG7I.mjs} +6 -6
  120. package/dist/{devtools-UF6JYHUN.cjs → devtools-SVRSGPNC.cjs} +8 -8
  121. package/dist/docs.cjs +9 -9
  122. package/dist/docs.d.mts +3 -3
  123. package/dist/docs.d.ts +3 -3
  124. package/dist/docs.mjs +8 -8
  125. package/dist/image/server.cjs +3 -3
  126. package/dist/image/server.mjs +2 -2
  127. package/dist/image/sharp.cjs +10 -10
  128. package/dist/image/sharp.mjs +2 -2
  129. package/dist/index.cjs +42 -27
  130. package/dist/{index.d-Dmfb7Kb_.d.mts → index.d-BDaiu2i5.d.mts} +1 -1
  131. package/dist/{index.d-DlCELfhf.d.ts → index.d-nAncqTXz.d.ts} +1 -1
  132. package/dist/index.d.mts +18 -18
  133. package/dist/index.d.ts +18 -18
  134. package/dist/index.mjs +42 -27
  135. package/dist/integrations.cjs +3 -3
  136. package/dist/integrations.d.mts +2 -2
  137. package/dist/integrations.d.ts +2 -2
  138. package/dist/integrations.mjs +2 -2
  139. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  140. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  141. package/dist/internal/build-runtime.cjs +27 -22
  142. package/dist/internal/build-runtime.d.mts +4 -4
  143. package/dist/internal/build-runtime.d.ts +4 -4
  144. package/dist/internal/build-runtime.mjs +26 -21
  145. package/dist/internal/cli-runtime.cjs +12 -11
  146. package/dist/internal/cli-runtime.mjs +11 -10
  147. package/dist/internal/client-error-overlay.cjs +4 -4
  148. package/dist/internal/client-error-overlay.mjs +1 -1
  149. package/dist/internal/client-runtime.d.mts +5 -5
  150. package/dist/internal/client-runtime.d.ts +5 -5
  151. package/dist/internal/compression-runtime.d.mts +2 -2
  152. package/dist/internal/compression-runtime.d.ts +2 -2
  153. package/dist/internal/config-runtime.cjs +8 -8
  154. package/dist/internal/config-runtime.d.mts +5 -5
  155. package/dist/internal/config-runtime.d.ts +5 -5
  156. package/dist/internal/config-runtime.mjs +7 -7
  157. package/dist/internal/form-actions.cjs +4 -4
  158. package/dist/internal/form-actions.mjs +3 -3
  159. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  160. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  161. package/dist/internal/metadata-image-runtime.cjs +3 -3
  162. package/dist/internal/metadata-image-runtime.mjs +2 -2
  163. package/dist/internal/native-server-fns.cjs +25 -0
  164. package/dist/internal/native-server-fns.d.mts +42 -0
  165. package/dist/internal/native-server-fns.d.ts +42 -0
  166. package/dist/internal/native-server-fns.mjs +25 -0
  167. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  168. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  169. package/dist/internal/production-node-env.cjs +2 -2
  170. package/dist/internal/production-node-env.mjs +1 -1
  171. package/dist/internal/production-runtime.cjs +16 -10
  172. package/dist/internal/production-runtime.d.mts +39 -12
  173. package/dist/internal/production-runtime.d.ts +39 -12
  174. package/dist/internal/production-runtime.mjs +15 -9
  175. package/dist/internal/react-cache.cjs +51 -0
  176. package/dist/internal/react-cache.d.mts +3 -0
  177. package/dist/internal/react-cache.d.ts +3 -0
  178. package/dist/internal/react-cache.mjs +51 -0
  179. package/dist/markdown.d.mts +2 -2
  180. package/dist/markdown.d.ts +2 -2
  181. package/dist/middleware.cjs +3 -3
  182. package/dist/middleware.d.mts +4 -4
  183. package/dist/middleware.d.ts +4 -4
  184. package/dist/middleware.mjs +2 -2
  185. package/dist/mobile.d.mts +10 -4
  186. package/dist/mobile.d.ts +10 -4
  187. package/dist/{modules-VHD7BELU.mjs → modules-KOKD4XS6.mjs} +2 -2
  188. package/dist/modules-QTP7WJPD.cjs +13 -0
  189. package/dist/native-server-fn-handler-GLRHAYWV.mjs +28 -0
  190. package/dist/native-server-fn-handler-J5MYRXN6.cjs +28 -0
  191. package/dist/native-specs-5OLED4MM.cjs +15 -0
  192. package/dist/{native-specs-BD7HOTMJ.mjs → native-specs-LDV6IZ4N.mjs} +1 -1
  193. package/dist/{native-tree-VWNW2MQ2.mjs → native-tree-AS5L3ID3.mjs} +2 -2
  194. package/dist/{native-tree-6G5O53O3.cjs → native-tree-Z2WYUJEV.cjs} +3 -3
  195. package/dist/native.cjs +1 -1
  196. package/dist/native.d.mts +5 -5
  197. package/dist/native.d.ts +5 -5
  198. package/dist/native.mjs +1 -1
  199. package/dist/{navigation-delegate.d-JXx40JzR.d.ts → navigation-delegate.d-BbUHRXxG.d.ts} +1 -1
  200. package/dist/{navigation-delegate.d-CnOTWOyi.d.mts → navigation-delegate.d-CSCm8ZxL.d.mts} +1 -1
  201. package/dist/navigation.d.mts +5 -5
  202. package/dist/navigation.d.ts +5 -5
  203. package/dist/{nitro-FLN6DRGJ.mjs → nitro-DD4QCA66.mjs} +5 -5
  204. package/dist/{nitro-HXAZZQKY.cjs → nitro-VRDX2H4M.cjs} +8 -8
  205. package/dist/plugin.cjs +19 -18
  206. package/dist/plugin.d.mts +5 -5
  207. package/dist/plugin.d.ts +5 -5
  208. package/dist/plugin.mjs +18 -17
  209. package/dist/{port-WOOQ3V56.mjs → port-UFUZL6RI.mjs} +2 -2
  210. package/dist/{port-C6GBH4C6.cjs → port-VTLHPZOI.cjs} +10 -10
  211. package/dist/{production-runtime.d-CP5s6RuY.d.mts → production-runtime.d-CcQiDko5.d.mts} +1 -1
  212. package/dist/{production-runtime.d-N-cE3pmy.d.ts → production-runtime.d-DgT24A0f.d.ts} +1 -1
  213. package/dist/{render-plan.d-DZ-qjjdG.d.mts → render-plan.d-BH9WF-JZ.d.mts} +1 -1
  214. package/dist/{render-plan.d-B9lAP3uX.d.ts → render-plan.d-CyrX6MDs.d.ts} +1 -1
  215. package/dist/renderer-client.d.mts +5 -5
  216. package/dist/renderer-client.d.ts +5 -5
  217. package/dist/{request.d-BiicaNxb.d.ts → request.d-BB8M8bcD.d.ts} +1 -1
  218. package/dist/{request.d-DV0oeUit.d.mts → request.d-CUrPnCW7.d.mts} +1 -1
  219. package/dist/request.d.mts +3 -3
  220. package/dist/request.d.ts +3 -3
  221. package/dist/{route-rendering.d-BrIKA51A.d.mts → route-rendering.d-CYxlzaFm.d.mts} +1 -1
  222. package/dist/{route-rendering.d-Iss0C7GR.d.ts → route-rendering.d-DYqZMIf4.d.ts} +1 -1
  223. package/dist/{router.d-mNTbOGV_.d.mts → router.d-7o24CD8u.d.mts} +1 -1
  224. package/dist/{router.d-DjGn_al7.d.ts → router.d-DaKo507j.d.ts} +1 -1
  225. package/dist/{routes.d-BKSjHuH9.d.ts → routes.d-BknKQcTu.d.ts} +7 -1
  226. package/dist/{routes.d-qd8Qf4LG.d.mts → routes.d-D1IrO9KK.d.mts} +7 -1
  227. package/dist/routes.d.mts +2 -2
  228. package/dist/routes.d.ts +2 -2
  229. package/dist/{rsc-pipeline-SVLBTY7H.cjs → rsc-pipeline-OF2I7PCX.cjs} +8 -8
  230. package/dist/{rsc-pipeline-WBLBDQXA.mjs → rsc-pipeline-RFLHDAKD.mjs} +7 -7
  231. package/dist/{runtime-DGUOWSMF.cjs → runtime-LBTK62AD.cjs} +70 -47
  232. package/dist/{runtime-HFZTVNFF.mjs → runtime-M6UJCSLA.mjs} +38 -15
  233. package/dist/{runtime.d-Bm_4hP5T.d.ts → runtime.d-CN73a-IL.d.ts} +1 -1
  234. package/dist/{runtime.d-BNVbojF1.d.mts → runtime.d-CcNuzhX6.d.mts} +1 -1
  235. package/dist/server-action-security.cjs +3 -3
  236. package/dist/server-action-security.mjs +2 -2
  237. package/dist/server-fn.cjs +4 -4
  238. package/dist/server-fn.mjs +3 -3
  239. package/dist/server-plugins.d.mts +3 -3
  240. package/dist/server-plugins.d.ts +3 -3
  241. package/dist/server-query.cjs +5 -5
  242. package/dist/server-query.mjs +4 -4
  243. package/dist/server.cjs +38 -37
  244. package/dist/server.d.mts +10 -10
  245. package/dist/server.d.ts +10 -10
  246. package/dist/server.mjs +23 -22
  247. package/dist/{spa-router.d-DHDoXxDE.d.mts → spa-router.d-CNi77LZm.d.mts} +2 -2
  248. package/dist/{spa-router.d-DAtnNoBe.d.ts → spa-router.d-Cvgf5QP4.d.ts} +2 -2
  249. package/dist/testing.cjs +6 -6
  250. package/dist/testing.d.mts +2 -2
  251. package/dist/testing.d.ts +2 -2
  252. package/dist/testing.mjs +4 -4
  253. package/dist/{utils.d-DwZ-KLSB.d.ts → utils.d-C3H-14_Y.d.ts} +1 -1
  254. package/dist/{utils.d-uKZcKJk4.d.mts → utils.d-D8VfzZYn.d.mts} +1 -1
  255. package/dist/version.cjs +2 -2
  256. package/dist/version.mjs +1 -1
  257. package/dist/vite.cjs +21 -18
  258. package/dist/vite.d.mts +5 -5
  259. package/dist/vite.d.ts +5 -5
  260. package/dist/vite.mjs +20 -17
  261. package/dist/workflows.cjs +3 -3
  262. package/dist/workflows.mjs +2 -2
  263. package/package.json +12 -2
  264. package/dist/modules-WT5D3AWY.cjs +0 -13
  265. package/dist/native-specs-IQQRJOOW.cjs +0 -15
@@ -5,18 +5,17 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkD2X5MUF5cjs = require('./chunk-D2X5MUF5.cjs');
8
+ var _chunkV727H3RIcjs = require('./chunk-V727H3RI.cjs');
9
9
 
10
10
 
11
- var _chunk2FRLSDBTcjs = require('./chunk-2FRLSDBT.cjs');
12
- require('./chunk-BTZ5O6VM.cjs');
11
+ var _chunkSM25ZC4Scjs = require('./chunk-SM25ZC4S.cjs');
13
12
 
14
13
  // src/mobile/analyzer.ts
15
14
  var _crypto = require('crypto');
16
15
  var _fs = require('fs');
17
16
  var _promises = require('fs/promises');
18
17
  var _path = require('path'); var path = _interopRequireWildcard(_path);
19
- var ANALYZER_VERSION = `5:${_chunk2FRLSDBTcjs.FARM_VERSION}`;
18
+ var ANALYZER_VERSION = `5:${_chunkSM25ZC4Scjs.FARM_VERSION}`;
20
19
  var INTRINSIC_KINDS = {};
21
20
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
22
21
  INTRINSIC_KINDS[tag] = "View";
@@ -140,13 +139,13 @@ var INLINE_BOX_TAGS = new Set("span strong em b i small label code".split(" "));
140
139
  function hasBoxStyle(node) {
141
140
  const tokens = _nullishCoalesce(node.style, () => ( []));
142
141
  const classes = tokens.filter((token) => !token.startsWith("style."));
143
- const resolved = _chunkD2X5MUF5cjs.resolveFarmNativeClasses.call(void 0, classes.join(" "));
142
+ const resolved = _chunkV727H3RIcjs.resolveFarmNativeClasses.call(void 0, classes.join(" "));
144
143
  const keys = [
145
144
  ...Object.keys(resolved.style),
146
145
  ...Object.keys(_nullishCoalesce(resolved.dark, () => ( {}))),
147
146
  ...tokens.filter((token) => token.startsWith("style.")).map((token) => token.slice(6))
148
147
  ];
149
- return keys.some((key) => !_chunkD2X5MUF5cjs.FARM_NATIVE_TEXT_KEYS.has(key));
148
+ return keys.some((key) => !_chunkV727H3RIcjs.FARM_NATIVE_TEXT_KEYS.has(key));
150
149
  }
151
150
  var MAPPED_COMPONENTS = {
152
151
  "@farm.js/core": { Link: "Pressable" },
@@ -512,7 +511,7 @@ function analyzeSource(file, source, parseSync) {
512
511
  } else if (problem) block(attribute, "class-name", problem);
513
512
  else {
514
513
  style.push(token);
515
- const native = _chunkD2X5MUF5cjs.farmNativeClassProblem.call(void 0, token);
514
+ const native = _chunkV727H3RIcjs.farmNativeClassProblem.call(void 0, token);
516
515
  if (native) block(attribute, "class-name", native, "native");
517
516
  }
518
517
  }
@@ -534,7 +533,7 @@ function analyzeSource(file, source, parseSync) {
534
533
  block(property, "style", `style.${key} has no native mapping`);
535
534
  continue;
536
535
  }
537
- if (!_chunkD2X5MUF5cjs.FARM_NATIVE_STYLE_PROPERTIES.has(key)) {
536
+ if (!_chunkV727H3RIcjs.FARM_NATIVE_STYLE_PROPERTIES.has(key)) {
538
537
  block(property, "style", `style.${key} has no native-tier style`, "native");
539
538
  }
540
539
  const literal2 = staticString(property.value);
@@ -1037,7 +1036,7 @@ async function analyzeFarmMobileRoutes(options) {
1037
1036
  const readStylesheet = (file) => {
1038
1037
  let sheet = parsedSheets.get(file);
1039
1038
  if (!sheet) {
1040
- sheet = _chunkD2X5MUF5cjs.parseFarmNativeStylesheet.call(void 0, _fs.readFileSync.call(void 0, file, "utf8"));
1039
+ sheet = _chunkV727H3RIcjs.parseFarmNativeStylesheet.call(void 0, _fs.readFileSync.call(void 0, file, "utf8"));
1041
1040
  parsedSheets.set(file, sheet);
1042
1041
  }
1043
1042
  return sheet;
@@ -1049,6 +1048,7 @@ async function analyzeFarmMobileRoutes(options) {
1049
1048
  const allStylesheets = /* @__PURE__ */ new Set();
1050
1049
  const unreadStylesheets = /* @__PURE__ */ new Set();
1051
1050
  for (const [route, { page, layouts }] of entries) {
1051
+ if (!page && _optionalChain([options, 'access', _34 => _34.nativeOnlyRoutes, 'optionalAccess', _35 => _35.has, 'call', _36 => _36(route)])) continue;
1052
1052
  const blockers = [];
1053
1053
  const wins = /* @__PURE__ */ new Set();
1054
1054
  const elements = { total: 0, mapped: 0, byKind: {} };
@@ -1127,7 +1127,7 @@ async function analyzeFarmMobileRoutes(options) {
1127
1127
  if (entryImport.stylesheet) {
1128
1128
  stylesheets.add(entryImport.stylesheet);
1129
1129
  allStylesheets.add(entryImport.stylesheet);
1130
- } else if (_optionalChain([entryImport, 'access', _34 => _34.blocker, 'optionalAccess', _35 => _35.rule]) === "css-import") {
1130
+ } else if (_optionalChain([entryImport, 'access', _37 => _37.blocker, 'optionalAccess', _38 => _38.rule]) === "css-import") {
1131
1131
  unreadStylesheets.add(entryImport.fact.source);
1132
1132
  }
1133
1133
  if (entryImport.blocker) add({ file: label, ...entryImport.blocker });
@@ -1157,7 +1157,7 @@ async function analyzeFarmMobileRoutes(options) {
1157
1157
  for (const layout of layouts) walk(layout, true, true);
1158
1158
  const sheets = [...stylesheets].map(readStylesheet);
1159
1159
  for (const appClass of appClasses) {
1160
- const { styled, problems } = _chunkD2X5MUF5cjs.inspectFarmNativeStylesheets.call(void 0, sheets, { class: appClass.name });
1160
+ const { styled, problems } = _chunkV727H3RIcjs.inspectFarmNativeStylesheets.call(void 0, sheets, { class: appClass.name });
1161
1161
  const at = { file: appClass.file, line: appClass.line, column: appClass.column };
1162
1162
  if (!styled) {
1163
1163
  blockers.push({
@@ -1172,7 +1172,7 @@ async function analyzeFarmMobileRoutes(options) {
1172
1172
  }
1173
1173
  }
1174
1174
  for (const tag of tags) {
1175
- for (const message of _chunkD2X5MUF5cjs.inspectFarmNativeStylesheets.call(void 0, sheets, { tag }).problems) {
1175
+ for (const message of _chunkV727H3RIcjs.inspectFarmNativeStylesheets.call(void 0, sheets, { tag }).problems) {
1176
1176
  blockers.push({
1177
1177
  file: relative2(root, _nullishCoalesce(page, () => ( ""))),
1178
1178
  line: 1,
@@ -1226,4 +1226,7 @@ async function analyzeFarmMobileRoutes(options) {
1226
1226
 
1227
1227
 
1228
1228
 
1229
- exports.CORE_PORTABLE = CORE_PORTABLE; exports.analyzeFarmMobileRoutes = analyzeFarmMobileRoutes;
1229
+
1230
+
1231
+
1232
+ exports.CORE_PORTABLE = CORE_PORTABLE; exports.readAliases = readAliases; exports.resolveFile = resolveFile; exports.analyzeFarmMobileRoutes = analyzeFarmMobileRoutes;
@@ -9,7 +9,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
9
9
  var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
10
10
 
11
11
 
12
- var _chunkW2RZ73IUcjs = require('./chunk-W2RZ73IU.cjs');
12
+ var _chunkSYXPWJ7Ncjs = require('./chunk-SYXPWJ7N.cjs');
13
13
 
14
14
 
15
15
  var _chunkNWUHS6GVcjs = require('./chunk-NWUHS6GV.cjs');
@@ -24,7 +24,7 @@ var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
24
24
 
25
25
 
26
26
 
27
- var _chunkCBKRS3M4cjs = require('./chunk-CBKRS3M4.cjs');
27
+ var _chunkZ7P2BTZ3cjs = require('./chunk-Z7P2BTZ3.cjs');
28
28
 
29
29
 
30
30
  var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
@@ -45,7 +45,7 @@ var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
45
45
 
46
46
 
47
47
 
48
- var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
48
+ var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
49
49
 
50
50
 
51
51
  var _chunkHNAISJFDcjs = require('./chunk-HNAISJFD.cjs');
@@ -61,7 +61,7 @@ function farmApiPlugin(options = {}) {
61
61
  const srcDir = _nullishCoalesce(options.srcDir, () => ( "src"));
62
62
  const apiDirFromRoot = _nullishCoalesce(options.apiDir, () => ( _path2.default.join(srcDir, "api")));
63
63
  const debug = _nullishCoalesce(options.debug, () => ( false));
64
- const bodySizeLimit = _chunkLIFUPCXWcjs.resolveFarmServerConfig.call(void 0, {
64
+ const bodySizeLimit = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, {
65
65
  bodySizeLimit: options.bodySizeLimit
66
66
  }).bodySizeLimit;
67
67
  const basePath = options.basePath;
@@ -114,7 +114,7 @@ function farmApiPlugin(options = {}) {
114
114
  const existing = apiRoutesCache.get(routePath);
115
115
  const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
116
116
  if (existingFile) {
117
- throw new (0, _chunkW2RZ73IUcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
117
+ throw new (0, _chunkSYXPWJ7Ncjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
118
118
  }
119
119
  if (existing) {
120
120
  if (!existing.methods.includes(normalizedMethod)) {
@@ -190,7 +190,7 @@ function farmApiPlugin(options = {}) {
190
190
  const createRouter = async () => {
191
191
  const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
192
192
  pluginMergedRoutes = plugins.length ? new Map(
193
- _chunkCBKRS3M4cjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
193
+ _chunkZ7P2BTZ3cjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
194
194
  bodySizeLimit,
195
195
  // A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
196
196
  // so the middleware that guards the endpoint's path runs for it.
@@ -210,7 +210,7 @@ function farmApiPlugin(options = {}) {
210
210
  const url = new URL(request.url);
211
211
  const method = request.method.toUpperCase();
212
212
  const pathname = url.pathname;
213
- const match = _chunkCBKRS3M4cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
213
+ const match = _chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
214
214
  if (!match) {
215
215
  return new Response(JSON.stringify({ error: "Not Found" }), {
216
216
  status: 404,
@@ -218,18 +218,18 @@ function farmApiPlugin(options = {}) {
218
218
  });
219
219
  }
220
220
  const { route, params } = match;
221
- const endpoint = _chunkCBKRS3M4cjs.resolveAPIRouteEndpoint.call(void 0, route, method);
221
+ const endpoint = _chunkZ7P2BTZ3cjs.resolveAPIRouteEndpoint.call(void 0, route, method);
222
222
  if (!endpoint) {
223
223
  return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
224
224
  status: 405,
225
225
  headers: {
226
- Allow: _chunkCBKRS3M4cjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
226
+ Allow: _chunkZ7P2BTZ3cjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
227
227
  "Content-Type": "application/json"
228
228
  }
229
229
  });
230
230
  }
231
231
  try {
232
- return await _chunkCBKRS3M4cjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
232
+ return await _chunkZ7P2BTZ3cjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
233
233
  } catch (error) {
234
234
  return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
235
235
  status: 500,
@@ -278,7 +278,7 @@ function farmApiPlugin(options = {}) {
278
278
  const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, filePath);
279
279
  const endpoints = {};
280
280
  const availableMethods = [];
281
- for (const method of _chunkCBKRS3M4cjs.API_ROUTE_METHODS) {
281
+ for (const method of _chunkZ7P2BTZ3cjs.API_ROUTE_METHODS) {
282
282
  if (routeModule[method]) {
283
283
  availableMethods.push(method);
284
284
  endpoints[method] = routeModule[method];
@@ -291,7 +291,7 @@ function farmApiPlugin(options = {}) {
291
291
  log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
292
292
  }
293
293
  } catch (e) {
294
- if (e instanceof _chunkW2RZ73IUcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
294
+ if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
295
295
  log(`API route load failed at ${filePath}: ${e.message}`);
296
296
  }
297
297
  }
@@ -318,7 +318,7 @@ function farmApiPlugin(options = {}) {
318
318
  }
319
319
  }
320
320
  } catch (e) {
321
- if (e instanceof _chunkW2RZ73IUcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
321
+ if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
322
322
  log(`Root routes.ts load failed: ${e.message}`);
323
323
  }
324
324
  break;
@@ -349,7 +349,7 @@ function farmApiPlugin(options = {}) {
349
349
  }
350
350
  }
351
351
  } catch (e) {
352
- if (e instanceof _chunkW2RZ73IUcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
352
+ if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
353
353
  log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
354
354
  }
355
355
  }
@@ -403,15 +403,15 @@ function farmApiPlugin(options = {}) {
403
403
  if (discoveryPromise) await waitForDiscovery();
404
404
  const farmMiddleware = server.__farmMiddleware__;
405
405
  let middlewareRan = false;
406
- if (!_chunkCBKRS3M4cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
407
- if (!farmMiddleware || !apiRouterHandler || !_chunkCBKRS3M4cjs.isFarmAPIPathname.call(void 0, pathname, basePath)) {
406
+ if (!_chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
407
+ if (!farmMiddleware || !apiRouterHandler || !_chunkZ7P2BTZ3cjs.isFarmAPIPathname.call(void 0, pathname, basePath)) {
408
408
  return next();
409
409
  }
410
410
  await _optionalChain([farmMiddleware, 'access', _5 => _5.waitForDiscovery, 'optionalCall', _6 => _6()]);
411
411
  if (await farmMiddleware.execute(req, res, pathname, /* @__PURE__ */ new Map())) return;
412
412
  middlewareRan = true;
413
413
  const rewrittenPathname = (req.url || url).split("?")[0];
414
- if (rewrittenPathname === pathname || !_chunkCBKRS3M4cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), rewrittenPathname, basePath)) {
414
+ if (rewrittenPathname === pathname || !_chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), rewrittenPathname, basePath)) {
415
415
  return next();
416
416
  }
417
417
  }
@@ -432,7 +432,7 @@ function farmApiPlugin(options = {}) {
432
432
  }
433
433
  const currentUrl = req.url || url;
434
434
  const currentPathname = currentUrl.split("?")[0];
435
- if (currentPathname !== pathname && !_chunkCBKRS3M4cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
435
+ if (currentPathname !== pathname && !_chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
436
436
  return next();
437
437
  }
438
438
  const fullUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req);
@@ -444,7 +444,7 @@ function farmApiPlugin(options = {}) {
444
444
  }
445
445
  let body;
446
446
  if (method !== "GET" && method !== "HEAD") {
447
- body = await _chunkLIFUPCXWcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
447
+ body = await _chunkCFG4QERRcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
448
448
  }
449
449
  const request = new Request(fullUrl, {
450
450
  method,
@@ -459,7 +459,7 @@ function farmApiPlugin(options = {}) {
459
459
  logResponse(method, currentPathname, response.status, duration);
460
460
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
461
461
  } catch (error) {
462
- const bodyErrorResponse = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
462
+ const bodyErrorResponse = _chunkCFG4QERRcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
463
463
  if (bodyErrorResponse) {
464
464
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
465
465
  return;
@@ -536,7 +536,7 @@ function farmApiPlugin(options = {}) {
536
536
  log(`API router recreated`);
537
537
  } catch (e) {
538
538
  restoreRouteState(previousState);
539
- if (e instanceof _chunkW2RZ73IUcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
539
+ if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
540
540
  log(`Root routes.ts HMR failed: ${e.message}`);
541
541
  }
542
542
  return [];
@@ -564,7 +564,7 @@ function farmApiPlugin(options = {}) {
564
564
  const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
565
565
  removeEndpointsFromFile(file);
566
566
  const availableMethods = [];
567
- for (const method of _chunkCBKRS3M4cjs.API_ROUTE_METHODS) {
567
+ for (const method of _chunkZ7P2BTZ3cjs.API_ROUTE_METHODS) {
568
568
  if (!routeModule[method]) continue;
569
569
  availableMethods.push(method);
570
570
  addEndpoint(routePath, file, method, routeModule[method]);
@@ -574,7 +574,7 @@ function farmApiPlugin(options = {}) {
574
574
  log(`API router recreated`);
575
575
  } catch (e) {
576
576
  restoreRouteState(previousState);
577
- if (e instanceof _chunkW2RZ73IUcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
577
+ if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
578
578
  log(`API route HMR failed: ${e.message}`);
579
579
  }
580
580
  return [];
@@ -29,7 +29,7 @@ var _chunkSYW346ZNcjs = require('./chunk-SYW346ZN.cjs');
29
29
  var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
30
30
 
31
31
 
32
- var _chunkZP32GNJQcjs = require('./chunk-ZP32GNJQ.cjs');
32
+ var _chunkI32V5CZLcjs = require('./chunk-I32V5CZL.cjs');
33
33
 
34
34
  // src/schema-dependencies.ts
35
35
  function collectSchemaDependencies(owners) {
@@ -115,7 +115,7 @@ async function withTimeout(work, timeoutMs) {
115
115
  var formatSeconds = (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`;
116
116
  function collectSchemaOwners(config) {
117
117
  const owners = [];
118
- const integrationSchemas = _chunkZP32GNJQcjs.getIntegrationSchemas.call(void 0, config.integrations);
118
+ const integrationSchemas = _chunkI32V5CZLcjs.getIntegrationSchemas.call(void 0, config.integrations);
119
119
  let integrationClient;
120
120
  for (const [name, schema] of Object.entries(integrationSchemas)) {
121
121
  owners.push({
@@ -0,0 +1,8 @@
1
+ // src/mobile/native-server-fn-names.ts
2
+ var FARM_NATIVE_SERVER_FN_PATH = "/api/__farm/native/fn";
3
+ var FARM_NATIVE_SERVER_FN_PLUGIN = "farm:native-server-fns";
4
+
5
+ export {
6
+ FARM_NATIVE_SERVER_FN_PATH,
7
+ FARM_NATIVE_SERVER_FN_PLUGIN
8
+ };
@@ -0,0 +1,115 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+ var _chunkYN6BHOYYcjs = require('./chunk-YN6BHOYY.cjs');
5
+
6
+
7
+
8
+ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
9
+
10
+
11
+ var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
12
+
13
+ // src/mobile/native-server-fn-handler.ts
14
+ var MOBILE_APP_HEADER = "x-farm-mobile";
15
+ var FETCH_METADATA = ["sec-fetch-site", "sec-fetch-mode", "sec-fetch-dest", "sec-fetch-user"];
16
+ var ID = /^[\w-]{1,64}$/;
17
+ var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
18
+ function hasUnsafeKey(value, depth = 0) {
19
+ if (depth > 64) return true;
20
+ if (Array.isArray(value)) return value.some((item) => hasUnsafeKey(item, depth + 1));
21
+ if (!value || typeof value !== "object") return false;
22
+ return Object.keys(value).some(
23
+ (key) => UNSAFE_KEYS.has(key) || hasUnsafeKey(value[key], depth + 1)
24
+ );
25
+ }
26
+ function json(status, body) {
27
+ return new Response(JSON.stringify(body), {
28
+ status,
29
+ headers: { "content-type": "application/json", "cache-control": "private, no-store" }
30
+ });
31
+ }
32
+ function refuse(status, code, message) {
33
+ return json(status, { error: { code, message } });
34
+ }
35
+ async function handleFarmNativeServerFnRequest(request, options, parsed) {
36
+ if (request.method !== "POST") {
37
+ return refuse(405, "method_not_allowed", "Call server functions with POST.");
38
+ }
39
+ const origin = request.headers.get("origin");
40
+ if (!request.headers.get(MOBILE_APP_HEADER) || FETCH_METADATA.some((name) => request.headers.has(name)) || origin !== null && origin !== new URL(request.url).origin) {
41
+ return refuse(403, "not_native", "Only the app's native screens call server functions here.");
42
+ }
43
+ const length = Number(_nullishCoalesce(request.headers.get("content-length"), () => ( "0")));
44
+ if (length > _chunk4P5634G6cjs.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT) {
45
+ return refuse(413, "body_too_large", "The call's input is too large.");
46
+ }
47
+ let call;
48
+ if (parsed !== void 0) call = parsed;
49
+ else {
50
+ const text = await request.text();
51
+ if (text.length > _chunk4P5634G6cjs.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT) {
52
+ return refuse(413, "body_too_large", "The call's input is too large.");
53
+ }
54
+ try {
55
+ call = JSON.parse(text);
56
+ } catch (e) {
57
+ return refuse(400, "invalid_body", 'Send { "id", "input" } as JSON.');
58
+ }
59
+ }
60
+ if (typeof _optionalChain([call, 'optionalAccess', _ => _.id]) !== "string" || !ID.test(call.id)) {
61
+ return refuse(400, "invalid_body", 'Send { "id", "input" } as JSON.');
62
+ }
63
+ if (hasUnsafeKey(call.input)) {
64
+ return refuse(400, "invalid_body", "The input has a key that is not allowed.");
65
+ }
66
+ const fn = await options.resolve(call.id);
67
+ if (fn === void 0 || _chunkYN6BHOYYcjs._describeServerFunction.call(void 0, fn) === void 0) {
68
+ return refuse(
69
+ 404,
70
+ "unknown_function",
71
+ "No server function with this id is open to native screens."
72
+ );
73
+ }
74
+ const outcome = await _chunkYN6BHOYYcjs._invokeServerFunction.call(void 0, fn, call.input, request);
75
+ if (outcome.ok) {
76
+ try {
77
+ return json(200, { data: _nullishCoalesce(outcome.data, () => ( null)) });
78
+ } catch (error) {
79
+ console.error("[Farm] A server function's result for a native screen is not JSON:", error);
80
+ return refuse(500, "server_error", "Server function failed");
81
+ }
82
+ }
83
+ switch (outcome.reason) {
84
+ case "input":
85
+ return refuse(
86
+ 400,
87
+ "invalid_input",
88
+ outcome.error instanceof Error ? outcome.error.message : "The input is invalid."
89
+ );
90
+ case "failure": {
91
+ const { code, status, message, data } = outcome.failure;
92
+ return json(status, { error: { code, status, message, data } });
93
+ }
94
+ case "redirect":
95
+ return json(200, { redirect: { url: outcome.url, status: outcome.status } });
96
+ default:
97
+ console.error("[Farm] A server function called from a native screen failed:", outcome.error);
98
+ return refuse(500, "server_error", "Server function failed");
99
+ }
100
+ }
101
+ function createFarmNativeServerFnPlugin(options) {
102
+ return {
103
+ name: _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN,
104
+ routes: ({ route }) => [
105
+ route.post(_chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PATH, {
106
+ handler: (request, { input }) => handleFarmNativeServerFnRequest(request, options, input.body)
107
+ })
108
+ ]
109
+ };
110
+ }
111
+
112
+
113
+
114
+
115
+ exports.handleFarmNativeServerFnRequest = handleFarmNativeServerFnRequest; exports.createFarmNativeServerFnPlugin = createFarmNativeServerFnPlugin;
@@ -5,11 +5,10 @@ import {
5
5
  inspectFarmNativeStylesheets,
6
6
  parseFarmNativeStylesheet,
7
7
  resolveFarmNativeClasses
8
- } from "./chunk-NHD7BAKD.mjs";
8
+ } from "./chunk-JCEFKP5M.mjs";
9
9
  import {
10
10
  FARM_VERSION
11
- } from "./chunk-HPWB57PZ.mjs";
12
- import "./chunk-Y6FXYEAI.mjs";
11
+ } from "./chunk-NT3QDN2E.mjs";
13
12
 
14
13
  // src/mobile/analyzer.ts
15
14
  import { createHash } from "crypto";
@@ -1049,6 +1048,7 @@ async function analyzeFarmMobileRoutes(options) {
1049
1048
  const allStylesheets = /* @__PURE__ */ new Set();
1050
1049
  const unreadStylesheets = /* @__PURE__ */ new Set();
1051
1050
  for (const [route, { page, layouts }] of entries) {
1051
+ if (!page && options.nativeOnlyRoutes?.has(route)) continue;
1052
1052
  const blockers = [];
1053
1053
  const wins = /* @__PURE__ */ new Set();
1054
1054
  const elements = { total: 0, mapped: 0, byKind: {} };
@@ -1223,7 +1223,10 @@ async function analyzeFarmMobileRoutes(options) {
1223
1223
  unreadStylesheets: [...unreadStylesheets].sort()
1224
1224
  };
1225
1225
  }
1226
+
1226
1227
  export {
1227
1228
  CORE_PORTABLE,
1229
+ readAliases,
1230
+ resolveFile,
1228
1231
  analyzeFarmMobileRoutes
1229
1232
  };
@@ -6,7 +6,7 @@ import {
6
6
  runWithServerActionRequest,
7
7
  sanitizeServerActionError,
8
8
  serializeServerFnFailure
9
- } from "./chunk-FSQMN2MQ.mjs";
9
+ } from "./chunk-E46NXBNJ.mjs";
10
10
  import {
11
11
  getFarmRedirectError,
12
12
  isFarmNotFoundError
@@ -4,13 +4,13 @@ import {
4
4
  _runServerFunctionForCaller,
5
5
  createServerFn,
6
6
  createServerFunctionDescriptor
7
- } from "./chunk-AER5I65K.mjs";
7
+ } from "./chunk-QTD6EMN2.mjs";
8
8
  import {
9
9
  createFarmServerQueryResult
10
10
  } from "./chunk-N7XWC6BN.mjs";
11
11
  import {
12
12
  getServerActionExecutionContext
13
- } from "./chunk-FSQMN2MQ.mjs";
13
+ } from "./chunk-E46NXBNJ.mjs";
14
14
  import {
15
15
  createRouteDataCacheTag,
16
16
  getFarmDataCache
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.1.60";
2
+ var version = "0.1.62";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;