@farm.js/core 0.1.0-beta.95 → 0.1.0-beta.97

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 (317) hide show
  1. package/dist/after.cjs +1 -1
  2. package/dist/after.mjs +1 -1
  3. package/dist/agent-runtime.d.mts +3 -2
  4. package/dist/agent-runtime.d.ts +3 -2
  5. package/dist/api/route-manager.cjs +43 -4
  6. package/dist/api/route-manager.d.mts +4 -3
  7. package/dist/api/route-manager.d.ts +4 -3
  8. package/dist/api/route-manager.mjs +7 -7
  9. package/dist/api/runtime.cjs +43 -4
  10. package/dist/api/runtime.d.mts +1 -1
  11. package/dist/api/runtime.d.ts +1 -1
  12. package/dist/api/runtime.mjs +5 -5
  13. package/dist/api.cjs +352 -109
  14. package/dist/api.d.mts +7 -6
  15. package/dist/api.d.ts +7 -6
  16. package/dist/api.mjs +19 -12
  17. package/dist/{app-CIIEvA4r.d.ts → app-CIOx3LvY.d.ts} +4 -4
  18. package/dist/{app-O4AEC1OH.d.mts → app-DBd6437H.d.mts} +4 -4
  19. package/dist/app-markdown.d.mts +4 -3
  20. package/dist/app-markdown.d.ts +4 -3
  21. package/dist/cache.cjs +42 -4
  22. package/dist/cache.d.mts +68 -1
  23. package/dist/cache.d.ts +68 -1
  24. package/dist/cache.mjs +3 -3
  25. package/dist/{chunk-AXVJCMVF.mjs → chunk-2HDOV47R.mjs} +3 -3
  26. package/dist/chunk-2HDOV47R.mjs.map +1 -0
  27. package/dist/{chunk-RBRLLZL5.mjs → chunk-34IAPZBG.mjs} +16 -3
  28. package/dist/chunk-34IAPZBG.mjs.map +1 -0
  29. package/dist/{chunk-VV24CC42.mjs → chunk-35NPLKQJ.mjs} +2 -2
  30. package/dist/{chunk-D7QH7MDU.mjs → chunk-3TWQERDE.mjs} +5 -4
  31. package/dist/chunk-3TWQERDE.mjs.map +1 -0
  32. package/dist/{chunk-RWYRFCLG.mjs → chunk-4X57GXQA.mjs} +2 -2
  33. package/dist/{chunk-KOTSX5JH.mjs → chunk-52BR7LTX.mjs} +30 -21
  34. package/dist/chunk-52BR7LTX.mjs.map +1 -0
  35. package/dist/{chunk-SALMKQXH.mjs → chunk-6EJHNHH4.mjs} +80 -27
  36. package/dist/chunk-6EJHNHH4.mjs.map +1 -0
  37. package/dist/{chunk-ZFNK77WN.mjs → chunk-6JNGOC37.mjs} +2 -2
  38. package/dist/{after.cjs.map → chunk-6JNGOC37.mjs.map} +1 -1
  39. package/dist/{chunk-MOW47IF5.mjs → chunk-6UYVU46O.mjs} +2 -2
  40. package/dist/{chunk-7MABZJIM.mjs → chunk-7PYVLJ4J.mjs} +1 -1
  41. package/dist/chunk-7PYVLJ4J.mjs.map +1 -0
  42. package/dist/{chunk-FLHLPB57.mjs → chunk-D7F7YZ7L.mjs} +93 -67
  43. package/dist/chunk-D7F7YZ7L.mjs.map +1 -0
  44. package/dist/chunk-DU3PKDVQ.mjs +35 -0
  45. package/dist/chunk-DU3PKDVQ.mjs.map +1 -0
  46. package/dist/{chunk-SCFX4UTD.mjs → chunk-EHTUKVSW.mjs} +1 -1
  47. package/dist/chunk-EHTUKVSW.mjs.map +1 -0
  48. package/dist/{chunk-KWCNQUH5.mjs → chunk-EPDIF432.mjs} +526 -50
  49. package/dist/chunk-EPDIF432.mjs.map +1 -0
  50. package/dist/{chunk-A3636IHN.mjs → chunk-FP5Q67FO.mjs} +167 -96
  51. package/dist/chunk-FP5Q67FO.mjs.map +1 -0
  52. package/dist/{chunk-HHZAOTQD.mjs → chunk-GJ7W6LNK.mjs} +7 -6
  53. package/dist/chunk-GJ7W6LNK.mjs.map +1 -0
  54. package/dist/{chunk-RLGUZ3HS.mjs → chunk-I3OOUWO5.mjs} +3 -3
  55. package/dist/{chunk-75CGAL6E.mjs → chunk-IZBX2TEU.mjs} +217 -105
  56. package/dist/chunk-IZBX2TEU.mjs.map +1 -0
  57. package/dist/{chunk-22VG4DFJ.mjs → chunk-J3MPQ4MQ.mjs} +2 -2
  58. package/dist/{chunk-22VG4DFJ.mjs.map → chunk-J3MPQ4MQ.mjs.map} +1 -1
  59. package/dist/{chunk-2LS3KKE7.mjs → chunk-JV7JUD7Q.mjs} +4 -4
  60. package/dist/{chunk-Q3OX763A.mjs → chunk-LXDASSTE.mjs} +2 -2
  61. package/dist/{chunk-ZRBCBOEX.mjs → chunk-N2FY2QZ7.mjs} +28 -3
  62. package/dist/chunk-N2FY2QZ7.mjs.map +1 -0
  63. package/dist/{chunk-MRVJCLYQ.mjs → chunk-PSQ7N4XP.mjs} +4 -2
  64. package/dist/chunk-PSQ7N4XP.mjs.map +1 -0
  65. package/dist/{chunk-HVG3HLQZ.mjs → chunk-Q7WGOOAI.mjs} +3 -3
  66. package/dist/{chunk-WTYAPO5I.mjs → chunk-RCNWMEBT.mjs} +3 -2
  67. package/dist/{chunk-WTYAPO5I.mjs.map → chunk-RCNWMEBT.mjs.map} +1 -1
  68. package/dist/{chunk-3INDBMUU.mjs → chunk-TGDIACZT.mjs} +2 -2
  69. package/dist/{chunk-WB75GIX2.mjs → chunk-TQTB33JS.mjs} +14 -3
  70. package/dist/chunk-TQTB33JS.mjs.map +1 -0
  71. package/dist/{chunk-MH27UH72.mjs → chunk-TT3E2JOF.mjs} +3 -3
  72. package/dist/{chunk-UWRGX3J3.mjs → chunk-UMUWR5XA.mjs} +2 -2
  73. package/dist/{chunk-XTLLHCWU.mjs → chunk-V4VRLVLW.mjs} +52 -31
  74. package/dist/chunk-V4VRLVLW.mjs.map +1 -0
  75. package/dist/{chunk-EXCGBERG.mjs → chunk-WD2EBM3I.mjs} +79 -17
  76. package/dist/chunk-WD2EBM3I.mjs.map +1 -0
  77. package/dist/{chunk-DLBUAJTK.mjs → chunk-WMJGA32P.mjs} +74 -5
  78. package/dist/chunk-WMJGA32P.mjs.map +1 -0
  79. package/dist/{chunk-TKQCJMY7.mjs → chunk-X4SFHKFH.mjs} +7 -4
  80. package/dist/{chunk-TKQCJMY7.mjs.map → chunk-X4SFHKFH.mjs.map} +1 -1
  81. package/dist/{chunk-Q7GPJZCO.mjs → chunk-YIBV77KZ.mjs} +26 -7
  82. package/dist/chunk-YIBV77KZ.mjs.map +1 -0
  83. package/dist/client/lifecycle.mjs +2 -2
  84. package/dist/{client-mcMC334J.d.mts → client-DWoLZ3QU.d.mts} +52 -5
  85. package/dist/{client-d5ONQ-Pd.d.ts → client-DuQuQC1h.d.ts} +52 -5
  86. package/dist/client-cache-BMxuFqwH.d.ts +18 -0
  87. package/dist/client-cache-CCK-fCe0.d.mts +18 -0
  88. package/dist/{client-plugins-BvClItiL.d.mts → client-plugins-B6-07YmP.d.mts} +52 -99
  89. package/dist/{client-plugins-B9Sq-iMg.d.ts → client-plugins-By6MVUX-.d.ts} +52 -99
  90. package/dist/client-plugins.cjs +1 -1
  91. package/dist/client-plugins.d.mts +3 -2
  92. package/dist/client-plugins.d.ts +3 -2
  93. package/dist/client-plugins.mjs +2 -2
  94. package/dist/client.cjs +1046 -211
  95. package/dist/client.d.mts +136 -18
  96. package/dist/client.d.ts +136 -18
  97. package/dist/client.mjs +32 -15
  98. package/dist/config.d.mts +3 -2
  99. package/dist/config.d.ts +3 -2
  100. package/dist/{devtools-S52RRRMN.mjs → devtools-XWZX6CCL.mjs} +5 -5
  101. package/dist/{devtools-client-3XRTBND5.mjs → devtools-client-Z7QQA3Q2.mjs} +56 -17
  102. package/dist/devtools-client-Z7QQA3Q2.mjs.map +1 -0
  103. package/dist/{devtools-ui-NJKFORTG.mjs → devtools-ui-2HG5M4EL.mjs} +3 -1
  104. package/dist/devtools-ui-2HG5M4EL.mjs.map +1 -0
  105. package/dist/docs.cjs +24 -5
  106. package/dist/docs.mjs +5 -5
  107. package/dist/i18n/server.cjs +13 -2
  108. package/dist/i18n/server.d.mts +2 -2
  109. package/dist/i18n/server.d.ts +2 -2
  110. package/dist/i18n/server.mjs +1 -1
  111. package/dist/index.cjs +1928 -894
  112. package/dist/index.d.mts +139 -21
  113. package/dist/index.d.ts +139 -21
  114. package/dist/index.mjs +57 -34
  115. package/dist/index.mjs.map +1 -1
  116. package/dist/integration-api-BT024nuJ.d.mts +97 -0
  117. package/dist/integration-api-BT024nuJ.d.ts +97 -0
  118. package/dist/integrations.d.mts +3 -2
  119. package/dist/integrations.d.ts +3 -2
  120. package/dist/internal/build-runtime.cjs +764 -547
  121. package/dist/internal/build-runtime.d.mts +5 -4
  122. package/dist/internal/build-runtime.d.ts +5 -4
  123. package/dist/internal/build-runtime.mjs +16 -16
  124. package/dist/internal/client-runtime.cjs +1 -1
  125. package/dist/internal/client-runtime.mjs +2 -2
  126. package/dist/internal/config-runtime.cjs +4 -1
  127. package/dist/internal/config-runtime.d.mts +4 -3
  128. package/dist/internal/config-runtime.d.ts +4 -3
  129. package/dist/internal/config-runtime.mjs +4 -4
  130. package/dist/internal/product-telemetry-runtime.cjs +1 -1
  131. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  132. package/dist/internal/production-runtime.cjs +29 -3
  133. package/dist/internal/production-runtime.d.mts +8 -7
  134. package/dist/internal/production-runtime.d.ts +8 -7
  135. package/dist/internal/production-runtime.mjs +5 -5
  136. package/dist/{metadata-route-yV4U6X8h.d.ts → metadata-route-8_V3UonT.d.ts} +1 -1
  137. package/dist/{metadata-route-p4K1l92V.d.mts → metadata-route-CWP_HjGU.d.mts} +1 -1
  138. package/dist/middleware.cjs +28 -2
  139. package/dist/middleware.d.mts +5 -4
  140. package/dist/middleware.d.ts +5 -4
  141. package/dist/middleware.mjs +4 -4
  142. package/dist/navigation.cjs +3 -1
  143. package/dist/navigation.mjs +3 -3
  144. package/dist/observability.cjs +27 -2
  145. package/dist/observability.mjs +1 -1
  146. package/dist/plugin.cjs +528 -349
  147. package/dist/plugin.d.mts +3 -2
  148. package/dist/plugin.d.ts +3 -2
  149. package/dist/plugin.mjs +13 -13
  150. package/dist/{production-runtime-IkB0Qj4i.d.mts → production-runtime-BGRH1dKG.d.mts} +1 -1
  151. package/dist/{production-runtime-0JTch4_d.d.ts → production-runtime-CdmzsDax.d.ts} +1 -1
  152. package/dist/query/client.cjs +68 -29
  153. package/dist/query/client.mjs +69 -30
  154. package/dist/query/client.mjs.map +1 -1
  155. package/dist/{render-plan-Dc8CjNI7.d.ts → render-plan-0GeHiGVZ.d.ts} +1 -1
  156. package/dist/{render-plan-CU31j-Jk.d.mts → render-plan-DLxJYAA5.d.mts} +1 -1
  157. package/dist/renderer-client.cjs +169 -26
  158. package/dist/renderer-client.d.mts +7 -6
  159. package/dist/renderer-client.d.ts +7 -6
  160. package/dist/renderer-client.mjs +16 -19
  161. package/dist/renderer-client.mjs.map +1 -1
  162. package/dist/{request-BXa1KY8i.d.mts → request-BCNXSXLh.d.mts} +1 -1
  163. package/dist/{request-CUUBujZt.d.ts → request-BstWbZ6O.d.ts} +1 -1
  164. package/dist/request.d.mts +4 -3
  165. package/dist/request.d.ts +4 -3
  166. package/dist/{route-Y8lfz1wF.d.ts → route-4pd-EVtw.d.ts} +45 -50
  167. package/dist/{route-Cq3aObmj.d.mts → route-CvEr4Uc9.d.mts} +45 -50
  168. package/dist/routes.cjs +27 -2
  169. package/dist/routes.d.mts +3 -2
  170. package/dist/routes.d.ts +3 -2
  171. package/dist/routes.mjs +4 -4
  172. package/dist/{runtime-j1S3sDTh.d.ts → runtime-BgDQzBiu.d.ts} +1 -0
  173. package/dist/{runtime-DDwvDtS4.d.mts → runtime-CV2UCV-5.d.mts} +1 -0
  174. package/dist/server-action-security.mjs +2 -2
  175. package/dist/server-fn-client.cjs +102 -26
  176. package/dist/server-fn-client.d.mts +6 -0
  177. package/dist/server-fn-client.d.ts +6 -0
  178. package/dist/server-fn-client.mjs +2 -1
  179. package/dist/server-fn.cjs +42 -4
  180. package/dist/server-fn.mjs +5 -5
  181. package/dist/server-plugins.d.mts +4 -3
  182. package/dist/server-plugins.d.ts +4 -3
  183. package/dist/server-query-client.cjs +195 -34
  184. package/dist/server-query-client.d.mts +3 -3
  185. package/dist/server-query-client.d.ts +3 -3
  186. package/dist/server-query-client.mjs +7 -7
  187. package/dist/{server-query-runtime-3zAj77yv.d.ts → server-query-runtime-DXRNhX_3.d.ts} +2 -0
  188. package/dist/{server-query-runtime-B50KAcj5.d.mts → server-query-runtime-aP52iuL5.d.mts} +2 -0
  189. package/dist/server-query.cjs +44 -5
  190. package/dist/server-query.d.mts +4 -0
  191. package/dist/server-query.d.ts +4 -0
  192. package/dist/server-query.mjs +7 -7
  193. package/dist/server.cjs +553 -370
  194. package/dist/server.d.mts +11 -10
  195. package/dist/server.d.ts +11 -10
  196. package/dist/server.mjs +17 -17
  197. package/dist/{spa-router-CyLkwst6.d.mts → spa-router-BeyAVSc6.d.mts} +1 -1
  198. package/dist/{spa-router-BkqGXaV_.d.ts → spa-router-COgu4txb.d.ts} +1 -1
  199. package/dist/testing.cjs +27 -2
  200. package/dist/testing.d.mts +3 -2
  201. package/dist/testing.d.ts +3 -2
  202. package/dist/testing.mjs +9 -9
  203. package/dist/{utils-NKR6SoNv.d.mts → utils-DL2VwDQl.d.mts} +1 -1
  204. package/dist/{utils-B2OHrb9F.d.ts → utils-DkU2c_1B.d.ts} +1 -1
  205. package/dist/version.cjs +1 -1
  206. package/dist/version.mjs +1 -1
  207. package/dist/vite.cjs +536 -353
  208. package/dist/vite.d.mts +3 -2
  209. package/dist/vite.d.ts +3 -2
  210. package/dist/vite.mjs +17 -13
  211. package/package.json +17 -17
  212. package/types/client.d.ts +115 -10
  213. package/dist/agent-runtime.cjs.map +0 -1
  214. package/dist/api/route-manager.cjs.map +0 -1
  215. package/dist/api/runtime.cjs.map +0 -1
  216. package/dist/api.cjs.map +0 -1
  217. package/dist/app-markdown.cjs.map +0 -1
  218. package/dist/cache.cjs.map +0 -1
  219. package/dist/chunk-75CGAL6E.mjs.map +0 -1
  220. package/dist/chunk-7MABZJIM.mjs.map +0 -1
  221. package/dist/chunk-A3636IHN.mjs.map +0 -1
  222. package/dist/chunk-AXVJCMVF.mjs.map +0 -1
  223. package/dist/chunk-D7QH7MDU.mjs.map +0 -1
  224. package/dist/chunk-DLBUAJTK.mjs.map +0 -1
  225. package/dist/chunk-EXCGBERG.mjs.map +0 -1
  226. package/dist/chunk-FLHLPB57.mjs.map +0 -1
  227. package/dist/chunk-HHZAOTQD.mjs.map +0 -1
  228. package/dist/chunk-KOTSX5JH.mjs.map +0 -1
  229. package/dist/chunk-KWCNQUH5.mjs.map +0 -1
  230. package/dist/chunk-MRVJCLYQ.mjs.map +0 -1
  231. package/dist/chunk-Q7GPJZCO.mjs.map +0 -1
  232. package/dist/chunk-RBRLLZL5.mjs.map +0 -1
  233. package/dist/chunk-SALMKQXH.mjs.map +0 -1
  234. package/dist/chunk-SCFX4UTD.mjs.map +0 -1
  235. package/dist/chunk-WB75GIX2.mjs.map +0 -1
  236. package/dist/chunk-XTLLHCWU.mjs.map +0 -1
  237. package/dist/chunk-ZFNK77WN.mjs.map +0 -1
  238. package/dist/chunk-ZRBCBOEX.mjs.map +0 -1
  239. package/dist/client/lifecycle.cjs.map +0 -1
  240. package/dist/client-cache-CopR_MaI.d.mts +0 -6
  241. package/dist/client-cache-Djy_TlE8.d.ts +0 -6
  242. package/dist/client-plugins.cjs.map +0 -1
  243. package/dist/client.cjs.map +0 -1
  244. package/dist/config.cjs.map +0 -1
  245. package/dist/cron.cjs.map +0 -1
  246. package/dist/deferred.cjs.map +0 -1
  247. package/dist/deployment.cjs.map +0 -1
  248. package/dist/devtools-client-3XRTBND5.mjs.map +0 -1
  249. package/dist/devtools-ui-NJKFORTG.mjs.map +0 -1
  250. package/dist/docs.cjs.map +0 -1
  251. package/dist/env-types.cjs.map +0 -1
  252. package/dist/env.cjs.map +0 -1
  253. package/dist/environment/vite.cjs.map +0 -1
  254. package/dist/environment.cjs.map +0 -1
  255. package/dist/font.cjs.map +0 -1
  256. package/dist/headers.cjs.map +0 -1
  257. package/dist/i18n/client.cjs.map +0 -1
  258. package/dist/i18n/index.cjs.map +0 -1
  259. package/dist/i18n/server.cjs.map +0 -1
  260. package/dist/image/server.cjs.map +0 -1
  261. package/dist/image/sharp.cjs.map +0 -1
  262. package/dist/image.cjs.map +0 -1
  263. package/dist/index.cjs.map +0 -1
  264. package/dist/instrumentation.cjs.map +0 -1
  265. package/dist/integrations.cjs.map +0 -1
  266. package/dist/internal/build-runtime.cjs.map +0 -1
  267. package/dist/internal/client-runtime.cjs.map +0 -1
  268. package/dist/internal/config-runtime.cjs.map +0 -1
  269. package/dist/internal/isolated-boundary.cjs.map +0 -1
  270. package/dist/internal/metadata-image-runtime.cjs.map +0 -1
  271. package/dist/internal/product-telemetry-runtime.cjs.map +0 -1
  272. package/dist/internal/production-node-env.cjs.map +0 -1
  273. package/dist/internal/production-runtime.cjs.map +0 -1
  274. package/dist/markdown.cjs.map +0 -1
  275. package/dist/middleware.cjs.map +0 -1
  276. package/dist/navigation.cjs.map +0 -1
  277. package/dist/observability.cjs.map +0 -1
  278. package/dist/plugin.cjs.map +0 -1
  279. package/dist/query/client.cjs.map +0 -1
  280. package/dist/query/index.cjs.map +0 -1
  281. package/dist/query/parsers.cjs.map +0 -1
  282. package/dist/query/server.cjs.map +0 -1
  283. package/dist/renderer/react/client.cjs.map +0 -1
  284. package/dist/renderer/react/server.cjs.map +0 -1
  285. package/dist/renderer/react/vite.cjs.map +0 -1
  286. package/dist/renderer-client.cjs.map +0 -1
  287. package/dist/renderer.cjs.map +0 -1
  288. package/dist/request.cjs.map +0 -1
  289. package/dist/router.cjs.map +0 -1
  290. package/dist/routes.cjs.map +0 -1
  291. package/dist/server-action-security.cjs.map +0 -1
  292. package/dist/server-fn-client.cjs.map +0 -1
  293. package/dist/server-fn.cjs.map +0 -1
  294. package/dist/server-plugins.cjs.map +0 -1
  295. package/dist/server-query-client.cjs.map +0 -1
  296. package/dist/server-query.cjs.map +0 -1
  297. package/dist/server.cjs.map +0 -1
  298. package/dist/storage.cjs.map +0 -1
  299. package/dist/testing.cjs.map +0 -1
  300. package/dist/theme/client.cjs.map +0 -1
  301. package/dist/theme/index.cjs.map +0 -1
  302. package/dist/theme/runtime.cjs.map +0 -1
  303. package/dist/theme/server.cjs.map +0 -1
  304. package/dist/version.cjs.map +0 -1
  305. package/dist/vite.cjs.map +0 -1
  306. package/dist/workflows.cjs.map +0 -1
  307. /package/dist/{chunk-VV24CC42.mjs.map → chunk-35NPLKQJ.mjs.map} +0 -0
  308. /package/dist/{chunk-RWYRFCLG.mjs.map → chunk-4X57GXQA.mjs.map} +0 -0
  309. /package/dist/{chunk-MOW47IF5.mjs.map → chunk-6UYVU46O.mjs.map} +0 -0
  310. /package/dist/{chunk-RLGUZ3HS.mjs.map → chunk-I3OOUWO5.mjs.map} +0 -0
  311. /package/dist/{chunk-2LS3KKE7.mjs.map → chunk-JV7JUD7Q.mjs.map} +0 -0
  312. /package/dist/{chunk-Q3OX763A.mjs.map → chunk-LXDASSTE.mjs.map} +0 -0
  313. /package/dist/{chunk-HVG3HLQZ.mjs.map → chunk-Q7WGOOAI.mjs.map} +0 -0
  314. /package/dist/{chunk-3INDBMUU.mjs.map → chunk-TGDIACZT.mjs.map} +0 -0
  315. /package/dist/{chunk-MH27UH72.mjs.map → chunk-TT3E2JOF.mjs.map} +0 -0
  316. /package/dist/{chunk-UWRGX3J3.mjs.map → chunk-UMUWR5XA.mjs.map} +0 -0
  317. /package/dist/{devtools-S52RRRMN.mjs.map → devtools-XWZX6CCL.mjs.map} +0 -0
