@farm.js/core 0.1.48 → 0.1.50

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 (322) hide show
  1. package/dist/{agent-mcp-DAjB8Eyu.d.ts → agent-mcp-9BMbRgg_.d.ts} +1 -1
  2. package/dist/{agent-mcp-CXN3g0eX.d.mts → agent-mcp-CIMH324y.d.mts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -3
  4. package/dist/agent-runtime.d.mts +6 -6
  5. package/dist/agent-runtime.d.ts +6 -6
  6. package/dist/agent-runtime.mjs +2 -2
  7. package/dist/analyzer-CN7C74WX.cjs +1066 -0
  8. package/dist/analyzer-DDW34OMC.mjs +1066 -0
  9. package/dist/api/client.d.mts +0 -1
  10. package/dist/api/client.d.ts +0 -1
  11. package/dist/api/route-manager.cjs +5 -5
  12. package/dist/api/route-manager.d.mts +10 -10
  13. package/dist/api/route-manager.d.ts +10 -10
  14. package/dist/api/route-manager.mjs +4 -4
  15. package/dist/api/runtime.cjs +3 -3
  16. package/dist/api/runtime.d.mts +7 -7
  17. package/dist/api/runtime.d.ts +7 -7
  18. package/dist/api/runtime.mjs +2 -2
  19. package/dist/api.cjs +6 -6
  20. package/dist/api.d.mts +10 -10
  21. package/dist/api.d.ts +10 -10
  22. package/dist/api.mjs +5 -5
  23. package/dist/{app-VK9sHDn5.d.ts → app-BWibTHVT.d.ts} +7 -7
  24. package/dist/{app-DytgRPjJ.d.mts → app-DVJ13FPA.d.mts} +7 -7
  25. package/dist/{app-manifest-DPgW5ke5.d.mts → app-manifest-CQDJOKL2.d.mts} +1 -1
  26. package/dist/{app-manifest-BUu7YGAx.d.ts → app-manifest-D0kaXdwu.d.ts} +1 -1
  27. package/dist/app-markdown.d.mts +7 -7
  28. package/dist/app-markdown.d.ts +7 -7
  29. package/dist/cache.d.mts +4 -3
  30. package/dist/cache.d.ts +4 -3
  31. package/dist/{chunk-VJXLUTBM.mjs → chunk-2DEPNLXK.mjs} +7 -7
  32. package/dist/chunk-2G63BIRL.mjs +227 -0
  33. package/dist/chunk-2GLQSIZD.mjs +55 -0
  34. package/dist/{chunk-HRLYO2XJ.mjs → chunk-2VCC3GVC.mjs} +1 -1
  35. package/dist/chunk-3ATXWZPH.cjs +227 -0
  36. package/dist/{chunk-YSPMY4B7.cjs → chunk-474FO3UE.cjs} +233 -157
  37. package/dist/{chunk-QNQEK3OF.cjs → chunk-4T25YCZ5.cjs} +14 -14
  38. package/dist/{chunk-ATHPRVP2.mjs → chunk-5V4KZOZO.mjs} +1 -1
  39. package/dist/{chunk-FGJQS4EC.cjs → chunk-6QA2SXVH.cjs} +2 -2
  40. package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
  41. package/dist/{chunk-QFQDRJKJ.mjs → chunk-76R5GJER.mjs} +2 -2
  42. package/dist/{chunk-NG44F7AH.mjs → chunk-7ONZDKVY.mjs} +2 -2
  43. package/dist/{chunk-MZZA6ZQV.mjs → chunk-7PZVXMWG.mjs} +4 -4
  44. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  45. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  46. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  47. package/dist/{chunk-Q2ZKQ6GD.cjs → chunk-B5S2JS6M.cjs} +127 -125
  48. package/dist/{chunk-AXRNEVCS.cjs → chunk-B6PREBN6.cjs} +8 -8
  49. package/dist/{chunk-JOHXK4BB.mjs → chunk-BW6SCVYX.mjs} +1 -1
  50. package/dist/{chunk-LZBM35DH.mjs → chunk-C73RIAEF.mjs} +4 -4
  51. package/dist/chunk-CGCJ2TJU.cjs +55 -0
  52. package/dist/{chunk-UYQOIPXE.mjs → chunk-CPXDDWGL.mjs} +1 -1
  53. package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
  54. package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
  55. package/dist/{chunk-73XBJRZW.cjs → chunk-E2BMCNMJ.cjs} +2 -2
  56. package/dist/{chunk-WUEDTW6E.cjs → chunk-F5LERVY3.cjs} +23 -5
  57. package/dist/{chunk-A7DK663W.cjs → chunk-FACTMUPI.cjs} +27 -27
  58. package/dist/chunk-G2KTRMWA.mjs +40 -0
  59. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  60. package/dist/{chunk-ZGS3ZDF7.cjs → chunk-GOOK2J2W.cjs} +7 -7
  61. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  62. package/dist/{chunk-6M3HXUBQ.mjs → chunk-HWCHIBJZ.mjs} +21 -3
  63. package/dist/{chunk-HUL4LTC6.cjs → chunk-HYN3LLG7.cjs} +63 -20
  64. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  65. package/dist/{chunk-SSNN55Q6.cjs → chunk-IQXGHGZF.cjs} +5 -5
  66. package/dist/{chunk-ZSIGEHSE.cjs → chunk-IUBDMDZZ.cjs} +21 -180
  67. package/dist/{chunk-TQWGOQ7O.mjs → chunk-IWJKJDNW.mjs} +116 -40
  68. package/dist/{chunk-NRFUVDTH.mjs → chunk-JJOWY3XD.mjs} +2 -2
  69. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  70. package/dist/{chunk-XO6WL6NL.mjs → chunk-KGP76FSV.mjs} +1 -1
  71. package/dist/{chunk-GXSMF7UR.mjs → chunk-KO2NWUKN.mjs} +1 -1
  72. package/dist/{chunk-VDLF2DJA.cjs → chunk-KZH6YLND.cjs} +375 -162
  73. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  74. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  75. package/dist/{chunk-KZT2VHRQ.cjs → chunk-LYWAGXXW.cjs} +11 -11
  76. package/dist/{chunk-N6SIQJEJ.mjs → chunk-M7LKA632.mjs} +54 -11
  77. package/dist/{chunk-6LH33DLL.cjs → chunk-NJVFPJ2Y.cjs} +2 -2
  78. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  79. package/dist/{chunk-MJ6IC4K2.mjs → chunk-OTOOJIUB.mjs} +1 -1
  80. package/dist/{chunk-TFA6BUAE.cjs → chunk-OY5XDG24.cjs} +4 -4
  81. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  82. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  83. package/dist/chunk-QXJADAQB.cjs +40 -0
  84. package/dist/{chunk-JLS6ZLFM.cjs → chunk-RHOR2J6V.cjs} +1 -1
  85. package/dist/{chunk-YQGZLCT4.cjs → chunk-RWT2BTJT.cjs} +6 -6
  86. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  87. package/dist/{chunk-HNAUK3SC.mjs → chunk-SHJJM6OG.mjs} +40 -199
  88. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  89. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  90. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  91. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  92. package/dist/chunk-UB7RVEMX.mjs +73 -0
  93. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  94. package/dist/{chunk-BEXYFR2R.cjs → chunk-UY6HS5PF.cjs} +2 -2
  95. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  96. package/dist/{chunk-C2R5RVLA.cjs → chunk-VCKGOXFI.cjs} +73 -1
  97. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  98. package/dist/{chunk-NE33FRQ5.mjs → chunk-WVBUXNBX.mjs} +274 -61
  99. package/dist/{chunk-ALD2WMLA.mjs → chunk-WXHDVXJE.mjs} +2 -2
  100. package/dist/{chunk-EVCQX243.cjs → chunk-X2EL3BLH.cjs} +2 -2
  101. package/dist/{chunk-EA5PMJDU.mjs → chunk-X3HOVNHI.mjs} +1 -1
  102. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  103. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  104. package/dist/{chunk-EXHEPWFJ.cjs → chunk-YAXOEAND.cjs} +10 -10
  105. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  106. package/dist/chunk-YKHRCY4T.cjs +73 -0
  107. package/dist/{chunk-NIPKC4DA.mjs → chunk-ZIBIE7AH.mjs} +72 -0
  108. package/dist/{chunk-N7SPZJLY.mjs → chunk-ZLOQQ2UF.mjs} +33 -31
  109. package/dist/client/lifecycle.d.mts +1 -1
  110. package/dist/client/lifecycle.d.ts +1 -1
  111. package/dist/{client-plugins-DqjCsKMN.d.ts → client-plugins-BPfltM5m.d.ts} +19 -10
  112. package/dist/{client-plugins-BlEzV5FO.d.mts → client-plugins-D4RO59f0.d.mts} +19 -10
  113. package/dist/client-plugins.d.mts +6 -6
  114. package/dist/client-plugins.d.ts +6 -6
  115. package/dist/client.cjs +11 -8
  116. package/dist/client.d.mts +11 -10
  117. package/dist/client.d.ts +11 -10
  118. package/dist/client.mjs +12 -9
  119. package/dist/client.react-server.mjs +1 -1
  120. package/dist/config-CnhyvvmT.d.mts +188 -0
  121. package/dist/config-CnhyvvmT.d.ts +188 -0
  122. package/dist/config.d.mts +6 -6
  123. package/dist/config.d.ts +6 -6
  124. package/dist/desktop.d.mts +7 -7
  125. package/dist/desktop.d.ts +7 -7
  126. package/dist/{dev-guard-MPZUJFIV.mjs → dev-guard-4PFQNXQX.mjs} +4 -2
  127. package/dist/{dev-guard-4NQ3LFO5.cjs → dev-guard-YLO5DE3H.cjs} +7 -5
  128. package/dist/{devtools-A37WWJZL.cjs → devtools-N5XTOECL.cjs} +8 -8
  129. package/dist/{devtools-BLKHPY3C.mjs → devtools-STG7HPRV.mjs} +7 -7
  130. package/dist/docs.cjs +10 -10
  131. package/dist/docs.d.mts +7 -7
  132. package/dist/docs.d.ts +7 -7
  133. package/dist/docs.mjs +9 -9
  134. package/dist/environment/vite.d.mts +1 -1
  135. package/dist/environment/vite.d.ts +1 -1
  136. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  137. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  138. package/dist/i18n/client.d.mts +2 -2
  139. package/dist/i18n/client.d.ts +2 -2
  140. package/dist/i18n/index.d.mts +3 -3
  141. package/dist/i18n/index.d.ts +3 -3
  142. package/dist/i18n/server.d.mts +5 -5
  143. package/dist/i18n/server.d.ts +5 -5
  144. package/dist/image/server.cjs +3 -3
  145. package/dist/image/server.mjs +2 -2
  146. package/dist/image/sharp.cjs +10 -10
  147. package/dist/image/sharp.mjs +2 -2
  148. package/dist/{index-CMigAr9f.d.mts → index-C-N3Pwg-.d.ts} +2 -2
  149. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  150. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  151. package/dist/{index-n3hjOvVC.d.ts → index-k8o8eUOd.d.mts} +2 -2
  152. package/dist/index.cjs +73 -66
  153. package/dist/index.d.mts +29 -45
  154. package/dist/index.d.ts +29 -45
  155. package/dist/index.mjs +78 -71
  156. package/dist/integrations.cjs +3 -3
  157. package/dist/integrations.d.mts +6 -6
  158. package/dist/integrations.d.ts +6 -6
  159. package/dist/integrations.mjs +2 -2
  160. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  161. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  162. package/dist/internal/build-runtime.cjs +36 -32
  163. package/dist/internal/build-runtime.d.mts +9 -9
  164. package/dist/internal/build-runtime.d.ts +9 -9
  165. package/dist/internal/build-runtime.mjs +35 -31
  166. package/dist/internal/cli-runtime.cjs +16 -15
  167. package/dist/internal/cli-runtime.mjs +16 -15
  168. package/dist/internal/client-error-overlay.cjs +4 -4
  169. package/dist/internal/client-error-overlay.mjs +1 -1
  170. package/dist/internal/client-runtime.cjs +19 -2
  171. package/dist/internal/client-runtime.d.mts +45 -3
  172. package/dist/internal/client-runtime.d.ts +45 -3
  173. package/dist/internal/client-runtime.mjs +19 -2
  174. package/dist/internal/compression-runtime.d.mts +6 -6
  175. package/dist/internal/compression-runtime.d.ts +6 -6
  176. package/dist/internal/config-runtime.cjs +17 -10
  177. package/dist/internal/config-runtime.d.mts +259 -18
  178. package/dist/internal/config-runtime.d.ts +259 -18
  179. package/dist/internal/config-runtime.mjs +15 -8
  180. package/dist/internal/desktop-guard.cjs +2 -2
  181. package/dist/internal/desktop-guard.d.mts +7 -0
  182. package/dist/internal/desktop-guard.d.ts +7 -0
  183. package/dist/internal/desktop-guard.mjs +1 -1
  184. package/dist/internal/form-actions.cjs +4 -4
  185. package/dist/internal/form-actions.mjs +3 -3
  186. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  187. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  188. package/dist/internal/islands-runtime.cjs +4 -1
  189. package/dist/internal/islands-runtime.d.mts +9 -12
  190. package/dist/internal/islands-runtime.d.ts +9 -12
  191. package/dist/internal/islands-runtime.mjs +5 -2
  192. package/dist/internal/metadata-image-runtime.cjs +3 -3
  193. package/dist/internal/metadata-image-runtime.mjs +2 -2
  194. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  195. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  196. package/dist/internal/production-runtime.cjs +13 -13
  197. package/dist/internal/production-runtime.d.mts +19 -19
  198. package/dist/internal/production-runtime.d.ts +19 -19
  199. package/dist/internal/production-runtime.mjs +15 -15
  200. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  201. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  202. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  203. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  204. package/dist/markdown.d.mts +6 -6
  205. package/dist/markdown.d.ts +6 -6
  206. package/dist/middleware.cjs +7 -7
  207. package/dist/middleware.d.mts +8 -8
  208. package/dist/middleware.d.ts +8 -8
  209. package/dist/middleware.mjs +6 -6
  210. package/dist/mobile.cjs +9 -0
  211. package/dist/mobile.d.mts +67 -0
  212. package/dist/mobile.d.ts +67 -0
  213. package/dist/mobile.mjs +9 -0
  214. package/dist/navigation-delegate-8xg3Zvp4.d.ts +29 -0
  215. package/dist/navigation-delegate-ji6elCKy.d.mts +29 -0
  216. package/dist/navigation.cjs +5 -5
  217. package/dist/navigation.d.mts +9 -9
  218. package/dist/navigation.d.ts +9 -9
  219. package/dist/navigation.mjs +4 -4
  220. package/dist/{nitro-UT2J5A5D.mjs → nitro-2Q5NVY7L.mjs} +2 -2
  221. package/dist/{nitro-BIXIKJZS.cjs → nitro-YPSZBYDK.cjs} +3 -3
  222. package/dist/platform.cjs +2 -1
  223. package/dist/platform.d.mts +4 -3
  224. package/dist/platform.d.ts +4 -3
  225. package/dist/platform.mjs +2 -1
  226. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  227. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  228. package/dist/plugin.cjs +31 -29
  229. package/dist/plugin.d.mts +13 -8
  230. package/dist/plugin.d.ts +13 -8
  231. package/dist/plugin.mjs +30 -28
  232. package/dist/{production-runtime-bWZJMcQb.d.mts → production-runtime-DXnQQkQf.d.mts} +3 -3
  233. package/dist/{production-runtime-YVDGYWBG.d.ts → production-runtime-TdKaYRj0.d.ts} +3 -3
  234. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  235. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  236. package/dist/{programmatic-routes-client-DviwGeAv.d.ts → programmatic-routes-client-BwiTndEC.d.ts} +2 -2
  237. package/dist/{programmatic-routes-client-BFKOTEXN.d.mts → programmatic-routes-client-Dh1SDLSM.d.mts} +2 -2
  238. package/dist/query/client.cjs +6 -6
  239. package/dist/query/client.mjs +2 -2
  240. package/dist/{render-plan-DqWXo3-B.d.ts → render-plan-BPbwRbuN.d.ts} +1 -1
  241. package/dist/{render-plan-CS8l0zaK.d.mts → render-plan-BvCGXF6K.d.mts} +1 -1
  242. package/dist/renderer-client.cjs +9 -6
  243. package/dist/renderer-client.d.mts +9 -8
  244. package/dist/renderer-client.d.ts +9 -8
  245. package/dist/renderer-client.mjs +6 -3
  246. package/dist/{request-CBrHpaCC.d.ts → request-B8PGTZNR.d.ts} +1 -1
  247. package/dist/{request-D4XqmnJF.d.mts → request-C_xTkJib.d.mts} +1 -1
  248. package/dist/request.d.mts +7 -7
  249. package/dist/request.d.ts +7 -7
  250. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  251. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  252. package/dist/{route-rendering-3pRPtyO2.d.mts → route-rendering-DlddURL1.d.mts} +1 -1
  253. package/dist/{route-rendering-Bltnu8a3.d.ts → route-rendering-RNtcj607.d.ts} +1 -1
  254. package/dist/{router-BFSmKGtI.d.mts → router-B97eB0Mq.d.mts} +1 -1
  255. package/dist/{router-DDT7bkg7.d.ts → router-qUVaoEN8.d.ts} +1 -1
  256. package/dist/routes-8PT9cl60.d.ts +121 -0
  257. package/dist/routes-kEUsXHx3.d.mts +121 -0
  258. package/dist/routes.d.mts +6 -6
  259. package/dist/routes.d.ts +6 -6
  260. package/dist/{rsc-pipeline-4KOITP64.cjs → rsc-pipeline-L4XOZ2TE.cjs} +13 -10
  261. package/dist/{rsc-pipeline-ULFIB3UT.mjs → rsc-pipeline-T3775JUA.mjs} +12 -9
  262. package/dist/runtime-BIBGJO7V.cjs +1005 -0
  263. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  264. package/dist/{runtime-C6yG64je.d.ts → runtime-C8GUnNeP.d.ts} +1 -1
  265. package/dist/{runtime-Cpylaypt.d.mts → runtime-CaDswfWi.d.mts} +1 -1
  266. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  267. package/dist/runtime-HRSFC4ZC.mjs +1005 -0
  268. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-LZ5NXGLN.mjs} +2 -2
  269. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-XV7GZ3QJ.cjs} +4 -4
  270. package/dist/server-action-security.cjs +3 -3
  271. package/dist/server-action-security.mjs +2 -2
  272. package/dist/server-fn-client.d.mts +0 -1
  273. package/dist/server-fn-client.d.ts +0 -1
  274. package/dist/server-fn.cjs +4 -4
  275. package/dist/server-fn.d.mts +0 -1
  276. package/dist/server-fn.d.ts +0 -1
  277. package/dist/server-fn.mjs +3 -3
  278. package/dist/server-plugins.cjs +1 -1
  279. package/dist/server-plugins.d.mts +7 -7
  280. package/dist/server-plugins.d.ts +7 -7
  281. package/dist/server-plugins.mjs +1 -1
  282. package/dist/server-query-client.d.mts +0 -1
  283. package/dist/server-query-client.d.ts +0 -1
  284. package/dist/server-query.cjs +5 -5
  285. package/dist/server-query.d.mts +0 -1
  286. package/dist/server-query.d.ts +0 -1
  287. package/dist/server-query.mjs +4 -4
  288. package/dist/server.cjs +89 -66
  289. package/dist/server.d.mts +22 -17
  290. package/dist/server.d.ts +22 -17
  291. package/dist/server.mjs +64 -41
  292. package/dist/{spa-router-CkTPnA4L.d.mts → spa-router-Dlv5ofg0.d.mts} +4 -4
  293. package/dist/{spa-router-CKuS81mi.d.ts → spa-router-qapSboKz.d.ts} +4 -4
  294. package/dist/testing.cjs +7 -7
  295. package/dist/testing.d.mts +6 -6
  296. package/dist/testing.d.ts +6 -6
  297. package/dist/testing.mjs +5 -5
  298. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  299. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  300. package/dist/{utils-C0ORLYXc.d.ts → utils-A-cYF81u.d.ts} +1 -1
  301. package/dist/{utils-IA9wVkef.d.mts → utils-DyvlSxFk.d.mts} +1 -1
  302. package/dist/version.cjs +2 -2
  303. package/dist/version.mjs +1 -1
  304. package/dist/vite.cjs +31 -29
  305. package/dist/vite.d.mts +9 -9
  306. package/dist/vite.d.ts +9 -9
  307. package/dist/vite.mjs +30 -28
  308. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  309. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  310. package/dist/workflows.cjs +3 -3
  311. package/dist/workflows.d.mts +1 -1
  312. package/dist/workflows.d.ts +1 -1
  313. package/dist/workflows.mjs +2 -2
  314. package/package.json +10 -2
  315. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  316. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  317. package/dist/chunk-45EUIICW.mjs +0 -15
  318. package/dist/chunk-V7KTQR4C.cjs +0 -15
  319. package/dist/{chunk-BR5FSKZ5.cjs → chunk-EQWWOQTK.cjs} +0 -0
  320. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  321. package/dist/{chunk-VR4SEDEM.mjs → chunk-VOZ5DI7D.mjs} +0 -0
  322. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -4,14 +4,14 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkEVCQX243cjs = require('./chunk-EVCQX243.cjs');
