@farm.js/core 0.2.0 → 0.2.3

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 (237) hide show
  1. package/dist/{agent-mcp.d-xPua9Zdz.d.ts → agent-mcp.d-DuZjglYX.d.ts} +1 -1
  2. package/dist/{agent-mcp.d-DhZf5-v0.d.mts → agent-mcp.d-gI3ahrF6.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +4 -4
  4. package/dist/agent-runtime.d.ts +4 -4
  5. package/dist/analyzer-5RSMYPWD.cjs +17 -0
  6. package/dist/{analyzer-LQ4LVDCW.mjs → analyzer-7TNBOI3J.mjs} +2 -2
  7. package/dist/api/node.d.mts +6 -6
  8. package/dist/api/node.d.ts +6 -6
  9. package/dist/api/route-manager.cjs +5 -5
  10. package/dist/api/route-manager.d.mts +6 -6
  11. package/dist/api/route-manager.d.ts +6 -6
  12. package/dist/api/route-manager.mjs +4 -4
  13. package/dist/api/runtime.d.mts +5 -5
  14. package/dist/api/runtime.d.ts +5 -5
  15. package/dist/api.cjs +6 -6
  16. package/dist/api.d.mts +7 -7
  17. package/dist/api.d.ts +7 -7
  18. package/dist/api.mjs +5 -5
  19. package/dist/{app-manifest.d-D6l1Wkn6.d.ts → app-manifest.d-B3h89j6a.d.ts} +1 -1
  20. package/dist/{app-manifest.d-Bq9VWtpk.d.mts → app-manifest.d-bHK9EGPI.d.mts} +1 -1
  21. package/dist/app-markdown.d.mts +5 -5
  22. package/dist/app-markdown.d.ts +5 -5
  23. package/dist/{app.d-gnTrW72o.d.ts → app.d-C3uyET_L.d.ts} +4 -4
  24. package/dist/{app.d-Bn1bqBkf.d.mts → app.d-Cr7fXGvJ.d.mts} +4 -4
  25. package/dist/{chunk-MEIZIRMK.mjs → chunk-2FKGY2ZS.mjs} +1 -1
  26. package/dist/{chunk-YOVSWY2E.mjs → chunk-2XDRRAAD.mjs} +1 -1
  27. package/dist/{chunk-GAD63TH7.mjs → chunk-4WCEWA22.mjs} +4 -4
  28. package/dist/{chunk-YQXLBYY2.cjs → chunk-5B2Y4EVS.cjs} +32 -8
  29. package/dist/{chunk-QCVP22KW.cjs → chunk-5RYBQKBY.cjs} +3 -3
  30. package/dist/{chunk-VFZQXADS.cjs → chunk-6QWBZGGP.cjs} +139 -137
  31. package/dist/{chunk-DVL3UVYT.mjs → chunk-6XABTMXR.mjs} +2 -2
  32. package/dist/{chunk-RDT2LJES.mjs → chunk-6YOMQ4GX.mjs} +9 -9
  33. package/dist/chunk-7QGA6UX6.cjs +26 -0
  34. package/dist/{chunk-LGL5QKUJ.cjs → chunk-A4WDDASS.cjs} +2 -2
  35. package/dist/{chunk-V36K4TSU.mjs → chunk-ADKPJZPP.mjs} +1 -1
  36. package/dist/{chunk-LQZXCSYG.mjs → chunk-B6K2ZM3C.mjs} +5 -3
  37. package/dist/{chunk-Z7YIQ7AJ.cjs → chunk-C2J5LMH6.cjs} +1 -1
  38. package/dist/{chunk-D7KBMJ7L.mjs → chunk-CIRC2LRP.mjs} +1 -1
  39. package/dist/{chunk-RMLXUVR5.cjs → chunk-CS6GXE42.cjs} +91 -21
  40. package/dist/{chunk-DNERKYN4.cjs → chunk-CSCORWIQ.cjs} +15 -15
  41. package/dist/{chunk-GK2RCRT2.mjs → chunk-CTHQE7DO.mjs} +1 -1
  42. package/dist/{chunk-PRKFECGT.cjs → chunk-DZWX7FDX.cjs} +6 -4
  43. package/dist/{chunk-ZVEKOMZS.mjs → chunk-ERY4VYUH.mjs} +1 -1
  44. package/dist/{chunk-4ER5KYSC.cjs → chunk-F6JSVP5C.cjs} +3 -3
  45. package/dist/chunk-G7LNCHTS.mjs +21 -0
  46. package/dist/{chunk-ZCT6B5PQ.cjs → chunk-GWFNJLDN.cjs} +11 -11
  47. package/dist/{chunk-O47IT4CS.cjs → chunk-H7DAFRYR.cjs} +4 -4
  48. package/dist/{chunk-MX4G24YS.mjs → chunk-HOBCEE5J.mjs} +17 -15
  49. package/dist/{chunk-ZF7N222A.mjs → chunk-IPKL7L6B.mjs} +2 -2
  50. package/dist/{chunk-54INSSWI.mjs → chunk-IQQ3SWH6.mjs} +99 -56
  51. package/dist/{chunk-MUQP2APN.cjs → chunk-JJUHUPRB.cjs} +2 -2
  52. package/dist/{chunk-2LHO4HTP.cjs → chunk-K7RXZ77U.cjs} +2 -2
  53. package/dist/{chunk-SIHHYNX4.mjs → chunk-KJMRW3IP.mjs} +1 -1
  54. package/dist/{chunk-PYPHM7AS.cjs → chunk-LH7S7FI3.cjs} +5 -1
  55. package/dist/chunk-O77EKGAS.mjs +36 -0
  56. package/dist/{chunk-WXPY5FRF.cjs → chunk-P2PF5FUW.cjs} +2 -2
  57. package/dist/{chunk-WOPQQCP3.mjs → chunk-P3UT3OLV.mjs} +3 -3
  58. package/dist/{chunk-PZ5ZJAAO.mjs → chunk-POCWXRXW.mjs} +1 -1
  59. package/dist/{chunk-Z23OCU33.cjs → chunk-RF3VCNV7.cjs} +6 -6
  60. package/dist/{chunk-MLMDOIBY.mjs → chunk-RS4QZOFK.mjs} +3 -3
  61. package/dist/{chunk-MZG5M4JS.cjs → chunk-SO4USIKL.cjs} +4 -4
  62. package/dist/{chunk-HYYOVRED.mjs → chunk-SPVXL37B.mjs} +1 -1
  63. package/dist/{chunk-VWPGK6UV.cjs → chunk-TAXZQNFZ.cjs} +74 -74
  64. package/dist/{chunk-KKXGBQ2K.mjs → chunk-UKGAP2OK.mjs} +4 -4
  65. package/dist/{chunk-DZXD6CYJ.mjs → chunk-V2RXBDV6.mjs} +4 -0
  66. package/dist/{chunk-FFROR7QD.mjs → chunk-VZRY3CL5.mjs} +1 -1
  67. package/dist/{chunk-LO5BNR6Y.mjs → chunk-W5T3ZAFU.mjs} +25 -1
  68. package/dist/{chunk-ADCVSTFV.cjs → chunk-WAQIO2VD.cjs} +2 -2
  69. package/dist/{chunk-JKNQMGZE.cjs → chunk-WFL7CD5C.cjs} +12 -12
  70. package/dist/{chunk-KJW6KEOZ.mjs → chunk-WRT775N6.mjs} +92 -22
  71. package/dist/{chunk-RP55BUJM.mjs → chunk-XGBDRC5B.mjs} +2 -2
  72. package/dist/{chunk-J6JAUJPC.cjs → chunk-XLJ2REOI.cjs} +385 -342
  73. package/dist/{chunk-ZTNU4XCC.cjs → chunk-Y3MTKPLN.cjs} +7 -7
  74. package/dist/{chunk-MNBFSAWF.cjs → chunk-YCGOQKVC.cjs} +20 -1
  75. package/dist/{chunk-T4VF6BYV.cjs → chunk-YPPAYYSX.cjs} +6 -6
  76. package/dist/{chunk-PATIHHC7.cjs → chunk-ZQOHL6TX.cjs} +2 -2
  77. package/dist/{client-component.d-DT5OKBZu.d.ts → client-component.d-BavTzqsn.d.ts} +1 -1
  78. package/dist/{client-component.d-34DDMZcl.d.mts → client-component.d-X3j9FOZ2.d.mts} +1 -1
  79. package/dist/{client-plugins.d-D9CnUvZ5.d.ts → client-plugins.d-CqTr5IrQ.d.ts} +64 -4
  80. package/dist/{client-plugins.d-D7k9t9Ge.d.mts → client-plugins.d-DnnAopKG.d.mts} +64 -4
  81. package/dist/client-plugins.d.mts +4 -4
  82. package/dist/client-plugins.d.ts +4 -4
  83. package/dist/client.d.mts +10 -10
  84. package/dist/client.d.ts +10 -10
  85. package/dist/config.d.mts +4 -4
  86. package/dist/config.d.ts +4 -4
  87. package/dist/desktop.cjs +5 -1
  88. package/dist/desktop.d.mts +11 -7
  89. package/dist/desktop.d.ts +11 -7
  90. package/dist/desktop.mjs +4 -0
  91. package/dist/{dev-guard-M3ZCDWCK.cjs → dev-guard-5NUIX6IZ.cjs} +4 -3
  92. package/dist/{dev-guard-TFVWJNIB.mjs → dev-guard-L42ZZRCZ.mjs} +2 -1
  93. package/dist/{devtools-R77KAJA4.mjs → devtools-VPFBH6I2.mjs} +1 -1
  94. package/dist/{devtools-IUU4SWQL.cjs → devtools-YTND2OWT.cjs} +2 -2
  95. package/dist/docs.cjs +3 -3
  96. package/dist/docs.d.mts +6 -6
  97. package/dist/docs.d.ts +6 -6
  98. package/dist/docs.mjs +2 -2
  99. package/dist/environment/vite.cjs +4 -4
  100. package/dist/environment/vite.d.mts +1 -1
  101. package/dist/environment/vite.d.ts +1 -1
  102. package/dist/environment/vite.mjs +3 -3
  103. package/dist/{generate-route-types.d-BFOMM8Ef.d.mts → generate-route-types.d-CAiRw4N0.d.mts} +1 -1
  104. package/dist/{generate-route-types.d-C2m8myHb.d.ts → generate-route-types.d-Dz8MOQ3u.d.ts} +1 -1
  105. package/dist/{handler.d-fxTjv3Nn.d.mts → handler.d-BSlpYCDB.d.mts} +2 -2
  106. package/dist/{handler.d-DbZvbwNi.d.ts → handler.d-DgX7gPO6.d.ts} +2 -2
  107. package/dist/{headers.d-OBHpGTF_.d.mts → headers.d-Cf8l5LMo.d.mts} +1 -1
  108. package/dist/{headers.d-oeWybIk8.d.ts → headers.d-CmxW42R2.d.ts} +1 -1
  109. package/dist/index.cjs +29 -28
  110. package/dist/{index.d-CRrPQwlO.d.mts → index.d-7xoJqKRZ.d.mts} +1 -1
  111. package/dist/{index.d-BM-dKdzH.d.ts → index.d-BZZt7kxO.d.ts} +1 -1
  112. package/dist/index.d.mts +27 -27
  113. package/dist/index.d.ts +27 -27
  114. package/dist/index.mjs +24 -23
  115. package/dist/integrations/orm.d.mts +4 -4
  116. package/dist/integrations/orm.d.ts +4 -4
  117. package/dist/integrations.d.mts +4 -4
  118. package/dist/integrations.d.ts +4 -4
  119. package/dist/internal/app-markdown-runtime.d.mts +5 -5
  120. package/dist/internal/app-markdown-runtime.d.ts +5 -5
  121. package/dist/internal/build-runtime.cjs +24 -23
  122. package/dist/internal/build-runtime.d.mts +7 -7
  123. package/dist/internal/build-runtime.d.ts +7 -7
  124. package/dist/internal/build-runtime.mjs +23 -22
  125. package/dist/internal/cli-runtime.cjs +12 -9
  126. package/dist/internal/cli-runtime.d.mts +20 -12
  127. package/dist/internal/cli-runtime.d.ts +20 -12
  128. package/dist/internal/cli-runtime.mjs +11 -8
  129. package/dist/internal/client-error-overlay.cjs +4 -4
  130. package/dist/internal/client-error-overlay.mjs +1 -1
  131. package/dist/internal/client-runtime.d.mts +8 -8
  132. package/dist/internal/client-runtime.d.ts +8 -8
  133. package/dist/internal/compression-runtime.d.mts +4 -4
  134. package/dist/internal/compression-runtime.d.ts +4 -4
  135. package/dist/internal/config-runtime.cjs +5 -4
  136. package/dist/internal/config-runtime.d.mts +8 -8
  137. package/dist/internal/config-runtime.d.ts +8 -8
  138. package/dist/internal/config-runtime.mjs +4 -3
  139. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  140. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  141. package/dist/internal/native-server-fns.cjs +4 -4
  142. package/dist/internal/native-server-fns.mjs +3 -3
  143. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  144. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  145. package/dist/internal/production-runtime.cjs +4 -4
  146. package/dist/internal/production-runtime.d.mts +13 -13
  147. package/dist/internal/production-runtime.d.ts +13 -13
  148. package/dist/internal/production-runtime.mjs +3 -3
  149. package/dist/internal/spa-router.d.mts +6 -6
  150. package/dist/internal/spa-router.d.ts +6 -6
  151. package/dist/internal/start-manifest.d.mts +4 -4
  152. package/dist/internal/start-manifest.d.ts +4 -4
  153. package/dist/{layers.d-CH0bC4QL.d.mts → layers.d-dNBkiNE9.d.mts} +1 -1
  154. package/dist/{layers.d-CH0bC4QL.d.ts → layers.d-dNBkiNE9.d.ts} +1 -1
  155. package/dist/{manager-STAB5TVZ.cjs → manager-YRIENS63.cjs} +4 -4
  156. package/dist/{manager-EFPBRS3U.mjs → manager-YTJOAHII.mjs} +3 -3
  157. package/dist/markdown.d.mts +4 -4
  158. package/dist/markdown.d.ts +4 -4
  159. package/dist/middleware.d.mts +4 -4
  160. package/dist/middleware.d.ts +4 -4
  161. package/dist/mobile.d.mts +4 -4
  162. package/dist/mobile.d.ts +4 -4
  163. package/dist/{mount.d-TnD-Mebk.d.ts → mount.d-CD-xVBu7.d.ts} +1 -1
  164. package/dist/{mount.d-B7RiwjiO.d.mts → mount.d-Dd0xeRMl.d.mts} +1 -1
  165. package/dist/{navigation-delegate.d-VBCF0EeN.d.ts → navigation-delegate.d-Bses_F-y.d.ts} +1 -1
  166. package/dist/{navigation-delegate.d-Boz2511c.d.mts → navigation-delegate.d-dBNg976E.d.mts} +1 -1
  167. package/dist/navigation.d.mts +7 -7
  168. package/dist/navigation.d.ts +7 -7
  169. package/dist/plugin.cjs +19 -18
  170. package/dist/plugin.d.mts +8 -8
  171. package/dist/plugin.d.ts +8 -8
  172. package/dist/plugin.mjs +18 -17
  173. package/dist/{render-plan.d-BrumV_ZE.d.ts → render-plan.d-DaIwnRK2.d.ts} +1 -1
  174. package/dist/{render-plan.d-BwnmyfNk.d.mts → render-plan.d-vOdZHHLI.d.mts} +1 -1
  175. package/dist/renderer-client.d.mts +8 -8
  176. package/dist/renderer-client.d.ts +8 -8
  177. package/dist/{request.d-Dd5nRTO5.d.mts → request.d-B8U4pVFP.d.mts} +1 -1
  178. package/dist/{request.d-NUi01-5e.d.ts → request.d-CgXp3EEc.d.ts} +1 -1
  179. package/dist/request.d.mts +5 -5
  180. package/dist/request.d.ts +5 -5
  181. package/dist/{route-rendering.d-BK0Pf7_k.d.mts → route-rendering.d-BQvNYQqu.d.mts} +1 -1
  182. package/dist/{route-rendering.d-CJR5BPXV.d.ts → route-rendering.d-Di0AxFix.d.ts} +1 -1
  183. package/dist/{router.d-C-JSFCPU.d.ts → router.d-BJVGhSAJ.d.ts} +1 -1
  184. package/dist/{router.d-CNUS3x1j.d.mts → router.d-hNedVdoB.d.mts} +1 -1
  185. package/dist/routes.cjs +3 -3
  186. package/dist/{routes.d-D7RWvfqL.d.ts → routes.d-CYe98R_8.d.ts} +1 -1
  187. package/dist/{routes.d-BWvpUoYu.d.mts → routes.d-DBGnKaUQ.d.mts} +1 -1
  188. package/dist/routes.d.mts +4 -4
  189. package/dist/routes.d.ts +4 -4
  190. package/dist/routes.mjs +2 -2
  191. package/dist/{rsc-pipeline-DHISDFT7.mjs → rsc-pipeline-2JSNRVIL.mjs} +6 -5
  192. package/dist/{rsc-pipeline-UBWVU3NF.cjs → rsc-pipeline-WTKDMTE2.cjs} +7 -6
  193. package/dist/{runtime-XKRQW3YT.cjs → runtime-I4GV4CDP.cjs} +8 -8
  194. package/dist/{runtime-VUKMY44G.mjs → runtime-RNSTQY27.mjs} +5 -5
  195. package/dist/{runtime.d-B2T4bM5_.d.ts → runtime.d-0R8nHCM6.d.ts} +1 -1
  196. package/dist/{runtime.d-CsOpO6yQ.d.mts → runtime.d-DpeuF_T-.d.mts} +1 -1
  197. package/dist/{cli-runtime.d-LwIb0swO.d.mts → schema-dependencies.d-_Wyey4Wv.d.mts} +21 -13
  198. package/dist/{cli-runtime.d-Vvxf-Z8a.d.ts → schema-dependencies.d-tkUHREqz.d.ts} +21 -13
  199. package/dist/{schema.d-BM-uVGpx.d.mts → schema.d-HlGSe1on.d.mts} +1 -1
  200. package/dist/{schema.d-BM-uVGpx.d.ts → schema.d-HlGSe1on.d.ts} +1 -1
  201. package/dist/schema.d.mts +1 -1
  202. package/dist/schema.d.ts +1 -1
  203. package/dist/{server-components-status.d-DOYt4E_Q.d.ts → server-components-status.d-B2Z5WvO5.d.ts} +2 -2
  204. package/dist/{server-components-status.d-Cc5rir0l.d.mts → server-components-status.d-sN7ju-ie.d.mts} +2 -2
  205. package/dist/server-plugins.d.mts +6 -6
  206. package/dist/server-plugins.d.ts +6 -6
  207. package/dist/server.cjs +46 -45
  208. package/dist/server.d.mts +14 -14
  209. package/dist/server.d.ts +14 -14
  210. package/dist/server.mjs +20 -19
  211. package/dist/{spa-router.d-Cq5UFJvq.d.mts → spa-router.d-D3AtR2Bc.d.mts} +2 -2
  212. package/dist/{spa-router.d-C7FcpLxU.d.ts → spa-router.d-MjT6sGb9.d.ts} +2 -2
  213. package/dist/{ssg.d-BzNZemk7.d.mts → ssg.d-B32Cp_XW.d.mts} +3 -3
  214. package/dist/{ssg.d-DUhacIxj.d.ts → ssg.d-C1SNuPz5.d.ts} +3 -3
  215. package/dist/storage.d.mts +2 -2
  216. package/dist/storage.d.ts +2 -2
  217. package/dist/{store-core.d-BX3yXrxA.d.ts → store-core.d-BZ3YXs70.d.ts} +2 -2
  218. package/dist/{store-core.d-DbUAtSBK.d.mts → store-core.d-BbVdaoA0.d.mts} +2 -2
  219. package/dist/testing.cjs +6 -6
  220. package/dist/testing.d.mts +4 -4
  221. package/dist/testing.d.ts +4 -4
  222. package/dist/testing.mjs +5 -5
  223. package/dist/{types.d-C5hlNbHa.d.mts → types.d-CRiwa0jj.d.mts} +1 -1
  224. package/dist/{types.d-C5hlNbHa.d.ts → types.d-CRiwa0jj.d.ts} +1 -1
  225. package/dist/{utils.d-BhJJEXzo.d.ts → utils.d-Bjbm44fP.d.ts} +1 -1
  226. package/dist/{utils.d-NOMkLFpC.d.mts → utils.d-CoLozp7-.d.mts} +1 -1
  227. package/dist/version.cjs +2 -2
  228. package/dist/version.mjs +1 -1
  229. package/dist/vite.cjs +19 -18
  230. package/dist/vite.d.mts +9 -9
  231. package/dist/vite.d.ts +9 -9
  232. package/dist/vite.mjs +18 -17
  233. package/package.json +1 -1
  234. package/dist/analyzer-ZFC2L6NZ.cjs +0 -17
  235. package/dist/chunk-OZAVCLXY.mjs +0 -17
  236. /package/dist/{chunk-OAAVIFOJ.cjs → chunk-2LGM5WIK.cjs} +0 -0
  237. /package/dist/{chunk-ZRTBDHO2.mjs → chunk-MVNIAD6O.mjs} +0 -0
@@ -25,13 +25,13 @@ var _chunk32HGOX3Mcjs = require('./chunk-32HGOX3M.cjs');
25
25
 
26
26
 
27
27
 
28
- var _chunkPYPHM7AScjs = require('./chunk-PYPHM7AS.cjs');
28
+ var _chunkLH7S7FI3cjs = require('./chunk-LH7S7FI3.cjs');
29
29
 
30
30
 
31
31
  var _chunk7ZDLE77Pcjs = require('./chunk-7ZDLE77P.cjs');
32
32
 
33
33
 
34
- var _chunkZ7YIQ7AJcjs = require('./chunk-Z7YIQ7AJ.cjs');
34
+ var _chunkC2J5LMH6cjs = require('./chunk-C2J5LMH6.cjs');
35
35
 
36
36
 
37
37
  var _chunkUGL4BDNBcjs = require('./chunk-UGL4BDNB.cjs');
@@ -980,7 +980,7 @@ function usePackageScanCacheFile(file) {
980
980
  const stored = /* @__PURE__ */ new Map();
981
981
  try {
982
982
  const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
983
- if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunkZ7YIQ7AJcjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
983
+ if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunkC2J5LMH6cjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
984
984
  for (const [directory, scan] of Object.entries(value.scans)) {
985
985
  if (isStoredPackageScan(scan)) stored.set(directory, scan);
986
986
  }
@@ -1009,7 +1009,7 @@ function persistPackageScanCache() {
1009
1009
  _fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
1010
1010
  _fs2.default.writeFileSync(
1011
1011
  temporary,
1012
- JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunkZ7YIQ7AJcjs.FARM_VERSION, scans })
1012
+ JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunkC2J5LMH6cjs.FARM_VERSION, scans })
1013
1013
  );
