@farm.js/core 0.1.50 → 0.1.51-beta.0

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 (252) hide show
  1. package/README.md +163 -3
  2. package/dist/{agent-mcp-9BMbRgg_.d.ts → agent-mcp-BBMfNpsC.d.ts} +1 -1
  3. package/dist/{agent-mcp-CIMH324y.d.mts → agent-mcp-D44ip11f.d.mts} +1 -1
  4. package/dist/agent-runtime.d.mts +1 -1
  5. package/dist/agent-runtime.d.ts +1 -1
  6. package/dist/{analyzer-DDW34OMC.mjs → analyzer-HOUCQR3K.mjs} +1 -1
  7. package/dist/{analyzer-CN7C74WX.cjs → analyzer-VKUDHNDF.cjs} +2 -2
  8. package/dist/api/route-manager.cjs +5 -5
  9. package/dist/api/route-manager.d.mts +3 -3
  10. package/dist/api/route-manager.d.ts +3 -3
  11. package/dist/api/route-manager.mjs +4 -4
  12. package/dist/api/runtime.d.mts +2 -2
  13. package/dist/api/runtime.d.ts +2 -2
  14. package/dist/api.cjs +6 -6
  15. package/dist/api.d.mts +3 -3
  16. package/dist/api.d.ts +3 -3
  17. package/dist/api.mjs +5 -5
  18. package/dist/{app-BWibTHVT.d.ts → app-CourU3rQ.d.ts} +4 -4
  19. package/dist/{app-DVJ13FPA.d.mts → app-aeD4s_mg.d.mts} +4 -4
  20. package/dist/{app-manifest-CQDJOKL2.d.mts → app-manifest-BC6mFn5A.d.mts} +1 -1
  21. package/dist/{app-manifest-D0kaXdwu.d.ts → app-manifest-LzjoNPeq.d.ts} +1 -1
  22. package/dist/app-markdown.d.mts +2 -2
  23. package/dist/app-markdown.d.ts +2 -2
  24. package/dist/base-path-BOUV5ozD.d.mts +10 -0
  25. package/dist/base-path-BOUV5ozD.d.ts +10 -0
  26. package/dist/{chunk-RWT2BTJT.cjs → chunk-2IAPKPEB.cjs} +6 -6
  27. package/dist/{chunk-2G63BIRL.mjs → chunk-2KVDHNQS.mjs} +8 -11
  28. package/dist/{chunk-76R5GJER.mjs → chunk-3HA7PP72.mjs} +2 -2
  29. package/dist/{chunk-NJVFPJ2Y.cjs → chunk-3OWVWZ6R.cjs} +28 -2
  30. package/dist/{chunk-KO2NWUKN.mjs → chunk-4GJJ65RB.mjs} +9 -1
  31. package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
  32. package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
  33. package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
  34. package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
  35. package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
  36. package/dist/{chunk-CPXDDWGL.mjs → chunk-AER5I65K.mjs} +1 -1
  37. package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
  38. package/dist/{chunk-WVBUXNBX.mjs → chunk-AMRK3P6W.mjs} +123 -47
  39. package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
  40. package/dist/chunk-CKPTIEDX.cjs +12 -0
  41. package/dist/{chunk-B5S2JS6M.cjs → chunk-DWW3AMJX.cjs} +288 -255
  42. package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
  43. package/dist/{chunk-3ATXWZPH.cjs → chunk-E36C43IX.cjs} +13 -16
  44. package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
  45. package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
  46. package/dist/{chunk-474FO3UE.cjs → chunk-F42U3R4F.cjs} +170 -163
  47. package/dist/{chunk-6QA2SXVH.cjs → chunk-FK25QSVC.cjs} +2 -1
  48. package/dist/{chunk-BW6SCVYX.mjs → chunk-FSQMN2MQ.mjs} +1 -0
  49. package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
  50. package/dist/chunk-GNZIAJGB.mjs +358 -0
  51. package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
  52. package/dist/{chunk-B6PREBN6.cjs → chunk-HASX6DC7.cjs} +8 -8
  53. package/dist/{chunk-ZLOQQ2UF.mjs → chunk-I2ZA5SXS.mjs} +60 -27
  54. package/dist/{chunk-X2EL3BLH.cjs → chunk-IOUOGRDX.cjs} +11 -3
  55. package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
  56. package/dist/{chunk-GOOK2J2W.cjs → chunk-J22JD5YJ.cjs} +2 -2
  57. package/dist/{chunk-2DEPNLXK.mjs → chunk-JF5CNHHF.mjs} +4 -4
  58. package/dist/{chunk-VOZ5DI7D.mjs → chunk-JWI5PUO2.mjs} +6 -2
  59. package/dist/{chunk-YAXOEAND.cjs → chunk-KHXAJ2KA.cjs} +6 -6
  60. package/dist/{chunk-WXHDVXJE.mjs → chunk-KY32FWK7.mjs} +2 -2
  61. package/dist/{chunk-EQWWOQTK.cjs → chunk-LEIXUFJN.cjs} +6 -2
  62. package/dist/{chunk-2GLQSIZD.mjs → chunk-LMFJCXDD.mjs} +1 -1
  63. package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
  64. package/dist/{chunk-5V4KZOZO.mjs → chunk-LZ4SB57H.mjs} +2 -2
  65. package/dist/{chunk-E2BMCNMJ.cjs → chunk-MMEEXMUQ.cjs} +2 -2
  66. package/dist/chunk-N4AQNEXR.cjs +17 -0
  67. package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
  68. package/dist/{chunk-LYWAGXXW.cjs → chunk-O3MMJPC2.cjs} +12 -12
  69. package/dist/{chunk-FACTMUPI.cjs → chunk-PDJSL7PL.cjs} +30 -19
  70. package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
  71. package/dist/chunk-PIUTGRDI.cjs +358 -0
  72. package/dist/{chunk-KGP76FSV.mjs → chunk-PPDHCRTC.mjs} +1 -1
  73. package/dist/{chunk-C73RIAEF.mjs → chunk-QI5AQMEE.mjs} +17 -6
  74. package/dist/{chunk-F5LERVY3.cjs → chunk-QK3HBOTG.cjs} +10 -10
  75. package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
  76. package/dist/{chunk-JJOWY3XD.mjs → chunk-R5P4KFPM.mjs} +1 -1
  77. package/dist/{chunk-IWJKJDNW.mjs → chunk-S5ZA2T2W.mjs} +35 -28
  78. package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
  79. package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
  80. package/dist/{chunk-KZH6YLND.cjs → chunk-SO3T6T4I.cjs} +427 -351
  81. package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
  82. package/dist/{chunk-7ONZDKVY.mjs → chunk-T4EW7AAD.mjs} +2 -2
  83. package/dist/{chunk-UY6HS5PF.cjs → chunk-USL2ANCB.cjs} +8 -8
  84. package/dist/{chunk-4T25YCZ5.cjs → chunk-VIFPE5RG.cjs} +14 -14
  85. package/dist/{chunk-HYN3LLG7.cjs → chunk-VO6NLTV4.cjs} +3 -3
  86. package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
  87. package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
  88. package/dist/{chunk-X3HOVNHI.mjs → chunk-WSY2JD7O.mjs} +6 -6
  89. package/dist/{chunk-SHJJM6OG.mjs → chunk-WVX3BUNJ.mjs} +1 -1
  90. package/dist/chunk-X3EFRVXY.mjs +12 -0
  91. package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
  92. package/dist/{chunk-RHOR2J6V.cjs → chunk-X5BCMLGP.cjs} +1 -1
  93. package/dist/{chunk-IQXGHGZF.cjs → chunk-XB24LZWI.cjs} +5 -5
  94. package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
  95. package/dist/{chunk-CGCJ2TJU.cjs → chunk-XPMC4E2G.cjs} +3 -3
  96. package/dist/{chunk-HWCHIBJZ.mjs → chunk-XWC5NAHV.mjs} +4 -4
  97. package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
  98. package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
  99. package/dist/{chunk-IUBDMDZZ.cjs → chunk-Y7TLL65B.cjs} +4 -4
  100. package/dist/{chunk-M7LKA632.mjs → chunk-YLNBWUVS.mjs} +1 -1
  101. package/dist/chunk-Z5A6CNV2.mjs +60 -0
  102. package/dist/chunk-Z64V4WZI.mjs +17 -0
  103. package/dist/{chunk-2VCC3GVC.mjs → chunk-ZF3GX4O7.mjs} +1 -1
  104. package/dist/{client-plugins-BPfltM5m.d.ts → client-plugins-CFBEfVPO.d.ts} +20 -3
  105. package/dist/{client-plugins-D4RO59f0.d.mts → client-plugins-cqy_dQd0.d.mts} +20 -3
  106. package/dist/client-plugins.d.mts +1 -1
  107. package/dist/client-plugins.d.ts +1 -1
  108. package/dist/client.cjs +5 -4
  109. package/dist/client.d.mts +6 -6
  110. package/dist/client.d.ts +6 -6
  111. package/dist/client.mjs +4 -3
  112. package/dist/config.d.mts +1 -1
  113. package/dist/config.d.ts +1 -1
  114. package/dist/cron.cjs +4 -4
  115. package/dist/cron.mjs +3 -3
  116. package/dist/desktop.d.mts +2 -2
  117. package/dist/desktop.d.ts +2 -2
  118. package/dist/{devtools-STG7HPRV.mjs → devtools-4MLL3RAL.mjs} +6 -6
  119. package/dist/{devtools-N5XTOECL.cjs → devtools-4ZLMD454.cjs} +8 -8
  120. package/dist/docs.cjs +10 -10
  121. package/dist/docs.d.mts +2 -2
  122. package/dist/docs.d.ts +2 -2
  123. package/dist/docs.mjs +9 -9
  124. package/dist/{index-k8o8eUOd.d.mts → index-BYkNbeQV.d.mts} +1 -1
  125. package/dist/{index-C-N3Pwg-.d.ts → index-BxjN_UDZ.d.ts} +1 -1
  126. package/dist/index.cjs +42 -40
  127. package/dist/index.d.mts +16 -16
  128. package/dist/index.d.ts +16 -16
  129. package/dist/index.mjs +41 -39
  130. package/dist/integrations.d.mts +1 -1
  131. package/dist/integrations.d.ts +1 -1
  132. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  133. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  134. package/dist/internal/build-runtime.cjs +32 -31
  135. package/dist/internal/build-runtime.d.mts +3 -3
  136. package/dist/internal/build-runtime.d.ts +3 -3
  137. package/dist/internal/build-runtime.mjs +31 -30
  138. package/dist/internal/cli-runtime.cjs +15 -15
  139. package/dist/internal/cli-runtime.mjs +14 -14
  140. package/dist/internal/client-error-overlay.cjs +4 -4
  141. package/dist/internal/client-error-overlay.mjs +1 -1
  142. package/dist/internal/client-runtime.cjs +4 -2
  143. package/dist/internal/client-runtime.d.mts +5 -5
  144. package/dist/internal/client-runtime.d.ts +5 -5
  145. package/dist/internal/client-runtime.mjs +3 -1
  146. package/dist/internal/compression-runtime.d.mts +1 -1
  147. package/dist/internal/compression-runtime.d.ts +1 -1
  148. package/dist/internal/config-runtime.cjs +8 -8
  149. package/dist/internal/config-runtime.d.mts +3 -3
  150. package/dist/internal/config-runtime.d.ts +3 -3
  151. package/dist/internal/config-runtime.mjs +7 -7
  152. package/dist/internal/form-actions.cjs +4 -3
  153. package/dist/internal/form-actions.mjs +3 -2
  154. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  155. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  156. package/dist/internal/islands-runtime.cjs +56 -0
  157. package/dist/internal/islands-runtime.mjs +57 -1
  158. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  159. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  160. package/dist/internal/production-runtime.cjs +11 -8
  161. package/dist/internal/production-runtime.d.mts +24 -11
  162. package/dist/internal/production-runtime.d.ts +24 -11
  163. package/dist/internal/production-runtime.mjs +10 -7
  164. package/dist/internal/server-fn-transform.cjs +13 -0
  165. package/dist/internal/server-fn-transform.d.mts +24 -0
  166. package/dist/internal/server-fn-transform.d.ts +24 -0
  167. package/dist/internal/server-fn-transform.mjs +13 -0
  168. package/dist/markdown.d.mts +1 -1
  169. package/dist/markdown.d.ts +1 -1
  170. package/dist/middleware.cjs +7 -7
  171. package/dist/middleware.d.mts +3 -3
  172. package/dist/middleware.d.ts +3 -3
  173. package/dist/middleware.mjs +6 -6
  174. package/dist/mobile.d.mts +30 -3
  175. package/dist/mobile.d.ts +30 -3
  176. package/dist/{navigation-delegate-8xg3Zvp4.d.ts → navigation-delegate-BU4xqdnw.d.ts} +1 -1
  177. package/dist/{navigation-delegate-ji6elCKy.d.mts → navigation-delegate-DLhbfEN4.d.mts} +1 -1
  178. package/dist/navigation.d.mts +4 -4
  179. package/dist/navigation.d.ts +4 -4
  180. package/dist/{nitro-YPSZBYDK.cjs → nitro-CK7M4RMY.cjs} +11 -11
  181. package/dist/{nitro-2Q5NVY7L.mjs → nitro-R444AF3O.mjs} +7 -7
  182. package/dist/plugin.cjs +25 -23
  183. package/dist/plugin.d.mts +3 -3
  184. package/dist/plugin.d.ts +3 -3
  185. package/dist/plugin.mjs +24 -22
  186. package/dist/{production-runtime-TdKaYRj0.d.ts → production-runtime-C78A8YgK.d.ts} +1 -1
  187. package/dist/{production-runtime-DXnQQkQf.d.mts → production-runtime-DLA4J5WG.d.mts} +1 -1
  188. package/dist/{programmatic-routes-client-BwiTndEC.d.ts → programmatic-routes-client-CBqkNhBy.d.ts} +2 -2
  189. package/dist/{programmatic-routes-client-Dh1SDLSM.d.mts → programmatic-routes-client-NpqGBn-i.d.mts} +2 -2
  190. package/dist/{render-plan-BvCGXF6K.d.mts → render-plan-C9sWvDTv.d.mts} +1 -1
  191. package/dist/{render-plan-BPbwRbuN.d.ts → render-plan-CrqcBbnV.d.ts} +1 -1
  192. package/dist/renderer-client.cjs +8 -6
  193. package/dist/renderer-client.d.mts +4 -4
  194. package/dist/renderer-client.d.ts +4 -4
  195. package/dist/renderer-client.mjs +4 -2
  196. package/dist/{request-B8PGTZNR.d.ts → request-BizeuqD7.d.ts} +1 -1
  197. package/dist/{request-C_xTkJib.d.mts → request-WwB1-Uim.d.mts} +1 -1
  198. package/dist/request.d.mts +2 -2
  199. package/dist/request.d.ts +2 -2
  200. package/dist/{route-rendering-RNtcj607.d.ts → route-rendering-BGhJN64l.d.ts} +1 -1
  201. package/dist/{route-rendering-DlddURL1.d.mts → route-rendering-S6NFjnx4.d.mts} +1 -1
  202. package/dist/{router-B97eB0Mq.d.mts → router-BIheIy9G.d.mts} +1 -1
  203. package/dist/{router-qUVaoEN8.d.ts → router-BUD_j2EL.d.ts} +1 -1
  204. package/dist/routes.cjs +3 -2
  205. package/dist/routes.d.mts +2 -2
  206. package/dist/routes.d.ts +2 -2
  207. package/dist/routes.mjs +2 -1
  208. package/dist/{rsc-pipeline-L4XOZ2TE.cjs → rsc-pipeline-JRGUZBYM.cjs} +11 -11
  209. package/dist/{rsc-pipeline-T3775JUA.mjs → rsc-pipeline-OLAVIKI3.mjs} +10 -10
  210. package/dist/{runtime-C8GUnNeP.d.ts → runtime-CWP-21hP.d.ts} +1 -1
  211. package/dist/{runtime-CaDswfWi.d.mts → runtime-CgJwe6H_.d.mts} +1 -1
  212. package/dist/{runtime-BIBGJO7V.cjs → runtime-G23RSLEK.cjs} +14 -14
  213. package/dist/{runtime-HRSFC4ZC.mjs → runtime-OGCHDACZ.mjs} +12 -12
  214. package/dist/{schema-dev-notice-LZ5NXGLN.mjs → schema-dev-notice-F6QYSOAI.mjs} +2 -2
  215. package/dist/{schema-dev-notice-XV7GZ3QJ.cjs → schema-dev-notice-UU7DMZEU.cjs} +3 -3
  216. package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
  217. package/dist/search-client-ZZLKVO5R.cjs +15 -0
  218. package/dist/server-action-security.cjs +2 -2
  219. package/dist/server-action-security.mjs +1 -1
  220. package/dist/server-fn.cjs +3 -3
  221. package/dist/server-fn.mjs +2 -2
  222. package/dist/server-plugins.d.mts +2 -2
  223. package/dist/server-plugins.d.ts +2 -2
  224. package/dist/server-query-client.cjs +4 -3
  225. package/dist/server-query-client.mjs +3 -2
  226. package/dist/server-query.cjs +4 -4
  227. package/dist/server-query.mjs +3 -3
  228. package/dist/server.cjs +57 -55
  229. package/dist/server.d.mts +9 -9
  230. package/dist/server.d.ts +9 -9
  231. package/dist/server.mjs +34 -32
  232. package/dist/{spa-router-Dlv5ofg0.d.mts → spa-router-CVOL0Vrq.d.mts} +2 -2
  233. package/dist/{spa-router-qapSboKz.d.ts → spa-router-Kytv4jSB.d.ts} +2 -2
  234. package/dist/testing.cjs +12 -11
  235. package/dist/testing.d.mts +1 -1
  236. package/dist/testing.d.ts +1 -1
  237. package/dist/testing.mjs +9 -8
  238. package/dist/{utils-A-cYF81u.d.ts → utils-DbyXlzaj.d.ts} +1 -1
  239. package/dist/{utils-DyvlSxFk.d.mts → utils-Dsa1HZ7X.d.mts} +1 -1
  240. package/dist/version.cjs +2 -2
  241. package/dist/version.mjs +1 -1
  242. package/dist/vite.cjs +25 -23
  243. package/dist/vite.d.mts +4 -4
  244. package/dist/vite.d.ts +4 -4
  245. package/dist/vite.mjs +24 -22
  246. package/dist/workflows.cjs +4 -4
  247. package/dist/workflows.mjs +3 -3
  248. package/package.json +8 -3
  249. package/dist/base-path-leyrqXbX.d.mts +0 -19
  250. package/dist/base-path-leyrqXbX.d.ts +0 -19
  251. package/dist/chunk-OTOOJIUB.mjs +0 -34
  252. package/dist/search-client-QCYAL6AY.cjs +0 -13
