@farm.js/core 0.1.0-beta.1 → 0.1.0-beta.11

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 (310) hide show
  1. package/README.md +1 -1
  2. package/dist/agent-runtime.d.mts +3 -2
  3. package/dist/agent-runtime.d.ts +3 -2
  4. package/dist/api/route-manager.cjs +410 -15
  5. package/dist/api/route-manager.cjs.map +1 -1
  6. package/dist/api/route-manager.d.mts +7 -5
  7. package/dist/api/route-manager.d.ts +7 -5
  8. package/dist/api/route-manager.mjs +9 -8
  9. package/dist/api/runtime.cjs +748 -9
  10. package/dist/api/runtime.cjs.map +1 -1
  11. package/dist/api/runtime.d.mts +3 -16
  12. package/dist/api/runtime.d.ts +3 -16
  13. package/dist/api/runtime.mjs +8 -1
  14. package/dist/api.cjs +1243 -342
  15. package/dist/api.cjs.map +1 -1
  16. package/dist/api.d.mts +8 -150
  17. package/dist/api.d.ts +8 -150
  18. package/dist/api.mjs +51 -21
  19. package/dist/{app-BiX4qb-d.d.mts → app-BNE2FoZ4.d.mts} +42 -5
  20. package/dist/{app-CFRNJXP1.d.ts → app-DRGUmJ3s.d.ts} +42 -5
  21. package/dist/app-markdown.cjs +32 -8
  22. package/dist/app-markdown.cjs.map +1 -1
  23. package/dist/app-markdown.d.mts +3 -2
  24. package/dist/app-markdown.d.ts +3 -2
  25. package/dist/app-markdown.mjs +2 -1
  26. package/dist/cache.cjs +414 -12
  27. package/dist/cache.cjs.map +1 -1
  28. package/dist/cache.d.mts +120 -6
  29. package/dist/cache.d.ts +120 -6
  30. package/dist/cache.mjs +11 -3
  31. package/dist/{chunk-QF4PHCMA.mjs → chunk-2ED5Q2GH.mjs} +3 -3
  32. package/dist/chunk-2ED5Q2GH.mjs.map +1 -0
  33. package/dist/{chunk-GZP5W4K3.mjs → chunk-32W4QEJP.mjs} +1 -1
  34. package/dist/chunk-32W4QEJP.mjs.map +1 -0
  35. package/dist/{chunk-G3B5BRDY.mjs → chunk-4677KXB7.mjs} +646 -86
  36. package/dist/chunk-4677KXB7.mjs.map +1 -0
  37. package/dist/{chunk-3QJO55ZF.mjs → chunk-4LND3PXF.mjs} +30 -38
  38. package/dist/chunk-4LND3PXF.mjs.map +1 -0
  39. package/dist/chunk-5EVQFRL2.mjs +10 -0
  40. package/dist/chunk-5EVQFRL2.mjs.map +1 -0
  41. package/dist/{chunk-25D7G34K.mjs → chunk-65A7QIKI.mjs} +5 -5
  42. package/dist/{chunk-25D7G34K.mjs.map → chunk-65A7QIKI.mjs.map} +1 -1
  43. package/dist/{chunk-CHFHNEMO.mjs → chunk-77BOAQHI.mjs} +1972 -188
  44. package/dist/chunk-77BOAQHI.mjs.map +1 -0
  45. package/dist/{chunk-LLC7BNXW.mjs → chunk-7FBJLMQH.mjs} +73 -10
  46. package/dist/chunk-7FBJLMQH.mjs.map +1 -0
  47. package/dist/{chunk-TRORP7E4.mjs → chunk-7N62DNSO.mjs} +2 -2
  48. package/dist/chunk-ALCLXXTY.mjs +187 -0
  49. package/dist/chunk-ALCLXXTY.mjs.map +1 -0
  50. package/dist/chunk-AW6I64AP.mjs +25 -0
  51. package/dist/chunk-AW6I64AP.mjs.map +1 -0
  52. package/dist/{chunk-B6N4ZB2H.mjs → chunk-C2ROET2V.mjs} +3 -3
  53. package/dist/{chunk-BHG3LVHH.mjs → chunk-CGIXMLSY.mjs} +15 -7
  54. package/dist/chunk-CGIXMLSY.mjs.map +1 -0
  55. package/dist/{chunk-C3DLZMBU.mjs → chunk-DJSGLHCN.mjs} +2 -2
  56. package/dist/{chunk-JN3UU635.mjs → chunk-EJ7T4TPB.mjs} +2 -2
  57. package/dist/chunk-EJ7T4TPB.mjs.map +1 -0
  58. package/dist/{chunk-ZJQNATYV.mjs → chunk-FRPWCMMG.mjs} +3 -3
  59. package/dist/chunk-FRPWCMMG.mjs.map +1 -0
  60. package/dist/{chunk-QM6VV26B.mjs → chunk-GQVGIUSN.mjs} +3 -3
  61. package/dist/{chunk-QM6VV26B.mjs.map → chunk-GQVGIUSN.mjs.map} +1 -1
  62. package/dist/{chunk-UREJA4GZ.mjs → chunk-GXASWWJU.mjs} +1 -1
  63. package/dist/{chunk-UREJA4GZ.mjs.map → chunk-GXASWWJU.mjs.map} +1 -1
  64. package/dist/chunk-I4CUBGVF.mjs +93 -0
  65. package/dist/chunk-I4CUBGVF.mjs.map +1 -0
  66. package/dist/{chunk-HXP3ZSPC.mjs → chunk-J5YWQVI5.mjs} +4 -4
  67. package/dist/chunk-J5YWQVI5.mjs.map +1 -0
  68. package/dist/{chunk-PRNYWD7K.mjs → chunk-JDEOUK5V.mjs} +67 -239
  69. package/dist/chunk-JDEOUK5V.mjs.map +1 -0
  70. package/dist/{chunk-UHE2TTLK.mjs → chunk-K5ZTUF22.mjs} +34 -17
  71. package/dist/chunk-K5ZTUF22.mjs.map +1 -0
  72. package/dist/{chunk-O3HADRW6.mjs → chunk-MIUW47JX.mjs} +2 -2
  73. package/dist/{chunk-O3HADRW6.mjs.map → chunk-MIUW47JX.mjs.map} +1 -1
  74. package/dist/chunk-PFE6GMNE.mjs +603 -0
  75. package/dist/chunk-PFE6GMNE.mjs.map +1 -0
  76. package/dist/{chunk-RKI6TN3A.mjs → chunk-QM746KUO.mjs} +9 -2
  77. package/dist/chunk-QM746KUO.mjs.map +1 -0
  78. package/dist/{chunk-TU4YJICB.mjs → chunk-QTZZ2ISQ.mjs} +41 -16
  79. package/dist/chunk-QTZZ2ISQ.mjs.map +1 -0
  80. package/dist/chunk-RBRLLZL5.mjs +81 -0
  81. package/dist/chunk-RBRLLZL5.mjs.map +1 -0
  82. package/dist/{chunk-RSKVYESE.mjs → chunk-RQ633A5I.mjs} +1 -1
  83. package/dist/chunk-RQ633A5I.mjs.map +1 -0
  84. package/dist/{chunk-6XDUHOEM.mjs → chunk-TQAEEJB4.mjs} +3 -3
  85. package/dist/{chunk-AGS7UJ52.mjs → chunk-UB5UOSHB.mjs} +24 -12
  86. package/dist/chunk-UB5UOSHB.mjs.map +1 -0
  87. package/dist/{chunk-SXZTEK3V.mjs → chunk-UXUAWNO5.mjs} +2 -2
  88. package/dist/chunk-V3XURYJO.mjs +756 -0
  89. package/dist/chunk-V3XURYJO.mjs.map +1 -0
  90. package/dist/{chunk-JLWMCADZ.mjs → chunk-VY2UYN5R.mjs} +24 -4
  91. package/dist/chunk-VY2UYN5R.mjs.map +1 -0
  92. package/dist/{chunk-QFQRHRZS.mjs → chunk-W2CRQFF6.mjs} +151 -23
  93. package/dist/chunk-W2CRQFF6.mjs.map +1 -0
  94. package/dist/{chunk-Y7A27276.mjs → chunk-WDU6QXNK.mjs} +349 -15
  95. package/dist/chunk-WDU6QXNK.mjs.map +1 -0
  96. package/dist/{chunk-Y2OJJD7R.mjs → chunk-XIVV5IWN.mjs} +7 -9
  97. package/dist/chunk-XIVV5IWN.mjs.map +1 -0
  98. package/dist/{chunk-OYXO65LI.mjs → chunk-YW7OBE6Q.mjs} +4 -4
  99. package/dist/chunk-YW7OBE6Q.mjs.map +1 -0
  100. package/dist/{chunk-YHU7SS6L.mjs → chunk-Z5CQMP54.mjs} +11 -11
  101. package/dist/{chunk-S2XHZS7W.mjs → chunk-ZVWA4ZQ3.mjs} +18 -9
  102. package/dist/chunk-ZVWA4ZQ3.mjs.map +1 -0
  103. package/dist/{chunk-SOU3Q3ZA.mjs → chunk-ZZ57EH5Z.mjs} +1 -1
  104. package/dist/chunk-ZZ57EH5Z.mjs.map +1 -0
  105. package/dist/{client-D_yUjVhe.d.mts → client-BT1mFQas.d.mts} +55 -10
  106. package/dist/{client-Dkc03WP8.d.ts → client-Nn0q4eO4.d.ts} +55 -10
  107. package/dist/{client-plugins-BZnpeTGA.d.ts → client-plugins-Bc5jHcNr.d.ts} +85 -6
  108. package/dist/{client-plugins-g4bzuCmo.d.mts → client-plugins-jsk-ZLzJ.d.mts} +85 -6
  109. package/dist/client-plugins.d.mts +3 -2
  110. package/dist/client-plugins.d.ts +3 -2
  111. package/dist/client.cjs +922 -91
  112. package/dist/client.cjs.map +1 -1
  113. package/dist/client.d.mts +124 -6
  114. package/dist/client.d.ts +124 -6
  115. package/dist/client.mjs +23 -16
  116. package/dist/config.d.mts +3 -2
  117. package/dist/config.d.ts +3 -2
  118. package/dist/cron.cjs.map +1 -1
  119. package/dist/cron.mjs +1 -1
  120. package/dist/{devtools-AE4RVXCM.mjs → devtools-A22KUJZT.mjs} +13 -12
  121. package/dist/{devtools-AE4RVXCM.mjs.map → devtools-A22KUJZT.mjs.map} +1 -1
  122. package/dist/{devtools-client-6WPY2AQU.mjs → devtools-client-3XRTBND5.mjs} +2 -11
  123. package/dist/devtools-client-3XRTBND5.mjs.map +1 -0
  124. package/dist/docs.cjs +65 -58
  125. package/dist/docs.cjs.map +1 -1
  126. package/dist/docs.mjs +13 -12
  127. package/dist/env-types.cjs +14 -5
  128. package/dist/env-types.cjs.map +1 -1
  129. package/dist/env-types.d.mts +2 -1
  130. package/dist/env-types.d.ts +2 -1
  131. package/dist/env-types.mjs +3 -1
  132. package/dist/env.cjs.map +1 -1
  133. package/dist/env.d.mts +1 -1
  134. package/dist/env.d.ts +1 -1
  135. package/dist/env.mjs +1 -1
  136. package/dist/font.cjs +47 -0
  137. package/dist/font.cjs.map +1 -0
  138. package/dist/font.d.mts +70 -0
  139. package/dist/font.d.ts +70 -0
  140. package/dist/font.mjs +10 -0
  141. package/dist/font.mjs.map +1 -0
  142. package/dist/i18n/client.d.mts +2 -2
  143. package/dist/i18n/client.d.ts +2 -2
  144. package/dist/i18n/index.d.mts +3 -3
  145. package/dist/i18n/index.d.ts +3 -3
  146. package/dist/i18n/server.cjs +2 -2
  147. package/dist/i18n/server.cjs.map +1 -1
  148. package/dist/i18n/server.d.mts +5 -5
  149. package/dist/i18n/server.d.ts +5 -5
  150. package/dist/i18n/server.mjs +1 -1
  151. package/dist/index.cjs +5016 -1108
  152. package/dist/index.cjs.map +1 -1
  153. package/dist/index.d.mts +23 -19
  154. package/dist/index.d.ts +23 -19
  155. package/dist/index.mjs +177 -121
  156. package/dist/index.mjs.map +1 -1
  157. package/dist/integrations.d.mts +3 -2
  158. package/dist/integrations.d.ts +3 -2
  159. package/dist/internal/build-runtime.cjs +3504 -581
  160. package/dist/internal/build-runtime.cjs.map +1 -1
  161. package/dist/internal/build-runtime.d.mts +5 -4
  162. package/dist/internal/build-runtime.d.ts +5 -4
  163. package/dist/internal/build-runtime.mjs +32 -29
  164. package/dist/internal/client-runtime.cjs.map +1 -1
  165. package/dist/internal/client-runtime.mjs +1 -1
  166. package/dist/internal/config-runtime.cjs +148 -41
  167. package/dist/internal/config-runtime.cjs.map +1 -1
  168. package/dist/internal/config-runtime.d.mts +4 -3
  169. package/dist/internal/config-runtime.d.ts +4 -3
  170. package/dist/internal/config-runtime.mjs +12 -11
  171. package/dist/internal/production-runtime.cjs +300 -9
  172. package/dist/internal/production-runtime.cjs.map +1 -1
  173. package/dist/internal/production-runtime.d.mts +10 -8
  174. package/dist/internal/production-runtime.d.ts +10 -8
  175. package/dist/internal/production-runtime.mjs +27 -9
  176. package/dist/internal/production-runtime.mjs.map +1 -1
  177. package/dist/markdown.cjs +73 -8
  178. package/dist/markdown.cjs.map +1 -1
  179. package/dist/markdown.d.mts +19 -2
  180. package/dist/markdown.d.ts +19 -2
  181. package/dist/markdown.mjs +5 -1
  182. package/dist/{metadata-C9NZxMDW.d.mts → metadata-7ffpT3jr.d.mts} +1 -1
  183. package/dist/{metadata-DAXRaOHx.d.ts → metadata-JHn-8eht.d.ts} +1 -1
  184. package/dist/middleware.cjs +2 -2
  185. package/dist/middleware.cjs.map +1 -1
  186. package/dist/middleware.d.mts +5 -4
  187. package/dist/middleware.d.ts +5 -4
  188. package/dist/middleware.mjs +3 -3
  189. package/dist/navigation.cjs +40 -15
  190. package/dist/navigation.cjs.map +1 -1
  191. package/dist/navigation.mjs +3 -3
  192. package/dist/{nitro-KME62MWG.mjs → nitro-QO5LV6QK.mjs} +11 -13
  193. package/dist/{nitro-KME62MWG.mjs.map → nitro-QO5LV6QK.mjs.map} +1 -1
  194. package/dist/plugin.cjs +2854 -590
  195. package/dist/plugin.cjs.map +1 -1
  196. package/dist/plugin.d.mts +3 -2
  197. package/dist/plugin.d.ts +3 -2
  198. package/dist/plugin.mjs +28 -25
  199. package/dist/{production-runtime-DRkCHUvJ.d.ts → production-runtime-9KG7GuvW.d.ts} +2 -2
  200. package/dist/{production-runtime-flrjp_nC.d.mts → production-runtime-B-fweKts.d.mts} +2 -2
  201. package/dist/{request-BrFBuc8G.d.mts → request-Dsq4kGW0.d.mts} +1 -1
  202. package/dist/{request-BslSZIRz.d.ts → request-udtobOLv.d.ts} +1 -1
  203. package/dist/request.d.mts +2 -2
  204. package/dist/request.d.ts +2 -2
  205. package/dist/{resolver-DlOPpjkB.d.mts → resolver-DJqjLMg_.d.mts} +1 -1
  206. package/dist/{resolver-C6iecsDV.d.ts → resolver-IH4RmPEl.d.ts} +1 -1
  207. package/dist/routes.cjs +276 -6
  208. package/dist/routes.cjs.map +1 -1
  209. package/dist/routes.d.mts +2 -2
  210. package/dist/routes.d.ts +2 -2
  211. package/dist/routes.mjs +4 -4
  212. package/dist/runtime-9nQjVM7X.d.mts +206 -0
  213. package/dist/{runtime-DeAAZ6gO.d.mts → runtime-Cxpq6xZN.d.mts} +2 -2
  214. package/dist/runtime-DgeS2skB.d.ts +206 -0
  215. package/dist/{runtime-B6GvwDS1.d.ts → runtime-bv63eUiO.d.ts} +2 -2
  216. package/dist/server-action-security.cjs +28 -10
  217. package/dist/server-action-security.cjs.map +1 -1
  218. package/dist/server-action-security.d.mts +2 -1
  219. package/dist/server-action-security.d.ts +2 -1
  220. package/dist/server-action-security.mjs +2 -2
  221. package/dist/server-fn-client.cjs.map +1 -1
  222. package/dist/server-fn-client.d.mts +1 -0
  223. package/dist/server-fn-client.d.ts +1 -0
  224. package/dist/server-fn-client.mjs +1 -1
  225. package/dist/server-fn.cjs +785 -3
  226. package/dist/server-fn.cjs.map +1 -1
  227. package/dist/server-fn.d.mts +10 -1
  228. package/dist/server-fn.d.ts +10 -1
  229. package/dist/server-fn.mjs +6 -3
  230. package/dist/server-plugins.d.mts +4 -3
  231. package/dist/server-plugins.d.ts +4 -3
  232. package/dist/server-query-client.cjs +279 -8
  233. package/dist/server-query-client.cjs.map +1 -1
  234. package/dist/server-query-client.mjs +4 -4
  235. package/dist/server-query.cjs +381 -10
  236. package/dist/server-query.cjs.map +1 -1
  237. package/dist/server-query.mjs +5 -5
  238. package/dist/server.cjs +3319 -841
  239. package/dist/server.cjs.map +1 -1
  240. package/dist/server.d.mts +12 -11
  241. package/dist/server.d.ts +12 -11
  242. package/dist/server.mjs +57 -36
  243. package/dist/server.mjs.map +1 -1
  244. package/dist/testing.cjs +436 -25
  245. package/dist/testing.cjs.map +1 -1
  246. package/dist/testing.d.mts +5 -4
  247. package/dist/testing.d.ts +5 -4
  248. package/dist/testing.mjs +19 -18
  249. package/dist/testing.mjs.map +1 -1
  250. package/dist/transport-BmbGTXA5.d.mts +49 -0
  251. package/dist/transport-BmbGTXA5.d.ts +49 -0
  252. package/dist/{types-BH1lhg5G.d.ts → types-BMxWr97v.d.mts} +2 -2
  253. package/dist/{types-BH1lhg5G.d.mts → types-BMxWr97v.d.ts} +2 -2
  254. package/dist/{utils-DA1yo54_.d.ts → utils-CA0z0c-2.d.ts} +1 -1
  255. package/dist/{utils-DOXXivjL.d.mts → utils-mYVkSOt2.d.mts} +1 -1
  256. package/dist/version.cjs +36 -0
  257. package/dist/version.cjs.map +1 -0
  258. package/dist/version.d.mts +3 -0
  259. package/dist/version.d.ts +3 -0
  260. package/dist/version.mjs +8 -0
  261. package/dist/version.mjs.map +1 -0
  262. package/dist/vite.cjs +2938 -668
  263. package/dist/vite.cjs.map +1 -1
  264. package/dist/vite.d.mts +3 -2
  265. package/dist/vite.d.ts +3 -2
  266. package/dist/vite.mjs +26 -23
  267. package/dist/workflows.cjs +6 -8
  268. package/dist/workflows.cjs.map +1 -1
  269. package/dist/workflows.mjs +1 -1
  270. package/package.json +22 -6
  271. package/types/api.d.ts +44 -0
  272. package/types/client.d.ts +221 -17
  273. package/types/image.d.ts +4 -0
  274. package/types/images.d.ts +59 -0
  275. package/dist/chunk-3QJO55ZF.mjs.map +0 -1
  276. package/dist/chunk-4PTK6KT4.mjs +0 -364
  277. package/dist/chunk-4PTK6KT4.mjs.map +0 -1
  278. package/dist/chunk-AGS7UJ52.mjs.map +0 -1
  279. package/dist/chunk-BHG3LVHH.mjs.map +0 -1
  280. package/dist/chunk-CHFHNEMO.mjs.map +0 -1
  281. package/dist/chunk-EVGBEZDF.mjs +0 -215
  282. package/dist/chunk-EVGBEZDF.mjs.map +0 -1
  283. package/dist/chunk-G3B5BRDY.mjs.map +0 -1
  284. package/dist/chunk-GZP5W4K3.mjs.map +0 -1
  285. package/dist/chunk-HXP3ZSPC.mjs.map +0 -1
  286. package/dist/chunk-JLWMCADZ.mjs.map +0 -1
  287. package/dist/chunk-JN3UU635.mjs.map +0 -1
  288. package/dist/chunk-LLC7BNXW.mjs.map +0 -1
  289. package/dist/chunk-OYXO65LI.mjs.map +0 -1
  290. package/dist/chunk-PRNYWD7K.mjs.map +0 -1
  291. package/dist/chunk-QF4PHCMA.mjs.map +0 -1
  292. package/dist/chunk-QFQRHRZS.mjs.map +0 -1
  293. package/dist/chunk-RKI6TN3A.mjs.map +0 -1
  294. package/dist/chunk-RSKVYESE.mjs.map +0 -1
  295. package/dist/chunk-S2XHZS7W.mjs.map +0 -1
  296. package/dist/chunk-SOU3Q3ZA.mjs.map +0 -1
  297. package/dist/chunk-TU4YJICB.mjs.map +0 -1
  298. package/dist/chunk-TXCFGOHW.mjs +0 -42
  299. package/dist/chunk-TXCFGOHW.mjs.map +0 -1
  300. package/dist/chunk-UHE2TTLK.mjs.map +0 -1
  301. package/dist/chunk-Y2OJJD7R.mjs.map +0 -1
  302. package/dist/chunk-Y7A27276.mjs.map +0 -1
  303. package/dist/chunk-ZJQNATYV.mjs.map +0 -1
  304. package/dist/devtools-client-6WPY2AQU.mjs.map +0 -1
  305. /package/dist/{chunk-TRORP7E4.mjs.map → chunk-7N62DNSO.mjs.map} +0 -0
  306. /package/dist/{chunk-B6N4ZB2H.mjs.map → chunk-C2ROET2V.mjs.map} +0 -0
  307. /package/dist/{chunk-C3DLZMBU.mjs.map → chunk-DJSGLHCN.mjs.map} +0 -0
  308. /package/dist/{chunk-6XDUHOEM.mjs.map → chunk-TQAEEJB4.mjs.map} +0 -0
  309. /package/dist/{chunk-SXZTEK3V.mjs.map → chunk-UXUAWNO5.mjs.map} +0 -0
  310. /package/dist/{chunk-YHU7SS6L.mjs.map → chunk-Z5CQMP54.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
- export { a4 as loadConfig, a3 as resolveConfig, a5 as resolveDeployConfig } from '../client-plugins-g4bzuCmo.mjs';
1
+ export { a5 as loadConfig, a4 as resolveConfig, a6 as resolveDeployConfig } from '../client-plugins-jsk-ZLzJ.mjs';
2
2
  import { build, createServer, loadEnv } from 'vite';
3
- export { l as logger } from '../utils-DOXXivjL.mjs';
3
+ export { l as logger } from '../utils-mYVkSOt2.mjs';
4
4
  import '../plugin-BJDf43dc.mjs';
5
5
  import 'react';
6
6
  import 'http';
@@ -18,7 +18,8 @@ import '../cron.mjs';
18
18
  import '../env.mjs';
19
19
  import '../server-action-security.mjs';
20
20
  import '../image-config-Duob7wER.mjs';
21
- import '../types-BH1lhg5G.mjs';
21
+ import '../types-BMxWr97v.mjs';
22
+ import '../cache.mjs';
22
23
  import '../route-runtime-DoOHzCAD.mjs';
23
24
 
24
25
  type FarmProductionViteBuilder = "rollup" | "rolldown";
@@ -1,6 +1,6 @@
1
- export { a4 as loadConfig, a3 as resolveConfig, a5 as resolveDeployConfig } from '../client-plugins-BZnpeTGA.js';
1
+ export { a5 as loadConfig, a4 as resolveConfig, a6 as resolveDeployConfig } from '../client-plugins-Bc5jHcNr.js';
2
2
  import { build, createServer, loadEnv } from 'vite';
3
- export { l as logger } from '../utils-DA1yo54_.js';
3
+ export { l as logger } from '../utils-CA0z0c-2.js';
4
4
  import '../plugin-BJDf43dc.js';
5
5
  import 'react';
6
6
  import 'http';
@@ -18,7 +18,8 @@ import '../cron.js';
18
18
  import '../env.js';
19
19
  import '../server-action-security.js';
20
20
  import '../image-config-Duob7wER.js';
21
- import '../types-BH1lhg5G.js';
21
+ import '../types-BMxWr97v.js';
22
+ import '../cache.js';
22
23
  import '../route-runtime-DoOHzCAD.js';
23
24
 
24
25
  type FarmProductionViteBuilder = "rollup" | "rolldown";
@@ -5,28 +5,29 @@ import {
5
5
  loadConfig,
6
6
  resolveConfig,
7
7
  resolveDeployConfig
8
- } from "../chunk-UHE2TTLK.mjs";
8
+ } from "../chunk-K5ZTUF22.mjs";
9
9
  import "../chunk-UVCIEUJC.mjs";