1014
1014
  _fs2.default.renameSync(temporary, cache2.file);
1015
1015
  cache2.dirty = false;
@@ -1234,7 +1234,7 @@ function resolveProgrammaticClientRoutes(options) {
1234
1234
  let untraced = false;
1235
1235
  const definedIn = /* @__PURE__ */ new Map();
1236
1236
  for (const route of definitions) {
1237
- const source = _chunkPYPHM7AScjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
1237
+ const source = _chunkLH7S7FI3cjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
1238
1238
  const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _85 => _85.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
1239
1239
  for (const caller of callers.flat()) caller.routeSource = true;
1240
1240
  definedIn.set(route, callers.flat());
@@ -2322,7 +2322,7 @@ var PackageClientBoundaryCache = class {
2322
2322
  }
2323
2323
  const contents = JSON.stringify({
2324
2324
  schema: SCHEMA_VERSION,
2325
- farm: _chunkZ7YIQ7AJcjs.FARM_VERSION,
2325
+ farm: _chunkC2J5LMH6cjs.FARM_VERSION,
2326
2326
  paths,
2327
2327
  entries
2328
2328
  });
@@ -2362,7 +2362,7 @@ function readStoredCache(file) {
2362
2362
  } catch (e38) {
2363
2363
  return null;
2364
2364
  }
2365
- if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkZ7YIQ7AJcjs.FARM_VERSION) {
2365
+ if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkC2J5LMH6cjs.FARM_VERSION) {
2366
2366
  return null;
2367
2367
  }
2368
2368
  const { paths, entries } = value;
@@ -2373,7 +2373,7 @@ function readStoredCache(file) {
2373
2373
  const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
2374
2374
  if (usable.length > 0) valid[key] = usable;
2375
2375
  }
2376
- return { schema: SCHEMA_VERSION, farm: _chunkZ7YIQ7AJcjs.FARM_VERSION, paths, entries: valid };
2376
+ return { schema: SCHEMA_VERSION, farm: _chunkC2J5LMH6cjs.FARM_VERSION, paths, entries: valid };
2377
2377
  }