@@ -16,7 +16,27 @@ function searchParamsToObject(searchParams) {
16
16
  });
17
17
  return output;
18
18
  }
19
+ var RESERVED_SEARCH_KEYS = /* @__PURE__ */ new Set([
20
+ "then",
21
+ "catch",
22
+ "finally",
23
+ "__proto__",
24
+ "constructor",
25
+ "prototype"
26
+ ]);
27
+ function createFarmSearchParams(search) {
28
+ const promise = Promise.resolve(search);
29
+ for (const key of Object.keys(search)) {
30
+ if (RESERVED_SEARCH_KEYS.has(key)) continue;
31
+ Object.defineProperty(promise, key, {
32
+ value: search[key],
33
+ enumerable: true
34
+ });
35
+ }
36
+ return promise;
37
+ }
38
+
19
39
 
20
40
 
21
41
 
22
- exports.searchParamsToObject = searchParamsToObject;
42
+ exports.searchParamsToObject = searchParamsToObject; exports.createFarmSearchParams = createFarmSearchParams;
@@ -4,13 +4,13 @@ import {
4
4
  _runServerFunctionForCaller,
5
5
  createServerFn,
6
6
  createServerFunctionDescriptor
7
- } from "./chunk-CPXDDWGL.mjs";
7
+ } from "./chunk-AER5I65K.mjs";
8
8
  import {
9
9
  createFarmServerQueryResult
10
10
  } from "./chunk-N7XWC6BN.mjs";