10
- import "../chunk-RSKVYESE.mjs";
10
+ import "../chunk-RQ633A5I.mjs";
11
+ import "../chunk-I4CUBGVF.mjs";
12
+ import "../chunk-YW7OBE6Q.mjs";
11
13
  import "../chunk-74YTBPTY.mjs";
12
14
  import "../chunk-7MABZJIM.mjs";
13
- import "../chunk-OYXO65LI.mjs";
14
15
  import "../chunk-GY2STC2S.mjs";
15
- import "../chunk-LLC7BNXW.mjs";
16
- import "../chunk-S2XHZS7W.mjs";
17
- import "../chunk-Y2OJJD7R.mjs";
18
- import "../chunk-UREJA4GZ.mjs";
19
- import "../chunk-AGS7UJ52.mjs";
16
+ import "../chunk-UB5UOSHB.mjs";
17
+ import "../chunk-ZVWA4ZQ3.mjs";
18
+ import "../chunk-7FBJLMQH.mjs";
19
+ import "../chunk-XIVV5IWN.mjs";
20
+ import "../chunk-GXASWWJU.mjs";
20
21
  import "../chunk-K4667E2Q.mjs";
21
22
  import "../chunk-QGOHVJ6J.mjs";
22
23
  import "../chunk-FQYDHKKU.mjs";