2378
2378
  function isRecord(value) {
2379
2379
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -4737,7 +4737,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4737
4737
  sources = void 0;
4738
4738
  routesFiles = new Set(
4739
4739
  _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
4740
- (source) => _chunkPYPHM7AScjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
4740
+ (source) => _chunkLH7S7FI3cjs.PROGRAMMATIC_ROUTE_FILE_NAMES.map(
4741
4741
  (name) => resolvedFile(_path2.default.resolve(source.root, source.srcDir, name))
4742
4742
  )
4743
4743
  )
@@ -4756,7 +4756,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4756
4756
  parse: parse3,
4757
4757
  componentExtensions
4758
4758
  });
4759
- if (environment === "client" && !isBuild && !_chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
4759
+ if (environment === "client" && !isBuild && !_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
4760
4760
  this.error(routeSourceError(moduleFile(id)));
4761
4761
  }
4762
4762
  if (environment === "server" && _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, options)) === "islands" && isApplicationScript(id)) {
@@ -4791,7 +4791,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4791
4791
  if (resolveBuildEnvironment(context, false) !== "client") return;
4792
4792
  const forbidden = routeSourceFiles();
4793
4793
  for (const id of this.getModuleIds()) {
4794
- if (_chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4794
+ if (_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4795
4795
  const chain = findClientNodeBuiltinChain(id, (moduleId) => {
4796
4796
  return _optionalChain([this, 'access', _285 => _285.getModuleInfo, 'call', _286 => _286(moduleId), 'optionalAccess', _287 => _287.importedIds]);
4797
4797
  });
@@ -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 _chunkMZG5M4JScjs = require('./chunk-MZG5M4JS.cjs');
3
+ var _chunkSO4USIKLcjs = require('./chunk-SO4USIKL.cjs');
4
4
 
5
5
 
6
6
 
@@ -370,7 +370,7 @@ function requestEvent(metadata, method, status, durationMs) {
370
370
  id: uuid(),
371
371
  requestId: metadata.id,
372
372
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
373
- route: routeTemplate(_chunkMZG5M4JScjs.getFarmRouteLabel.call(void 0, metadata.route)),
373
+ route: routeTemplate(_chunkSO4USIKLcjs.getFarmRouteLabel.call(void 0, metadata.route)),
374
374
  ...metadata.path ? { path: metadata.path } : {},
375
375
  agent: metadata.agent,
376
376
  kind: "request",
@@ -426,7 +426,7 @@ function toolEvent(metadata, event, payloads) {
426
426
  id: uuid(),
427
427
  requestId: metadata.id,
428
428
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
429
- route: routeTemplate(_chunkMZG5M4JScjs.getFarmRouteLabel.call(void 0, metadata.route)),
429
+ route: routeTemplate(_chunkSO4USIKLcjs.getFarmRouteLabel.call(void 0, metadata.route)),
430
430
  ...metadata.path ? { path: metadata.path } : {},
431
431
  agent: metadata.agent,
432
432
  kind: "mcp.tool",
@@ -512,7 +512,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
512
512
  exporter.enqueue({
513
513
  id: uuid(),
514
514
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
515
- route: routeTemplate(_chunkMZG5M4JScjs.getFarmRouteLabel.call(void 0, route)),
515
+ route: routeTemplate(_chunkSO4USIKLcjs.getFarmRouteLabel.call(void 0, route)),
516
516
  ...path ? { path } : {},
517
517
  agent: _chunkU2HFXURZcjs.classifyFarmClient.call(void 0, request),
518
518
  kind: "mcp.tool",
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  collectFarmNativeServerFns,
34
34
  findFarmNativeScreenFiles
35
- } from "./chunk-FFROR7QD.mjs";
35
+ } from "./chunk-VZRY3CL5.mjs";
36
36
  import {
37
37
  assertFarmDocsAdapterServesNoGuardedPages,
38
38
  compileFarmDocsAdapterEdgeManifest,
@@ -41,7 +41,7 @@ import {
41
41
  listFarmDocsAdapterPages,
42
42
  listFarmDocsAdapterRoutes,
43
43
  listFarmDocsPagePaths
44
- } from "./chunk-SIHHYNX4.mjs";
44
+ } from "./chunk-KJMRW3IP.mjs";
45
45
  import {
46
46
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
47
47
  createFarmDocsHandler,
@@ -71,7 +71,7 @@ import {
71
71
  getDeployTargetForPreset,
72
72
  hasCustomFarmRouteContext,
73
73
  resolveDeployOutputPath
74
- } from "./chunk-ZRTBDHO2.mjs";
74
+ } from "./chunk-MVNIAD6O.mjs";
75
75
  import {
76
76
  resolveFarmInstrumentationFile
77
77
  } from "./chunk-QRNYSISP.mjs";
@@ -117,14 +117,14 @@ import {
117
117
  resolveFarmNotFoundComponentPath,
118
118
  resolveFarmRouteRootStrategy,
119
119
  toBakedMarkdownSourcePath
120
- } from "./chunk-RDT2LJES.mjs";
120
+ } from "./chunk-6YOMQ4GX.mjs";
121
121
  import {
122
122
  TAILWIND_CSS_BROWSER_TARGET,
123
123
  generateFarmClientPluginEntryCode,
124
124
  hasFarmServerRuntimePlugins,
125
125
  includesTailwindVitePlugin,
126
126
  loadTailwindVitePlugin
127
- } from "./chunk-V36K4TSU.mjs";
127
+ } from "./chunk-ADKPJZPP.mjs";
128
128
  import {
129
129
  PluginManager
130
130
  } from "./chunk-6IKUYFNQ.mjs";
@@ -133,11 +133,11 @@ import {
133
133
  readRouteRenderingDirectiveFromFile,
134
134
  resolveRouteRenderingConfig,
135
135
  resolveRouteRenderingConfigFromFile
136
- } from "./chunk-MLMDOIBY.mjs";
136
+ } from "./chunk-RS4QZOFK.mjs";
137
137
  import {
138
138
  FARM_PRERENDER_ENV,
139
139
  _farmWebMCPReportsEnabled
140
- } from "./chunk-D7KBMJ7L.mjs";
140
+ } from "./chunk-CIRC2LRP.mjs";
141
141
  import {
142
142
  HOISTED_HEAD_ELEMENT,
143
143
  appMiddlewareMayHandlePath,
@@ -165,7 +165,7 @@ import {
165
165
  listFarmBuiltInRoutePaths,
166
166
  resolveFarmApiCatalogInput,
167
167
  resolveFarmAppManifestInput
168
- } from "./chunk-ZF7N222A.mjs";
168
+ } from "./chunk-IPKL7L6B.mjs";
169
169
  import {
170
170
  FARM_DEFAULT_MCP_PATH,
171
171
  createFarmDefaultMCPServer,
@@ -173,7 +173,7 @@ import {
173
173
  } from "./chunk-WABOJXAA.mjs";
174
174
  import {
175
175
  isFarmPreviewDeploymentEnvironment
176
- } from "./chunk-GK2RCRT2.mjs";
176
+ } from "./chunk-CTHQE7DO.mjs";
177
177
  import {
178
178
  FARM_NATIVE_SERVER_FN_PLUGIN
179
179
  } from "./chunk-L4RTTTVE.mjs";
@@ -194,7 +194,7 @@ import {
194
194
  withFarmSourceSnapshot,
195
195
  withFarmSourceSnapshotOf,
196
196
  withPackageClientBoundaryCache
197
- } from "./chunk-RP55BUJM.mjs";
197
+ } from "./chunk-XGBDRC5B.mjs";
198
198
  import {
199
199
  generateFarmDocsAdapterClientRuntime,
200
200
  getFarmDocsAdapterConfigModule
@@ -288,11 +288,11 @@ import {
288
288
  } from "./chunk-QD34VE4N.mjs";
289
289
  import {
290
290
  APIRouteManager
291
- } from "./chunk-WOPQQCP3.mjs";
291
+ } from "./chunk-P3UT3OLV.mjs";
292
292
  import {
293
293
  hasPolyroutePlugin,
294
294
  isPolyrouteRouteFileName
295
- } from "./chunk-OZAVCLXY.mjs";
295
+ } from "./chunk-O77EKGAS.mjs";
296
296
  import {
297
297
  readFarmI18nCatalogs
298
298
  } from "./chunk-VO55MMBX.mjs";