@@ -10,9 +10,9 @@ import {
10
10
  runWithServerActionRequest,
11
11
  sanitizeServerActionError,
12
12
  validateServerActionRequest
13
- } from "./chunk-VV24CC42.mjs";
13
+ } from "./chunk-35NPLKQJ.mjs";
14
14
  import "./chunk-ZHQMHJAV.mjs";
15
- import "./chunk-RBRLLZL5.mjs";
15
+ import "./chunk-34IAPZBG.mjs";
16
16
  import "./chunk-DZU3EKQP.mjs";
17
17
  import "./chunk-CGILA3WO.mjs";
18
18
  export {
@@ -27,10 +27,60 @@ __export(server_fn_client_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(server_fn_client_exports);
29
29
  var import_react = require("react");
30
+
31
+ // src/client-observers.ts
32
+ function notifyClientObserver(observer, args, label = "Client lifecycle") {
33
+ if (!observer) return;
34
+ const report = /* @__PURE__ */ __name((error) => {
35
+ const reportError = globalThis.reportError;
36
+ if (typeof reportError === "function") {
37
+ try {
38
+ reportError.call(globalThis, error);
39
+ return;
40
+ } catch {
41
+ }
42
+ }
43
+ try {
44
+ console.error(`[Farm.js] ${label} callback failed:`, error);
45
+ } catch {
46
+ }
47
+ }, "report");
48
+ try {
49
+ const result = observer(...args);
50
+ if (result && typeof result.then === "function")
51
+ void Promise.resolve(result).catch(report);
52
+ } catch (error) {
53
+ report(error);
54
+ }
55
+ }
56
+ __name(notifyClientObserver, "notifyClientObserver");
57
+
58
+ // src/mutation-retry.ts
59
+ async function invokeMutationWithRetry(invoke, retry, shouldContinue) {
60
+ const maxRetries = Math.max(0, retry?.count ?? 0);
61
+ let attempt = 0;
62
+ while (true) {
63
+ try {
64
+ return await invoke();
65
+ } catch (error) {
66
+ if (attempt >= maxRetries || !shouldContinue()) throw error;
67
+ attempt += 1;
68
+ const delay = typeof retry?.delay === "function" ? retry.delay(attempt) : retry?.delay ?? 0;
69
+ if (delay > 0) {
70
+ await new Promise((resolve) => setTimeout(resolve, delay));
71
+ if (!shouldContinue()) throw error;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ __name(invokeMutationWithRetry, "invokeMutationWithRetry");
77
+
78
+ // src/server-fn-client.ts
30
79
  function useServerFn(serverFn, options = {}) {
31
80
  const { initialResult = null, resetOnSubmit = true } = options;
32
81
  const callbacksRef = (0, import_react.useRef)({});
33
82
  const requestIdRef = (0, import_react.useRef)(0);
83
+ const lastResetIdRef = (0, import_react.useRef)(0);
34
84
  const initialState = {
35
85
  pendingCount: 0,
36
86
  status: "idle",
@@ -41,11 +91,9 @@ function useServerFn(serverFn, options = {}) {
41
91
  const [state, setState] = (0, import_react.useState)(initialState);
42
92
  const setActionState = (0, import_react.useCallback)(
43
93
  (value) => {
44
- setState((current) => {
45
- const next = typeof value === "function" ? value(current) : value;
46
- stateRef.current = next;
47
- return next;
48
- });
94
+ const next = typeof value === "function" ? value(stateRef.current) : value;
95
+ stateRef.current = next;
96
+ setState(next);
49
97
  },
50
98
  []
51
99
  );
@@ -66,63 +114,88 @@ function useServerFn(serverFn, options = {}) {
66
114
  current: previousResult
67
115
  });
68
116
  const hasOptimisticResult = optimisticResult !== void 0;
69
- setActionState((current) => ({
70
- pendingCount: current.pendingCount + 1,
71
- status: "pending",
72
- result: hasOptimisticResult ? optimisticResult : resetOnSubmit ? null : current.result,
73
- error: null
74
- }));
117
+ setActionState((current) => {
118
+ if (requestId < lastResetIdRef.current) return current;
119
+ const pendingCount = current.pendingCount + 1;
120
+ if (requestId !== requestIdRef.current) return { ...current, pendingCount };
121
+ return {
122
+ pendingCount,
123
+ status: "pending",
124
+ result: hasOptimisticResult ? optimisticResult : resetOnSubmit ? null : current.result,
125
+ error: null
126
+ };
127
+ });
75
128
  try {
76
- const result = await serverFn(input);
129
+ const result = await invokeMutationWithRetry(
130
+ () => serverFn(input),
131
+ options.retry,
132
+ // A reset disowns this submission; stop scheduling retries then.
133
+ () => requestId >= lastResetIdRef.current
134
+ );
77
135
  const isLatestRequest = requestId === requestIdRef.current;
78
136
  setActionState((current) => {
137
+ if (requestId < lastResetIdRef.current) return current;
79
138
  const pendingCount = Math.max(0, current.pendingCount - 1);
80
139
  if (!isLatestRequest) {
81
140
  return {
82
141
  ...current,
83
- pendingCount,
84
- status: pendingCount > 0 ? "pending" : current.status
142
+ pendingCount
85
143
  };
86
144
  }
87
145
  return {
88
146
  pendingCount,
89
- status: pendingCount > 0 ? "pending" : "success",
147
+ status: "success",
90
148
  result,
91
149
  error: null
92
150
  };
93
151
  });
94
152
  if (isLatestRequest) {
95
- callbacksRef.current.onSuccess?.(result);
96
- callbacksRef.current.onSettled?.(result, null);
153
+ notifyClientObserver(callbacksRef.current.onSuccess, [result], "Action onSuccess");
154
+ if (requestId === requestIdRef.current) {
155
+ notifyClientObserver(
156
+ callbacksRef.current.onSettled,
157
+ [result, null],
158
+ "Action onSettled"
159
+ );
160
+ }
97
161
  }
98
162
  return result;
99
163
  } catch (cause) {
100
164
  const error = normalizeServerFnError(cause);
101
165
  const isLatestRequest = requestId === requestIdRef.current;
102
166
  setActionState((current) => {
167
+ if (requestId < lastResetIdRef.current) return current;
103
168
  const pendingCount = Math.max(0, current.pendingCount - 1);
104
169
  if (!isLatestRequest) {
105
170
  return {
106
171
  ...current,
107
- pendingCount,
108
- status: pendingCount > 0 ? "pending" : current.status
172
+ pendingCount
109
173
  };
110
174
  }
111
175
  return {
112
176
  pendingCount,
113
- status: pendingCount > 0 ? "pending" : "error",
177
+ status: "error",
114
178
  result: hasOptimisticResult && options.rollbackOnError ? previousResult : resetOnSubmit ? null : current.result,
115
179
  error
116
180
  };
117
181
  });
118
182
  if (isLatestRequest) {
119
- callbacksRef.current.onError?.(error);
120
- callbacksRef.current.onSettled?.(null, error);
183
+ notifyClientObserver(callbacksRef.current.onError, [error], "Action onError");
184
+ if (requestId === requestIdRef.current) {
185
+ notifyClientObserver(callbacksRef.current.onSettled, [null, error], "Action onSettled");
186
+ }
121
187
  }
122
188
  throw error;
123
189
  }
124
190
  },
125
- [options.optimistic, options.rollbackOnError, resetOnSubmit, serverFn, setActionState]
191
+ [
192
+ options.optimistic,
193
+ options.retry,
194
+ options.rollbackOnError,
195
+ resetOnSubmit,
196
+ serverFn,
197
+ setActionState
198
+ ]
126
199
  );
127
200
  const formAction = (0, import_react.useCallback)(
128
201
  async (formData) => {
@@ -137,7 +210,7 @@ function useServerFn(serverFn, options = {}) {
137
210
  [submit]
138
211
  );
139
212
  const reset = (0, import_react.useCallback)(() => {
140
- requestIdRef.current += 1;
213
+ lastResetIdRef.current = ++requestIdRef.current;
141
214
  setActionState({
142
215
  pendingCount: 0,
143
216
  status: "idle",
@@ -162,14 +235,17 @@ __name(useServerFn, "useServerFn");
162
235
  function useAction(target, options = {}) {
163
236
  const serverFn = resolveServerFnTarget(target);
164
237
  const action = useServerFn(serverFn, options);
238
+ const formActionRef = (0, import_react.useRef)(action.formAction);
239
+ formActionRef.current = action.formAction;
165
240
  const Form = (0, import_react.useMemo)(() => {
241
+ const submitForm = /* @__PURE__ */ __name((formData) => formActionRef.current(formData), "submitForm");
166
242
  const ActionForm = /* @__PURE__ */ __name((props) => (0, import_react.createElement)("form", {
167
243
  ...props,
168
- action: action.formAction
244
+ action: submitForm
169
245
  }), "ActionForm");
170
246
  ActionForm.displayName = "FarmActionForm";
171
247
  return ActionForm;
172
- }, [action.formAction]);
248
+ }, []);
173
249
  return (0, import_react.useMemo)(() => {
174
250
  const call = /* @__PURE__ */ __name(((input) => action.submit(input)), "call");
175
251
  return Object.assign(call, {
@@ -1,7 +1,11 @@
1
1
  import { FormHTMLAttributes, ComponentType } from 'react';
2
2
  import { ServerFn } from './server-fn.mjs';
3
+ import { R as RetryOptions } from './client-DWoLZ3QU.mjs';
3
4
  import './cache.mjs';
4
5
  import './server-fn-error-DDh14a0V.mjs';
6
+ import './integration-api-BT024nuJ.mjs';
7
+ import './client-cache-CCK-fCe0.mjs';
8
+ import './route-CvEr4Uc9.mjs';
5
9
 
6
10
  type ServerFnActionStatus = "idle" | "pending" | "success" | "error";
7
11
  type ServerFnSubmit<TInput, TResult> = [unknown] extends [TInput] ? (input?: TInput | FormData) => Promise<TResult> : (input: TInput | FormData) => Promise<TResult>;
@@ -16,6 +20,8 @@ type UseServerFnOptions<TResult, TError extends Error = Error, TInput = unknown>
16
20
  throwOnFormError?: boolean;
17
21
  optimistic?: (context: ServerFnOptimisticContext<TInput, TResult>) => TResult | null | undefined;
18
22
  rollbackOnError?: boolean;
23
+ /** Retry failed submissions with the API client's retry shape. Defaults to no retries. */
24
+ retry?: RetryOptions;
19
25
  onSuccess?: (result: TResult) => void;
20
26
  onError?: (error: TError) => void;
21
27
  onSettled?: (result: TResult | null, error: TError | null) => void;
@@ -1,7 +1,11 @@
1
1
  import { FormHTMLAttributes, ComponentType } from 'react';
2
2
  import { ServerFn } from './server-fn.js';
3
+ import { R as RetryOptions } from './client-DuQuQC1h.js';
3
4
  import './cache.js';
4
5
  import './server-fn-error-DDh14a0V.js';
6
+ import './integration-api-BT024nuJ.js';
7
+ import './client-cache-BMxuFqwH.js';
8
+ import './route-4pd-EVtw.js';
5
9
 
6
10
  type ServerFnActionStatus = "idle" | "pending" | "success" | "error";
7
11
  type ServerFnSubmit<TInput, TResult> = [unknown] extends [TInput] ? (input?: TInput | FormData) => Promise<TResult> : (input: TInput | FormData) => Promise<TResult>;
@@ -16,6 +20,8 @@ type UseServerFnOptions<TResult, TError extends Error = Error, TInput = unknown>
16
20
  throwOnFormError?: boolean;
17
21
  optimistic?: (context: ServerFnOptimisticContext<TInput, TResult>) => TResult | null | undefined;
18
22
  rollbackOnError?: boolean;
23
+ /** Retry failed submissions with the API client's retry shape. Defaults to no retries. */
24
+ retry?: RetryOptions;
19
25
  onSuccess?: (result: TResult) => void;
20
26
  onError?: (error: TError) => void;
21
27
  onSettled?: (result: TResult | null, error: TError | null) => void;
@@ -2,7 +2,8 @@
2
2
  import {
3
3
  useAction,
4
4
  useServerFn
5
- } from "./chunk-SALMKQXH.mjs";
5
+ } from "./chunk-6EJHNHH4.mjs";
6
+ import "./chunk-DU3PKDVQ.mjs";
6
7
  import "./chunk-CGILA3WO.mjs";
7
8
  export {
8
9
  useAction,
@@ -46,16 +46,29 @@ function getFarmCacheInvalidationState() {
46
46
  });
47
47
  }
48
48
  __name(getFarmCacheInvalidationState, "getFarmCacheInvalidationState");
49
+ function warnFarmCacheListenerError(scope, error) {
50
+ const detail = error instanceof Error ? error.stack ?? error.message : String(error);
51
+ console.warn(`[farm:cache] ${scope} listener failed: ${detail}`);
52
+ }
53
+ __name(warnFarmCacheListenerError, "warnFarmCacheListenerError");
49
54
  function notifyFarmCacheInvalidation(key) {
50
55
  if (typeof key !== "string" || key.length === 0) return;
51
56
  for (const listener of getFarmCacheInvalidationState().listeners) {
52
- listener(key);
57
+ try {
58
+ listener(key);
59
+ } catch (error) {
60
+ warnFarmCacheListenerError("invalidation", error);
61
+ }
53
62
  }
54
63
  }
55
64
  __name(notifyFarmCacheInvalidation, "notifyFarmCacheInvalidation");
56
65
  function notifyFarmCacheTask(task) {
57
66
  for (const listener of getFarmCacheInvalidationState().taskListeners) {
58
- listener(task);
67
+ try {
68
+ listener(task);
69
+ } catch (error) {
70
+ warnFarmCacheListenerError("task", error);
71
+ }
59
72
  }
60
73
  }
61
74
  __name(notifyFarmCacheTask, "notifyFarmCacheTask");
@@ -235,7 +248,13 @@ function recordFarmEventTrace(event) {
235
248
  activeSpan.addEvent(event.type, toEventAttributes(event), event.timestamp);
236
249
  }
237
250
  const error = event.type === "request.error" ? void 0 : getEventError(event);
238
- if (error !== void 0) recordSpanError(activeSpan, error);
251
+ if (error !== void 0) {
252
+ if (event.type === "render.error") {
253
+ recordSpanException(activeSpan, error);
254
+ } else {
255
+ recordSpanError(activeSpan, error);
256
+ }
257
+ }
239
258
  }
240
259
  const completedTraceContext = recordCompletedEventSpan(event, activeContext);
241
260
  return traceContext ?? completedTraceContext;
@@ -332,12 +351,26 @@ function getCompletedSpanDescriptor(event) {
332
351
  }
333
352
  }
334
353
  __name(getCompletedSpanDescriptor, "getCompletedSpanDescriptor");
354
+ function hashFarmCacheKey(value) {
355
+ let hash = 2166136261;
356
+ for (let index = 0; index < value.length; index++) {
357
+ hash ^= value.charCodeAt(index);
358
+ hash = Math.imul(hash, 16777619);
359
+ }
360
+ return (hash >>> 0).toString(16).padStart(8, "0");
361
+ }
362
+ __name(hashFarmCacheKey, "hashFarmCacheKey");
335
363
  function toEventAttributes(event) {
336
364
  const attributes = {};
365
+ const redactKey = typeof event.type === "string" && event.type.startsWith("cache.");
337
366
  for (const [key, value] of Object.entries(event)) {
338
367
  if (key === "timestamp" || key === "level" || key === "error" || key === "traceId" || key === "spanId" || key === "traceSampled" || value === void 0) {
339
368
  continue;
340
369
  }
370
+ if (redactKey && key === "key" && typeof value === "string") {
371
+ attributes["farm.key_hash"] = hashFarmCacheKey(value);
372
+ continue;
373
+ }
341
374
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
342
375
  attributes[`farm.${key}`] = value;
343
376
  } else if (Array.isArray(value)) {
@@ -357,9 +390,14 @@ function getEventError(event) {
357
390
  return "error" in event ? event.error : void 0;
358
391
  }
359
392
  __name(getEventError, "getEventError");
360
- function recordSpanError(span, error) {
393
+ function recordSpanException(span, error) {
361
394
  const normalized = error instanceof Error ? error : new Error(String(error));
362
395
  span.recordException(normalized);
396
+ return normalized;
397
+ }
398
+ __name(recordSpanException, "recordSpanException");
399
+ function recordSpanError(span, error) {
400
+ const normalized = recordSpanException(span, error);
363
401
  span.setStatus({ code: import_api.SpanStatusCode.ERROR, message: normalized.message });
364
402
  }
365
403
  __name(recordSpanError, "recordSpanError");
@@ -3,19 +3,19 @@ import {
3
3
  _parseServerFnSchema,
4
4
  createServerFn,
5
5
  createServerMiddleware
6
- } from "./chunk-RLGUZ3HS.mjs";
6
+ } from "./chunk-I3OOUWO5.mjs";
7
7
  import {
8
8
  FARM_SERVER_FN_FAILURE_SYMBOL,
9
9
  ServerActionError,
10
10
  ServerFnFailure,
11
11
  createServerFnTransportError,
12
12
  isServerFnFailure
13
- } from "./chunk-VV24CC42.mjs";
13
+ } from "./chunk-35NPLKQJ.mjs";
14
14
  import "./chunk-ZHQMHJAV.mjs";
15
- import "./chunk-AXVJCMVF.mjs";
16
- import "./chunk-RBRLLZL5.mjs";
15
+ import "./chunk-2HDOV47R.mjs";
16
+ import "./chunk-34IAPZBG.mjs";
17
17
  import "./chunk-WZ5QFROO.mjs";
18
- import "./chunk-ZRBCBOEX.mjs";
18
+ import "./chunk-N2FY2QZ7.mjs";
19
19
  import "./chunk-LM2YNO4U.mjs";
20
20
  import "./chunk-DZU3EKQP.mjs";
21
21
  import "./chunk-CGILA3WO.mjs";
@@ -1,8 +1,8 @@
1
- import { bz as RedirectConfig, Y as FarmRequest, Z as FarmResponse, aX as FarmPluginContext, a as FarmPlugin, bA as HeaderConfig, bB as RewriteConfig } from './client-plugins-BvClItiL.mjs';
2
- export { aZ as FarmPluginLifecycle, a_ as FarmRequestPluginContext, a$ as FarmRequestStore } from './client-plugins-BvClItiL.mjs';
1
+ import { bx as RedirectConfig, Y as FarmRequest, Z as FarmResponse, aV as FarmPluginContext, a as FarmPlugin, by as HeaderConfig, bz as RewriteConfig } from './client-plugins-B6-07YmP.mjs';
2
+ export { aX as FarmPluginLifecycle, aY as FarmRequestPluginContext, aZ as FarmRequestStore } from './client-plugins-B6-07YmP.mjs';
3
3
  import { R as ResolvedFarmI18nConfig } from './types-CnH8DOqo.mjs';
4
4
  import './lifecycle-De0vQG45.mjs';
5
- import './route-Cq3aObmj.mjs';
5
+ import './route-CvEr4Uc9.mjs';
6
6
  import './cache.mjs';
7
7
  import './renderer.mjs';
8
8
  import 'http';
@@ -10,6 +10,7 @@ import './types-Cc8l9IqS.mjs';
10
10
  import 'db0';
11
11
  import 'unstorage';
12
12
  import 'react';
13
+ import './integration-api-BT024nuJ.mjs';
13
14
  import '@farming-labs/orm';
14
15
  import './types-CKwggz9n.mjs';
15
16
  import '@farming-labs/docs';
@@ -1,8 +1,8 @@
1
- import { bz as RedirectConfig, Y as FarmRequest, Z as FarmResponse, aX as FarmPluginContext, a as FarmPlugin, bA as HeaderConfig, bB as RewriteConfig } from './client-plugins-B9Sq-iMg.js';
2
- export { aZ as FarmPluginLifecycle, a_ as FarmRequestPluginContext, a$ as FarmRequestStore } from './client-plugins-B9Sq-iMg.js';
1
+ import { bx as RedirectConfig, Y as FarmRequest, Z as FarmResponse, aV as FarmPluginContext, a as FarmPlugin, by as HeaderConfig, bz as RewriteConfig } from './client-plugins-By6MVUX-.js';
2
+ export { aX as FarmPluginLifecycle, aY as FarmRequestPluginContext, aZ as FarmRequestStore } from './client-plugins-By6MVUX-.js';
3
3
  import { R as ResolvedFarmI18nConfig } from './types-CnH8DOqo.js';
4
4
  import './lifecycle-De0vQG45.js';
5
- import './route-Y8lfz1wF.js';
5
+ import './route-4pd-EVtw.js';
6
6
  import './cache.js';
7
7
  import './renderer.js';
8
8
  import 'http';
@@ -10,6 +10,7 @@ import './types-Cc8l9IqS.js';
10
10
  import 'db0';
11
11
  import 'unstorage';
12
12
  import 'react';
13
+ import './integration-api-BT024nuJ.js';
13
14
  import '@farming-labs/orm';
14
15
  import './types-CKwggz9n.js';
15
16
  import '@farming-labs/docs';