7
+ var _chunkX2EL3BLHcjs = require('./chunk-X2EL3BLH.cjs');
8
8
 
9
9
 
10
10
 
11
11
  var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
12
12
 
13
13
 
14
- var _chunkKZT2VHRQcjs = require('./chunk-KZT2VHRQ.cjs');
14
+ var _chunkLYWAGXXWcjs = require('./chunk-LYWAGXXW.cjs');
15
15
 
16
16
 
17
17
 
@@ -26,7 +26,7 @@ function hasFarmDocsRuntimeAdapter(docs) {
26
26
  }
27
27
  function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded) {
28
28
  if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
29
- const guarded = _chunkEVCQX243cjs.discoverFarmDocsPages.call(void 0, _chunkEVCQX243cjs.resolveFarmDocsContentDir.call(void 0, docs, options), docs).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunkEVCQX243cjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
29
+ const guarded = _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, options), docs).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunkX2EL3BLHcjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
30
30
  if (guarded.length === 0) return;
31
31
  throw new Error(
32
32
  `Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
@@ -44,7 +44,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
44
44
  ...moduleConfig ? { ...moduleConfig, ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
45
45
  entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
46
46
  docsPath: docs.entry,
47
- contentDir: _chunkEVCQX243cjs.resolveFarmDocsContentDir.call(void 0, docs, options)
47
+ contentDir: _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
48
48
  };
49
49
  }
50
50
  function getFarmDocsAdapterStylesheets(options) {
@@ -260,22 +260,22 @@ function getDocsDescription(docs) {
260
260
  return _optionalChain([docs, 'access', _11 => _11.config, 'access', _12 => _12.metadata, 'optionalAccess', _13 => _13.description]);
261
261
  }
262
262
  function getLoadedDocsPages(context) {
263
- return _chunkEVCQX243cjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunkEVCQX243cjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
263
+ return _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunkX2EL3BLHcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
264
264
  }
265
265
  function toDocsSourcePage(page) {
266
266
  return {
267
- ..._chunkEVCQX243cjs.toFarmDocsMarkdownPage.call(void 0, page),
267
+ ..._chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page),
268
268
  sourcePath: page.sourcePath
269
269
  };
270
270
  }
271
271
  function toDocsSitemapPage(page) {
272
272
  return {
273
- ..._chunkEVCQX243cjs.toFarmDocsMarkdownPage.call(void 0, page),
273
+ ..._chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page),
274
274
  sourcePath: page.sourcePath
275
275
  };
276
276
  }
277
277
  function toDocsLlmsPage(page) {
278
- return _chunkEVCQX243cjs.toFarmDocsMarkdownPage.call(void 0, page);
278
+ return _chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page);
279
279
  }
280
280
  function getDocsLlmsOptions(context, request) {
281
281
  const configured = isRecord(context.docs.config.llmsTxt) ? context.docs.config.llmsTxt : {};
@@ -362,7 +362,7 @@ function renderAgentsDocument(context, request) {
362
362
  function buildAgentSpec(context, request) {
363
363
  const url = new URL(request.url);
364
364
  const origin = url.origin;
365
- const pages = _chunkEVCQX243cjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
365
+ const pages = _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
366
366
  (page) => !context.isPathGuarded(page.href)
367
367
  );
368
368
  const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
@@ -450,7 +450,7 @@ function buildPublicConfig(context) {
450
450
  };
451
451
  }
452
452
  function buildDiagnostics(context) {
453
- const pages = _chunkEVCQX243cjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
453
+ const pages = _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
454
454
  const diagnostics = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
455
455
  entry: context.docs.entry,
456
456
  mcp: {
@@ -520,13 +520,13 @@ async function resolveAPIContext(options) {
520
520
  config: options.config,
521
521
  configPath: options.configPath
522
522
  }));
523
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkKZT2VHRQcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
523
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkLYWAGXXWcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
524
524
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _20 => _20.guardedPaths]), () => ( [])));
525
525
  return {
526
526
  root,
527
527
  srcDir,
528
528
  docs,
529
- contentDir: _chunkEVCQX243cjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
529
+ contentDir: _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
530
530
  diagnostics: options.diagnostics === true,
531
531
  isPathGuarded: _nullishCoalesce(options.isPathGuarded, () => ( ((pathname) => guardedPaths.has(pathname))))
532
532
  };
@@ -585,12 +585,12 @@ async function handleDocsAPIGet(request, context) {
585
585
  if (format === "markdown" || url.pathname.endsWith(".md")) {
586
586
  const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
587
587
  const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
588
- const page = _chunkEVCQX243cjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
588
+ const page = _chunkX2EL3BLHcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
589
589
  if (!page || context.isPathGuarded(page.href)) {
590
590
  return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
591
591
  }
592
592
  return text(
593
- _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkEVCQX243cjs.toFarmDocsMarkdownPage.call(void 0, page), {
593
+ _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page), {
594
594
  origin: new URL(request.url).origin,
595
595
  llms: getDocsLlmsOptions(context, request),
596
596
  sitemap: context.docs.config.sitemap
@@ -15,7 +15,7 @@ import {
15
15
  createFarmRequestBodyErrorResponse,
16
16
  readFarmRequestBody,
17
17
  resolveFarmServerConfig
18
- } from "./chunk-C6U66WWF.mjs";
18
+ } from "./chunk-GFT5AHAT.mjs";
19
19
  import {
20
20
  validateConfigRouteSource
21
21
  } from "./chunk-ONG4RDW3.mjs";
@@ -6,7 +6,7 @@
6
6
  var _chunkFEFCISOXcjs = require('./chunk-FEFCISOX.cjs');
7
7
 
8
8
 
9
- var _chunk5566GNEGcjs = require('./chunk-5566GNEG.cjs');
9
+ var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
10
10
 
11
11
 
12
12
 
@@ -94,7 +94,7 @@ function resolveServerActionsConfig(config) {
94
94
  const allowedOrigins = (_nullishCoalesce(_optionalChain([config, 'optionalAccess', _ => _.allowedOrigins]), () => ( []))).map(
95
95
  (value) => _chunkFEFCISOXcjs.normalizeAllowedOriginPattern.call(void 0, value, SERVER_ACTION_ALLOWED_ORIGINS_LABEL)
96
96
  );
97
- const bodySizeLimit = _chunk5566GNEGcjs.parseBodySizeLimit.call(void 0,
97
+ const bodySizeLimit = _chunkLIFUPCXWcjs.parseBodySizeLimit.call(void 0,
98
98
  _nullishCoalesce(_optionalChain([config, 'optionalAccess', _2 => _2.bodySizeLimit]), () => ( DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT)),
99
99
  "serverActions.bodySizeLimit"
100
100
  );
@@ -1,3 +1,24 @@
1
+ import {
2
+ resolveFarmPlatform
3
+ } from "./chunk-SMUW7UST.mjs";
4
+
5
+ // src/desktop/dev-guard-plugin.ts
6
+ function farmDesktopDevGuardPlugin(basePath) {
7
+ return {
8
+ name: "farm:desktop-dev-guard",
9
+ enforce: "pre",
10
+ apply: "serve",
11
+ configureServer: {
12
+ order: "pre",
13
+ async handler(server) {
14
+ if (resolveFarmPlatform() !== "desktop") return;
15
+ const { createFarmDesktopDevGuard } = await import("./dev-guard-4PFQNXQX.mjs");
16
+ server.middlewares.use(createFarmDesktopDevGuard(server, { basePath: basePath || "" }));
17
+ }
18
+ }
19
+ };
20
+ }
21
+
1
22
  // src/react-refresh.ts
2
23
  import { createRequire } from "module";
3
24
  import { pathToFileURL } from "url";
@@ -81,6 +102,7 @@ async function createFarmReactRefreshPlugins() {
81
102
  }
82
103
 
83
104
  export {
105
+ farmDesktopDevGuardPlugin,
84
106
  isFarmReactRefreshActive,
85
107
  loadFarmReactPlugin,
86
108
  createFarmReactRefreshPlugins
@@ -4,14 +4,14 @@ import {
4
4
  loadFarmDocsPage,
5
5
  resolveFarmDocsContentDir,
6
6
  toFarmDocsMarkdownPage
7
- } from "./chunk-GXSMF7UR.mjs";
7
+ } from "./chunk-KO2NWUKN.mjs";
8
8
  import {
9
9
  docsEngine,
10
10
  loadFarmDocsEngine
11
11
  } from "./chunk-VE3FWJBO.mjs";
12
12
  import {
13
13
  resolveDocsConfig
14
- } from "./chunk-VJXLUTBM.mjs";
14
+ } from "./chunk-2DEPNLXK.mjs";
15
15
  import {
16
16
  getFarmDocsAdapterConfigModule,
17
17
  isSecretDocsConfigKey
@@ -4,13 +4,13 @@ import {
4
4
  _runServerFunctionForCaller,
5
5
  createServerFn,
6
6
  createServerFunctionDescriptor
7
- } from "./chunk-UYQOIPXE.mjs";
7
+ } from "./chunk-CPXDDWGL.mjs";
8
8
  import {
9
9
  createFarmServerQueryResult
10
10
  } from "./chunk-N7XWC6BN.mjs";
11
11
  import {
12
12
  getServerActionExecutionContext
13
- } from "./chunk-JOHXK4BB.mjs";
13
+ } from "./chunk-BW6SCVYX.mjs";
14
14
  import {
15
15
  createRouteDataCacheTag,
16
16
  getFarmDataCache
@@ -56,8 +56,8 @@ function createFarmDesktopGuard(options) {
56
56
  if (options.secret === options.handshakeToken) {
57
57
  throw new TypeError("[Farm] The desktop secret and handshake token must be different values.");
58
58
  }
59
- const { secret } = options;
60
- let handshakeToken = options.handshakeToken;
59
+ const { secret, handshakeToken } = options;
60
+ const handshakeState = options.handshakeState ?? {};
61
61
  const basePath = normalizeBasePath(options.basePath);
62
62
  const handshakePath = `${basePath}${FARM_DESKTOP_HANDSHAKE_PATH}`;
63
63
  const home = `${basePath}/`;
@@ -81,10 +81,10 @@ function createFarmDesktopGuard(options) {
81
81
  if (pathname === handshakePath) {
82
82
  if (method !== "GET") return forbidden("handshake must be a GET");
83
83
  const token = new URLSearchParams(search).get(FARM_DESKTOP_HANDSHAKE_PARAM) ?? "";
84
- if (handshakeToken === void 0 || !farmSecretsMatch(token, handshakeToken)) {
84
+ if (handshakeState.handshakeUsed || !farmSecretsMatch(token, handshakeToken)) {
85
85
  return forbidden("invalid or used handshake token");
86
86
  }
87
- handshakeToken = void 0;
87
+ handshakeState.handshakeUsed = true;
88
88
  return new Response(null, {
89
89
  status: 303,
90
90
  headers: {
@@ -3,7 +3,7 @@
3
3
  var _chunkUNJZGVPUcjs = require('./chunk-UNJZGVPU.cjs');
4
4
 
5
5
 
6
- var _chunk5566GNEGcjs = require('./chunk-5566GNEG.cjs');
6
+ var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
7
7
 
8
8
  // src/image-pattern.ts
9
9
  var compiledPatterns = /* @__PURE__ */ new WeakMap();
@@ -582,7 +582,7 @@ function createOptimizedImageResponse(request, image) {
582
582
  // document, it still cannot run script or load anything.
583
583
  "content-security-policy": "default-src 'none'; sandbox"
584
584
  });
585
- if (_chunk5566GNEGcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), image.etag)) {
585
+ if (_chunkLIFUPCXWcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), image.etag)) {
586
586
  headers.delete("content-length");
587
587
  return new Response(null, { status: 304, headers });
588
588
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BRYPZIMB.mjs";
4
4
  import {
5
5
  matchesFarmIfNoneMatch
6
- } from "./chunk-C6U66WWF.mjs";
6
+ } from "./chunk-GFT5AHAT.mjs";
7
7
 
8
8
  // src/image-pattern.ts
9
9
  var compiledPatterns = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,13 @@
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/desktop/config.ts
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
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkYKHRCY4Tcjs = require('./chunk-YKHRCY4T.cjs');
9
+
10
+ // src/desktop/config.ts
2
11
  var _fs = require('fs');
3
12
  var _path = require('path'); var path = _interopRequireWildcard(_path);
4
13
  var FARM_PLATFORM_ENV = "FARM_PLATFORM";
@@ -9,33 +18,18 @@ function setFarmDesktopDevSession(session) {
9
18
  else delete store[FARM_DESKTOP_DEV_SESSION];
10
19
  }
11
20
  function resolveFarmPlatform(env = process.env) {
12
- return env[FARM_PLATFORM_ENV] === "desktop" ? "desktop" : "web";
21
+ const value = env[FARM_PLATFORM_ENV];
22
+ return value === "desktop" || value === "mobile" ? value : "web";
13
23
  }
14
24
  var DESKTOP_KEYS = /* @__PURE__ */ new Set(["name", "id", "version", "icon", "window", "shell"]);
15
25
  var WINDOW_KEYS = /* @__PURE__ */ new Set(["width", "height", "title"]);
16
26
  var APP_ID = /^[A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9][A-Za-z0-9-]*)+$/;
17
27
  var SHELL_NAME = /^[a-z][a-z0-9-]*$/;
18
28
  var SHELL_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/;
19
- var failPrefix = "desktop";
20
- function fail(message) {
21
- throw new TypeError(`${failPrefix}: ${message}`);
22
- }
23
- function isPlainObject(value) {
24
- return !!value && typeof value === "object" && !Array.isArray(value);
29
+ function desktopChecker(context) {
30
+ return _chunkYKHRCY4Tcjs.createPlatformBlockChecker.call(void 0, context ? `desktop (os: ${context.os})` : "desktop");
25
31
  }
26
- function checkKeys(value, allowed, where) {
27
- for (const key of Object.keys(value)) {
28
- if (!allowed.has(key)) {
29
- fail(`unknown option ${where}${key}. Supported: ${[...allowed].join(", ")}.`);
30
- }
31
- }
32
- }
33
- function optionalString(value, key) {
34
- if (value === void 0) return void 0;
35
- if (typeof value !== "string" || !value.trim()) fail(`${key} must be a non-empty string.`);
36
- return value.trim();
37
- }
38
- function optionalSize(value, key) {
32
+ function optionalSize({ fail }, value, key) {
39
33
  if (value === void 0) return void 0;
40
34
  if (typeof value !== "number" || !Number.isInteger(value) || value < 100 || value > 16384) {
41
35
  fail(`${key} must be a whole number of points between 100 and 16384.`);
@@ -43,9 +37,13 @@ function optionalSize(value, key) {
43
37
  return value;
44
38
  }
45
39
  function validateFarmDesktopConfig(input, context) {
46
- failPrefix = context ? `desktop (os: ${context.os})` : "desktop";
40
+ const check = desktopChecker(context);
41
+ const { checkKeys, optionalString } = check;
42
+ function fail(message) {
43
+ return check.fail(message);
44
+ }
47
45
  if (input === void 0) return void 0;
48
- if (!isPlainObject(input)) {
46
+ if (!_chunkYKHRCY4Tcjs.isPlainObject.call(void 0, input)) {
49
47
  fail(
50
48
  context ? 'the function must return an object, such as { name: "Notes" }.' : 'must be an object, such as { name: "Notes" }, or a function that returns one.'
51
49
  );
@@ -62,10 +60,10 @@ function validateFarmDesktopConfig(input, context) {
62
60
  fail(`icon must be a PNG file, such as "src/app-icon.png", got "${icon}".`);
63
61
  }
64
62
  if (input.window !== void 0) {
65
- if (!isPlainObject(input.window)) fail("window must be an object, such as { width: 1024 }.");
63
+ if (!_chunkYKHRCY4Tcjs.isPlainObject.call(void 0, input.window)) fail("window must be an object, such as { width: 1024 }.");
66
64
  checkKeys(input.window, WINDOW_KEYS, "window.");
67
- optionalSize(input.window.width, "window.width");
68
- optionalSize(input.window.height, "window.height");
65
+ optionalSize(check, input.window.width, "window.width");
66
+ optionalSize(check, input.window.height, "window.height");
69
67
  optionalString(input.window.title, "window.title");
70
68
  }
71
69
  const shell = optionalString(input.shell, "shell");
@@ -77,14 +75,6 @@ function validateFarmDesktopConfig(input, context) {
77
75
  }
78
76
  return input;
79
77
  }
80
- function readPackageJson(root) {
81
- try {
82
- const parsed = JSON.parse(_fs.readFileSync.call(void 0, path.join(root, "package.json"), "utf8"));
83
- return isPlainObject(parsed) ? parsed : {};
84
- } catch (e) {
85
- return {};
86
- }
87
- }
88
78
  function slug(value) {
89
79
  return value.replace(/^@[^/]+\//, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "app";
90
80
  }
@@ -93,12 +83,13 @@ function resolveFarmDesktopShellPackage(shell) {
93
83
  }
94
84
  function resolveFarmDesktopConfig(input, root, context) {
95
85
  const config = _nullishCoalesce(validateFarmDesktopConfig(input, context), () => ( {}));
96
- const pkg = readPackageJson(root);
97
- const packageName = typeof pkg.productName === "string" && pkg.productName.trim() || typeof pkg.name === "string" && pkg.name.replace(/^@[^/]+\//, "").trim() || path.basename(root);
86
+ const pkg = _chunkYKHRCY4Tcjs.readAppPackageJson.call(void 0, root);
87
+ const packageName = _chunkYKHRCY4Tcjs.resolveAppPackageName.call(void 0, root, pkg);
98
88
  const name = _optionalChain([config, 'access', _ => _.name, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]) || packageName || "Farm App";
99
89
  const shell = _optionalChain([config, 'access', _4 => _4.shell, 'optionalAccess', _5 => _5.trim, 'call', _6 => _6()]) || "electrobun";
100
90
  const icon = config.icon ? path.resolve(root, config.icon.trim()) : void 0;
101
- if (icon && !_fs.existsSync.call(void 0, icon)) fail(`icon ${config.icon} was not found in ${root}.`);
91
+ if (icon && !_fs.existsSync.call(void 0, icon))
92
+ desktopChecker(context).fail(`icon ${config.icon} was not found in ${root}.`);
102
93
  return {
103
94
  name,
104
95
  id: _optionalChain([config, 'access', _7 => _7.id, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) || `local.farm.${slug(name)}`,
@@ -132,10 +123,7 @@ function createFarmDesktopContext(options) {
132
123
  if (!DESKTOP_OS.has(os)) {
133
124
  throw new TypeError(`--os must be macos, windows, or linux, got "${os}".`);
134
125
  }
135
- const profile = _nullishCoalesce(options.profile, () => ( "production"));
136
- if (typeof profile !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(profile)) {
137
- throw new TypeError(`--profile must be a name such as "beta", got "${String(profile)}".`);
138
- }
126
+ const profile = _chunkYKHRCY4Tcjs.resolvePlatformProfile.call(void 0, options.profile);
139
127
  return Object.freeze({
140
128
  os,
141
129
  mode: options.mode,
@@ -146,26 +134,12 @@ function createFarmDesktopContext(options) {
146
134
  });
147
135
  }
148
136
  async function resolveFarmDesktopBlock(input, context, cache) {
149
- if (typeof input !== "function") {
150
- return _nullishCoalesce(validateFarmDesktopConfig(input, context), () => ( {}));
151
- }
152
- const call = () => Promise.resolve().then(() => input(context)).then((value) => _nullishCoalesce(validateFarmDesktopConfig(value, context), () => ( {})));
153
- if (!cache) return call();
154
- const key = [
155
- context.os,
156
- context.mode,
157
- context.command,
158
- context.profile,
159
- context.root,
160
- String(input)
161
- ].join("\0");
162
- let resolved = cache.get(key);
163
- if (!resolved) {
164
- resolved = call();
165
- cache.set(key, resolved);
166
- resolved.catch(() => cache.delete(key));
167
- }
168
- return resolved;
137
+ return _chunkYKHRCY4Tcjs.resolvePlatformBlock.call(void 0,
138
+ input,
139
+ context,
140
+ (value, ctx) => _nullishCoalesce(validateFarmDesktopConfig(value, ctx), () => ( {})),
141
+ cache
142
+ );
169
143
  }
170
144
  var FARM_DESKTOP_SETUP = /* @__PURE__ */ Symbol.for("@farm.js/core/desktop-setup");
171
145
  async function createFarmDesktopSetup(userConfig, root, mode, options, cache) {