@@ -320,7 +320,7 @@ import {
320
320
  } from "./chunk-2I6PUKWJ.mjs";
321
321
  import {
322
322
  FARM_VERSION
323
- } from "./chunk-MEIZIRMK.mjs";
323
+ } from "./chunk-2FKGY2ZS.mjs";
324
324
  import {
325
325
  FARM_VIDEO_PLAYER_PATH
326
326
  } from "./chunk-23NBOP43.mjs";
@@ -7652,7 +7652,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7652
7652
  const appDirs = getFarmAppDirectories(config);
7653
7653
  let openAPIReference = null;
7654
7654
  if (config.openapi.enabled && config.openapi.route) {
7655
- const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-EFPBRS3U.mjs");
7655
+ const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-YTJOAHII.mjs");
7656
7656
  const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
7657
7657
  mode: "production",
7658
7658
  apiBaseURL: config.api.baseURL,
@@ -16243,7 +16243,9 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
16243
16243
  suppressLintOnLink: config.suppressLintOnLink,
16244
16244
  componentExtensions: config.renderer.componentExtensions,
16245
16245
  renderer: config.renderer,
16246
- i18nConfig: config.i18n
16246
+ i18nConfig: config.i18n,
16247
+ // Match the routes the API route manager below discovers through this server.
16248
+ polyroute: hasPolyroutePlugin(projectModuleServer.config.plugins)
16247
16249
  }).catch((error) => {
16248
16250
  const message = error instanceof Error ? error.message : String(error);
16249
16251
  logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-WABOJXAA.mjs";
5
5
  import {
6
6
  normalizeFarmProductionSiteOrigin
7
- } from "./chunk-GK2RCRT2.mjs";
7
+ } from "./chunk-CTHQE7DO.mjs";
8
8
  import {
9
9
  resolveFarmAppManifestConfig
10
10
  } from "./chunk-SQ5O7I3L.mjs";
@@ -29,7 +29,7 @@ import {
29
29
  } from "./chunk-YT2ZMLXK.mjs";
30
30
  import {
31
31
  FARM_VERSION
32
- } from "./chunk-MEIZIRMK.mjs";
32
+ } from "./chunk-2FKGY2ZS.mjs";
33
33
  import {
34
34
  applyFarmBasePath
35
35
  } from "./chunk-SF3JB56B.mjs";