24
+ import "../chunk-GQVGIUSN.mjs";
23
25
  import {
24
26
  logger
25
27
  } from "../chunk-J4FNJ5IU.mjs";
26
- import "../chunk-QM6VV26B.mjs";
27
- import "../chunk-JK25YEN6.mjs";
28
28
  import "../chunk-B232I2GP.mjs";
29
- import "../chunk-TXCFGOHW.mjs";
29
+ import "../chunk-JK25YEN6.mjs";
30
+ import "../chunk-RBRLLZL5.mjs";
30
31
  import "../chunk-CGILA3WO.mjs";
31
32
  export {
32
33
  loadConfig,
@@ -26,7 +26,9 @@ __export(production_runtime_exports, {
26
26
  _runWithMiddlewareContext: () => _runWithMiddlewareContext,
27
27
  _runWithMiddlewareData: () => _runWithMiddlewareData,
28
28
  addMetadataImageReference: () => addMetadataImageReference,
29
+ appendFarmLinkHeader: () => appendFarmLinkHeader,
29
30
  applyProductionMiddlewareHeaders: () => applyProductionMiddlewareHeaders,
31
+ configureFarmCache: () => configureFarmCache,
30
32
  configureFarmObservability: () => configureFarmObservability,
31
33
  createFarmCacheKey: () => createFarmCacheKey,
32
34
  createFarmLocaleCookie: () => createFarmLocaleCookie,
@@ -401,11 +403,51 @@ __name(formatError, "formatError");
401
403
 
402
404
  // src/cache.ts
403
405
  var _FarmDataCache = class _FarmDataCache {
404
- constructor() {
406
+ constructor(config = {}) {
405
407
  this.entries = /* @__PURE__ */ new Map();
406
408
  this.inflight = /* @__PURE__ */ new Map();
407
409
  this.invalidatedTagVersions = /* @__PURE__ */ new Map();
408
410
  this.version = 0;
411
+ this.namespace = "farm";
412
+ this.local = true;
413
+ this.lease = {
414
+ enabled: true,
415
+ ttlMs: 1e4,
416
+ waitTimeoutMs: 1e4,
417
+ pollIntervalMs: 25
418
+ };
419
+ this.configure(config);
420
+ }
421
+ configure(config = {}) {
422
+ this.adapter = config.adapter;
423
+ this.namespace = normalizeCacheNamespace(config.namespace || "farm");
424
+ this.local = !config.adapter;
425
+ this.lease = config.lease === false ? { ...this.lease, enabled: false } : {
426
+ enabled: true,
427
+ ttlMs: normalizePositiveDuration(config.lease?.ttlMs, 1e4, "cache.lease.ttlMs"),
428
+ waitTimeoutMs: normalizePositiveDuration(
429
+ config.lease?.waitTimeoutMs,
430
+ 1e4,
431
+ "cache.lease.waitTimeoutMs"
432
+ ),
433
+ pollIntervalMs: normalizePositiveDuration(
434
+ config.lease?.pollIntervalMs,
435
+ 25,
436
+ "cache.lease.pollIntervalMs"
437
+ )
438
+ };
439
+ if (!this.local) {
440
+ this.entries.clear();
441
+ this.inflight.clear();
442
+ this.invalidatedTagVersions.clear();
443
+ this.version = 0;
444
+ }
445
+ }
446
+ get adapterName() {
447
+ return this.adapter?.name || (this.adapter ? "custom" : "memory");
448
+ }
449
+ get hasAdapter() {
450
+ return this.adapter !== void 0;
409
451
  }
410
452
  get size() {
411
453
  return this.entries.size;
@@ -441,6 +483,45 @@ var _FarmDataCache = class _FarmDataCache {
441
483
  });
442
484
  return this.toPublicEntry(entry);
443
485
  }
486
+ async getEntryAsync(key, options = {}) {
487
+ if (this.local) {
488
+ const localEntry = this.getEntry(key, options);
489
+ if (localEntry) return localEntry;
490
+ }
491
+ if (!this.adapter) {
492
+ return this.local ? void 0 : this.getEntry(key, options);
493
+ }
494
+ const entry = await this.adapter.get(this.createAdapterKey(key));
495
+ if (!entry) {
496
+ emitFarmEvent({ type: "cache.miss", key });
497
+ return void 0;
498
+ }
499
+ assertFarmCacheEntry(entry, key);
500
+ const stale = await this.isAdapterEntryStale(entry, options.now);
501
+ if (stale) {
502
+ emitFarmEvent({
503
+ type: "cache.stale",
504
+ key,
505
+ tags: [...entry.tags],
506
+ revalidate: entry.revalidate
507
+ });
508
+ if (!options.allowStale) {
509
+ emitFarmEvent({ type: "cache.miss", key, reason: "stale" });
510
+ return void 0;
511
+ }
512
+ }
513
+ emitFarmEvent({
514
+ type: "cache.hit",
515
+ key,
516
+ tags: [...entry.tags],
517
+ revalidate: entry.revalidate,
518
+ stale
519
+ });
520
+ if (this.local && !stale) {
521
+ this.hydrateLocalEntry(entry);
522
+ }
523
+ return { ...entry, key };
524
+ }
444
525
  set(key, value, options = {}) {
445
526
  const tags = /* @__PURE__ */ new Set();
446
527
  for (const tag of options.tags ?? []) {
@@ -453,6 +534,7 @@ var _FarmDataCache = class _FarmDataCache {
453
534
  key,
454
535
  value,
455
536
  tags,
537
+ tagVersions: void 0,
456
538
  createdAt: options.createdAt ?? Date.now(),
457
539
  createdVersion: ++this.version,
458
540
  revalidate: normalizeRevalidate(options.revalidate)
@@ -466,11 +548,45 @@ var _FarmDataCache = class _FarmDataCache {
466
548
  });
467
549
  return this.toPublicEntry(entry);
468
550
  }
551
+ async setAsync(key, value, options = {}, tagVersions) {
552
+ const tags = normalizeCacheOptionsTags(options);
553
+ const capturedVersions = tagVersions ?? await this.getAdapterTagVersions(Array.from(tags.values()));
554
+ const entry = {
555
+ key,
556
+ value,
557
+ tags: Array.from(tags),
558
+ tagVersions: capturedVersions,
559
+ createdAt: options.createdAt ?? Date.now(),
560
+ createdVersion: ++this.version,
561
+ revalidate: normalizeRevalidate(options.revalidate)
562
+ };
563
+ if (this.local) {
564
+ this.hydrateLocalEntry(entry);
565
+ }
566
+ if (this.adapter) {
567
+ await this.adapter.set(this.createAdapterKey(key), entry);
568
+ }
569
+ emitFarmEvent({
570
+ type: "cache.set",
571
+ key,
572
+ tags: [...entry.tags],
573
+ revalidate: entry.revalidate
574
+ });
575
+ return entry;
576
+ }
469
577
  delete(key) {
470
578
  const deleted = this.entries.delete(key);
471
579
  emitFarmEvent({ type: "cache.delete", key, deleted });
472
580
  return deleted;
473
581
  }
582
+ async deleteAsync(key) {
583
+ const deleted = this.entries.delete(key);
584
+ if (this.adapter) {
585
+ await this.adapter.delete(this.createAdapterKey(key));
586
+ }
587
+ emitFarmEvent({ type: "cache.delete", key, deleted: this.adapter ? true : deleted });
588
+ return this.adapter ? true : deleted;
589
+ }
474
590
  clear() {
475
591
  const count = this.entries.size;
476
592
  this.entries.clear();
@@ -479,6 +595,10 @@ var _FarmDataCache = class _FarmDataCache {
479
595
  this.version = 0;
480
596
  emitFarmEvent({ type: "cache.clear", count });
481
597
  }
598
+ async clearAsync() {
599
+ this.clear();
600
+ await this.adapter?.clear?.();
601
+ }
482
602
  isStale(entry, now = Date.now()) {
483
603
  if (typeof entry.revalidate === "number" && entry.revalidate > 0 && now - entry.createdAt >= entry.revalidate * 1e3) {
484
604
  return true;
@@ -491,6 +611,12 @@ var _FarmDataCache = class _FarmDataCache {
491
611
  }
492
612
  return false;
493
613
  }
614
+ async isStaleAsync(entry, now = Date.now()) {
615
+ if (this.adapter) {
616
+ return this.isAdapterEntryStale(entry, now);
617
+ }
618
+ return this.isStale(entry, now);
619
+ }
494
620
  revalidateTag(tag, options = {}) {
495
621
  const normalized = normalizeCacheTag(tag);
496
622
  const count = this.invalidateTag(normalized);
@@ -499,6 +625,15 @@ var _FarmDataCache = class _FarmDataCache {
499
625
  );
500
626
  return count;
501
627
  }
628
+ async revalidateTagAsync(tag, options = {}) {
629
+ const normalized = normalizeCacheTag(tag);
630
+ const count = this.invalidateTag(normalized);
631
+ await this.adapter?.invalidateTags?.([this.createAdapterTag(normalized)]);
632
+ emitFarmEvent(
633
+ options.source === "updateTag" ? { type: "cache.updateTag", tag: normalized, count } : { type: "cache.revalidateTag", tag: normalized, profile: options.profile, count }
634
+ );
635
+ return count;
636
+ }
502
637
  revalidatePath(routePath) {
503
638
  const normalizedPath = normalizeRevalidatePath(routePath);
504
639
  const pathTag = createPathCacheTag(normalizedPath);
@@ -515,8 +650,25 @@ var _FarmDataCache = class _FarmDataCache {
515
650
  }
516
651
  return count;
517
652
  }
653
+ async revalidatePathAsync(routePath) {
654
+ const normalizedPath = normalizeRevalidatePath(routePath);
655
+ const pathTag = createPathCacheTag(normalizedPath);
656
+ const pprCount = this.countEntriesForTags([pathTag, "ppr"]);
657
+ const count = this.invalidateTag(pathTag);
658
+ await this.adapter?.invalidateTags?.([this.createAdapterTag(pathTag)]);
659
+ emitFarmEvent({ type: "cache.revalidatePath", path: normalizedPath, count });
660
+ if (pprCount > 0) {
661
+ emitFarmEvent({
662
+ type: "ppr.shell.invalidated",
663
+ route: normalizedPath,
664
+ reason: "revalidatePath",
665
+ count: pprCount
666
+ });
667
+ }
668
+ return count;
669
+ }
518
670
  async getOrSet(key, producer, options = {}) {
519
- const cached = this.getEntry(key);
671
+ const cached = await this.getEntryAsync(key);
520
672
  if (cached) {
521
673
  return cached.value;
522
674
  }
@@ -525,10 +677,8 @@ var _FarmDataCache = class _FarmDataCache {
525
677
  emitFarmEvent({ type: "cache.dedupe", key });
526
678
  return inflight;
527
679
  }
528
- const promise = Promise.resolve().then(producer).then((value) => {
529
- this.set(key, value, options);
530
- return value;
531
- }).catch((error) => {
680
+ const tags = Array.from(normalizeCacheOptionsTags(options));
681
+ const promise = this.fillCacheEntry(key, producer, options, tags).catch((error) => {
532
682
  emitFarmEvent({ type: "cache.error", key, operation: "set", error });
533
683
  throw error;
534
684
  }).finally(() => {
@@ -537,6 +687,40 @@ var _FarmDataCache = class _FarmDataCache {
537
687
  this.inflight.set(key, promise);
538
688
  return promise;
539
689
  }
690
+ async fillCacheEntry(key, producer, options, tags) {
691
+ const leaseKey = `${this.namespace}:lease:${key}`;
692
+ let leaseToken;
693
+ if (this.adapter?.acquireLease && this.adapter.releaseLease && this.lease.enabled) {
694
+ leaseToken = await this.adapter.acquireLease(leaseKey, this.lease.ttlMs);
695
+ if (!leaseToken) {
696
+ const shared = await this.waitForAdapterEntry(key);
697
+ if (shared) {
698
+ emitFarmEvent({ type: "cache.dedupe", key });
699
+ return shared.value;
700
+ }
701
+ leaseToken = await this.adapter.acquireLease(leaseKey, this.lease.ttlMs);
702
+ }
703
+ }
704
+ try {
705
+ const initialTagVersions = await this.getAdapterTagVersions(tags);
706
+ const value = await producer();
707
+ await this.setAsync(key, value, options, initialTagVersions);
708
+ return value;
709
+ } finally {
710
+ if (leaseToken && this.adapter?.releaseLease) {
711
+ await this.adapter.releaseLease(leaseKey, leaseToken);
712
+ }
713
+ }
714
+ }
715
+ async waitForAdapterEntry(key) {
716
+ const deadline = Date.now() + this.lease.waitTimeoutMs;
717
+ while (Date.now() < deadline) {
718
+ await delay(this.lease.pollIntervalMs);
719
+ const entry = await this.getEntryAsync(key);
720
+ if (entry) return entry;
721
+ }
722
+ return void 0;
723
+ }
540
724
  countEntriesForTag(tag) {
541
725
  let count = 0;
542
726
  for (const entry of this.entries.values()) {
@@ -564,11 +748,53 @@ var _FarmDataCache = class _FarmDataCache {
564
748
  key: entry.key,
565
749
  value: entry.value,
566
750
  tags: Array.from(entry.tags),
751
+ tagVersions: entry.tagVersions,
567
752
  createdAt: entry.createdAt,
568
753
  createdVersion: entry.createdVersion,
569
754
  revalidate: entry.revalidate
570
755
  };
571
756
  }
757
+ hydrateLocalEntry(entry) {
758
+ this.entries.set(entry.key, {
759
+ key: entry.key,
760
+ value: entry.value,
761
+ tags: new Set(entry.tags.map(normalizeCacheTag)),
762
+ tagVersions: entry.tagVersions,
763
+ createdAt: entry.createdAt,
764
+ createdVersion: entry.createdVersion ?? ++this.version,
765
+ revalidate: normalizeRevalidate(entry.revalidate)
766
+ });
767
+ }
768
+ createAdapterKey(key) {
769
+ return `${this.namespace}:entry:${key}`;
770
+ }
771
+ createAdapterTag(tag) {
772
+ return `${this.namespace}:tag:${tag}`;
773
+ }
774
+ async getAdapterTagVersions(tags) {
775
+ if (!this.adapter?.getTagVersions || tags.length === 0) return {};
776
+ const normalized = tags.map(normalizeCacheTag);
777
+ const physicalTags = normalized.map((tag) => this.createAdapterTag(tag));
778
+ const versions = await this.adapter.getTagVersions(physicalTags);
779
+ return Object.fromEntries(
780
+ normalized.map((tag, index) => [
781
+ tag,
782
+ normalizeAdapterVersion(versions[physicalTags[index]])
783
+ ])
784
+ );
785
+ }
786
+ async isAdapterEntryStale(entry, now = Date.now()) {
787
+ if (typeof entry.revalidate === "number" && entry.revalidate > 0 && now - entry.createdAt >= entry.revalidate * 1e3) {
788
+ return true;
789
+ }
790
+ const currentVersions = await this.getAdapterTagVersions(entry.tags);
791
+ for (const tag of entry.tags) {
792
+ if (normalizeAdapterVersion(currentVersions[tag]) > normalizeAdapterVersion(entry.tagVersions?.[tag])) {
793
+ return true;
794
+ }
795
+ }
796
+ return false;
797
+ }
572
798
  };
573
799
  __name(_FarmDataCache, "FarmDataCache");
574
800
  var FarmDataCache = _FarmDataCache;
@@ -581,6 +807,10 @@ function getFarmDataCache() {
581
807
  return sharedFarmDataCache;
582
808
  }
583
809
  __name(getFarmDataCache, "getFarmDataCache");
810
+ function configureFarmCache(config) {
811
+ sharedFarmDataCache.configure(config);
812
+ }
813
+ __name(configureFarmCache, "configureFarmCache");
584
814
  function createPathCacheTag(routePath) {
585
815
  return `path:${normalizeRevalidatePath(routePath)}`;
586
816
  }
@@ -633,6 +863,52 @@ function normalizeCacheTag(tag) {
633
863
  return normalized;
634
864
  }
635
865
  __name(normalizeCacheTag, "normalizeCacheTag");
866
+ function normalizeCacheNamespace(namespace) {
867
+ if (typeof namespace !== "string") {
868
+ throw new TypeError("Cache namespace must be a string.");
869
+ }
870
+ const normalized = namespace.trim().replace(/:+$/g, "");
871
+ if (!normalized) {
872
+ throw new Error("Cache namespace cannot be empty.");
873
+ }
874
+ return normalized;
875
+ }
876
+ __name(normalizeCacheNamespace, "normalizeCacheNamespace");
877
+ function normalizeAdapterVersion(value) {
878
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
879
+ }
880
+ __name(normalizeAdapterVersion, "normalizeAdapterVersion");
881
+ function normalizePositiveDuration(value, fallback, name) {
882
+ if (value === void 0) return fallback;
883
+ if (!Number.isFinite(value) || value <= 0) {
884
+ throw new TypeError(`${name} must be a positive number of milliseconds.`);
885
+ }
886
+ return Math.floor(value);
887
+ }
888
+ __name(normalizePositiveDuration, "normalizePositiveDuration");
889
+ function delay(ms) {
890
+ return new Promise((resolve) => setTimeout(resolve, ms));
891
+ }
892
+ __name(delay, "delay");
893
+ function normalizeCacheOptionsTags(options) {
894
+ const tags = /* @__PURE__ */ new Set();
895
+ for (const tag of options.tags ?? []) {
896
+ tags.add(normalizeCacheTag(tag));
897
+ }
898
+ for (const routePath of options.paths ?? []) {
899
+ tags.add(createPathCacheTag(routePath));
900
+ }
901
+ return tags;
902
+ }
903
+ __name(normalizeCacheOptionsTags, "normalizeCacheOptionsTags");
904
+ function assertFarmCacheEntry(entry, expectedKey) {
905
+ if (!entry || typeof entry !== "object" || entry.key !== expectedKey || !Array.isArray(entry.tags) || typeof entry.createdAt !== "number") {
906
+ throw new TypeError(
907
+ `Cache adapter returned an invalid entry for ${JSON.stringify(expectedKey)}.`
908
+ );
909
+ }
910
+ }
911
+ __name(assertFarmCacheEntry, "assertFarmCacheEntry");
636
912
  function getFunctionCacheIdentity(fn) {
637
913
  if (fn.name) {
638
914
  return `name:${fn.name}`;
@@ -776,7 +1052,7 @@ function mergeMetadata(base, next) {
776
1052
  __name(mergeMetadata, "mergeMetadata");
777
1053
  function addMetadataImageReference(metadata, reference) {
778
1054
  if (reference.kind === "opengraph") {
779
- const openGraph = { ...metadata.openGraph || {} };
1055
+ const openGraph = { ...metadata.openGraph };
780
1056
  if (!hasMetadataImages(openGraph.images) && !hasMetadataImages(openGraph.image)) {
781
1057
  openGraph.images = [
782
1058
  {
@@ -793,7 +1069,7 @@ function addMetadataImageReference(metadata, reference) {
793
1069
  openGraph
794
1070
  };
795
1071
  }
796
- const twitter = { ...metadata.twitter || {} };
1072
+ const twitter = { ...metadata.twitter };
797
1073
  if (!hasMetadataImages(twitter.images)) {
798
1074
  twitter.images = [reference.href];
799
1075
  twitter.card = twitter.card || "summary_large_image";
@@ -1528,7 +1804,7 @@ function matchRoutePath(pathname, middlewarePath) {
1528
1804
  if (!nestedMatch.matched) {
1529
1805
  return { matched: false };
1530
1806
  }
1531
- const params = { ...nestedMatch.params || {} };
1807
+ const params = { ...nestedMatch.params };
1532
1808
  delete params.__farmRest;
1533
1809
  return {
1534
1810
  matched: true,
@@ -1865,6 +2141,19 @@ function withFarmRouteContext(props, context) {
1865
2141
  return props;
1866
2142
  }
1867
2143
  __name(withFarmRouteContext, "withFarmRouteContext");
2144
+
2145
+ // src/nitro/production-runtime.ts
2146
+ function appendFarmLinkHeader(headers, value) {
2147
+ const current = headers.get("Link");
2148
+ if (!current) {
2149
+ headers.set("Link", value);
2150
+ return;
2151
+ }
2152
+ if (current !== value && !current.endsWith(`, ${value}`)) {
2153
+ headers.set("Link", `${current}, ${value}`);
2154
+ }
2155
+ }
2156
+ __name(appendFarmLinkHeader, "appendFarmLinkHeader");
1868
2157
  // Annotate the CommonJS export names for ESM import in node:
1869
2158
  0 && (module.exports = {
1870
2159
  _runWithAfterRequest,
@@ -1872,7 +2161,9 @@ __name(withFarmRouteContext, "withFarmRouteContext");
1872
2161
  _runWithMiddlewareContext,
1873
2162
  _runWithMiddlewareData,
1874
2163
  addMetadataImageReference,
2164
+ appendFarmLinkHeader,
1875
2165
  applyProductionMiddlewareHeaders,
2166
+ configureFarmCache,
1876
2167
  configureFarmObservability,
1877
2168
  createFarmCacheKey,
1878
2169
  createFarmLocaleCookie,