11
11
  import {
12
12
  getServerActionExecutionContext
13
- } from "./chunk-BW6SCVYX.mjs";
13
+ } from "./chunk-FSQMN2MQ.mjs";
14
14
  import {
15
15
  createRouteDataCacheTag,
16
16
  getFarmDataCache
@@ -2,13 +2,13 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkL6QDME5Zcjs = require('./chunk-L6QDME5Z.cjs');
6
5
 
6
+ var _chunkUPYIFH2Hcjs = require('./chunk-UPYIFH2H.cjs');
7
7
 
8
8
 
9
9
 
10
10
 
11
- var _chunkUPYIFH2Hcjs = require('./chunk-UPYIFH2H.cjs');
11
+ var _chunkB3GZAQSCcjs = require('./chunk-B3GZAQSC.cjs');
12
12
 
13
13
 
14
14
 
@@ -27,7 +27,7 @@ var _chunkSNP33A33cjs = require('./chunk-SNP33A33.cjs');
27
27
  var _chunkJYNNIGQOcjs = require('./chunk-JYNNIGQO.cjs');
28
28
 
29
29
 
30
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
30
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
31
31
 
32
32
 
33
33
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
@@ -240,11 +240,11 @@ var MiddlewareManager = class {
240
240
  middlewareByDirectory.set(entry.location.directory, entry);
241
241
  }
242
242
  }