@@ -2,7 +2,7 @@ import {
2
2
  createFarmReactRefreshPlugins,
3
3
  farmDesktopDevGuardPlugin,
4
4
  isFarmReactRefreshActive
5
- } from "./chunk-DVL3UVYT.mjs";
5
+ } from "./chunk-6XABTMXR.mjs";
6
6
  import {
7
7
  _listFarmRegisteredMCPServerTools,
8
8
  _observeFarmRegisteredMCPResponse,
@@ -44,25 +44,25 @@ import {
44
44
  resolveFarmIslxActionsMode,
45
45
  resolveFarmRouteRootStrategy,
46
46
  toBakedMarkdownSourcePath
47
- } from "./chunk-RDT2LJES.mjs";
47
+ } from "./chunk-6YOMQ4GX.mjs";
48
48
  import {
49
49
  generateFarmClientPluginEntryCode,
50
50
  hasFarmServerRuntimePlugins,
51
51
  loadTailwindVitePlugin
52
- } from "./chunk-V36K4TSU.mjs";
52
+ } from "./chunk-ADKPJZPP.mjs";
53
53
  import {
54
54
  FARM_NODE_RESPONSE_END_PENDING
55
55
  } from "./chunk-6IKUYFNQ.mjs";
56
56
  import {
57
57
  resolveFarmPlatform
58
- } from "./chunk-LO5BNR6Y.mjs";
58
+ } from "./chunk-W5T3ZAFU.mjs";
59
59
  import {
60
60
  generateFarmTypeArtifacts,
61
61
  resolveRouteRenderingConfig
62
- } from "./chunk-MLMDOIBY.mjs";
62
+ } from "./chunk-RS4QZOFK.mjs";
63
63
  import {
64
64
  _setFarmInfraAnalyticsWebMCPRoute
65
- } from "./chunk-D7KBMJ7L.mjs";
65
+ } from "./chunk-CIRC2LRP.mjs";
66
66
  import {
67
67
  createFarmRouteRenderPlan,
68
68
  farmPathGuardCoversEndpoint,
@@ -89,13 +89,13 @@ import {
89
89
  resolveFarmMCPRouteLabel,
90
90
  resolveFarmMarkdownRouteLabel,
91
91
  setFarmRouteLabel
92
- } from "./chunk-ZF7N222A.mjs";
92
+ } from "./chunk-IPKL7L6B.mjs";
93
93
  import {
94
94
  FARM_DEFAULT_MCP_PATH
95
95
  } from "./chunk-WABOJXAA.mjs";
