@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
@@ -778,9 +778,9 @@ var FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = "farm.integration.internalD
778
778
  var FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME = /* @__PURE__ */ Symbol.for(
779
779
  "@farm.js/core/integration-plugin-server-runtime"
780
780
  );
781
- function defineTypedIntegrationRoute(method, path4, input) {
781
+ function defineTypedIntegrationRoute(method, path5, input) {
782
782
  return {
783
- path: path4,
783
+ path: path5,
784
784
  method,
785
785
  middleware: input.middleware,
786
786
  before: input.before,
@@ -790,7 +790,7 @@ function defineTypedIntegrationRoute(method, path4, input) {
790
790
  input: normalizeIntegrationRouteInputSchemas(input),
791
791
  handler: input.handler,
792
792
  __operation: defineIntegrationAPIOperation({
793
- path: path4,
793
+ path: path5,
794
794
  method,
795
795
  bodyFormat: input.bodyFormat,
796
796
  responseFormat: input.responseFormat,
@@ -803,52 +803,52 @@ function defineTypedIntegrationRoute(method, path4, input) {
803
803
  __name(defineTypedIntegrationRoute, "defineTypedIntegrationRoute");
804
804
  function createIntegrationRouteFactory() {
805
805
  return {
806
- get(path4, input) {
806
+ get(path5, input) {
807
807
  return defineTypedIntegrationRoute(
808
808
  "GET",
809
- path4,
809
+ path5,
810
810
  input
811
811
  );
812
812
  },
813
- post(path4, input) {
813
+ post(path5, input) {
814
814
  return defineTypedIntegrationRoute(
815
815
  "POST",
816
- path4,
816
+ path5,
817
817
  {
818
818
  bodyFormat: "json",
819
819
  ...input
820
820
  }
821
821
  );
822
822
  },
823
- put(path4, input) {
823
+ put(path5, input) {
824
824
  return defineTypedIntegrationRoute(
825
825
  "PUT",
826
- path4,
826
+ path5,
827
827
  {
828
828
  bodyFormat: "json",
829
829
  ...input
830
830
  }
831
831
  );
832
832
  },
833
- patch(path4, input) {
834
- return defineTypedIntegrationRoute("PATCH", path4, {
833
+ patch(path5, input) {
834
+ return defineTypedIntegrationRoute("PATCH", path5, {
835
835
  bodyFormat: "json",
836
836
  ...input
837
837
  });
838
838
  },
839
- delete(path4, input) {
840
- return defineTypedIntegrationRoute("DELETE", path4, {
839
+ delete(path5, input) {
840
+ return defineTypedIntegrationRoute("DELETE", path5, {
841
841
  bodyFormat: "json",
842
842
  ...input
843
843
  });
844
844
  },
845
- options(path4, input) {
846
- return defineTypedIntegrationRoute("OPTIONS", path4, input);
845
+ options(path5, input) {
846
+ return defineTypedIntegrationRoute("OPTIONS", path5, input);
847
847
  },
848
- head(path4, input) {
848
+ head(path5, input) {
849
849
  return defineTypedIntegrationRoute(
850
850
  "HEAD",
851
- path4,
851
+ path5,
852
852
  input
853
853
  );
854
854
  }
@@ -971,8 +971,8 @@ __name(parseIntegrationConfigSchema, "parseIntegrationConfigSchema");
971
971
  function createIntegrationConfigValidationError(integration, error) {
972
972
  const issues = Array.isArray(error.issues) && error.issues.length > 0 ? error.issues.map((issue) => {
973
973
  const normalizedPath = normalizeIntegrationValidationPath(issue.path);
974
- const path4 = normalizedPath.length ? `${normalizedPath.join(".")}: ` : "";
975
- return `${path4}${issue.message || "Invalid config"}`;
974
+ const path5 = normalizedPath.length ? `${normalizedPath.join(".")}: ` : "";
975
+ return `${path5}${issue.message || "Invalid config"}`;
976
976
  }).join("; ") : error.message || "Invalid config";
977
977
  return new Error(`Integration "${integration.type}" config validation failed: ${issues}`);
978
978
  }
@@ -1679,8 +1679,8 @@ function normalizeIntegrationValidationIssues(source, error) {
1679
1679
  ];
1680
1680
  }
1681
1681
  __name(normalizeIntegrationValidationIssues, "normalizeIntegrationValidationIssues");
1682
- function normalizeIntegrationValidationPath(path4) {
1683
- return (path4 || []).map((segment) => {
1682
+ function normalizeIntegrationValidationPath(path5) {
1683
+ return (path5 || []).map((segment) => {
1684
1684
  const key = typeof segment === "object" && segment !== null && "key" in segment ? segment.key : segment;
1685
1685
  return typeof key === "symbol" ? key.description || key.toString() : key;
1686
1686
  });
@@ -2378,7 +2378,7 @@ __name(normalizeMatcher, "normalizeMatcher");
2378
2378
 
2379
2379
  // src/markdown.ts
2380
2380
  function resolveMarkdownConfig(config) {
2381
- if (config === false || config === void 0) {
2381
+ if (config === false) {
2382
2382
  return {
2383
2383
  enabled: false,
2384
2384
  expose: [],
@@ -2386,7 +2386,7 @@ function resolveMarkdownConfig(config) {
2386
2386
  includeMetadata: true
2387
2387
  };
2388
2388
  }
2389
- if (config === true) {
2389
+ if (config === true || config === void 0) {
2390
2390
  return {
2391
2391
  enabled: true,
2392
2392
  expose: true,
@@ -2394,7 +2394,7 @@ function resolveMarkdownConfig(config) {
2394
2394
  includeMetadata: true
2395
2395
  };
2396
2396
  }
2397
- const exposeInput = config.expose ?? config.routes ?? [];
2397
+ const exposeInput = config.expose ?? config.routes ?? true;
2398
2398
  const expose = exposeInput === true ? true : Array.isArray(exposeInput) ? exposeInput.map(normalizeMarkdownRouteInput) : [];
2399
2399
  return {
2400
2400
  enabled: config.enabled !== false && (expose === true || expose.length > 0),
@@ -2417,7 +2417,7 @@ function normalizeMarkdownRouteInput(input) {
2417
2417
  }
2418
2418
  __name(normalizeMarkdownRouteInput, "normalizeMarkdownRouteInput");
2419
2419
  function normalizeMarkdownRoute(route) {
2420
- const withoutMarkdownExtension = route.endsWith(".md") ? route.slice(0, -3) : route;
2420
+ const withoutMarkdownExtension = route.toLowerCase().endsWith(".md") ? route.slice(0, -3) : route;
2421
2421
  const withSlash = withoutMarkdownExtension.startsWith("/") ? withoutMarkdownExtension : `/${withoutMarkdownExtension}`;
2422
2422
  const normalized = withSlash.replace(/\/+/g, "/").replace(/\/$/g, "");
2423
2423
  return normalized === "" || normalized === "/index" ? "/" : normalized;
@@ -2507,7 +2507,7 @@ function normalizeCronJob(name, job) {
2507
2507
  if (!job || typeof job !== "object" || Array.isArray(job)) {
2508
2508
  throw new TypeError(`Farm cron ${JSON.stringify(name)} must be a configuration object.`);
2509
2509
  }
2510
- const path4 = normalizeCronPath(name, job.path);
2510
+ const path5 = normalizeCronPath(name, job.path);
2511
2511
  const rawSchedule = Array.isArray(job.schedule) ? job.schedule : [job.schedule];
2512
2512
  const schedule = [...new Set(rawSchedule.map((value) => normalizeCronExpression(name, value)))];
2513
2513
  if (schedule.length === 0) {
@@ -2516,7 +2516,7 @@ function normalizeCronJob(name, job) {
2516
2516
  return {
2517
2517
  name,
2518
2518
  schedule,
2519
- path: path4,
2519
+ path: path5,
2520
2520
  description: job.description?.trim() || void 0
2521
2521
  };
2522
2522
  }
@@ -2525,13 +2525,13 @@ function normalizeCronPath(name, value) {
2525
2525
  if (typeof value !== "string" || !value.trim().startsWith("/")) {
2526
2526
  throw new TypeError(`Farm cron ${JSON.stringify(name)} path must start with "/".`);
2527
2527
  }
2528
- const path4 = value.trim();
2529
- if (path4.startsWith("//") || path4.includes("?") || path4.includes("#")) {
2528
+ const path5 = value.trim();
2529
+ if (path5.startsWith("//") || path5.includes("?") || path5.includes("#")) {
2530
2530
  throw new TypeError(
2531
2531
  `Farm cron ${JSON.stringify(name)} path must be an application pathname without a host, query, or hash.`
2532
2532
  );
2533
2533
  }
2534
- return path4.length > 1 ? path4.replace(/\/+$/, "") : path4;
2534
+ return path5.length > 1 ? path5.replace(/\/+$/, "") : path5;
2535
2535
  }
2536
2536
  __name(normalizeCronPath, "normalizeCronPath");
2537
2537
  function normalizeCronExpression(name, value) {
@@ -2831,7 +2831,7 @@ function routeRulesToHeaders(routeRules) {
2831
2831
  for (const [source, rule] of Object.entries(routeRules)) {
2832
2832
  const headers = {
2833
2833
  ...normalizeCorsHeaders(rule.cors),
2834
- ...rule.headers || {}
2834
+ ...rule.headers
2835
2835
  };
2836
2836
  const entries = Object.entries(headers);
2837
2837
  if (entries.length === 0) continue;
@@ -2879,7 +2879,8 @@ var FARM_CACHE_INVALIDATION_STATE = /* @__PURE__ */ Symbol.for("farm.cacheInvali
2879
2879
  var globalState = globalThis;
2880
2880
  function getFarmCacheInvalidationState() {
2881
2881
  return globalState[FARM_CACHE_INVALIDATION_STATE] ?? (globalState[FARM_CACHE_INVALIDATION_STATE] = {
2882
- listeners: /* @__PURE__ */ new Set()
2882
+ listeners: /* @__PURE__ */ new Set(),
2883
+ taskListeners: /* @__PURE__ */ new Set()
2883
2884
  });
2884
2885
  }
2885
2886
  __name(getFarmCacheInvalidationState, "getFarmCacheInvalidationState");
@@ -2889,6 +2890,12 @@ function subscribeFarmCacheInvalidation(listener) {
2889
2890
  return () => state.listeners.delete(listener);
2890
2891
  }
2891
2892
  __name(subscribeFarmCacheInvalidation, "subscribeFarmCacheInvalidation");
2893
+ function subscribeFarmCacheTask(listener) {
2894
+ const state = getFarmCacheInvalidationState();
2895
+ state.taskListeners.add(listener);
2896
+ return () => state.taskListeners.delete(listener);
2897
+ }
2898
+ __name(subscribeFarmCacheTask, "subscribeFarmCacheTask");
2892
2899
 
2893
2900
  // src/server-action-security.ts
2894
2901
  var DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT = 1e6;
@@ -2911,6 +2918,9 @@ __name(getServerActionExecutionContext, "getServerActionExecutionContext");
2911
2918
  subscribeFarmCacheInvalidation((key) => {
2912
2919
  getServerActionExecutionContext()?.invalidations.add(key);
2913
2920
  });
2921
+ subscribeFarmCacheTask((task) => {
2922
+ getServerActionExecutionContext()?.cacheTasks.add(task);
2923
+ });
2914
2924
  function getServerActionStorage() {
2915
2925
  const globalState2 = globalThis;
2916
2926
  if (!globalState2[SERVER_ACTION_STORAGE_KEY]) {
@@ -3457,7 +3467,7 @@ var SIZE_UNITS = {
3457
3467
  gib: 1073741824
3458
3468
  };
3459
3469
  function resolveFarmImageConfig(config) {
3460
- const path4 = normalizeImagePath(config?.path ?? DEFAULT_FARM_IMAGE_PATH);
3470
+ const path5 = normalizeImagePath(config?.path ?? DEFAULT_FARM_IMAGE_PATH);
3461
3471
  const deviceSizes = normalizeIntegerList(
3462
3472
  config?.deviceSizes ?? DEFAULT_FARM_IMAGE_DEVICE_SIZES,
3463
3473
  "images.deviceSizes"
@@ -3485,7 +3495,7 @@ function resolveFarmImageConfig(config) {
3485
3495
  );
3486
3496
  return Object.freeze({
3487
3497
  provider: config?.provider ?? "auto",
3488
- path: path4,
3498
+ path: path5,
3489
3499
  domains: Object.freeze([
3490
3500
  ...new Set(
3491
3501
  (config?.domains ?? []).map((domain) => domain.trim().toLowerCase()).filter(Boolean)
@@ -3515,11 +3525,11 @@ function resolveFarmImageConfig(config) {
3515
3525
  }
3516
3526
  __name(resolveFarmImageConfig, "resolveFarmImageConfig");
3517
3527
  function normalizeImagePath(value) {
3518
- const path4 = value.trim().replace(/\/+$/, "") || "/";
3519
- if (!path4.startsWith("/") || path4.includes("?") || path4.includes("#")) {
3528
+ const path5 = value.trim().replace(/\/+$/, "") || "/";
3529
+ if (!path5.startsWith("/") || path5.includes("?") || path5.includes("#")) {
3520
3530
  throw new TypeError("images.path must be an absolute pathname without a query or hash");
3521
3531
  }
3522
- return path4;
3532
+ return path5;
3523
3533
  }
3524
3534
  __name(normalizeImagePath, "normalizeImagePath");
3525
3535
  function normalizeIntegerList(values, name, max) {
@@ -3702,6 +3712,90 @@ function normalizePositiveInteger(value, fallback, name) {
3702
3712
  }
3703
3713
  __name(normalizePositiveInteger, "normalizePositiveInteger");
3704
3714
 
3715
+ // src/auth-config.ts
3716
+ var import_node_module2 = require("module");
3717
+ var import_node_path3 = __toESM(require("path"));
3718
+ var import_node_url2 = require("url");
3719
+ function resolveFarmAuthConfig(input) {
3720
+ const config = input === true ? {} : input && typeof input === "object" ? input : {};
3721
+ const passwordConfig = typeof config.emailAndPassword === "object" ? config.emailAndPassword : {};
3722
+ const resolved = {
3723
+ enabled: input !== void 0 && input !== false && config.enabled !== false,
3724
+ appName: config.appName,
3725
+ basePath: normalizeBasePath(config.basePath),
3726
+ emailAndPassword: {
3727
+ enabled: config.emailAndPassword !== false,
3728
+ requireEmailVerification: passwordConfig.requireEmailVerification ?? false,
3729
+ minPasswordLength: passwordConfig.minPasswordLength ?? 8,
3730
+ maxPasswordLength: passwordConfig.maxPasswordLength ?? 128
3731
+ },
3732
+ session: {
3733
+ expiresIn: config.session?.expiresIn ?? 60 * 60 * 24 * 7,
3734
+ updateAge: config.session?.updateAge ?? 60 * 60 * 24
3735
+ },
3736
+ database: {
3737
+ url: config.database?.url,
3738
+ path: config.database?.path || ".farm/auth.sqlite",
3739
+ migrateInDevelopment: config.database?.migrateInDevelopment ?? true
3740
+ }
3741
+ };
3742
+ validateFarmAuthConfig(resolved);
3743
+ return resolved;
3744
+ }
3745
+ __name(resolveFarmAuthConfig, "resolveFarmAuthConfig");
3746
+ async function resolveFarmAuthIntegration(config, options) {
3747
+ if (!config.enabled) return void 0;
3748
+ const root = import_node_path3.default.resolve(options.root);
3749
+ let modulePath;
3750
+ try {
3751
+ const resolveFromApp = (0, import_node_module2.createRequire)(import_node_path3.default.join(root, "package.json"));
3752
+ modulePath = resolveFromApp.resolve("@farm.js/auth/internal");
3753
+ } catch {
3754
+ throw new Error(
3755
+ "The `auth` config requires @farm.js/auth. Install it with `pnpm add @farm.js/auth` and try again."
3756
+ );
3757
+ }
3758
+ const runtime = await import(
3759
+ /* @vite-ignore */
3760
+ (0, import_node_url2.pathToFileURL)(modulePath).href
3761
+ );
3762
+ if (typeof runtime.createFarmAuthIntegration !== "function") {
3763
+ throw new Error(
3764
+ "The installed @farm.js/auth package is incompatible with this version of @farm.js/core."
3765
+ );
3766
+ }
3767
+ return runtime.createFarmAuthIntegration(config, {
3768
+ ...options,
3769
+ root
3770
+ });
3771
+ }
3772
+ __name(resolveFarmAuthIntegration, "resolveFarmAuthIntegration");
3773
+ function normalizeBasePath(value) {
3774
+ const route = (value || "/api/auth").trim();
3775
+ const withLeadingSlash = route.startsWith("/") ? route : `/${route}`;
3776
+ const normalized = withLeadingSlash.replace(/\/+/g, "/").replace(/\/+$/, "");
3777
+ return normalized || "/api/auth";
3778
+ }
3779
+ __name(normalizeBasePath, "normalizeBasePath");
3780
+ function validateFarmAuthConfig(config) {
3781
+ const { minPasswordLength, maxPasswordLength } = config.emailAndPassword;
3782
+ if (!Number.isInteger(minPasswordLength) || minPasswordLength < 1) {
3783
+ throw new Error("auth.emailAndPassword.minPasswordLength must be a positive integer.");
3784
+ }
3785
+ if (!Number.isInteger(maxPasswordLength) || maxPasswordLength < minPasswordLength) {
3786
+ throw new Error(
3787
+ "auth.emailAndPassword.maxPasswordLength must be an integer greater than or equal to minPasswordLength."
3788
+ );
3789
+ }
3790
+ if (!Number.isInteger(config.session.expiresIn) || config.session.expiresIn < 1) {
3791
+ throw new Error("auth.session.expiresIn must be a positive integer.");
3792
+ }
3793
+ if (!Number.isInteger(config.session.updateAge) || config.session.updateAge < 0) {
3794
+ throw new Error("auth.session.updateAge must be a non-negative integer.");
3795
+ }
3796
+ }
3797
+ __name(validateFarmAuthConfig, "validateFarmAuthConfig");
3798
+
3705
3799
  // src/config.ts
3706
3800
  var FARM_RESOLVED_CUSTOM_CONTEXT = /* @__PURE__ */ Symbol.for("farm.resolvedCustomContext");
3707
3801
  function normalizeDeployTarget(target) {
@@ -3853,7 +3947,7 @@ async function findDocsConfigPath(rootDir, configPath) {
3853
3947
  __name(findDocsConfigPath, "findDocsConfigPath");
3854
3948
  async function loadDocsConfig(rootDir, configPath) {
3855
3949
  const fs = await import("fs/promises");
3856
- const { pathToFileURL: pathToFileURL2 } = await import("url");
3950
+ const { pathToFileURL: pathToFileURL3 } = await import("url");
3857
3951
  const root = import_path.default.resolve(rootDir || process.cwd());
3858
3952
  const resolvedPath = await findDocsConfigPath(root, configPath);
3859
3953
  if (!resolvedPath) return void 0;
@@ -3882,7 +3976,7 @@ async function loadDocsConfig(rootDir, configPath) {
3882
3976
  logLevel: "silent",
3883
3977
  sourcemap: "inline"
3884
3978
  });
3885
- const moduleUrl = pathToFileURL2(modulePath).href + `?t=${Date.now()}`;
3979
+ const moduleUrl = pathToFileURL3(modulePath).href + `?t=${Date.now()}`;
3886
3980
  let importedConfig;
3887
3981
  try {
3888
3982
  importedConfig = await import(
@@ -3985,6 +4079,17 @@ async function resolveConfig(userConfig, mode) {
3985
4079
  const mdx = resolveMdxConfig(userConfig.mdx);
3986
4080
  const env2 = resolveEnv(userConfig.env, process.env);
3987
4081
  setEnv(env2);
4082
+ const auth = resolveFarmAuthConfig(userConfig.auth);
4083
+ if (auth.enabled && userConfig.integrations?.auth) {
4084
+ throw new Error(
4085
+ "Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
4086
+ );
4087
+ }
4088
+ const nativeAuthIntegration = await resolveFarmAuthIntegration(auth, {
4089
+ root,
4090
+ mode
4091
+ });
4092
+ const integrations = nativeAuthIntegration ? { ...userConfig.integrations, auth: nativeAuthIntegration } : userConfig.integrations || {};
3988
4093
  const generateBuildId = userConfig.generateBuildId || (() => `build-${Date.now()}`);
3989
4094
  const deploymentId = normalizeFarmDeploymentId(
3990
4095
  userConfig.deploymentId || process.env.FARM_DEPLOYMENT_ID || process.env.VERCEL_GIT_COMMIT_SHA || process.env.CF_PAGES_COMMIT_SHA || (mode === "production" ? await generateBuildId() : "development")
@@ -4008,14 +4113,16 @@ async function resolveConfig(userConfig, mode) {
4008
4113
  observability: userConfig.observability ?? false,
4009
4114
  devtools: resolveFarmDevtoolsConfig(userConfig.devtools, mode),
4010
4115
  storage: userConfig.storage || {},
4116
+ cache: userConfig.cache || {},
4117
+ auth,
4011
4118
  suppressLintOnLink: userConfig.suppressLintOnLink ?? false,
4012
4119
  experimental: {
4013
4120
  serverComponents: false,
4014
4121
  serverActions: false,
4015
4122
  ...userConfig.experimental
4016
4123
  },
4017
- plugins: [...resolveIntegrationPlugins(userConfig.integrations), ...userConfig.plugins || []],
4018
- integrations: userConfig.integrations || {},
4124
+ plugins: [...resolveIntegrationPlugins(integrations), ...userConfig.plugins || []],
4125
+ integrations,
4019
4126
  trailingSlash: userConfig.trailingSlash ?? false,
4020
4127
  redirects: /* @__PURE__ */ __name(() => [...redirects, ...routeRuleRedirects], "redirects"),
4021
4128
  rewrites: /* @__PURE__ */ __name(() => rewrites, "rewrites"),