243
- this.middleware = Array.from(middlewareByDirectory.values()).sort((left, right) => _chunkL6QDME5Zcjs.compareMiddlewareRouteLocations.call(void 0, left.location, right.location)).map((entry) => entry.middleware);
243
+ this.middleware = Array.from(middlewareByDirectory.values()).sort((left, right) => _chunkB3GZAQSCcjs.compareMiddlewareRouteLocations.call(void 0, left.location, right.location)).map((entry) => entry.middleware);
244
244
  if (process.env.FARM_VERBOSE && this.middleware.length > 0) {
245
- _chunkXN2MB4QZcjs.logger.success(`Discovered ${this.middleware.length} middleware files`);
245
+ _chunkVQJYGZNXcjs.logger.success(`Discovered ${this.middleware.length} middleware files`);
246
246
  for (const mw of this.middleware) {
247
- _chunkXN2MB4QZcjs.logger.info(` ${mw.path} (${mw.handlers.length} handlers)`);
247
+ _chunkVQJYGZNXcjs.logger.info(` ${mw.path} (${mw.handlers.length} handlers)`);
248
248
  }
249
249
  }
250
250
  }
@@ -267,8 +267,8 @@ var MiddlewareManager = class {
267
267
  if (entry.isDirectory() && !entry.name.startsWith(".")) {
268
268
  await this.discoverInDirectory(
269
269
  path.join(dir, entry.name),
270
- _chunkL6QDME5Zcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
271
- _chunkL6QDME5Zcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
270
+ _chunkB3GZAQSCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
271
+ _chunkB3GZAQSCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
272
272
  discovered
273
273
  );
274
274
  }
@@ -4,14 +4,14 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkX2EL3BLHcjs = require('./chunk-X2EL3BLH.cjs');
7
+ var _chunkIOUOGRDXcjs = require('./chunk-IOUOGRDX.cjs');
8
8
 
9
9
 
10
10
 
11
11
  var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
12
12
 
13
13
 
14
- var _chunkLYWAGXXWcjs = require('./chunk-LYWAGXXW.cjs');
14
+ var _chunkO3MMJPC2cjs = require('./chunk-O3MMJPC2.cjs');
15
15
 
16
16
 
17
17
 
@@ -26,7 +26,7 @@ function hasFarmDocsRuntimeAdapter(docs) {
26
26
  }
27
27
  function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded) {
28
28
  if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
29
- const guarded = _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, options), docs).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunkX2EL3BLHcjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
29
+ const guarded = _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, docs, options), docs).filter((page) => isPathGuarded(page.href) || isPathGuarded(_chunkIOUOGRDXcjs.getFarmDocsMarkdownPath.call(void 0, page.href))).map((page) => page.href);
30
30
  if (guarded.length === 0) return;