96
96
  import {
97
97
  isFarmPreviewDeploymentEnvironment
98
- } from "./chunk-GK2RCRT2.mjs";
98
+ } from "./chunk-CTHQE7DO.mjs";
99
99
  import {
100
100
  createFarmServerFnBoundaryModule,
101
101
  isFarmServerFnBoundaryId,
@@ -148,7 +148,7 @@ import {
148
148
  usePackageScanCacheFile,
149
149
  withFarmSourceSnapshotOf,
150
150
  wrapFarmIslandContainers
151
- } from "./chunk-RP55BUJM.mjs";
151
+ } from "./chunk-XGBDRC5B.mjs";
152
152
  import {
153
153
  generateFarmDocsAdapterClientRuntime,
154
154
  getFarmDocsAdapterConfigModule
@@ -253,11 +253,12 @@ import {
253
253
  } from "./chunk-IYEY3JWJ.mjs";
254
254
  import {
255
255
  APIRouteManager
256
- } from "./chunk-WOPQQCP3.mjs";
256
+ } from "./chunk-P3UT3OLV.mjs";
257
257
  import {
258
258
  hasPolyroutePlugin,
259
- isFarmAPIRouteFileName
260
- } from "./chunk-OZAVCLXY.mjs";
259
+ isFarmAPIRouteFileName,
260
+ isPolyrouteRouteDeclarationFileName
261
+ } from "./chunk-O77EKGAS.mjs";
261
262
  import {
262
263
  getFarmI18nClientSnapshot
263
264
  } from "./chunk-O7JEFGUV.mjs";
@@ -275,9 +276,10 @@ import {
275
276
  } from "./chunk-F7MJWW6A.mjs";
276
277
  import {
277
278
  isProgrammaticRoutesFileName,
279
+ isTestSourceFile,
278
280
  parseProgrammaticRouteModuleId,
279
281
  scanProgrammaticPagePaths
280
- } from "./chunk-DZXD6CYJ.mjs";
282
+ } from "./chunk-V2RXBDV6.mjs";
281
283
  import {
282
284
  createCliColors
283
285
  } from "./chunk-IGL6CO6M.mjs";
@@ -320,7 +322,7 @@ import {
320
322
  } from "./chunk-EILUVBKS.mjs";
321
323
  import {
322
324
  FARM_VERSION
323
- } from "./chunk-MEIZIRMK.mjs";
325
+ } from "./chunk-2FKGY2ZS.mjs";
324
326
  import {
325
327
  DEFAULT_FARM_API_BASE_PATH
326
328
  } from "./chunk-W6QLRQ3V.mjs";
@@ -1296,13 +1298,13 @@ function loadFarmDocsSearchDevRuntime() {
1296
1298
  return import("./search-client-HN3ZY6AK.mjs");
1297
1299
  }
1298
1300
  function loadFarmOpenAPIDevRuntime() {
1299
- return import("./manager-EFPBRS3U.mjs");
1301
+ return import("./manager-YTJOAHII.mjs");
1300
1302
  }
1301
1303
  function loadFarmWorkflowsDevRuntime() {
1302
1304
  return import("./workflows.mjs");
1303
1305
  }
1304
1306
  function loadFarmDevtoolsSnapshotRuntime() {
1305
- return import("./devtools-R77KAJA4.mjs");
1307
+ return import("./devtools-VPFBH6I2.mjs");
1306
1308
  }
1307
1309
  function loadFarmDevtoolsUIRuntime() {
1308
1310
  return import("./devtools-ui-UYEVDADD.mjs");
@@ -2031,7 +2033,9 @@ function isResolvedEnvScope(value) {
2031
2033
  );
2032
2034
  }
2033
2035
  function isPotentialProgrammaticRouteSourceFile(normalizedFile, srcDirSlug) {
2034
- return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) && !normalizedFile.endsWith(".d.ts") && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts");
2036
+ return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) && // A declaration file, including TypeScript's `.d.<ext>.ts` form such as a
2037
+ // Polyroute `route.d.rs.ts`, has no runtime code to register a route.
2038
+ !/\.d(\.[^./]+)?\.ts$/.test(normalizedFile) && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts") && !isTestSourceFile(normalizedFile.slice(srcDirSlug.length));
2035
2039
  }