31
31
  throw new Error(
32
32
  `Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
@@ -44,7 +44,7 @@ function createFarmDocsAdapterRuntimeConfig(docs, options, moduleConfig) {
44
44
  ...moduleConfig ? { ...moduleConfig, ...docs.configOverrides } : _nullishCoalesce(docs.runtimeConfig, () => ( docs.config)),
45
45
  entry: docs.config.entry || docs.entry.replace(/^\/+|\/+$/g, "") || "docs",
46
46
  docsPath: docs.entry,
47
- contentDir: _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
47
+ contentDir: _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, docs, options)
48
48
  };
49
49
  }
50
50
  function getFarmDocsAdapterStylesheets(options) {
@@ -260,22 +260,22 @@ function getDocsDescription(docs) {
260
260
  return _optionalChain([docs, 'access', _11 => _11.config, 'access', _12 => _12.metadata, 'optionalAccess', _13 => _13.description]);
261
261
  }
262
262
  function getLoadedDocsPages(context) {
263
- return _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunkX2EL3BLHcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
263
+ return _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => _chunkIOUOGRDXcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
264
264
  }
265
265
  function toDocsSourcePage(page) {
266
266
  return {
267
- ..._chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page),
267
+ ..._chunkIOUOGRDXcjs.toFarmDocsMarkdownPage.call(void 0, page),
268
268
  sourcePath: page.sourcePath
269
269
  };
270
270
  }
271
271
  function toDocsSitemapPage(page) {
272
272
  return {
273
- ..._chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page),
273
+ ..._chunkIOUOGRDXcjs.toFarmDocsMarkdownPage.call(void 0, page),
274
274
  sourcePath: page.sourcePath
275
275
  };
276
276
  }
277
277
  function toDocsLlmsPage(page) {
278
- return _chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page);
278
+ return _chunkIOUOGRDXcjs.toFarmDocsMarkdownPage.call(void 0, page);
279
279
  }
280
280
  function getDocsLlmsOptions(context, request) {
281
281
  const configured = isRecord(context.docs.config.llmsTxt) ? context.docs.config.llmsTxt : {};
@@ -362,7 +362,7 @@ function renderAgentsDocument(context, request) {
362
362
  function buildAgentSpec(context, request) {
363
363
  const url = new URL(request.url);
364
364
  const origin = url.origin;
365
- const pages = _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
365
+ const pages = _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs).filter(
366
366
  (page) => !context.isPathGuarded(page.href)
367
367
  );
368
368
  const spec = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(context, request));
@@ -450,7 +450,7 @@ function buildPublicConfig(context) {
450
450
  };
451
451
  }
452
452
  function buildDiagnostics(context) {
453
- const pages = _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
453
+ const pages = _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, context.contentDir, context.docs);
454
454
  const diagnostics = _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).buildDocsDiagnostics(context.docs.config, {
455
455
  entry: context.docs.entry,
456
456
  mcp: {
@@ -520,13 +520,13 @@ async function resolveAPIContext(options) {
520
520
  config: options.config,
521
521
  configPath: options.configPath
522
522
  }));
523
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkLYWAGXXWcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
523
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkO3MMJPC2cjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
524
524
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _20 => _20.guardedPaths]), () => ( [])));
525
525
  return {
526
526
  root,
527
527
  srcDir,
528
528
  docs,
529
- contentDir: _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
529
+ contentDir: _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, docs, { root, srcDir }),
530
530
  diagnostics: options.diagnostics === true,
531
531
  isPathGuarded: _nullishCoalesce(options.isPathGuarded, () => ( ((pathname) => guardedPaths.has(pathname))))
532
532
  };
@@ -585,12 +585,12 @@ async function handleDocsAPIGet(request, context) {
585
585
  if (format === "markdown" || url.pathname.endsWith(".md")) {
586
586
  const pathParam = url.searchParams.get("path") || url.searchParams.get("slug");
587
587
  const slug = normalizeDocsApiSlug(_nullishCoalesce(_nullishCoalesce(pathParam, () => ( pathTarget.slug)), () => ( "")), context.docs);
588
- const page = _chunkX2EL3BLHcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
588
+ const page = _chunkIOUOGRDXcjs.loadFarmDocsPage.call(void 0, context.contentDir, context.docs, slug);
589
589
  if (!page || context.isPathGuarded(page.href)) {
590
590
  return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
591
591
  }
592
592
  return text(
593
- _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page), {
593
+ _chunkV3UOEWCBcjs.docsEngine.call(void 0, ).renderDocsMarkdownDocument(_chunkIOUOGRDXcjs.toFarmDocsMarkdownPage.call(void 0, page), {
594
594
  origin: new URL(request.url).origin,
595
595
  llms: getDocsLlmsOptions(context, request),
596
596
  sitemap: context.docs.config.sitemap
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkGOOK2J2Wcjs = require('./chunk-GOOK2J2W.cjs');
3
+ var _chunkJ22JD5YJcjs = require('./chunk-J22JD5YJ.cjs');
4
4
 
5
5
 
6
6
  var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
@@ -273,7 +273,7 @@ function requestEvent(metadata, method, status, durationMs) {
273
273
  id: uuid(),
274
274
  requestId: metadata.id,
275
275
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
276
- route: routeTemplate(_chunkGOOK2J2Wcjs.getFarmRouteLabel.call(void 0, metadata.route)),
276
+ route: routeTemplate(_chunkJ22JD5YJcjs.getFarmRouteLabel.call(void 0, metadata.route)),
277
277
  agent: metadata.agent,
278
278
  kind: "request",
279
279
  method,
@@ -286,7 +286,7 @@ function toolEvent(metadata, event) {
286
286
  id: uuid(),
287
287
  requestId: metadata.id,
288
288
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
289
- route: routeTemplate(_chunkGOOK2J2Wcjs.getFarmRouteLabel.call(void 0, metadata.route)),
289
+ route: routeTemplate(_chunkJ22JD5YJcjs.getFarmRouteLabel.call(void 0, metadata.route)),
290
290
  agent: metadata.agent,
291
291
  kind: "mcp.tool",
292
292
  tool: event.tool,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkJHXJBNLYcjs = require('./chunk-JHXJBNLY.cjs');
3
+ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
4
4
 
5
5
 
6
6
  var _chunk6CTFVBATcjs = require('./chunk-6CTFVBAT.cjs');
@@ -172,11 +172,11 @@ async function fileExists(filePath) {
172
172
  }
173
173
  }
174
174
  async function globFiles(pattern, cwd) {
175
- const glob = await import("fast-glob");
176
- return glob.default(pattern, { cwd, absolute: false });
175
+ const { glob } = await import("tinyglobby");
176
+ return glob(pattern, { cwd, expandDirectories: false });
177
177
  }
178
178
  function parseSearchParams(searchParams) {
179
- return _chunkJHXJBNLYcjs.searchParamsToObject.call(void 0, searchParams);
179
+ return _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, searchParams);
180
180
  }
181
181
  var logger = {
182
182
  info: (message) => console.log(`[info] ${message}`),
@@ -1,8 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
+ var _chunkN4AQNEXRcjs = require('./chunk-N4AQNEXR.cjs');
3
4
 
4
5
 
5
- var _chunkWQGRD5BJcjs = require('./chunk-WQGRD5BJ.cjs');
6
+
7
+ var _chunkEX6ZSN5Pcjs = require('./chunk-EX6ZSN5P.cjs');
6
8
 
7
9
 
8
10
  var _chunkI2BYNELAcjs = require('./chunk-I2BYNELA.cjs');
@@ -11,7 +13,7 @@ var _chunkI2BYNELAcjs = require('./chunk-I2BYNELA.cjs');
11
13
  var _react = require('react');
12
14
  function useServerQuery(query, input, options = {}) {
13
15
  const cache = _chunkI2BYNELAcjs.getFarmClientDataCache.call(void 0, );
14
- const key = _chunkWQGRD5BJcjs.createServerQueryCallKey.call(void 0, query, input);
16
+ const key = _chunkEX6ZSN5Pcjs.createServerQueryCallKey.call(void 0, query, input);
15
17
  const inputRef = _react.useRef.call(void 0, input);
16
18
  const optionsRef = _react.useRef.call(void 0, options);
17
19
  const mountedKeyRef = _react.useRef.call(void 0, void 0);
@@ -33,7 +35,7 @@ function useServerQuery(query, input, options = {}) {
33
35
  const run = _react.useCallback.call(void 0,
34
36
  (force = false) => {
35
37
  pendingInvalidationRef.current = false;
36
- return _chunkWQGRD5BJcjs.fetchServerQuery.call(void 0, query, inputRef.current, {
38
+ return _chunkEX6ZSN5Pcjs.fetchServerQuery.call(void 0, query, inputRef.current, {
37
39
  ...optionsRef.current,
38
40
  force
39
41
  });
@@ -53,7 +55,7 @@ function useServerQuery(query, input, options = {}) {
53
55
  }, [cache, entry, key, options.enabled, run]);
54
56
  _react.useEffect.call(void 0, () => {
55
57
  if (options.enabled === false) return;
56
- return _chunkWQGRD5BJcjs.attachRevalidationListeners.call(void 0,
58
+ return _chunkN4AQNEXRcjs.attachRevalidationListeners.call(void 0,
57
59
  () => {
58
60
  if (cache.isStale(key)) void run().catch(() => void 0);
59
61
  },
@@ -1,14 +1,14 @@
1
- import {
2
- appendMiddlewareDirectory,
3
- appendMiddlewareRoutePath,
4
- compareMiddlewareRouteLocations
5
- } from "./chunk-4HBKBHVP.mjs";
6
1
  import {
7
2
  normalizeMiddlewareModule,
8
3
  parseMiddlewareCookieHeader,
9
4
  serializeMiddlewareCookie,
10
5
  serializeMiddlewareCookieDeletion
11
6
  } from "./chunk-KPAJWD3N.mjs";
7
+ import {
8
+ appendMiddlewareDirectory,
9
+ appendMiddlewareRoutePath,
10
+ compareMiddlewareRouteLocations
11
+ } from "./chunk-5ENW27SL.mjs";
12
12
  import {
13
13
  compileMiddlewareConfig,
14
14
  compileMiddlewareRoute,
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-TUOO6IK3.mjs";
28
28
  import {
29
29
  logger
30
- } from "./chunk-2SVJGOAX.mjs";
30
+ } from "./chunk-Y3N5BFRJ.mjs";
31
31
  import {
32
32
  emitFarmEvent
33
33
  } from "./chunk-2DA7CLY7.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRouteTypeDeclarations,
3
3
  generateRouteTypes
4
- } from "./chunk-2G63BIRL.mjs";
4
+ } from "./chunk-2KVDHNQS.mjs";
5
5
  import {
6
6
  readSchemaTables
7
7
  } from "./chunk-2DLGV2ZG.mjs";
@@ -0,0 +1,12 @@
1
+ // src/islands-action-protocol.ts
2
+ var FARM_ACTION_RESULT_KEY = "__farmAction";
3
+ function isFarmIslandsActionResult(value) {
4
+ if (!value || typeof value !== "object") return false;
5
+ const meta = value[FARM_ACTION_RESULT_KEY];
6
+ return !!meta && typeof meta === "object" && Array.isArray(meta.invalidations);
7
+ }
8
+
9
+ export {
10
+ FARM_ACTION_RESULT_KEY,
11
+ isFarmIslandsActionResult
12
+ };
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-YP7YO3S3.mjs";
8
8
  import {
9
9
  toPosixPath
10
- } from "./chunk-2SVJGOAX.mjs";
10
+ } from "./chunk-Y3N5BFRJ.mjs";
11
11
 
12
12
  // src/cron.ts
13
13
  var DEFAULT_FARM_CRON_SECRET_ENV = "CRON_SECRET";
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.1.50";
2
+ var version = "0.1.51-beta.0";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -7,10 +7,10 @@ var _chunk2KMIJDY6cjs = require('./chunk-2KMIJDY6.cjs');
7
7
  var _chunkSHIWRBFIcjs = require('./chunk-SHIWRBFI.cjs');
8
8
 
9
9
 
10
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
10
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
11
11
 
12
12
 
13
- var _chunkJHXJBNLYcjs = require('./chunk-JHXJBNLY.cjs');
13
+ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
14
14
 
15
15
 
16
16
 
@@ -195,7 +195,7 @@ async function prepareFarmWorkflowsForNitro(config) {
195
195
  const scheduledTasks = createScheduledTasks(workflows);
196
196
  const wrapperNames = resolveWorkflowWrapperFileNames(workflows.map((workflow) => workflow.id));
197
197
  for (const workflow of workflows) {
198
- const wrapperPath = _chunkXN2MB4QZcjs.toPosixPath.call(void 0,
198
+ const wrapperPath = _chunkVQJYGZNXcjs.toPosixPath.call(void 0,
199
199
  path.join(generatedDir, `${wrapperNames.get(workflow.id)}.mjs`)
200
200
  );
201
201
  await fs.writeFile(wrapperPath, createNitroTaskWrapper(workflow), "utf8");
@@ -204,7 +204,7 @@ async function prepareFarmWorkflowsForNitro(config) {
204
204
  description: workflow.description || `Farm workflow ${workflow.id}`
205
205
  };
206
206
  }
207
- const handlerPath = _chunkXN2MB4QZcjs.toPosixPath.call(void 0, path.join(generatedDir, "http-handler.mjs"));
207
+ const handlerPath = _chunkVQJYGZNXcjs.toPosixPath.call(void 0, path.join(generatedDir, "http-handler.mjs"));
208
208
  await fs.writeFile(
209
209
  handlerPath,
210
210
  createNitroWorkflowHTTPHandler(
@@ -559,7 +559,7 @@ function toWorkflowMetadata(workflow) {
559
559
  async function readWorkflowPayload(request, bodySizeLimit) {
560
560
  const url = new URL(request.url);
561
561
  if (request.method === "GET" || request.method === "HEAD") {
562
- return _chunkJHXJBNLYcjs.searchParamsToObject.call(void 0, url.searchParams);
562
+ return _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
563
563
  }
564
564
  const bytes = await _chunkLIFUPCXWcjs.readFarmRequestBody.call(void 0, request, bodySizeLimit);
565
565
  const text = new TextDecoder().decode(bytes);
@@ -9,20 +9,6 @@ import {
9
9
  createFarmCacheKey
10
10
  } from "./chunk-GLOICKDO.mjs";
11
11
 
12
- // src/client-revalidation.ts
13
- function attachRevalidationListeners(refresh, options = {}) {
14
- if (typeof window === "undefined") return () => {
15
- };
16
- const onFocus = options.refetchOnWindowFocus === false ? void 0 : refresh;
17
- const onOnline = options.refetchOnReconnect === false ? void 0 : refresh;
18
- if (onFocus) window.addEventListener("focus", onFocus);
19
- if (onOnline) window.addEventListener("online", onOnline);
20
- return () => {
21
- if (onFocus) window.removeEventListener("focus", onFocus);
22
- if (onOnline) window.removeEventListener("online", onOnline);
23
- };
24
- }
25
-
26
12
  // src/server-query-runtime.ts
27
13
  var FARM_SERVER_QUERY_CLIENT_STATE = /* @__PURE__ */ Symbol.for("farm.serverQueryClientState");
28
14
  var serverQueryClientGlobal = globalThis;
@@ -228,7 +214,6 @@ function normalizeServerQueryError(cause) {
228
214
  }
229
215
 
230
216
  export {
231
- attachRevalidationListeners,
232
217
  isFarmServerQueryBrowserRuntime,
233
218
  beginFarmServerQueryAction,
234
219
  completeFarmServerQueryAction,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
3
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
4
4
 
5
5
  // src/server/dev-loopback.ts
6
6
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
@@ -30,7 +30,7 @@ async function listenOnOtherLoopback(server) {
30
30
  const listening = await new Promise((resolve) => {
31
31
  const onError = (error) => {
32
32
  if (error.code === "EADDRINUSE") {
33
- _chunkXN2MB4QZcjs.logger.warn(
33
+ _chunkVQJYGZNXcjs.logger.warn(
34
34
  `Another process is listening on ${formatHost(other)}:${address.port}; the dev server answers on ${formatHost(address.address)}:${address.port} only.`
35
35
  );
36
36
  }
@@ -43,7 +43,7 @@ async function listenOnOtherLoopback(server) {
43
43
  });
44
44
  });
45
45
  if (!listening) return;
46
- loopback.on("error", (error) => _chunkXN2MB4QZcjs.logger.warn(`Dev loopback listener failed: ${String(error)}`));
46
+ loopback.on("error", (error) => _chunkVQJYGZNXcjs.logger.warn(`Dev loopback listener failed: ${String(error)}`));
47
47
  httpServer.once("close", () => loopback.close());
48
48
  }
49
49
  function formatHost(address) {
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  FARM_RSC_INSTALL_HINT,
3
3
  findFarmAppPackageDir
4
- } from "./chunk-PXEXOQ5R.mjs";
4
+ } from "./chunk-SHS6KXOZ.mjs";
5
5
  import {
6
6
  createFarmDevLoopbackPlugin
7
- } from "./chunk-2GLQSIZD.mjs";
7
+ } from "./chunk-LMFJCXDD.mjs";
8
8
  import {
9
9
  resolveDeployOutputPath
10
- } from "./chunk-2DEPNLXK.mjs";
10
+ } from "./chunk-JF5CNHHF.mjs";
11
11
  import {
12
12
  farmDesktopDevGuardPlugin,
13
13
  loadFarmReactPlugin
14
14
  } from "./chunk-75WWOZ5C.mjs";
15
15
  import {
16
16
  loadTailwindVitePlugin
17
- } from "./chunk-XLLVWLWO.mjs";
17
+ } from "./chunk-PIHKO25G.mjs";
18
18
  import {
19
19
  resolveFarmPlatform
20
20
  } from "./chunk-SMUW7UST.mjs";
@@ -7,7 +7,7 @@ var _chunk2KMIJDY6cjs = require('./chunk-2KMIJDY6.cjs');
7
7
  var _chunkSHIWRBFIcjs = require('./chunk-SHIWRBFI.cjs');
8
8
 
9
9
 
10
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
10
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
11
11
 
12
12
  // src/cron.ts
13
13
  var DEFAULT_FARM_CRON_SECRET_ENV = "CRON_SECRET";
@@ -67,7 +67,7 @@ async function prepareFarmCronForNitro(config) {
67
67
  const wrapperNames = resolveCronWrapperFileNames(cron.jobs.map((job) => job.name));
68
68
  for (const job of cron.jobs) {
69
69
  const taskName = getFarmCronTaskName(job.name);
70
- const wrapperPath = _chunkXN2MB4QZcjs.toPosixPath.call(void 0, path.join(generatedDir, `${wrapperNames.get(job.name)}.mjs`));
70
+ const wrapperPath = _chunkVQJYGZNXcjs.toPosixPath.call(void 0, path.join(generatedDir, `${wrapperNames.get(job.name)}.mjs`));
71
71
  await fs.writeFile(wrapperPath, createNitroCronTaskWrapper(job, cron.secretEnv), "utf8");
72
72
  tasks[taskName] = {
73
73
  handler: wrapperPath,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  searchParamsToObject
3
- } from "./chunk-TXK4D46O.mjs";
3
+ } from "./chunk-H3ASZDT7.mjs";
4
4
  import {
5
5
  decodeRouteSegment
6
6
  } from "./chunk-OHWM2VI4.mjs";
@@ -172,8 +172,8 @@ async function fileExists(filePath) {
172
172
  }
173
173
  }
174
174
  async function globFiles(pattern, cwd) {
175
- const glob = await import("fast-glob");
176
- return glob.default(pattern, { cwd, absolute: false });
175
+ const { glob } = await import("tinyglobby");
176
+ return glob(pattern, { cwd, expandDirectories: false });
177
177
  }
178
178
  function parseSearchParams(searchParams) {
179
179
  return searchParamsToObject(searchParams);
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunk3ATXWZPHcjs = require('./chunk-3ATXWZPH.cjs');
4
+ var _chunkE36C43IXcjs = require('./chunk-E36C43IX.cjs');
5
5
 
6
6
 
7
7
  var _chunkSYW346ZNcjs = require('./chunk-SYW346ZN.cjs');
@@ -792,7 +792,7 @@ async function generateFarmTypeArtifacts(options) {
792
792
  componentExtensions: options.componentExtensions,
793
793
  sourceRoots
794
794
  };
795
- unifiedSections.push(await _chunk3ATXWZPHcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
795
+ unifiedSections.push(await _chunkE36C43IXcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
796
796
  result.routeTypesPath = unifiedTypesPath;
797
797
  } else if (shouldGenerateRoutes) {
798
798
  const routeOptions = {
@@ -806,11 +806,11 @@ async function generateFarmTypeArtifacts(options) {
806
806
  };
807
807
  if (options.check) {
808
808
  const routeTypesPath = resolveGeneratedPath(root, srcDir, options.routeTypesOutFile);
809
- const content = await _chunk3ATXWZPHcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
809
+ const content = await _chunkE36C43IXcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
810
810
  checkGeneratedFile(routeTypesPath, content, result.stalePaths);
811
811
  result.routeTypesPath = routeTypesPath;
812
812
  } else {
813
- result.routeTypesPath = await _chunk3ATXWZPHcjs.generateRouteTypes.call(void 0, routeOptions);
813
+ result.routeTypesPath = await _chunkE36C43IXcjs.generateRouteTypes.call(void 0, routeOptions);
814
814
  }
815
815
  }
816
816
  if (shouldGenerateApi) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFarmRouteLabel
3
- } from "./chunk-JJOWY3XD.mjs";
3
+ } from "./chunk-R5P4KFPM.mjs";
4
4
  import {
5
5
  classifyFarmAgent
6
6
  } from "./chunk-N77JBPLC.mjs";
@@ -0,0 +1,60 @@
1
+ import {
2
+ FARM_ACTION_RESULT_KEY
3
+ } from "./chunk-X3EFRVXY.mjs";
4
+ import {
5
+ getServerActionInvalidations,
6
+ runWithServerActionRequest,
7
+ sanitizeServerActionError,
8
+ serializeServerFnFailure
9
+ } from "./chunk-FSQMN2MQ.mjs";
10
+ import {
11
+ getFarmRedirectError,
12
+ isFarmNotFoundError
13
+ } from "./chunk-JNYFXL7X.mjs";
14
+
15
+ // src/form-actions.ts
16
+ import { handleAction, registerServerReference } from "@farm.js/islx/server";
17
+ var FARM_FORM_ACTION_HEADER = "F-Action";
18
+ function registerFarmFormAction(action, id) {
19
+ return registerServerReference(action, id);
20
+ }
21
+ function handleFarmFormActionRequest(request, config) {
22
+ return handleAction(request, {
23
+ allowedOrigins: config.allowedOrigins,
24
+ bodySizeLimit: config.bodySizeLimit,
25
+ // The result islx sends is the envelope, not the action's own type.
26
+ run: (actionRequest, action) => runFarmFormAction(actionRequest, action),
27
+ mapError(error) {
28
+ const redirect = getFarmRedirectError(error);
29
+ if (redirect) return { redirect: redirect.url };
30
+ if (isFarmNotFoundError(error)) return { status: 404 };
31
+ return void 0;
32
+ },
33
+ onError: (error) => console.error("[Farm.js] Server action failed:", error)
34
+ });
35
+ }
36
+ async function runFarmFormAction(request, action) {
37
+ if (!request.headers.has(FARM_FORM_ACTION_HEADER)) {
38
+ return runWithServerActionRequest(request, action);
39
+ }
40
+ try {
41
+ return await runWithServerActionRequest(request, async () => {
42
+ const value = await action();
43
+ return {
44
+ [FARM_ACTION_RESULT_KEY]: { invalidations: [...getServerActionInvalidations()] },
45
+ value
46
+ };
47
+ });
48
+ } catch (error) {
49
+ if (!serializeServerFnFailure(error)) throw error;
50
+ return {
51
+ [FARM_ACTION_RESULT_KEY]: { invalidations: [], error: sanitizeServerActionError(error) }
52
+ };
53
+ }
54
+ }
55
+
56
+ export {
57
+ FARM_FORM_ACTION_HEADER,
58
+ registerFarmFormAction,
59
+ handleFarmFormActionRequest
60
+ };
@@ -0,0 +1,17 @@
1
+ // src/client-revalidation.ts
2
+ function attachRevalidationListeners(refresh, options = {}) {
3
+ if (typeof window === "undefined") return () => {
4
+ };
5
+ const onFocus = options.refetchOnWindowFocus === false ? void 0 : refresh;
6
+ const onOnline = options.refetchOnReconnect === false ? void 0 : refresh;
7
+ if (onFocus) window.addEventListener("focus", onFocus);
8
+ if (onOnline) window.addEventListener("online", onOnline);
9
+ return () => {
10
+ if (onFocus) window.removeEventListener("focus", onFocus);
11
+ if (onOnline) window.removeEventListener("online", onOnline);
12
+ };
13
+ }
14
+
15
+ export {
16
+ attachRevalidationListeners
17
+ };