2036
2040
  function fileContainsProgrammaticPageRoute(file) {
2037
2041
  if (!fs2.existsSync(file)) {
@@ -2347,6 +2351,11 @@ function toFarmRuntimeModuleId(specifier) {
2347
2351
  function getFarmCoreFile() {
2348
2352
  return typeof __filename === "string" ? __filename : fileURLToPath(import.meta.url);
2349
2353
  }
2354
+ var farmCoreModuleDirectory;
2355
+ function isFarmCoreModule(id) {
2356
+ farmCoreModuleDirectory ?? (farmCoreModuleDirectory = `${toPosixPath(path6.dirname(getFarmCoreFile()))}/`);
2357
+ return toPosixPath(id.split("?", 1)[0]).startsWith(farmCoreModuleDirectory);
2358
+ }
2350
2359
  var FARM_SOURCE_ALIAS_PROBES = [
2351
2360
  "@/x",
2352
2361
  "@/index.ts",
@@ -2418,6 +2427,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2418
2427
  let openAPIManager = null;
2419
2428
  let middlewareManager;
2420
2429
  let refreshRouteDiscovery = null;
2430
+ let refreshFarmDocsConfig = null;
2421
2431
  const pendingRouteReloads = /* @__PURE__ */ new Set();
2422
2432
  let workflowHandler = null;
2423
2433
  let isBuild = false;
@@ -2513,11 +2523,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2513
2523
  }
2514
2524
  },
2515
2525
  async configureServer(viteServer) {
2516
- viteServer.middlewares.use(
2517
- createFarmDevPreviewGuard(viteServer, {
2526
+ viteServer.middlewares.stack.unshift({
2527
+ route: "",
2528
+ handle: createFarmDevPreviewGuard(viteServer, {
2518
2529
  getSourceRoots: () => getFarmSourceRoots(farmApp?.getConfig() ?? options)
2519
2530
  })
2520
- );
2531
+ });
2521
2532
  if (typeof fontImports.configureServer === "function") {
2522
2533
  await fontImports.configureServer.call(this, viteServer);
2523
2534
  }
@@ -2614,6 +2625,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2614
2625
  const appDirSlugs = sourceRoots.map(
2615
2626
  (source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
2616
2627
  );
2628
+ const polyroute = hasPolyroutePlugin(server.config.plugins);
2617
2629
  const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
2618
2630
  try {
2619
2631
  const result = await generateFarmTypeArtifacts({
@@ -2627,6 +2639,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2627
2639
  componentExtensions: farmConfig.renderer.componentExtensions,
2628
2640
  renderer: farmConfig.renderer,
2629
2641
  i18nConfig: farmConfig.i18n,
2642
+ polyroute,
2630
2643
  ...selection
2631
2644
  });
2632
2645
  if (log) {
@@ -2670,11 +2683,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2670
2683
  const match = /\/(?:page|layout|loading|error)(\.[^./]+)$/.exec(normalized);
2671
2684
  return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/`)) && !!match && routeModuleExtensions.has(match[1].toLowerCase());
2672
2685
  };
2673
- const polyroute = hasPolyroutePlugin(server.config.plugins);
2674
2686
  const isApiRouteFile = (file) => {
2675
2687
  const normalized = file.replace(/\\/g, "/");
2676
2688
  return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && isFarmAPIRouteFileName(path6.posix.basename(normalized), polyroute);
2677
2689
  };
2690
+ const isApiRouteDeclarationFile = (file) => {
2691
+ const normalized = file.replace(/\\/g, "/");
2692
+ return polyroute && appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && isPolyrouteRouteDeclarationFileName(path6.posix.basename(normalized));
2693
+ };
2678
2694
  const isProgrammaticRouteFile = (file) => {
2679
2695
  const normalized = file.replace(/\\/g, "/");
2680
2696
  return srcDirSlugs.some((srcDir) => normalized.startsWith(`${srcDir}/`)) && isProgrammaticRoutesFileName(normalized);
@@ -2724,7 +2740,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2724
2740
  const programmaticRouteChanged = isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file));
2725
2741
  const typeArtifacts = configChanged ? ALL_TYPE_ARTIFACTS : {
2726
2742
  routes: ev !== "change" && (isRouteModuleFile(file) || isRendererRouteFile(file)) || programmaticRouteChanged,
2727
- api: isApiRouteFile(file) || programmaticRouteChanged,
2743
+ api: isApiRouteFile(file) || isApiRouteDeclarationFile(file) || programmaticRouteChanged,
2728
2744
  env: false,
2729
2745
  images: false,
2730
2746
  i18n: isI18nCatalogFile(file)
@@ -2911,38 +2927,58 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2911
2927
  },
2912
2928
  href
2913
2929
  );
2914
- const farmDocsHandler = farmDocsDevRuntime ? farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? await farmDocsDevRuntime.createFarmDocsAdapterHandler(farmConfig.docs, {
2915
- root: farmConfig.root,
2916
- srcDir: farmConfig.srcDir,
2917
- clientEntry: "/@farm/client.js",
2918
- rendererServer: farmConfig.renderer.server,
2919
- resolveLayoutFonts: resolveDocsLayoutFonts,
2920
- fontStylesheetHref: "/@farm/fonts.css",
2921
- globalStylesheetHref: resolveDevGlobalStylesheetHref(
2922
- farmConfig.root,
2923
- farmConfig.srcDir
2924
- ),
2925
- loadModule: async (specifier) => {
2926
- const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
2927
- if (specifier === farmConfig.docs.adapter?.server && resolved?.id) {
2928
- const file = resolved.id.split("?", 1)[0];
2929
- return import(
2930
- /* @vite-ignore */
2931
- pathToFileURL(file).href
2932
- );
2930
+ let farmDocsRuntimeGeneration = 0;
2931
+ const createFarmDocsAdapterHandler = () => {
2932
+ const generation = ++farmDocsRuntimeGeneration;
2933
+ return farmDocsDevRuntime.createFarmDocsAdapterHandler(farmConfig.docs, {
2934
+ root: farmConfig.root,
2935
+ srcDir: farmConfig.srcDir,
2936
+ clientEntry: "/@farm/client.js",
2937
+ rendererServer: farmConfig.renderer.server,
2938
+ resolveLayoutFonts: resolveDocsLayoutFonts,
2939
+ fontStylesheetHref: "/@farm/fonts.css",
2940
+ globalStylesheetHref: resolveDevGlobalStylesheetHref(farmConfig.root, farmConfig.srcDir),
2941
+ loadModule: async (specifier) => {
2942
+ const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
2943
+ if (specifier === farmConfig.docs.adapter?.server && resolved?.id) {
2944
+ const file = resolved.id.split("?", 1)[0];
2945
+ return import(
2946
+ /* @vite-ignore */
2947
+ pathToFileURL(file).href
2948
+ );
2949
+ }
2950
+ return loadFarmDevModule(server, resolved?.id ?? specifier);
2951
+ },
2952
+ registerMCPServer: (mcpServer) => {
2953
+ if (generation !== farmDocsRuntimeGeneration) return () => {
2954
+ };
2955
+ const dispose = registerFarmMCPServer(mcpServer);
2956
+ docsMCPServerDisposers.add(dispose);
2957
+ return () => {
2958
+ docsMCPServerDisposers.delete(dispose);
2959
+ dispose();
2960
+ };
2961
+ },
2962
+ isPathGuarded: isFarmDocsPathGuarded
2963
+ });
2964
+ };
2965
+ let farmDocsAdapterHandler = farmDocsDevRuntime?.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? createFarmDocsAdapterHandler() : void 0;
2966
+ if (farmDocsAdapterHandler) await farmDocsAdapterHandler;
2967
+ const farmDocsConfigModule = farmDocsAdapterHandler ? getFarmDocsAdapterConfigModule(farmConfig.docs) : void 0;
2968
+ if (farmDocsConfigModule) {
2969
+ const configFile = toPosixPath(path6.resolve(farmConfig.root, farmDocsConfigModule));
2970
+ refreshFarmDocsConfig = (file) => {
2971
+ if (invalidateFarmDevDependents(server, file, /* @__PURE__ */ new Set([configFile])).length === 0) {
2972
+ return false;
2933
2973
  }
2934
- return loadFarmDevModule(server, resolved?.id ?? specifier);
2935
- },
2936
- registerMCPServer: (mcpServer) => {
2937
- const dispose = registerFarmMCPServer(mcpServer);
2938
- docsMCPServerDisposers.add(dispose);
2939
- return () => {
2940
- docsMCPServerDisposers.delete(dispose);
2941
- dispose();
2942
- };
2943
- },
2944
- isPathGuarded: isFarmDocsPathGuarded
2945
- }) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
2974
+ releaseDocsMCPServers();
2975
+ farmDocsAdapterHandler = createFarmDocsAdapterHandler();
2976
+ farmDocsAdapterHandler.catch(() => {
2977
+ });
2978
+ return true;
2979
+ };
2980
+ }
2981
+ const farmDocsHandler = farmDocsDevRuntime ? farmDocsAdapterHandler ? (request) => farmDocsAdapterHandler.then((handle) => handle(request)) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
2946
2982
  root: farmConfig.root,
2947
2983
  srcDir: farmConfig.srcDir,
2948
2984
  clientEntry: "/@farm/client.js",
@@ -5051,7 +5087,7 @@ export { manifest };
5051
5087
  const runtimeModule = !isBuild && transformOptions?.ssr === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
5052
5088
  const actionConfig = farmApp?.getConfig() ?? options;
5053
5089
  let rewrotePackageImports = false;
5054
- if (resolveFarmServerComponentsMode(readFarmServerComponentsConfig(actionConfig)) === "islands" && (!id.includes("/node_modules/") || transformOptions?.ssr === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !hasUseClientDirective(code)) {
5090
+ if (resolveFarmServerComponentsMode(readFarmServerComponentsConfig(actionConfig)) === "islands" && (!id.includes("/node_modules/") && !isFarmCoreModule(id) || transformOptions?.ssr === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !hasUseClientDirective(code)) {
5055
5091
  const file = id.split("?", 1)[0];
5056
5092
  const projectRoot = actionConfig.root || server?.config.root || process.cwd();
5057
5093
  const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
@@ -5503,6 +5539,11 @@ if (import.meta.hot) {
5503
5539
  if (apiRouteManager && invalidateFarmDevDependents(server2, file, apiRouteManager.getSourceFiles()).length > 0) {
5504
5540
  await refreshRouteDiscovery?.(`updated ${file}`);
5505
5541
  }
5542
+ if (refreshFarmDocsConfig?.(file)) {
5543
+ logUpdate("PAGE", `updated ${path6.basename(file)}`);
5544
+ reloadAfterEdit();
5545
+ return [];
5546
+ }
5506
5547
  const isolatedHydrationMode = currentFarmConfig?.experimental?.isolatedClientHydration;
5507
5548
  const planRouteManager = farmApp?.getRouteManager();
5508
5549
  const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
@@ -5604,10 +5645,11 @@ if (import.meta.hot) {
5604
5645
  return modules;
5605
5646
  }
5606
5647
  };
5607
- if (!deferredSetup) return plugin;
5608
5648
  const setUpDevServer = plugin.configureServer;
5649
+ plugin.configureServer = { order: "post", handler: setUpDevServer };
5650
+ if (!deferredSetup) return plugin;
5609
5651
  let deferred = false;
5610
- plugin.configureServer = function(viteServer) {
5652
+ const setUpDeferredDevServer = function(viteServer) {
5611
5653
  if (deferred) {
5612
5654
  deferredGates = void 0;
5613
5655
  return setUpDevServer.call(this, viteServer);
@@ -5637,6 +5679,7 @@ if (import.meta.hot) {
5637
5679
  viteServer.middlewares.use(post);
5638
5680
  };
5639
5681
  };
5682
+ plugin.configureServer = { order: "post", handler: setUpDeferredDevServer };
5640
5683
  return plugin;
5641
5684
  }
5642
5685
  function runFarmMiddlewareWithNavigation(renderer, middlewareRequest, req, res, execute) {
@@ -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 _chunkZ7YIQ7AJcjs = require('./chunk-Z7YIQ7AJ.cjs');
3
+ var _chunkC2J5LMH6cjs = require('./chunk-C2J5LMH6.cjs');
4
4
 
5
5
 
6
6
  var _chunkUGL4BDNBcjs = require('./chunk-UGL4BDNB.cjs');
@@ -97,7 +97,7 @@ function createFarmProductionSiteReporter(options) {
97
97
  schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
98
98
  eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
99
99
  packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
100
- packageVersion: sanitizeDetail(_chunkZ7YIQ7AJcjs.FARM_VERSION, "unknown"),
100
+ packageVersion: sanitizeDetail(_chunkC2J5LMH6cjs.FARM_VERSION, "unknown"),
101
101
  renderer: sanitizeDetail(options.renderer, "custom"),
102
102
  deployTarget: sanitizeDetail(options.deployTarget, "custom")
103
103
  };
@@ -18,7 +18,7 @@ var _chunk4A6WSOZHcjs = require('./chunk-4A6WSOZH.cjs');
18
18
  var _chunkTDAH76RRcjs = require('./chunk-TDAH76RR.cjs');
19
19
 
20
20
 
21
- var _chunkOAAVIFOJcjs = require('./chunk-OAAVIFOJ.cjs');
21
+ var _chunk2LGM5WIKcjs = require('./chunk-2LGM5WIK.cjs');
22
22
 
23
23
 
24
24
 
@@ -638,7 +638,7 @@ async function resolveAPIContext(options) {
638
638
  config: options.config,
639
639
  configPath: options.configPath
640
640
  }));
641
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkOAAVIFOJcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
641
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunk2LGM5WIKcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
642
642
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _27 => _27.guardedPaths]), () => ( [])));
643
643
  return {
644
644
  root,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-LRPPXKCX.mjs";
19
19
  import {
20
20
  resolveDocsConfig
21
- } from "./chunk-ZRTBDHO2.mjs";
21
+ } from "./chunk-MVNIAD6O.mjs";
22
22
  import {
23
23
  getFarmDocsAdapterConfigModule,
24
24
  isSecretDocsConfigKey