@farm.js/core 0.1.51-beta.3 → 0.1.61

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 (1248) hide show
  1. package/dist/after.cjs +3 -3
  2. package/dist/after.mjs +2 -2
  3. package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
  4. package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
  5. package/dist/agent-runtime.cjs +59 -36
  6. package/dist/agent-runtime.mjs +58 -35
  7. package/dist/api/client.cjs +14 -14
  8. package/dist/api/client.mjs +13 -13
  9. package/dist/api/route-manager.cjs +39 -41
  10. package/dist/api/route-manager.mjs +38 -40
  11. package/dist/api/runtime.cjs +22 -24
  12. package/dist/api/runtime.mjs +22 -24
  13. package/dist/api.cjs +50 -52
  14. package/dist/api.mjs +49 -51
  15. package/dist/app-markdown.cjs +15 -15
  16. package/dist/app-markdown.mjs +14 -14
  17. package/dist/cache.cjs +7 -10
  18. package/dist/cache.mjs +6 -9
  19. package/dist/chunk-23MGIV4X.mjs +579 -0
  20. package/dist/chunk-27ZWSI3W.cjs +64 -0
  21. package/dist/chunk-2A3EQHXX.mjs +173 -0
  22. package/dist/chunk-2CQ74SP6.cjs +13 -0
  23. package/dist/chunk-2ELDTQRN.mjs +85 -0
  24. package/dist/chunk-2J7W2WND.mjs +149 -0
  25. package/dist/chunk-2NNMOPDN.mjs +237 -0
  26. package/dist/chunk-2PQNJXFM.mjs +20 -0
  27. package/dist/chunk-2SJ4RQ6P.cjs +57 -0
  28. package/dist/chunk-2UC36WAC.mjs +22 -0
  29. package/dist/chunk-2VQKKQ6D.mjs +51 -0
  30. package/dist/chunk-2Y3JRYVG.mjs +71 -0
  31. package/dist/chunk-35GKZR22.mjs +157 -0
  32. package/dist/chunk-3BU22U3M.cjs +237 -0
  33. package/dist/chunk-3KZS4SUS.mjs +414 -0
  34. package/dist/chunk-3SDFA7UF.cjs +701 -0
  35. package/dist/chunk-3TLO7SBY.cjs +240 -0
  36. package/dist/chunk-3UEVPCGW.mjs +435 -0
  37. package/dist/chunk-3WNDJT2E.cjs +109 -0
  38. package/dist/chunk-44SYJEG3.mjs +13 -0
  39. package/dist/chunk-45ZSJLDT.mjs +183 -0
  40. package/dist/chunk-4E5AEDKY.mjs +696 -0
  41. package/dist/chunk-4E5WBPEG.mjs +1157 -0
  42. package/dist/chunk-4GLOOWKE.mjs +1344 -0
  43. package/dist/chunk-4JCQDWPX.mjs +24 -0
  44. package/dist/chunk-4NU4GGTC.cjs +484 -0
  45. package/dist/chunk-4OOBRCJX.mjs +300 -0
  46. package/dist/chunk-4PPEPOZZ.cjs +21 -0
  47. package/dist/chunk-4RB44K6Z.mjs +94 -0
  48. package/dist/chunk-4SIYUGRY.mjs +93 -0
  49. package/dist/chunk-4WQ6PGSJ.cjs +367 -0
  50. package/dist/chunk-4WVJLURN.mjs +417 -0
  51. package/dist/chunk-4ZFL5GFN.cjs +520 -0
  52. package/dist/chunk-54UPOYFS.mjs +35 -0
  53. package/dist/chunk-55YI3RRB.mjs +192 -0
  54. package/dist/chunk-5I3OT426.cjs +11021 -0
  55. package/dist/chunk-5QIKR7RR.cjs +224 -0
  56. package/dist/chunk-5SJWVY6R.mjs +26 -0
  57. package/dist/chunk-5WI2S4CO.mjs +20 -0
  58. package/dist/chunk-63H6BKXG.cjs +389 -0
  59. package/dist/chunk-655RLQQL.mjs +43 -0
  60. package/dist/chunk-6EODJYCX.cjs +183 -0
  61. package/dist/chunk-6EXBPJ24.cjs +434 -0
  62. package/dist/chunk-6MVFL3R5.cjs +506 -0
  63. package/dist/chunk-6NT6S2VQ.mjs +180 -0
  64. package/dist/chunk-6QQDAAAZ.cjs +38 -0
  65. package/dist/chunk-6SJ2KJTA.mjs +314 -0
  66. package/dist/chunk-6SM5XXFS.cjs +70 -0
  67. package/dist/chunk-6V4TDWEC.cjs +455 -0
  68. package/dist/chunk-72ADZ6GQ.cjs +19 -0
  69. package/dist/chunk-72AK62H5.mjs +55 -0
  70. package/dist/chunk-75RZHGLS.cjs +135 -0
  71. package/dist/chunk-77GNHH2Z.cjs +236 -0
  72. package/dist/chunk-7DBXEASO.cjs +40 -0
  73. package/dist/chunk-7LTCDQRS.mjs +166 -0
  74. package/dist/chunk-7W3CPVXS.cjs +24 -0
  75. package/dist/chunk-A6WIQH5Z.cjs +31 -0
  76. package/dist/chunk-ADEA7PN3.cjs +1101 -0
  77. package/dist/chunk-AELACLOB.mjs +47 -0
  78. package/dist/chunk-AHGECQEW.mjs +49 -0
  79. package/dist/chunk-AI7QMY7O.cjs +41 -0
  80. package/dist/chunk-AJQTP4OO.mjs +212 -0
  81. package/dist/chunk-AMDMVWMI.cjs +39 -0
  82. package/dist/chunk-ARJWXNQL.cjs +256 -0
  83. package/dist/chunk-BCMSYSN2.mjs +183 -0
  84. package/dist/chunk-BIDYX3SL.cjs +91 -0
  85. package/dist/chunk-BJIYRUGQ.mjs +35 -0
  86. package/dist/chunk-BJPBQNIE.cjs +2355 -0
  87. package/dist/chunk-BO36SELV.cjs +395 -0
  88. package/dist/chunk-BOYNDCZL.mjs +54 -0
  89. package/dist/chunk-BPMATOP2.cjs +687 -0
  90. package/dist/chunk-BPOF5U4N.mjs +566 -0
  91. package/dist/chunk-BRYHOB4X.mjs +18 -0
  92. package/dist/chunk-BSC7JTOK.mjs +70 -0
  93. package/dist/chunk-BTHHUD7Q.mjs +51 -0
  94. package/dist/chunk-BUGNQIHC.mjs +449 -0
  95. package/dist/chunk-C4NCTZLM.mjs +22 -0
  96. package/dist/chunk-C4SPBWFM.cjs +26 -0
  97. package/dist/chunk-C5GUTBZK.cjs +173 -0
  98. package/dist/chunk-CBBLJMR5.mjs +74 -0
  99. package/dist/chunk-CBJJH36A.cjs +2187 -0
  100. package/dist/chunk-CGBDNNSM.cjs +664 -0
  101. package/dist/chunk-CI6E3UOH.cjs +314 -0
  102. package/dist/chunk-CMGMGHUZ.cjs +27 -0
  103. package/dist/chunk-CNOQY6Z7.mjs +156 -0
  104. package/dist/chunk-CQ6OSQ3K.mjs +36 -0
  105. package/dist/chunk-CU625VAY.mjs +13 -0
  106. package/dist/chunk-CVOSWIQA.mjs +15300 -0
  107. package/dist/chunk-CXEN47J3.mjs +550 -0
  108. package/dist/chunk-CXP5U3RW.cjs +54 -0
  109. package/dist/chunk-D227TIEN.cjs +1114 -0
  110. package/dist/chunk-D2BB47NB.cjs +157 -0
  111. package/dist/chunk-D2ULAULS.cjs +166 -0
  112. package/dist/chunk-D7JTOLFK.cjs +285 -0
  113. package/dist/chunk-DAATZTKJ.mjs +220 -0
  114. package/dist/chunk-DAO7JGTS.mjs +73 -0
  115. package/dist/chunk-DQQOKWYA.cjs +42 -0
  116. package/dist/chunk-DTSROJ5J.mjs +367 -0
  117. package/dist/chunk-DVM4FKZL.cjs +169 -0
  118. package/dist/chunk-DZ5ZVB2K.cjs +9 -0
  119. package/dist/chunk-E2ROOWQC.cjs +2225 -0
  120. package/dist/chunk-E3UK5IIB.cjs +593 -0
  121. package/dist/chunk-E5GNDG5F.mjs +701 -0
  122. package/dist/chunk-EA5K5BKU.mjs +455 -0
  123. package/dist/chunk-ECKF2BAM.cjs +403 -0
  124. package/dist/chunk-EK4QAEFZ.cjs +550 -0
  125. package/dist/chunk-EMLAPBEM.mjs +256 -0
  126. package/dist/chunk-ENLZ4R3Y.mjs +55 -0
  127. package/dist/chunk-EUV4YR3V.cjs +1362 -0
  128. package/dist/chunk-EWET4D2Y.mjs +395 -0
  129. package/dist/chunk-EZDQRNQ7.mjs +1496 -0
  130. package/dist/chunk-F2SE2VDO.mjs +65 -0
  131. package/dist/chunk-F3LTXB63.mjs +40 -0
  132. package/dist/chunk-F3VB7ONA.mjs +338 -0
  133. package/dist/chunk-F5QO4FNE.mjs +664 -0
  134. package/dist/chunk-FA2W42OV.mjs +25 -0
  135. package/dist/chunk-FDR64H6B.mjs +140 -0
  136. package/dist/chunk-FFFW3OQ7.cjs +65 -0
  137. package/dist/chunk-FJ3M4CUX.cjs +46 -0
  138. package/dist/chunk-FK6GO24V.cjs +54 -0
  139. package/dist/chunk-FNO7A7CM.cjs +1496 -0
  140. package/dist/chunk-FO427P6I.cjs +392 -0
  141. package/dist/chunk-FP2INE7H.mjs +113 -0
  142. package/dist/chunk-FUZEBRP3.mjs +593 -0
  143. package/dist/chunk-FZ6YYU2W.mjs +65 -0
  144. package/dist/chunk-G2KY33I6.mjs +202 -0
  145. package/dist/chunk-G4MWPDSE.mjs +19 -0
  146. package/dist/chunk-G643DQCH.cjs +13 -0
  147. package/dist/chunk-G7HXGLEC.cjs +175 -0
  148. package/dist/chunk-GC3SUL6M.mjs +109 -0
  149. package/dist/chunk-GCXWJJKH.mjs +169 -0
  150. package/dist/chunk-GHFS7RUB.mjs +152 -0
  151. package/dist/chunk-GQ3Z3IZI.cjs +241 -0
  152. package/dist/chunk-H4AMB6ZE.mjs +421 -0
  153. package/dist/chunk-H77NVNJ2.mjs +57 -0
  154. package/dist/chunk-HALDNTIV.mjs +2225 -0
  155. package/dist/chunk-HITLGIAO.cjs +55 -0
  156. package/dist/chunk-HLJ6MBUZ.cjs +183 -0
  157. package/dist/chunk-HOXTWRGB.mjs +484 -0
  158. package/dist/chunk-HREOKQWT.cjs +45 -0
  159. package/dist/chunk-I2BHUNBU.mjs +14 -0
  160. package/dist/chunk-I57LW5VZ.cjs +94 -0
  161. package/dist/chunk-IE7XCHH3.cjs +85 -0
  162. package/dist/chunk-IHNIDL6H.cjs +772 -0
  163. package/dist/chunk-IK6LVLKC.cjs +51 -0
  164. package/dist/chunk-IOEH4VWN.mjs +202 -0
  165. package/dist/chunk-IWZKTWHZ.cjs +435 -0
  166. package/dist/chunk-IZY3V5XW.mjs +23 -0
  167. package/dist/chunk-J63ZH5OQ.cjs +62 -0
  168. package/dist/chunk-J7FSKED3.cjs +93 -0
  169. package/dist/chunk-JBSVKMC5.mjs +28 -0
  170. package/dist/chunk-JDNHKPTD.cjs +22 -0
  171. package/dist/chunk-JG6DJF5A.mjs +238 -0
  172. package/dist/chunk-JGLC4TO3.cjs +192 -0
  173. package/dist/chunk-JM5XPKWH.mjs +41 -0
  174. package/dist/chunk-JNUWCDTF.cjs +1344 -0
  175. package/dist/chunk-JNZ4TDWM.mjs +445 -0
  176. package/dist/chunk-JPLUGGRV.mjs +230 -0
  177. package/dist/chunk-JSROZYYO.cjs +164 -0
  178. package/dist/chunk-KCMTCM6I.cjs +53 -0
  179. package/dist/chunk-KGB5UXJJ.mjs +27 -0
  180. package/dist/chunk-KGZIORNL.cjs +43 -0
  181. package/dist/chunk-KI3MESHB.mjs +224 -0
  182. package/dist/chunk-KIIMAWOJ.cjs +505 -0
  183. package/dist/chunk-KMTGADN3.mjs +95 -0
  184. package/dist/chunk-KN7K4VQN.mjs +236 -0
  185. package/dist/chunk-KNBBQHO2.cjs +51 -0
  186. package/dist/chunk-KR6CKSXT.cjs +15 -0
  187. package/dist/chunk-KXWRO25S.cjs +85 -0
  188. package/dist/chunk-L3KT7IXV.mjs +91 -0
  189. package/dist/chunk-LCCBO7PJ.cjs +46 -0
  190. package/dist/chunk-LIUGYUX3.cjs +22 -0
  191. package/dist/chunk-LPEX4YW6.mjs +13 -0
  192. package/dist/chunk-LSKZMJMP.cjs +65 -0
  193. package/dist/chunk-LSZAVSGY.mjs +1101 -0
  194. package/dist/chunk-LTNGXMQ6.cjs +55 -0
  195. package/dist/chunk-LYLEZIG3.cjs +73 -0
  196. package/dist/chunk-LYV44OIR.mjs +256 -0
  197. package/dist/chunk-M2L4MYDQ.cjs +14 -0
  198. package/dist/chunk-M7MKQXAF.cjs +87 -0
  199. package/dist/chunk-MKYBIIAQ.mjs +2187 -0
  200. package/dist/chunk-MQ3H6LT5.cjs +202 -0
  201. package/dist/chunk-MRMI32SN.cjs +1157 -0
  202. package/dist/chunk-MSSFIQGM.mjs +1002 -0
  203. package/dist/chunk-MT763TDW.cjs +43 -0
  204. package/dist/chunk-MVL2RAJW.mjs +62 -0
  205. package/dist/chunk-MWSK6C4J.cjs +18 -0
  206. package/dist/chunk-MWWVKDW3.cjs +169 -0
  207. package/dist/chunk-N2NAS2AM.cjs +725 -0
  208. package/dist/chunk-N46M65CI.mjs +54 -0
  209. package/dist/chunk-N4UOK6ZI.cjs +256 -0
  210. package/dist/chunk-NI2TCCTG.mjs +11020 -0
  211. package/dist/chunk-NO3WWW3N.cjs +192 -0
  212. package/dist/chunk-NPC7VWJE.mjs +277 -0
  213. package/dist/chunk-NRDBW4MP.mjs +45 -0
  214. package/dist/chunk-NRSN7G7E.mjs +42 -0
  215. package/dist/chunk-NYJMY3JA.cjs +156 -0
  216. package/dist/chunk-NZKJGRB3.cjs +230 -0
  217. package/dist/chunk-O6BCQV2T.mjs +46 -0
  218. package/dist/chunk-O6I6VWKK.mjs +493 -0
  219. package/dist/chunk-O6WAEAX3.mjs +2028 -0
  220. package/dist/chunk-O7BH5O46.mjs +175 -0
  221. package/dist/chunk-OFZUJMCU.mjs +601 -0
  222. package/dist/chunk-OHLSEQ57.mjs +910 -0
  223. package/dist/chunk-OHY2ZWUG.cjs +25 -0
  224. package/dist/chunk-OI6CMLWX.cjs +47 -0
  225. package/dist/chunk-ONUEYC6N.mjs +27 -0
  226. package/dist/chunk-OO7GXVSR.mjs +9 -0
  227. package/dist/chunk-OT6ZEW74.mjs +139 -0
  228. package/dist/chunk-OTC5BDGO.mjs +687 -0
  229. package/dist/chunk-OX6O6WVA.cjs +74 -0
  230. package/dist/chunk-OYEUREB6.cjs +35 -0
  231. package/dist/chunk-OZVEHHMA.cjs +194 -0
  232. package/dist/chunk-P5TJO5IS.mjs +240 -0
  233. package/dist/chunk-PCOTGFSM.cjs +139 -0
  234. package/dist/chunk-PNGWZFUQ.mjs +39 -0
  235. package/dist/chunk-PSV6XKPO.cjs +220 -0
  236. package/dist/chunk-PTZ2TVNE.cjs +178 -0
  237. package/dist/chunk-PZNL3WEG.mjs +772 -0
  238. package/dist/chunk-PZYCPSCC.cjs +35 -0
  239. package/dist/chunk-Q2KB32T4.mjs +690 -0
  240. package/dist/chunk-Q5B3KJBP.cjs +152 -0
  241. package/dist/chunk-QBK2AA4U.cjs +445 -0
  242. package/dist/chunk-QCFBDFRS.mjs +169 -0
  243. package/dist/chunk-QCVE2OCI.cjs +169 -0
  244. package/dist/chunk-QE6VAKLT.mjs +85 -0
  245. package/dist/chunk-QNPEUFHQ.cjs +27 -0
  246. package/dist/chunk-QORUJDIV.mjs +46 -0
  247. package/dist/chunk-QV4VE2OW.mjs +166 -0
  248. package/dist/chunk-QVKYGNVM.mjs +27 -0
  249. package/dist/chunk-QVYLBY73.mjs +93 -0
  250. package/dist/chunk-R3DS7A2T.mjs +21 -0
  251. package/dist/chunk-R5A5KNVX.cjs +20 -0
  252. package/dist/chunk-R5JIFR6B.cjs +42 -0
  253. package/dist/chunk-RHAZ22ZN.mjs +87 -0
  254. package/dist/chunk-RKPDESVW.cjs +15301 -0
  255. package/dist/chunk-RSOJ7DRT.mjs +506 -0
  256. package/dist/chunk-S3A45T7F.cjs +166 -0
  257. package/dist/chunk-S3FNNQHR.mjs +31 -0
  258. package/dist/chunk-S3JO3N4H.cjs +17 -0
  259. package/dist/chunk-S67OYZU7.mjs +711 -0
  260. package/dist/chunk-S6VYG6XU.cjs +493 -0
  261. package/dist/chunk-SAXPH6G5.mjs +169 -0
  262. package/dist/chunk-SC2WYWPF.mjs +241 -0
  263. package/dist/chunk-SDOTRX3V.cjs +690 -0
  264. package/dist/chunk-SEJ5N6SL.mjs +38 -0
  265. package/dist/chunk-SFGWNC43.mjs +97 -0
  266. package/dist/chunk-SHB3GYXI.mjs +285 -0
  267. package/dist/chunk-SHLXACIO.cjs +95 -0
  268. package/dist/chunk-SJNMVDDF.cjs +86 -0
  269. package/dist/chunk-SK35NQKK.cjs +27 -0
  270. package/dist/chunk-SKNL7VA2.mjs +42 -0
  271. package/dist/chunk-SLQCDJSO.mjs +18 -0
  272. package/dist/chunk-SOR334EB.cjs +149 -0
  273. package/dist/chunk-SU7MH53P.cjs +180 -0
  274. package/dist/chunk-SVRTJOUF.cjs +113 -0
  275. package/dist/chunk-SYQ3MOWW.cjs +73 -0
  276. package/dist/chunk-T4OGRVNS.mjs +392 -0
  277. package/dist/chunk-T5OJPTVN.cjs +417 -0
  278. package/dist/chunk-TE2G5ION.cjs +2028 -0
  279. package/dist/chunk-TFQG7TBC.mjs +43 -0
  280. package/dist/chunk-TIWHTW3Q.cjs +24 -0
  281. package/dist/chunk-TKJZFIML.cjs +20 -0
  282. package/dist/chunk-TKSCR644.cjs +414 -0
  283. package/dist/chunk-TVGP4BBZ.mjs +45 -0
  284. package/dist/chunk-U4KT7QP3.cjs +23 -0
  285. package/dist/chunk-UDNPLXW7.mjs +86 -0
  286. package/dist/chunk-UFDAAQFX.cjs +169 -0
  287. package/dist/chunk-UFDV5N3C.cjs +711 -0
  288. package/dist/chunk-UH6QN5NL.mjs +178 -0
  289. package/dist/chunk-UP4CW6WP.mjs +169 -0
  290. package/dist/chunk-UQZ4AYTH.cjs +168 -0
  291. package/dist/chunk-US2QVW3E.cjs +36 -0
  292. package/dist/chunk-UVW64BCB.cjs +910 -0
  293. package/dist/chunk-UWPLULNK.mjs +520 -0
  294. package/dist/chunk-UXFQ3UDA.cjs +140 -0
  295. package/dist/chunk-UYIHRDE4.cjs +97 -0
  296. package/dist/chunk-V2FTMRS7.mjs +223 -0
  297. package/dist/chunk-VB6UCX3V.cjs +421 -0
  298. package/dist/chunk-VEKFLAQM.cjs +300 -0
  299. package/dist/chunk-VILIPRS6.mjs +725 -0
  300. package/dist/chunk-VQLJWDVW.cjs +696 -0
  301. package/dist/chunk-W3B4PKAW.mjs +28 -0
  302. package/dist/chunk-W4E7WMXE.cjs +71 -0
  303. package/dist/chunk-W7LF2J2S.mjs +64 -0
  304. package/dist/chunk-WBKEZXWE.cjs +449 -0
  305. package/dist/chunk-WC5UV2HQ.cjs +212 -0
  306. package/dist/chunk-WMAPPDMM.cjs +28 -0
  307. package/dist/chunk-WMOGFOUJ.cjs +223 -0
  308. package/dist/chunk-WNSDDRNU.mjs +24 -0
  309. package/dist/chunk-WWFTAUFG.cjs +45 -0
  310. package/dist/chunk-WWIKMBRN.mjs +1362 -0
  311. package/dist/chunk-XCMCS4DA.mjs +1114 -0
  312. package/dist/chunk-XJJVLDM6.mjs +194 -0
  313. package/dist/chunk-XJXBIP67.cjs +277 -0
  314. package/dist/chunk-XNPDONUH.mjs +389 -0
  315. package/dist/chunk-XSIRSMAS.cjs +339 -0
  316. package/dist/chunk-XZNTNMHT.mjs +15 -0
  317. package/dist/chunk-Y5SJM2W7.cjs +579 -0
  318. package/dist/chunk-YDQZGSDS.mjs +2355 -0
  319. package/dist/chunk-YFILVET3.mjs +192 -0
  320. package/dist/chunk-YFPGHF5F.cjs +202 -0
  321. package/dist/chunk-YHOCRI4H.mjs +434 -0
  322. package/dist/chunk-YJRZR7VU.cjs +28 -0
  323. package/dist/chunk-YKX5BK66.cjs +46 -0
  324. package/dist/chunk-YOZYCI6Z.mjs +73 -0
  325. package/dist/chunk-YSCV4SJF.cjs +49 -0
  326. package/dist/chunk-YSLWRWWP.cjs +601 -0
  327. package/dist/chunk-YWMZUGIS.mjs +403 -0
  328. package/dist/chunk-YWN746US.cjs +1002 -0
  329. package/dist/chunk-YX3DBN4M.cjs +18 -0
  330. package/dist/chunk-Z2HLU4IX.cjs +238 -0
  331. package/dist/chunk-Z2RZJZIZ.mjs +168 -0
  332. package/dist/chunk-Z3HATSKO.mjs +46 -0
  333. package/dist/chunk-ZEG3OPIB.cjs +93 -0
  334. package/dist/chunk-ZLAT2CWY.mjs +135 -0
  335. package/dist/chunk-ZMMBIVQM.mjs +505 -0
  336. package/dist/chunk-ZMSZZXOR.mjs +164 -0
  337. package/dist/chunk-ZWM5KGAA.cjs +566 -0
  338. package/dist/chunk-ZZSRYEYU.mjs +53 -0
  339. package/dist/client/lifecycle.cjs +3 -3
  340. package/dist/client/lifecycle.mjs +2 -2
  341. package/dist/client-plugins.cjs +3 -3
  342. package/dist/client-plugins.mjs +2 -2
  343. package/dist/client.cjs +40 -45
  344. package/dist/client.mjs +41 -46
  345. package/dist/config.cjs +3 -3
  346. package/dist/config.mjs +2 -2
  347. package/dist/cron.cjs +9 -9
  348. package/dist/cron.mjs +8 -8
  349. package/dist/deferred.cjs +3 -3
  350. package/dist/deferred.mjs +2 -2
  351. package/dist/deployment.cjs +3 -3
  352. package/dist/deployment.mjs +2 -2
  353. package/dist/devtools-ERIKFEXX.mjs +472 -0
  354. package/dist/devtools-JZJJY5CK.cjs +472 -0
  355. package/dist/devtools-client-CXQ6PXI6.cjs +254 -0
  356. package/dist/devtools-client-HJS2T34Y.mjs +254 -0
  357. package/dist/devtools-ui-5GBDIGMK.cjs +1296 -0
  358. package/dist/devtools-ui-5KDAVPIF.mjs +1296 -0
  359. package/dist/docs.cjs +58 -66
  360. package/dist/docs.mjs +57 -65
  361. package/dist/env-types.cjs +4 -4
  362. package/dist/env-types.mjs +3 -3
  363. package/dist/env.cjs +4 -4
  364. package/dist/env.mjs +3 -3
  365. package/dist/environment/vite.cjs +3 -7
  366. package/dist/environment/vite.mjs +2 -6
  367. package/dist/environment.cjs +3 -3
  368. package/dist/environment.mjs +2 -2
  369. package/dist/font.cjs +3 -3
  370. package/dist/font.mjs +2 -2
  371. package/dist/headers.cjs +6 -8
  372. package/dist/headers.mjs +5 -7
  373. package/dist/i18n/client.cjs +30 -19
  374. package/dist/i18n/client.mjs +20 -9
  375. package/dist/i18n/index.cjs +6 -6
  376. package/dist/i18n/index.mjs +5 -5
  377. package/dist/i18n/server.cjs +10 -10
  378. package/dist/i18n/server.mjs +9 -9
  379. package/dist/image/server.cjs +5 -9
  380. package/dist/image/server.mjs +4 -8
  381. package/dist/image/sharp.cjs +20 -16
  382. package/dist/image/sharp.mjs +12 -8
  383. package/dist/image.cjs +18 -9
  384. package/dist/image.mjs +13 -4
  385. package/dist/index.cjs +175 -236
  386. package/dist/index.mjs +245 -306
  387. package/dist/instrumentation.cjs +5 -5
  388. package/dist/instrumentation.mjs +4 -4
  389. package/dist/integration-orm-55F7CII5.cjs +13 -0
  390. package/dist/integration-orm-KV5B3BGZ.mjs +13 -0
  391. package/dist/integrations.cjs +17 -23
  392. package/dist/integrations.mjs +18 -24
  393. package/dist/internal/app-markdown-runtime.cjs +13 -13
  394. package/dist/internal/app-markdown-runtime.mjs +12 -12
  395. package/dist/internal/build-runtime.cjs +133 -161
  396. package/dist/internal/build-runtime.mjs +121 -149
  397. package/dist/internal/cli-runtime.cjs +79 -101
  398. package/dist/internal/cli-runtime.mjs +79 -101
  399. package/dist/internal/client-error-overlay.cjs +49 -18
  400. package/dist/internal/client-error-overlay.mjs +45 -14
  401. package/dist/internal/client-runtime.cjs +50 -59
  402. package/dist/internal/client-runtime.mjs +50 -59
  403. package/dist/internal/compression-runtime.cjs +4 -4
  404. package/dist/internal/compression-runtime.mjs +3 -3
  405. package/dist/internal/config-runtime.cjs +65 -94
  406. package/dist/internal/config-runtime.mjs +51 -80
  407. package/dist/internal/docs-precompiled-runtime.cjs +24 -18
  408. package/dist/internal/docs-precompiled-runtime.mjs +20 -14
  409. package/dist/internal/infra-analytics-runtime.cjs +8 -22
  410. package/dist/internal/infra-analytics-runtime.mjs +6 -20
  411. package/dist/internal/isolated-boundary.cjs +4 -5
  412. package/dist/internal/isolated-boundary.mjs +3 -4
  413. package/dist/internal/metadata-image-runtime.cjs +7 -8
  414. package/dist/internal/metadata-image-runtime.mjs +6 -7
  415. package/dist/internal/product-telemetry-runtime.cjs +17 -5
  416. package/dist/internal/product-telemetry-runtime.mjs +15 -3
  417. package/dist/internal/production-node-env.cjs +3 -7
  418. package/dist/internal/production-node-env.mjs +2 -6
  419. package/dist/internal/production-runtime.cjs +90 -236
  420. package/dist/internal/production-runtime.mjs +115 -261
  421. package/dist/internal/request-cookies.cjs +3 -3
  422. package/dist/internal/request-cookies.mjs +2 -2
  423. package/dist/internal/server-tree.cjs +4 -7
  424. package/dist/internal/server-tree.mjs +5 -8
  425. package/dist/json-ld.cjs +16 -3
  426. package/dist/json-ld.mjs +16 -3
  427. package/dist/layers-UTB43B7A.mjs +18 -0
  428. package/dist/layers-VUWIOFEO.cjs +18 -0
  429. package/dist/manager-RT733VRK.mjs +14 -0
  430. package/dist/manager-XZ5TX7AO.cjs +14 -0
  431. package/dist/markdown.cjs +12 -19
  432. package/dist/markdown.mjs +11 -18
  433. package/dist/middleware.cjs +26 -34
  434. package/dist/middleware.mjs +30 -38
  435. package/dist/navigation.cjs +21 -22
  436. package/dist/navigation.mjs +20 -21
  437. package/dist/nitro-7F65EZZS.cjs +653 -0
  438. package/dist/nitro-MPZJGPXK.mjs +653 -0
  439. package/dist/node-module-bundle-L5L7JCZ4.mjs +11 -0
  440. package/dist/node-module-bundle-VAFZOXMJ.cjs +11 -0
  441. package/dist/observability.cjs +3 -3
  442. package/dist/observability.mjs +2 -2
  443. package/dist/og.cjs +1 -1
  444. package/dist/og.mjs +1 -1
  445. package/dist/plugin.cjs +124 -153
  446. package/dist/plugin.mjs +107 -136
  447. package/dist/query/client.cjs +69 -59
  448. package/dist/query/client.mjs +61 -51
  449. package/dist/query/index.cjs +4 -4
  450. package/dist/query/index.mjs +3 -3
  451. package/dist/query/parsers.cjs +3 -3
  452. package/dist/query/parsers.mjs +2 -2
  453. package/dist/query/server.cjs +11 -5
  454. package/dist/query/server.mjs +9 -3
  455. package/dist/renderer/react/client.cjs +1 -1
  456. package/dist/renderer/react/client.mjs +1 -1
  457. package/dist/renderer/react/server.cjs +14 -10
  458. package/dist/renderer/react/server.mjs +14 -10
  459. package/dist/renderer/react/vite.cjs +4 -1
  460. package/dist/renderer/react/vite.mjs +4 -1
  461. package/dist/renderer-client.cjs +77 -71
  462. package/dist/renderer-client.mjs +57 -51
  463. package/dist/renderer.cjs +3 -3
  464. package/dist/renderer.mjs +2 -2
  465. package/dist/request.cjs +4 -4
  466. package/dist/request.mjs +3 -3
  467. package/dist/router.cjs +5 -5
  468. package/dist/router.mjs +4 -4
  469. package/dist/routes.cjs +12 -14
  470. package/dist/routes.mjs +11 -13
  471. package/dist/schema-dev-notice-O67CPXJ6.mjs +56 -0
  472. package/dist/schema-dev-notice-Y7MQEFGN.cjs +56 -0
  473. package/dist/schema.cjs +3 -3
  474. package/dist/schema.mjs +2 -2
  475. package/dist/search-client-G3RICOFU.cjs +13 -0
  476. package/dist/search-client-KR7YRIVR.mjs +13 -0
  477. package/dist/server-action-security.cjs +7 -8
  478. package/dist/server-action-security.mjs +6 -7
  479. package/dist/server-fn-client.cjs +4 -4
  480. package/dist/server-fn-client.mjs +3 -3
  481. package/dist/server-fn.cjs +14 -15
  482. package/dist/server-fn.mjs +13 -14
  483. package/dist/server-plugins.cjs +15 -15
  484. package/dist/server-plugins.mjs +14 -14
  485. package/dist/server-query-client.cjs +8 -9
  486. package/dist/server-query-client.mjs +7 -8
  487. package/dist/server-query.cjs +16 -17
  488. package/dist/server-query.mjs +15 -16
  489. package/dist/server.cjs +199 -265
  490. package/dist/server.mjs +172 -238
  491. package/dist/storage.cjs +3 -7
  492. package/dist/storage.mjs +2 -6
  493. package/dist/testing.cjs +76 -59
  494. package/dist/testing.mjs +66 -49
  495. package/dist/theme/client.cjs +5 -5
  496. package/dist/theme/client.mjs +4 -4
  497. package/dist/theme/index.cjs +3 -3
  498. package/dist/theme/index.mjs +2 -2
  499. package/dist/theme/runtime.cjs +3 -3
  500. package/dist/theme/runtime.mjs +2 -2
  501. package/dist/theme/server.cjs +8 -8
  502. package/dist/theme/server.mjs +7 -7
  503. package/dist/version.cjs +3 -3
  504. package/dist/version.mjs +2 -2
  505. package/dist/vite.cjs +121 -166
  506. package/dist/vite.mjs +107 -152
  507. package/dist/workflows.cjs +13 -14
  508. package/dist/workflows.mjs +12 -13
  509. package/package.json +22 -3
  510. package/dist/after.d.mts +0 -25
  511. package/dist/after.d.ts +0 -25
  512. package/dist/agent-mcp-handler-7JSKGSOW.mjs +0 -18
  513. package/dist/agent-mcp-handler-YE4AGWHN.cjs +0 -18
  514. package/dist/agent-mcp.d-BAR9njbJ.d.ts +0 -115
  515. package/dist/agent-mcp.d-BJKChOrO.d.mts +0 -115
  516. package/dist/agent-runtime.d.mts +0 -105
  517. package/dist/agent-runtime.d.ts +0 -105
  518. package/dist/analyzer-OTPEWH5W.mjs +0 -1126
  519. package/dist/analyzer-TSQXZCZN.cjs +0 -1126
  520. package/dist/api/client.d.mts +0 -5
  521. package/dist/api/client.d.ts +0 -5
  522. package/dist/api/route-manager.d.mts +0 -119
  523. package/dist/api/route-manager.d.ts +0 -119
  524. package/dist/api/runtime.d.mts +0 -35
  525. package/dist/api/runtime.d.ts +0 -35
  526. package/dist/api-client.d-BWcqZciH.d.ts +0 -622
  527. package/dist/api-client.d-CeA6tNA6.d.mts +0 -622
  528. package/dist/api.d.mts +0 -103
  529. package/dist/api.d.ts +0 -103
  530. package/dist/app-manifest.d-BLFbaqx8.d.ts +0 -120
  531. package/dist/app-manifest.d-DEQNnNhV.d.mts +0 -120
  532. package/dist/app-markdown.d.mts +0 -48
  533. package/dist/app-markdown.d.ts +0 -48
  534. package/dist/app.d-CNPaUYaa.d.ts +0 -564
  535. package/dist/app.d-CT7xDkj2.d.mts +0 -564
  536. package/dist/base-path.d-BOUV5ozD.d.mts +0 -10
  537. package/dist/base-path.d-BOUV5ozD.d.ts +0 -10
  538. package/dist/cache.d.mts +0 -333
  539. package/dist/cache.d.ts +0 -333
  540. package/dist/chunk-22W4FNTG.mjs +0 -538
  541. package/dist/chunk-23LVFSID.mjs +0 -182
  542. package/dist/chunk-2DA7CLY7.mjs +0 -560
  543. package/dist/chunk-2DLGV2ZG.mjs +0 -71
  544. package/dist/chunk-2HW5LWAH.cjs +0 -19
  545. package/dist/chunk-2IAPKPEB.cjs +0 -368
  546. package/dist/chunk-2KMIJDY6.cjs +0 -20
  547. package/dist/chunk-2KVDHNQS.mjs +0 -224
  548. package/dist/chunk-2NGZFOKG.mjs +0 -190
  549. package/dist/chunk-2NHOYYUT.mjs +0 -2250
  550. package/dist/chunk-2WZTGPK6.mjs +0 -65
  551. package/dist/chunk-2XGBJSDV.cjs +0 -408
  552. package/dist/chunk-3BIASUGR.cjs +0 -59
  553. package/dist/chunk-3BLEXUGE.mjs +0 -35
  554. package/dist/chunk-3EEET2Q5.cjs +0 -1044
  555. package/dist/chunk-3EIPOTZV.cjs +0 -272
  556. package/dist/chunk-3HLQTOVU.cjs +0 -6
  557. package/dist/chunk-3OWVWZ6R.cjs +0 -60
  558. package/dist/chunk-3SMXQNFD.mjs +0 -433
  559. package/dist/chunk-3TLKUBXG.mjs +0 -8948
  560. package/dist/chunk-3WSIYBMG.mjs +0 -6257
  561. package/dist/chunk-3XQ57EFI.cjs +0 -713
  562. package/dist/chunk-3Z63X45F.mjs +0 -277
  563. package/dist/chunk-4353ZRE5.mjs +0 -153
  564. package/dist/chunk-46KXZBOG.cjs +0 -169
  565. package/dist/chunk-46P5KNTE.mjs +0 -8
  566. package/dist/chunk-47JV57DA.cjs +0 -69
  567. package/dist/chunk-4CGOMZP3.cjs +0 -6257
  568. package/dist/chunk-4DCWVSL2.cjs +0 -15
  569. package/dist/chunk-4MU4QCX4.mjs +0 -158
  570. package/dist/chunk-4SEHMBL4.cjs +0 -491
  571. package/dist/chunk-4TKAIO2F.mjs +0 -491
  572. package/dist/chunk-4ZJ5C7UJ.cjs +0 -75
  573. package/dist/chunk-52Y3C3HG.mjs +0 -421
  574. package/dist/chunk-53EHWHT2.cjs +0 -166
  575. package/dist/chunk-53SACYBY.cjs +0 -293
  576. package/dist/chunk-5A77OEIG.cjs +0 -778
  577. package/dist/chunk-5C7XMKQ4.cjs +0 -410
  578. package/dist/chunk-5DX3O6TT.cjs +0 -266
  579. package/dist/chunk-5ENW27SL.mjs +0 -36
  580. package/dist/chunk-5FXPJIOT.mjs +0 -713
  581. package/dist/chunk-5IONBVJY.cjs +0 -588
  582. package/dist/chunk-5J45H65F.mjs +0 -48
  583. package/dist/chunk-5PZJ63PK.mjs +0 -17
  584. package/dist/chunk-5Y2P454O.cjs +0 -421
  585. package/dist/chunk-5Y4GYKKH.mjs +0 -13
  586. package/dist/chunk-5YPBFMBN.cjs +0 -19
  587. package/dist/chunk-65Y5SIBH.cjs +0 -112
  588. package/dist/chunk-6BLAY2VQ.mjs +0 -45
  589. package/dist/chunk-6CTFVBAT.cjs +0 -29
  590. package/dist/chunk-6FXBJPF5.cjs +0 -35
  591. package/dist/chunk-6HRAK7I5.mjs +0 -215
  592. package/dist/chunk-6IOZPJ3I.cjs +0 -549
  593. package/dist/chunk-6JHZPB52.cjs +0 -538
  594. package/dist/chunk-6ONBZGVH.cjs +0 -124
  595. package/dist/chunk-6XQSPIN6.cjs +0 -155
  596. package/dist/chunk-6YFC3ZFX.mjs +0 -449
  597. package/dist/chunk-6ZFRWRHO.mjs +0 -54
  598. package/dist/chunk-724WT3NI.mjs +0 -83
  599. package/dist/chunk-72KCTHLV.cjs +0 -723
  600. package/dist/chunk-72NBDVWQ.mjs +0 -588
  601. package/dist/chunk-75XSZIRE.mjs +0 -180
  602. package/dist/chunk-7EPYN7GW.cjs +0 -30
  603. package/dist/chunk-7FVVQEVL.cjs +0 -541
  604. package/dist/chunk-7H4SVNC4.cjs +0 -700
  605. package/dist/chunk-7JUIK547.cjs +0 -62
  606. package/dist/chunk-7KJJ4SBS.cjs +0 -13
  607. package/dist/chunk-7MD37P5V.cjs +0 -433
  608. package/dist/chunk-7PTISZSQ.cjs +0 -176
  609. package/dist/chunk-7PZVXMWG.mjs +0 -113
  610. package/dist/chunk-7S7AAK2D.mjs +0 -82
  611. package/dist/chunk-A25FXJ7D.cjs +0 -38
  612. package/dist/chunk-A4PWGL46.mjs +0 -141
  613. package/dist/chunk-A5BJKSZE.cjs +0 -657
  614. package/dist/chunk-AER5I65K.mjs +0 -368
  615. package/dist/chunk-ALEUMLJN.mjs +0 -190
  616. package/dist/chunk-ANHZ6SUL.mjs +0 -657
  617. package/dist/chunk-AOKXITZ6.cjs +0 -16
  618. package/dist/chunk-AQLHD6HZ.cjs +0 -196
  619. package/dist/chunk-ATYTLVSI.cjs +0 -45
  620. package/dist/chunk-AV26KHTG.mjs +0 -712
  621. package/dist/chunk-AY2YD5ZX.mjs +0 -34
  622. package/dist/chunk-AYP2YFVN.mjs +0 -168
  623. package/dist/chunk-AZQXXXDX.mjs +0 -80
  624. package/dist/chunk-B3GM5I6N.cjs +0 -277
  625. package/dist/chunk-B3GZAQSC.cjs +0 -36
  626. package/dist/chunk-B5BBTPJQ.cjs +0 -44
  627. package/dist/chunk-BBPDJGCU.cjs +0 -157
  628. package/dist/chunk-BLD5GVCG.mjs +0 -152
  629. package/dist/chunk-BMQAPZXD.mjs +0 -31
  630. package/dist/chunk-BNH53KOT.cjs +0 -69
  631. package/dist/chunk-BPAXGCKX.mjs +0 -166
  632. package/dist/chunk-BPNOYILC.cjs +0 -450
  633. package/dist/chunk-BRWIVOV4.cjs +0 -48
  634. package/dist/chunk-BRYPZIMB.mjs +0 -6
  635. package/dist/chunk-BTZ5O6VM.cjs +0 -14
  636. package/dist/chunk-BUC3FDYC.cjs +0 -158
  637. package/dist/chunk-C3BOESDW.mjs +0 -541
  638. package/dist/chunk-C64XOPBZ.mjs +0 -380
  639. package/dist/chunk-C7LCTVJ2.cjs +0 -30
  640. package/dist/chunk-CA7DNRHO.cjs +0 -164
  641. package/dist/chunk-CECUDGXQ.cjs +0 -1964
  642. package/dist/chunk-CKPTIEDX.cjs +0 -12
  643. package/dist/chunk-CL2ONP73.cjs +0 -180
  644. package/dist/chunk-CO6UYM2D.mjs +0 -172
  645. package/dist/chunk-CQL5ZGFU.cjs +0 -50
  646. package/dist/chunk-CSLUBKGG.mjs +0 -44
  647. package/dist/chunk-CU5SYTJG.mjs +0 -23
  648. package/dist/chunk-CV6MFQ4Y.mjs +0 -259
  649. package/dist/chunk-CZ35L6PL.mjs +0 -1029
  650. package/dist/chunk-D22BUQKW.cjs +0 -82
  651. package/dist/chunk-D2LCAV6L.mjs +0 -79
  652. package/dist/chunk-D4XGKF67.cjs +0 -127
  653. package/dist/chunk-D7UQC4O6.cjs +0 -1359
  654. package/dist/chunk-D7Y63SOY.mjs +0 -15
  655. package/dist/chunk-DMAP4RND.cjs +0 -998
  656. package/dist/chunk-DQJ2CIH7.cjs +0 -87
  657. package/dist/chunk-DU4VHHPJ.mjs +0 -157
  658. package/dist/chunk-DUIP64BF.cjs +0 -16
  659. package/dist/chunk-DV52ZS53.cjs +0 -40
  660. package/dist/chunk-DXUXQP2T.cjs +0 -142
  661. package/dist/chunk-DZZHTMWM.cjs +0 -190
  662. package/dist/chunk-E36C43IX.cjs +0 -224
  663. package/dist/chunk-E552H232.cjs +0 -154
  664. package/dist/chunk-E5DXF5GE.mjs +0 -169
  665. package/dist/chunk-E7QOEV5Z.cjs +0 -449
  666. package/dist/chunk-EDPENAVO.mjs +0 -266
  667. package/dist/chunk-EFLNOZGH.mjs +0 -30
  668. package/dist/chunk-EFZGB7JC.cjs +0 -114
  669. package/dist/chunk-EGHPFXPZ.cjs +0 -590
  670. package/dist/chunk-EHB77D5U.cjs +0 -80
  671. package/dist/chunk-EJCVG25Z.mjs +0 -49
  672. package/dist/chunk-EKJYE4Y7.cjs +0 -712
  673. package/dist/chunk-EMDGXYUD.mjs +0 -75
  674. package/dist/chunk-EOXPRC2C.cjs +0 -48
  675. package/dist/chunk-ERMUL73L.cjs +0 -39
  676. package/dist/chunk-ES2LD2YD.mjs +0 -203
  677. package/dist/chunk-EV4SBMPX.mjs +0 -208
  678. package/dist/chunk-EVIWKPJV.cjs +0 -560
  679. package/dist/chunk-EVMXPJCB.mjs +0 -133
  680. package/dist/chunk-EX6ZSN5P.cjs +0 -224
  681. package/dist/chunk-EZTKXD6P.cjs +0 -182
  682. package/dist/chunk-F3N52U7S.mjs +0 -138
  683. package/dist/chunk-F6TLUMH7.mjs +0 -172
  684. package/dist/chunk-FBEBSAVI.cjs +0 -225
  685. package/dist/chunk-FEFCISOX.cjs +0 -102
  686. package/dist/chunk-FFE2EMF7.cjs +0 -593
  687. package/dist/chunk-FHURJABM.mjs +0 -45
  688. package/dist/chunk-FK25QSVC.cjs +0 -386
  689. package/dist/chunk-FSQMN2MQ.mjs +0 -386
  690. package/dist/chunk-FSXSQQTV.mjs +0 -79
  691. package/dist/chunk-G2KTRMWA.mjs +0 -40
  692. package/dist/chunk-GAO7MS5O.mjs +0 -1010
  693. package/dist/chunk-GBMWLDCC.cjs +0 -138
  694. package/dist/chunk-GFT5AHAT.mjs +0 -423
  695. package/dist/chunk-GHNW564E.mjs +0 -1044
  696. package/dist/chunk-GL3ZDHKI.mjs +0 -274
  697. package/dist/chunk-GLOICKDO.mjs +0 -142
  698. package/dist/chunk-GNZIAJGB.mjs +0 -358
  699. package/dist/chunk-GSVJ3IIF.cjs +0 -173
  700. package/dist/chunk-GUZC226X.mjs +0 -164
  701. package/dist/chunk-GWXZS7K5.mjs +0 -24
  702. package/dist/chunk-GYMGK467.mjs +0 -214
  703. package/dist/chunk-H227LYHT.mjs +0 -88
  704. package/dist/chunk-H33PJEXN.cjs +0 -341
  705. package/dist/chunk-H3ASZDT7.mjs +0 -42
  706. package/dist/chunk-H4WUWLQR.mjs +0 -16
  707. package/dist/chunk-HA7YRO53.cjs +0 -214
  708. package/dist/chunk-HASX6DC7.cjs +0 -150
  709. package/dist/chunk-HEPJIKKQ.cjs +0 -190
  710. package/dist/chunk-HLWOWZFX.cjs +0 -153
  711. package/dist/chunk-HLYRXN2I.cjs +0 -242
  712. package/dist/chunk-HNAISJFD.cjs +0 -215
  713. package/dist/chunk-HPP2II4Z.mjs +0 -332
  714. package/dist/chunk-HXNLKCWH.cjs +0 -13
  715. package/dist/chunk-HZOMT5DY.mjs +0 -30
  716. package/dist/chunk-I2BYNELA.cjs +0 -380
  717. package/dist/chunk-I2DQGS56.cjs +0 -1095
  718. package/dist/chunk-IAPTECEB.mjs +0 -48
  719. package/dist/chunk-IFTGERT3.mjs +0 -408
  720. package/dist/chunk-IGL6CO6M.mjs +0 -9
  721. package/dist/chunk-IRSS4HS4.mjs +0 -80
  722. package/dist/chunk-ITV4QQL2.cjs +0 -93
  723. package/dist/chunk-IWFV5ZED.cjs +0 -152
  724. package/dist/chunk-IYEY3JWJ.mjs +0 -186
  725. package/dist/chunk-JGAE5XPL.cjs +0 -26
  726. package/dist/chunk-JMYXO572.cjs +0 -531
  727. package/dist/chunk-JNYFXL7X.mjs +0 -62
  728. package/dist/chunk-JRHGJVJH.mjs +0 -44
  729. package/dist/chunk-JWI5PUO2.mjs +0 -1461
  730. package/dist/chunk-JXEPLIXD.cjs +0 -389
  731. package/dist/chunk-JXIYH2NO.cjs +0 -24
  732. package/dist/chunk-JYNNIGQO.cjs +0 -87
  733. package/dist/chunk-JYT7AN37.cjs +0 -79
  734. package/dist/chunk-K5EW7GUU.mjs +0 -417
  735. package/dist/chunk-K76CBYQM.mjs +0 -157
  736. package/dist/chunk-KBGZ5FD6.cjs +0 -17
  737. package/dist/chunk-KHXAJ2KA.cjs +0 -387
  738. package/dist/chunk-KJMWAUKE.mjs +0 -124
  739. package/dist/chunk-KLNFJDFM.cjs +0 -1010
  740. package/dist/chunk-KORZ6PRE.cjs +0 -64
  741. package/dist/chunk-KPAJWD3N.mjs +0 -168
  742. package/dist/chunk-KQH2COEJ.mjs +0 -42
  743. package/dist/chunk-KY32FWK7.mjs +0 -387
  744. package/dist/chunk-L5JDKFMQ.cjs +0 -44
  745. package/dist/chunk-LDNSSHEG.mjs +0 -593
  746. package/dist/chunk-LEIXUFJN.cjs +0 -1461
  747. package/dist/chunk-LIFUPCXW.cjs +0 -423
  748. package/dist/chunk-LJDIFIJ2.mjs +0 -453
  749. package/dist/chunk-LLZSYFOM.mjs +0 -6
  750. package/dist/chunk-LM2YOGDK.mjs +0 -44
  751. package/dist/chunk-LM55GS4R.mjs +0 -38
  752. package/dist/chunk-LMFJCXDD.mjs +0 -55
  753. package/dist/chunk-LNM57D3H.cjs +0 -100
  754. package/dist/chunk-LNVGXUL3.cjs +0 -172
  755. package/dist/chunk-LPDKG6RA.mjs +0 -1359
  756. package/dist/chunk-LSHX2H5G.cjs +0 -57
  757. package/dist/chunk-LZ4SB57H.mjs +0 -651
  758. package/dist/chunk-M25IONJP.mjs +0 -16
  759. package/dist/chunk-MF3IA2AW.cjs +0 -25
  760. package/dist/chunk-MFQGU5CC.mjs +0 -127
  761. package/dist/chunk-MIGFX2FN.mjs +0 -758
  762. package/dist/chunk-MNIR7I7B.mjs +0 -217
  763. package/dist/chunk-MPU5DOXX.cjs +0 -21
  764. package/dist/chunk-MRNDAJEV.mjs +0 -293
  765. package/dist/chunk-MU5V7XHL.mjs +0 -172
  766. package/dist/chunk-N33DLJBC.mjs +0 -272
  767. package/dist/chunk-N35YPV4N.mjs +0 -48
  768. package/dist/chunk-N4AQNEXR.cjs +0 -17
  769. package/dist/chunk-N7JQXQAV.cjs +0 -2072
  770. package/dist/chunk-N7XWC6BN.mjs +0 -21
  771. package/dist/chunk-NBIVGHAT.mjs +0 -50
  772. package/dist/chunk-NCIAP562.mjs +0 -27
  773. package/dist/chunk-NK2VWS7P.cjs +0 -954
  774. package/dist/chunk-NN3MOPSI.mjs +0 -527
  775. package/dist/chunk-NOTSHVRN.mjs +0 -12519
  776. package/dist/chunk-NR63PD3P.mjs +0 -64
  777. package/dist/chunk-NRNAHZ57.mjs +0 -39
  778. package/dist/chunk-NWUHS6GV.cjs +0 -79
  779. package/dist/chunk-O4F3JUST.mjs +0 -176
  780. package/dist/chunk-OAJOQU5J.mjs +0 -225
  781. package/dist/chunk-OAMUSC7H.cjs +0 -9
  782. package/dist/chunk-OCS3PSYR.cjs +0 -51
  783. package/dist/chunk-OHWM2VI4.mjs +0 -29
  784. package/dist/chunk-OJO2GOM3.mjs +0 -69
  785. package/dist/chunk-OLGQZRW6.mjs +0 -700
  786. package/dist/chunk-ONG4RDW3.mjs +0 -155
  787. package/dist/chunk-OOJBBHYW.cjs +0 -38
  788. package/dist/chunk-OOZEU5KK.cjs +0 -18
  789. package/dist/chunk-OWQV6MLM.cjs +0 -82
  790. package/dist/chunk-OY5XDG24.cjs +0 -113
  791. package/dist/chunk-OYNNA4DD.cjs +0 -453
  792. package/dist/chunk-OYZXVBZP.cjs +0 -133
  793. package/dist/chunk-OZC2JPW6.cjs +0 -10
  794. package/dist/chunk-OZK2DS44.mjs +0 -203
  795. package/dist/chunk-P2355C6E.cjs +0 -186
  796. package/dist/chunk-P6MHI5O2.cjs +0 -758
  797. package/dist/chunk-PAKCHVUS.mjs +0 -450
  798. package/dist/chunk-PENBZAHJ.cjs +0 -88
  799. package/dist/chunk-PFV2KPDZ.cjs +0 -172
  800. package/dist/chunk-PIHKO25G.mjs +0 -100
  801. package/dist/chunk-PIUTGRDI.cjs +0 -358
  802. package/dist/chunk-PO5MXV5X.cjs +0 -13
  803. package/dist/chunk-PSUYE5HR.mjs +0 -25
  804. package/dist/chunk-PTLXHRJZ.mjs +0 -57
  805. package/dist/chunk-PZXYAWYG.cjs +0 -274
  806. package/dist/chunk-Q5B4LNON.mjs +0 -19
  807. package/dist/chunk-QGJ4FI2G.mjs +0 -723
  808. package/dist/chunk-QISW423S.cjs +0 -335
  809. package/dist/chunk-QMDU6QHN.mjs +0 -778
  810. package/dist/chunk-QOSDWGKT.mjs +0 -109
  811. package/dist/chunk-QPJ4MZTO.mjs +0 -60
  812. package/dist/chunk-QPNVDSFZ.mjs +0 -18
  813. package/dist/chunk-QQ44FYRO.cjs +0 -27
  814. package/dist/chunk-QSTRBKHZ.mjs +0 -102
  815. package/dist/chunk-QXJADAQB.cjs +0 -40
  816. package/dist/chunk-R4PHCZ3G.mjs +0 -9
  817. package/dist/chunk-R5U7OIPI.cjs +0 -34
  818. package/dist/chunk-R62SF5R4.mjs +0 -410
  819. package/dist/chunk-RD623KW4.cjs +0 -203
  820. package/dist/chunk-RFKTJTWZ.mjs +0 -26
  821. package/dist/chunk-RI3EVPKD.cjs +0 -57
  822. package/dist/chunk-RLEALQEN.mjs +0 -998
  823. package/dist/chunk-RVGLYMJM.cjs +0 -259
  824. package/dist/chunk-S32PDOLO.mjs +0 -13
  825. package/dist/chunk-S5AQ7CAC.cjs +0 -227
  826. package/dist/chunk-S6O2L47H.mjs +0 -549
  827. package/dist/chunk-SBDWCDS6.cjs +0 -8
  828. package/dist/chunk-SF3JB56B.mjs +0 -82
  829. package/dist/chunk-SG57PX7K.cjs +0 -65
  830. package/dist/chunk-SGBNF56S.cjs +0 -44
  831. package/dist/chunk-SHD265HW.cjs +0 -19
  832. package/dist/chunk-SHIWRBFI.cjs +0 -17
  833. package/dist/chunk-SHS6KXOZ.mjs +0 -135
  834. package/dist/chunk-SJ23LJ3N.cjs +0 -135
  835. package/dist/chunk-SM2SYWAR.cjs +0 -49
  836. package/dist/chunk-SMUW7UST.mjs +0 -196
  837. package/dist/chunk-SN5VSO3Q.mjs +0 -1095
  838. package/dist/chunk-SNP33A33.cjs +0 -9
  839. package/dist/chunk-STF6VDYQ.cjs +0 -23
  840. package/dist/chunk-SUCDVKUB.cjs +0 -42
  841. package/dist/chunk-SUV6YO4Q.cjs +0 -697
  842. package/dist/chunk-SVCUSOEF.mjs +0 -590
  843. package/dist/chunk-SXCL2MIN.cjs +0 -208
  844. package/dist/chunk-SYW346ZN.cjs +0 -71
  845. package/dist/chunk-T4EW7AAD.mjs +0 -150
  846. package/dist/chunk-TGSEVBPO.mjs +0 -93
  847. package/dist/chunk-TJVUTGED.mjs +0 -531
  848. package/dist/chunk-TQMI6BYO.cjs +0 -8951
  849. package/dist/chunk-TSFMFPRU.cjs +0 -878
  850. package/dist/chunk-TUOO6IK3.mjs +0 -87
  851. package/dist/chunk-TUPKMMXT.mjs +0 -173
  852. package/dist/chunk-TVCFY3KK.cjs +0 -217
  853. package/dist/chunk-TWHXBMLJ.cjs +0 -1980
  854. package/dist/chunk-UAQD67HM.mjs +0 -154
  855. package/dist/chunk-UB7RVEMX.mjs +0 -73
  856. package/dist/chunk-UIJOLBUL.mjs +0 -19
  857. package/dist/chunk-UJL4JOXV.cjs +0 -35
  858. package/dist/chunk-UN6N623E.mjs +0 -40
  859. package/dist/chunk-UNJZGVPU.cjs +0 -6
  860. package/dist/chunk-UPYIFH2H.cjs +0 -168
  861. package/dist/chunk-UQF3OJVE.mjs +0 -389
  862. package/dist/chunk-UQHIWZZ6.cjs +0 -1029
  863. package/dist/chunk-UUMKLGUU.mjs +0 -69
  864. package/dist/chunk-UYTAP4FQ.cjs +0 -60
  865. package/dist/chunk-UZCMMJJT.cjs +0 -80
  866. package/dist/chunk-V3UOEWCB.cjs +0 -46
  867. package/dist/chunk-V56632LA.cjs +0 -141
  868. package/dist/chunk-VAHBCI6X.mjs +0 -227
  869. package/dist/chunk-VE3FWJBO.mjs +0 -46
  870. package/dist/chunk-VFXE6NWR.mjs +0 -87
  871. package/dist/chunk-VHIXGZYH.mjs +0 -9
  872. package/dist/chunk-VISQDC6W.mjs +0 -10
  873. package/dist/chunk-VIXTAVEA.mjs +0 -59
  874. package/dist/chunk-VM57CK74.cjs +0 -42
  875. package/dist/chunk-VOQ7XZZT.cjs +0 -157
  876. package/dist/chunk-VQJYGZNX.cjs +0 -206
  877. package/dist/chunk-VR6QLTTX.mjs +0 -59
  878. package/dist/chunk-VS7EHLLW.mjs +0 -462
  879. package/dist/chunk-VSLM6BHX.cjs +0 -2250
  880. package/dist/chunk-VU3MYZPO.mjs +0 -432
  881. package/dist/chunk-VXCFJWK5.cjs +0 -59
  882. package/dist/chunk-VZY7MAVS.cjs +0 -432
  883. package/dist/chunk-WCLLPR6H.mjs +0 -35
  884. package/dist/chunk-WEGAVN37.cjs +0 -45
  885. package/dist/chunk-WFVSAT7Y.cjs +0 -83
  886. package/dist/chunk-WGUHDWT5.cjs +0 -12522
  887. package/dist/chunk-WNDAISB7.mjs +0 -51
  888. package/dist/chunk-WNLPQW7W.mjs +0 -19
  889. package/dist/chunk-WSDKXV4E.mjs +0 -2072
  890. package/dist/chunk-WT6RAN2I.cjs +0 -41
  891. package/dist/chunk-WXFY5JIY.mjs +0 -20
  892. package/dist/chunk-WYL4ODZ4.mjs +0 -38
  893. package/dist/chunk-X2AMN2WV.cjs +0 -527
  894. package/dist/chunk-X333W5KV.cjs +0 -31
  895. package/dist/chunk-X3EFRVXY.mjs +0 -12
  896. package/dist/chunk-X3JNB2TB.mjs +0 -406
  897. package/dist/chunk-X3XUZWRB.mjs +0 -141
  898. package/dist/chunk-XB24LZWI.cjs +0 -651
  899. package/dist/chunk-XGJVRPYL.cjs +0 -141
  900. package/dist/chunk-XLRLSTJ6.cjs +0 -40
  901. package/dist/chunk-XMHERKSE.mjs +0 -224
  902. package/dist/chunk-XPMC4E2G.cjs +0 -55
  903. package/dist/chunk-XQ4DPO4G.mjs +0 -13
  904. package/dist/chunk-XQSYOVCW.cjs +0 -417
  905. package/dist/chunk-XR2ZIBQK.mjs +0 -57
  906. package/dist/chunk-XURDCXNH.cjs +0 -48
  907. package/dist/chunk-XXXRRVY6.mjs +0 -697
  908. package/dist/chunk-XYL4HSVC.cjs +0 -406
  909. package/dist/chunk-Y2G5SJFB.mjs +0 -1964
  910. package/dist/chunk-Y3N5BFRJ.mjs +0 -206
  911. package/dist/chunk-Y3WG64CP.cjs +0 -9
  912. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  913. package/dist/chunk-Y7NN63LS.mjs +0 -40
  914. package/dist/chunk-YAJTD3ZG.mjs +0 -341
  915. package/dist/chunk-YB44NKC2.cjs +0 -203
  916. package/dist/chunk-YDXLC4DW.cjs +0 -54
  917. package/dist/chunk-YIHRZBD7.cjs +0 -172
  918. package/dist/chunk-YKHRCY4T.cjs +0 -73
  919. package/dist/chunk-YP7YO3S3.mjs +0 -17
  920. package/dist/chunk-YT3SLLZK.mjs +0 -242
  921. package/dist/chunk-YTVSWXEZ.cjs +0 -168
  922. package/dist/chunk-YUEYBL35.mjs +0 -878
  923. package/dist/chunk-YWPNIYUP.mjs +0 -41
  924. package/dist/chunk-YX6AFPXC.mjs +0 -8
  925. package/dist/chunk-Z5A6CNV2.mjs +0 -60
  926. package/dist/chunk-Z64V4WZI.mjs +0 -17
  927. package/dist/chunk-ZD2VKAUI.mjs +0 -1980
  928. package/dist/chunk-ZNXTU4YH.mjs +0 -114
  929. package/dist/chunk-ZOWNWHK6.cjs +0 -462
  930. package/dist/chunk-ZQ5BDNKW.mjs +0 -954
  931. package/dist/chunk-ZXK2EYQW.cjs +0 -8
  932. package/dist/chunk-recovery.d-lnQFzcQP.d.mts +0 -26
  933. package/dist/chunk-recovery.d-lnQFzcQP.d.ts +0 -26
  934. package/dist/client/lifecycle.d.mts +0 -1
  935. package/dist/client/lifecycle.d.ts +0 -1
  936. package/dist/client-cache.d-Deoqq-nM.d.ts +0 -76
  937. package/dist/client-cache.d-di_Nasxa.d.mts +0 -76
  938. package/dist/client-plugins.d-DllmH8eM.d.mts +0 -4001
  939. package/dist/client-plugins.d-n3iWY1EJ.d.ts +0 -4001
  940. package/dist/client-plugins.d.mts +0 -33
  941. package/dist/client-plugins.d.ts +0 -33
  942. package/dist/client.d.mts +0 -452
  943. package/dist/client.d.ts +0 -452
  944. package/dist/client.react-server.mjs +0 -2
  945. package/dist/config.d-DqKaCr1r.d.mts +0 -199
  946. package/dist/config.d-DqKaCr1r.d.ts +0 -199
  947. package/dist/config.d.mts +0 -40
  948. package/dist/config.d.ts +0 -40
  949. package/dist/cron.d.mts +0 -78
  950. package/dist/cron.d.ts +0 -78
  951. package/dist/deferred.d.mts +0 -44
  952. package/dist/deferred.d.ts +0 -44
  953. package/dist/deployment.d.mts +0 -36
  954. package/dist/deployment.d.ts +0 -36
  955. package/dist/desktop.cjs +0 -13
  956. package/dist/desktop.d.mts +0 -120
  957. package/dist/desktop.d.ts +0 -120
  958. package/dist/desktop.mjs +0 -13
  959. package/dist/dev-guard-2UW2KERP.cjs +0 -59
  960. package/dist/dev-guard-ONNMVQUN.mjs +0 -59
  961. package/dist/devtools-TO6TAO32.cjs +0 -463
  962. package/dist/devtools-UESYARTF.mjs +0 -463
  963. package/dist/devtools-client-SU4XH46J.mjs +0 -250
  964. package/dist/devtools-client-X5OQCXDF.cjs +0 -250
  965. package/dist/devtools-ui-CYBVFLPH.mjs +0 -1265
  966. package/dist/devtools-ui-SYRUXUA7.cjs +0 -1265
  967. package/dist/docs.d.mts +0 -169
  968. package/dist/docs.d.ts +0 -169
  969. package/dist/endpoint.d-BgHn0lhl.d.ts +0 -370
  970. package/dist/endpoint.d-BkMSCRf6.d.mts +0 -370
  971. package/dist/env-types.d.mts +0 -12
  972. package/dist/env-types.d.ts +0 -12
  973. package/dist/env.d.mts +0 -65
  974. package/dist/env.d.ts +0 -65
  975. package/dist/environment/vite.d.mts +0 -31
  976. package/dist/environment/vite.d.ts +0 -31
  977. package/dist/environment.d.mts +0 -18
  978. package/dist/environment.d.ts +0 -18
  979. package/dist/font.d.mts +0 -95
  980. package/dist/font.d.ts +0 -95
  981. package/dist/generate-route-types.d-BL2pq6xC.d.ts +0 -33
  982. package/dist/generate-route-types.d-BoVDU8qX.d.mts +0 -33
  983. package/dist/headers.d.mts +0 -32
  984. package/dist/headers.d.ts +0 -32
  985. package/dist/i18n/client.d.mts +0 -32
  986. package/dist/i18n/client.d.ts +0 -32
  987. package/dist/i18n/index.d.mts +0 -3
  988. package/dist/i18n/index.d.ts +0 -3
  989. package/dist/i18n/server.d.mts +0 -30
  990. package/dist/i18n/server.d.ts +0 -30
  991. package/dist/image/server.d.mts +0 -59
  992. package/dist/image/server.d.ts +0 -59
  993. package/dist/image/sharp.d.mts +0 -20
  994. package/dist/image/sharp.d.ts +0 -20
  995. package/dist/image-config.d-CeDgNyX4.d.mts +0 -53
  996. package/dist/image-config.d-CeDgNyX4.d.ts +0 -53
  997. package/dist/image.d.mts +0 -39
  998. package/dist/image.d.ts +0 -39
  999. package/dist/index.d-BL7KKiwa.d.mts +0 -54
  1000. package/dist/index.d-BNNDpql4.d.ts +0 -20
  1001. package/dist/index.d-BXsAXm1U.d.ts +0 -54
  1002. package/dist/index.d-BqcfqJvt.d.mts +0 -20
  1003. package/dist/index.d.mts +0 -1053
  1004. package/dist/index.d.ts +0 -1053
  1005. package/dist/instrumentation-runtime.d-CX9Zh-16.d.mts +0 -22
  1006. package/dist/instrumentation-runtime.d-CX9Zh-16.d.ts +0 -22
  1007. package/dist/instrumentation.d.mts +0 -7
  1008. package/dist/instrumentation.d.ts +0 -7
  1009. package/dist/integration-orm-52GPGTHO.cjs +0 -14
  1010. package/dist/integration-orm-CO23MSFE.mjs +0 -14
  1011. package/dist/integrations.d.mts +0 -33
  1012. package/dist/integrations.d.ts +0 -33
  1013. package/dist/internal/app-markdown-runtime.d.mts +0 -86
  1014. package/dist/internal/app-markdown-runtime.d.ts +0 -86
  1015. package/dist/internal/build-runtime.d.mts +0 -46
  1016. package/dist/internal/build-runtime.d.ts +0 -46
  1017. package/dist/internal/client-error-overlay.d.mts +0 -25
  1018. package/dist/internal/client-error-overlay.d.ts +0 -25
  1019. package/dist/internal/client-runtime.d.mts +0 -93
  1020. package/dist/internal/client-runtime.d.ts +0 -93
  1021. package/dist/internal/compression-runtime.d.mts +0 -48
  1022. package/dist/internal/compression-runtime.d.ts +0 -48
  1023. package/dist/internal/config-runtime.d.mts +0 -248
  1024. package/dist/internal/config-runtime.d.ts +0 -248
  1025. package/dist/internal/desktop-guard.cjs +0 -17
  1026. package/dist/internal/desktop-guard.d.mts +0 -52
  1027. package/dist/internal/desktop-guard.d.ts +0 -52
  1028. package/dist/internal/desktop-guard.mjs +0 -17
  1029. package/dist/internal/docs-precompiled-runtime.d.mts +0 -43
  1030. package/dist/internal/docs-precompiled-runtime.d.ts +0 -43
  1031. package/dist/internal/form-actions-client.cjs +0 -14
  1032. package/dist/internal/form-actions-client.d.mts +0 -5
  1033. package/dist/internal/form-actions-client.d.ts +0 -5
  1034. package/dist/internal/form-actions-client.mjs +0 -14
  1035. package/dist/internal/form-actions.cjs +0 -19
  1036. package/dist/internal/form-actions.d.mts +0 -14
  1037. package/dist/internal/form-actions.d.ts +0 -14
  1038. package/dist/internal/form-actions.mjs +0 -19
  1039. package/dist/internal/infra-analytics-runtime.d.mts +0 -16
  1040. package/dist/internal/infra-analytics-runtime.d.ts +0 -16
  1041. package/dist/internal/island-codec.cjs +0 -22
  1042. package/dist/internal/island-codec.d.mts +0 -29
  1043. package/dist/internal/island-codec.d.ts +0 -29
  1044. package/dist/internal/island-codec.mjs +0 -22
  1045. package/dist/internal/island-value-store.cjs +0 -10
  1046. package/dist/internal/island-value-store.d.mts +0 -6
  1047. package/dist/internal/island-value-store.d.ts +0 -6
  1048. package/dist/internal/island-value-store.mjs +0 -10
  1049. package/dist/internal/islands-runtime.cjs +0 -161
  1050. package/dist/internal/islands-runtime.d.mts +0 -66
  1051. package/dist/internal/islands-runtime.d.ts +0 -66
  1052. package/dist/internal/islands-runtime.mjs +0 -161
  1053. package/dist/internal/islands-server.cjs +0 -16
  1054. package/dist/internal/islands-server.d.mts +0 -3
  1055. package/dist/internal/islands-server.d.ts +0 -3
  1056. package/dist/internal/islands-server.mjs +0 -16
  1057. package/dist/internal/islx-client.cjs +0 -5
  1058. package/dist/internal/islx-client.d.mts +0 -6
  1059. package/dist/internal/islx-client.d.ts +0 -6
  1060. package/dist/internal/islx-client.mjs +0 -3
  1061. package/dist/internal/islx-react.cjs +0 -4
  1062. package/dist/internal/islx-react.d.mts +0 -1
  1063. package/dist/internal/islx-react.d.ts +0 -1
  1064. package/dist/internal/islx-react.mjs +0 -2
  1065. package/dist/internal/islx-server.cjs +0 -5
  1066. package/dist/internal/islx-server.d.mts +0 -2
  1067. package/dist/internal/islx-server.d.ts +0 -2
  1068. package/dist/internal/islx-server.mjs +0 -3
  1069. package/dist/internal/isolated-boundary.d.mts +0 -66
  1070. package/dist/internal/isolated-boundary.d.ts +0 -66
  1071. package/dist/internal/metadata-image-runtime.d.mts +0 -30
  1072. package/dist/internal/metadata-image-runtime.d.ts +0 -30
  1073. package/dist/internal/product-telemetry-runtime.d.mts +0 -45
  1074. package/dist/internal/product-telemetry-runtime.d.ts +0 -45
  1075. package/dist/internal/production-node-env.d.mts +0 -21
  1076. package/dist/internal/production-node-env.d.ts +0 -21
  1077. package/dist/internal/production-runtime.d.mts +0 -533
  1078. package/dist/internal/production-runtime.d.ts +0 -533
  1079. package/dist/internal/request-cookies.d.mts +0 -16
  1080. package/dist/internal/request-cookies.d.ts +0 -16
  1081. package/dist/internal/server-fn-transform.cjs +0 -13
  1082. package/dist/internal/server-fn-transform.d.mts +0 -24
  1083. package/dist/internal/server-fn-transform.d.ts +0 -24
  1084. package/dist/internal/server-fn-transform.mjs +0 -13
  1085. package/dist/internal/server-tree.d.mts +0 -50
  1086. package/dist/internal/server-tree.d.ts +0 -50
  1087. package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
  1088. package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
  1089. package/dist/island.d-CfGru1MO.d.mts +0 -9
  1090. package/dist/island.d-CfGru1MO.d.ts +0 -9
  1091. package/dist/json-ld.d.mts +0 -94
  1092. package/dist/json-ld.d.ts +0 -94
  1093. package/dist/layers-DMRXRL7F.cjs +0 -18
  1094. package/dist/layers-T55SA47E.mjs +0 -18
  1095. package/dist/layers.d-CcS42OGR.d.mts +0 -55
  1096. package/dist/layers.d-CcS42OGR.d.ts +0 -55
  1097. package/dist/lifecycle.d-C2aLBOwu.d.mts +0 -176
  1098. package/dist/lifecycle.d-C2aLBOwu.d.ts +0 -176
  1099. package/dist/manager-2LUKNX2N.cjs +0 -14
  1100. package/dist/manager-H5ZM3HAM.mjs +0 -14
  1101. package/dist/markdown.d.mts +0 -33
  1102. package/dist/markdown.d.ts +0 -33
  1103. package/dist/middleware.d.mts +0 -225
  1104. package/dist/middleware.d.ts +0 -225
  1105. package/dist/mobile.cjs +0 -9
  1106. package/dist/mobile.d.mts +0 -110
  1107. package/dist/mobile.d.ts +0 -110
  1108. package/dist/mobile.mjs +0 -9
  1109. package/dist/native-tree-EBPDFTRW.mjs +0 -25
  1110. package/dist/native-tree-MMZS7S6W.cjs +0 -25
  1111. package/dist/navigation-delegate.d-C76gXTmO.d.mts +0 -29
  1112. package/dist/navigation-delegate.d-DIyDslxt.d.ts +0 -29
  1113. package/dist/navigation.d.mts +0 -51
  1114. package/dist/navigation.d.ts +0 -51
  1115. package/dist/nitro-CK7M4RMY.cjs +0 -650
  1116. package/dist/nitro-R444AF3O.mjs +0 -650
  1117. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  1118. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  1119. package/dist/observability.d-B2363jB6.d.mts +0 -448
  1120. package/dist/observability.d-B2363jB6.d.ts +0 -448
  1121. package/dist/observability.d.mts +0 -2
  1122. package/dist/observability.d.ts +0 -2
  1123. package/dist/og.d.mts +0 -1
  1124. package/dist/og.d.ts +0 -1
  1125. package/dist/params.d-BALtrRim.d.ts +0 -15
  1126. package/dist/params.d-ry-lxqmy.d.mts +0 -15
  1127. package/dist/platform.cjs +0 -29
  1128. package/dist/platform.d.mts +0 -24
  1129. package/dist/platform.d.ts +0 -24
  1130. package/dist/platform.mjs +0 -29
  1131. package/dist/plugin-53SY5YBS.mjs +0 -32
  1132. package/dist/plugin-HZIBL3DW.cjs +0 -32
  1133. package/dist/plugin.d.mts +0 -58
  1134. package/dist/plugin.d.ts +0 -58
  1135. package/dist/production-runtime.d-CDHztggO.d.mts +0 -123
  1136. package/dist/production-runtime.d-tyaGdbk6.d.ts +0 -123
  1137. package/dist/production-vite.d-BQFAlG7n.d.mts +0 -13
  1138. package/dist/production-vite.d-BQFAlG7n.d.ts +0 -13
  1139. package/dist/programmatic-routes-client.d-XfmIrCK1.d.ts +0 -192
  1140. package/dist/programmatic-routes-client.d-aAWiDd64.d.mts +0 -192
  1141. package/dist/query/client.d.mts +0 -61
  1142. package/dist/query/client.d.ts +0 -61
  1143. package/dist/query/index.d.mts +0 -90
  1144. package/dist/query/index.d.ts +0 -90
  1145. package/dist/query/parsers.d.mts +0 -29
  1146. package/dist/query/parsers.d.ts +0 -29
  1147. package/dist/query/server.d.mts +0 -55
  1148. package/dist/query/server.d.ts +0 -55
  1149. package/dist/render-plan.d-Diwybxo8.d.mts +0 -25
  1150. package/dist/render-plan.d-Dr5WRjoV.d.ts +0 -25
  1151. package/dist/renderer/react/client.d.mts +0 -3
  1152. package/dist/renderer/react/client.d.ts +0 -3
  1153. package/dist/renderer/react/server.d.mts +0 -48
  1154. package/dist/renderer/react/server.d.ts +0 -48
  1155. package/dist/renderer/react/vite.d.mts +0 -4
  1156. package/dist/renderer/react/vite.d.ts +0 -4
  1157. package/dist/renderer-client.d.mts +0 -126
  1158. package/dist/renderer-client.d.ts +0 -126
  1159. package/dist/renderer.d.mts +0 -260
  1160. package/dist/renderer.d.ts +0 -260
  1161. package/dist/request.d-D01fRn--.d.ts +0 -24
  1162. package/dist/request.d-Dd3AFR79.d.mts +0 -24
  1163. package/dist/request.d.mts +0 -34
  1164. package/dist/request.d.ts +0 -34
  1165. package/dist/resolver.d-BHyZgpa7.d.ts +0 -14
  1166. package/dist/resolver.d-JnZKKsc5.d.mts +0 -14
  1167. package/dist/response.d-BolW0Vx_.d.mts +0 -10
  1168. package/dist/response.d-BolW0Vx_.d.ts +0 -10
  1169. package/dist/route-pattern.d-CVsVbq5n.d.mts +0 -13
  1170. package/dist/route-pattern.d-CVsVbq5n.d.ts +0 -13
  1171. package/dist/route-rendering.d-BQ53lJ_D.d.mts +0 -44
  1172. package/dist/route-rendering.d-Bhx4QoJt.d.ts +0 -44
  1173. package/dist/route.d-BaVH3V0w.d.mts +0 -224
  1174. package/dist/route.d-DBTEqifW.d.ts +0 -224
  1175. package/dist/router.d-Bi23a6Xc.d.mts +0 -50
  1176. package/dist/router.d-DQ3k7EYn.d.ts +0 -50
  1177. package/dist/router.d.mts +0 -36
  1178. package/dist/router.d.ts +0 -36
  1179. package/dist/routes.d-BgTd7vI4.d.mts +0 -208
  1180. package/dist/routes.d-C7jMJFvP.d.ts +0 -208
  1181. package/dist/routes.d.mts +0 -273
  1182. package/dist/routes.d.ts +0 -273
  1183. package/dist/rsc-pipeline-K3ER3Q4N.mjs +0 -83
  1184. package/dist/rsc-pipeline-OCZIT5OF.cjs +0 -83
  1185. package/dist/runtime-DKNSIH7V.cjs +0 -1061
  1186. package/dist/runtime-MKYDEUZT.mjs +0 -1061
  1187. package/dist/runtime.d-3iJAKptR.d.mts +0 -28
  1188. package/dist/runtime.d-B2Js6qZ2.d.mts +0 -69
  1189. package/dist/runtime.d-BL-CGwoi.d.ts +0 -69
  1190. package/dist/runtime.d-BtL3PCL3.d.ts +0 -28
  1191. package/dist/schema-dev-notice-F6QYSOAI.mjs +0 -54
  1192. package/dist/schema-dev-notice-UU7DMZEU.cjs +0 -54
  1193. package/dist/schema.d.mts +0 -115
  1194. package/dist/schema.d.ts +0 -115
  1195. package/dist/search-client-OXH6GBNO.mjs +0 -15
  1196. package/dist/search-client-ZZLKVO5R.cjs +0 -15
  1197. package/dist/server-action-security.d.mts +0 -45
  1198. package/dist/server-action-security.d.ts +0 -45
  1199. package/dist/server-client-bridge.d-DKWDl5NB.d.mts +0 -7
  1200. package/dist/server-client-bridge.d-DKWDl5NB.d.ts +0 -7
  1201. package/dist/server-fn-client.d.mts +0 -60
  1202. package/dist/server-fn-client.d.ts +0 -60
  1203. package/dist/server-fn-error.d-DrcH9cc1.d.mts +0 -26
  1204. package/dist/server-fn-error.d-DrcH9cc1.d.ts +0 -26
  1205. package/dist/server-fn.d.mts +0 -192
  1206. package/dist/server-fn.d.ts +0 -192
  1207. package/dist/server-plugins.d.mts +0 -65
  1208. package/dist/server-plugins.d.ts +0 -65
  1209. package/dist/server-query-client.d.mts +0 -26
  1210. package/dist/server-query-client.d.ts +0 -26
  1211. package/dist/server-query-runtime.d-DXRNhX_3.d.ts +0 -36
  1212. package/dist/server-query-runtime.d-aP52iuL5.d.mts +0 -36
  1213. package/dist/server-query.d.mts +0 -46
  1214. package/dist/server-query.d.ts +0 -46
  1215. package/dist/server.d.mts +0 -78
  1216. package/dist/server.d.ts +0 -78
  1217. package/dist/session-AAU7RNRO.cjs +0 -23
  1218. package/dist/session-IGEDQ5PY.mjs +0 -23
  1219. package/dist/spa-router.d-B2rIFGs0.d.mts +0 -239
  1220. package/dist/spa-router.d-DqZ6Lfs0.d.ts +0 -239
  1221. package/dist/storage.d.mts +0 -60
  1222. package/dist/storage.d.ts +0 -60
  1223. package/dist/testing.d.mts +0 -110
  1224. package/dist/testing.d.ts +0 -110
  1225. package/dist/theme/client.d.mts +0 -10
  1226. package/dist/theme/client.d.ts +0 -10
  1227. package/dist/theme/index.d.mts +0 -6
  1228. package/dist/theme/index.d.ts +0 -6
  1229. package/dist/theme/runtime.d.mts +0 -13
  1230. package/dist/theme/runtime.d.ts +0 -13
  1231. package/dist/theme/server.d.mts +0 -8
  1232. package/dist/theme/server.d.ts +0 -8
  1233. package/dist/types.d-BnIqOn9w.d.mts +0 -73
  1234. package/dist/types.d-BnIqOn9w.d.ts +0 -73
  1235. package/dist/types.d-C41ePjvP.d.mts +0 -85
  1236. package/dist/types.d-C41ePjvP.d.ts +0 -85
  1237. package/dist/types.d-DQnyD3VD.d.mts +0 -30
  1238. package/dist/types.d-DQnyD3VD.d.ts +0 -30
  1239. package/dist/utils.d-Bv2MPeLR.d.ts +0 -48
  1240. package/dist/utils.d-fqXe8lNc.d.mts +0 -48
  1241. package/dist/version.d.mts +0 -3
  1242. package/dist/version.d.ts +0 -3
  1243. package/dist/vite.d.mts +0 -163
  1244. package/dist/vite.d.ts +0 -163
  1245. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  1246. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
  1247. package/dist/workflows.d.mts +0 -1
  1248. package/dist/workflows.d.ts +0 -1
@@ -1,1964 +0,0 @@
1
- import {
2
- setFarmPluginIntegrationContext
3
- } from "./chunk-H4WUWLQR.mjs";
4
- import {
5
- isFarmIntegration,
6
- matchPathSegments,
7
- resolveIntegrationMiddlewareParams,
8
- splitPath
9
- } from "./chunk-F6TLUMH7.mjs";
10
- import {
11
- defineSchema
12
- } from "./chunk-46P5KNTE.mjs";
13
- import {
14
- assertSupportedMiddlewareMatcher
15
- } from "./chunk-EDPENAVO.mjs";
16
- import {
17
- toPublicValidationIssues
18
- } from "./chunk-TGSEVBPO.mjs";
19
- import {
20
- applyWebResponseHeaders,
21
- sendWebResponse
22
- } from "./chunk-CO6UYM2D.mjs";
23
- import {
24
- bufferFarmRequestBody,
25
- createFarmRequestBodyErrorResponse,
26
- readNodeRequestBody,
27
- resolveFarmServerConfig,
28
- withFarmRequestClientAddress
29
- } from "./chunk-GFT5AHAT.mjs";
30
- import {
31
- clearRequestContext,
32
- deleteRequestContext,
33
- getRequestContext,
34
- getRequestContextSnapshot,
35
- hasRequestContext,
36
- setRequestContext
37
- } from "./chunk-D2LCAV6L.mjs";
38
- import {
39
- api,
40
- defineIntegrationAPIOperation
41
- } from "./chunk-GYMGK467.mjs";
42
- import {
43
- validateConfigRouteSource
44
- } from "./chunk-ONG4RDW3.mjs";
45
- import {
46
- canonicalizeRequestPathSegments
47
- } from "./chunk-OHWM2VI4.mjs";
48
- import {
49
- assertTerminalCatchAll,
50
- assertUniqueRouteParameters,
51
- compareRouteSpecificity,
52
- getRoutePatternSpecificity
53
- } from "./chunk-AYP2YFVN.mjs";
54
-
55
- // src/integrations.ts
56
- var FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = "farm.integration.internalDispatch";
57
- var FARM_INTEGRATION_SET_COOKIES_KEY = "farm:integration:set-cookies";
58
- function forwardIntegrationSetCookies(context, cookies) {
59
- if (cookies.length === 0) return;
60
- const existing = context.req.get(FARM_INTEGRATION_SET_COOKIES_KEY) ?? [];
61
- context.req.set(FARM_INTEGRATION_SET_COOKIES_KEY, [...existing, ...cookies]);
62
- }
63
- function takeForwardedIntegrationSetCookies(context) {
64
- const cookies = context.req.get(FARM_INTEGRATION_SET_COOKIES_KEY);
65
- if (cookies && cookies.length > 0) {
66
- context.req.delete(FARM_INTEGRATION_SET_COOKIES_KEY);
67
- return cookies;
68
- }
69
- if (cookies) {
70
- context.req.delete(FARM_INTEGRATION_SET_COOKIES_KEY);
71
- }
72
- return [];
73
- }
74
- function appendIntegrationForwardedCookies(response, cookies) {
75
- if (cookies.length === 0) return response;
76
- const headers = new Headers(response.headers);
77
- for (const cookie of cookies) {
78
- headers.append("set-cookie", cookie);
79
- }
80
- return new Response(response.body, {
81
- status: response.status,
82
- statusText: response.statusText,
83
- headers
84
- });
85
- }
86
- var defineIntegrationSchema = defineSchema;
87
- var FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME = /* @__PURE__ */ Symbol.for(
88
- "@farm.js/core/integration-plugin-server-runtime"
89
- );
90
- var FARM_INTEGRATION_PLUGIN_OWNER = /* @__PURE__ */ Symbol.for("@farm.js/core/integration-plugin-owner");
91
- function getFarmIntegrationPluginServerRuntime(plugin) {
92
- const value = plugin[FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME];
93
- return typeof value === "boolean" ? value : void 0;
94
- }
95
- function getFarmIntegrationPluginOwner(plugin) {
96
- const value = plugin[FARM_INTEGRATION_PLUGIN_OWNER];
97
- return value && typeof value === "object" ? value : void 0;
98
- }
99
- function defineTypedIntegrationRoute(method, path, input) {
100
- return {
101
- path,
102
- method,
103
- middleware: input.middleware,
104
- before: input.before,
105
- after: input.after,
106
- rawBody: input.rawBody,
107
- bodyFormat: input.bodyFormat,
108
- input: normalizeIntegrationRouteInputSchemas(input),
109
- handler: input.handler,
110
- __operation: defineIntegrationAPIOperation({
111
- path,
112
- method,
113
- bodyFormat: input.bodyFormat,
114
- responseFormat: input.responseFormat,
115
- headers: input.headers,
116
- credentials: input.credentials,
117
- isServer: input.isServer
118
- })
119
- };
120
- }
121
- function createIntegrationRouteFactory() {
122
- return {
123
- get(path, input) {
124
- return defineTypedIntegrationRoute(
125
- "GET",
126
- path,
127
- input
128
- );
129
- },
130
- post(path, input) {
131
- return defineTypedIntegrationRoute(
132
- "POST",
133
- path,
134
- {
135
- bodyFormat: "json",
136
- ...input
137
- }
138
- );
139
- },
140
- query(path, input) {
141
- return defineTypedIntegrationRoute("QUERY", path, {
142
- bodyFormat: "json",
143
- ...input
144
- });
145
- },
146
- put(path, input) {
147
- return defineTypedIntegrationRoute(
148
- "PUT",
149
- path,
150
- {
151
- bodyFormat: "json",
152
- ...input
153
- }
154
- );
155
- },
156
- patch(path, input) {
157
- return defineTypedIntegrationRoute("PATCH", path, {
158
- bodyFormat: "json",
159
- ...input
160
- });
161
- },
162
- delete(path, input) {
163
- return defineTypedIntegrationRoute("DELETE", path, {
164
- bodyFormat: "json",
165
- ...input
166
- });
167
- },
168
- options(path, input) {
169
- return defineTypedIntegrationRoute("OPTIONS", path, input);
170
- },
171
- head(path, input) {
172
- return defineTypedIntegrationRoute(
173
- "HEAD",
174
- path,
175
- input
176
- );
177
- }
178
- };
179
- }
180
- function createIntegrationRoute(_schema) {
181
- return createIntegrationRouteFactory();
182
- }
183
- var integrationRoute = createIntegrationRouteFactory();
184
- var INTEGRATION_RUNTIME_REGISTRY_KEY = /* @__PURE__ */ Symbol.for("farm.integrationRuntimeRegistry");
185
- var INTEGRATION_REQUEST_DISPATCHER_KEY = /* @__PURE__ */ Symbol.for("farm.integrationRequestDispatcher");
186
- function getIntegrationRuntimeRegistry() {
187
- const globalState = globalThis;
188
- if (!globalState[INTEGRATION_RUNTIME_REGISTRY_KEY]) {
189
- globalState[INTEGRATION_RUNTIME_REGISTRY_KEY] = /* @__PURE__ */ new Map();
190
- }
191
- return globalState[INTEGRATION_RUNTIME_REGISTRY_KEY];
192
- }
193
- function isIntegrationEndpointRoute(value) {
194
- return !!value && typeof value === "object" && typeof value.path === "string" && typeof value.handler === "function";
195
- }
196
- function flattenIntegrationEndpoints(endpoints) {
197
- if (!endpoints) {
198
- return [];
199
- }
200
- if (Array.isArray(endpoints)) {
201
- return endpoints.flatMap((endpoint) => flattenIntegrationEndpoints(endpoint));
202
- }
203
- if (isIntegrationEndpointRoute(endpoints)) {
204
- return [endpoints];
205
- }
206
- if (typeof endpoints === "object") {
207
- return Object.values(endpoints).flatMap((endpoint) => flattenIntegrationEndpoints(endpoint));
208
- }
209
- return [];
210
- }
211
- function defineIntegration(integration) {
212
- const category = integration.category ?? integration.slot;
213
- if (!category) {
214
- throw new Error("Integration category is required.");
215
- }
216
- if (integration.category && integration.slot && integration.category !== integration.slot) {
217
- throw new Error("Integration category and slot must match when both are provided.");
218
- }
219
- const routeFactory = createIntegrationRoute(integration.schema);
220
- const routes = typeof integration.routes === "function" ? integration.routes({
221
- route: routeFactory,
222
- integrationRoute: routeFactory
223
- }) : integration.routes;
224
- const endpoints = typeof integration.endpoints === "function" ? integration.endpoints({
225
- endpoint: routeFactory,
226
- route: routeFactory,
227
- integrationRoute: routeFactory
228
- }) : integration.endpoints;
229
- const endpointRoutes = flattenIntegrationEndpoints(endpoints);
230
- const allRoutes = routes?.length || endpointRoutes.length ? [...routes || [], ...endpointRoutes] : void 0;
231
- for (const route of allRoutes || []) {
232
- assertUniqueRouteParameters(route.path, "api");
233
- validateConfigRouteSource(route.path, `Integration route "${route.path}"`);
234
- assertTerminalCatchAll(route.path, "api");
235
- }
236
- const derivedApi = integration.api || (allRoutes?.length ? api.fromRoutes(
237
- allRoutes
238
- ) : void 0);
239
- return {
240
- kind: "farm-integration",
241
- ...integration,
242
- endpoints,
243
- routes: allRoutes,
244
- api: derivedApi,
245
- category,
246
- slot: category
247
- };
248
- }
249
- function resolveIntegrationPlugins(integrations) {
250
- if (!integrations) {
251
- return [];
252
- }
253
- const plugins = [];
254
- for (const [key, integration] of Object.entries(integrations)) {
255
- if (!integration || !isFarmIntegration(integration)) {
256
- continue;
257
- }
258
- for (const entry of integration.middleware || []) {
259
- if (!entry.matcher) continue;
260
- const matchers = Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher];
261
- try {
262
- matchers.forEach(assertSupportedMiddlewareMatcher);
263
- } catch (error) {
264
- throw new Error(`Integration "${key}": ${error.message}`);
265
- }
266
- }
267
- const owner = createIntegrationPluginOwner(key, integration, "lifecycle");
268
- plugins.push(withIntegrationPluginOwner(createIntegrationPlugin(key, integration), owner));
269
- plugins.push(...resolveIntegrationPluginContributions(key, integration));
270
- }
271
- return plugins;
272
- }
273
- function resolveIntegrationPluginContributions(key, integration) {
274
- const contributions = integration.plugins;
275
- if (!contributions) return [];
276
- if (!Array.isArray(contributions)) {
277
- throw new TypeError(`Integration "${key}" plugins must be an array`);
278
- }
279
- const names = /* @__PURE__ */ new Set();
280
- return contributions.map((plugin, index) => {
281
- if (!plugin || typeof plugin !== "object" || typeof plugin.name !== "string") {
282
- throw new TypeError(`Integration "${key}" plugin at index ${index} is invalid`);
283
- }
284
- const name = plugin.name.trim();
285
- if (!name) {
286
- throw new TypeError(`Integration "${key}" plugin at index ${index} requires a name`);
287
- }
288
- if (names.has(name)) {
289
- throw new Error(`Integration "${key}" contributes duplicate plugin name "${name}"`);
290
- }
291
- names.add(name);
292
- return withIntegrationPluginOwner(
293
- plugin,
294
- createIntegrationPluginOwner(key, integration, "contribution"),
295
- createIntegrationPluginContext(key, integration)
296
- );
297
- });
298
- }
299
- function createIntegrationPluginOwner(key, integration, source) {
300
- return Object.freeze({
301
- key,
302
- category: integration.category,
303
- type: integration.type,
304
- source,
305
- serverRuntime: integration.serverRuntime !== false
306
- });
307
- }
308
- function createIntegrationPluginContext(key, integration) {
309
- return Object.freeze({
310
- key,
311
- category: integration.category,
312
- type: integration.type,
313
- instance: integration.instance,
314
- serverRuntime: integration.serverRuntime !== false
315
- });
316
- }
317
- function withIntegrationPluginOwner(plugin, owner, integration) {
318
- const descriptors = Object.getOwnPropertyDescriptors(plugin);
319
- Reflect.deleteProperty(descriptors, FARM_INTEGRATION_PLUGIN_OWNER);
320
- Reflect.deleteProperty(descriptors, FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME);
321
- const ownedPlugin = Object.create(Object.getPrototypeOf(plugin), descriptors);
322
- Object.defineProperty(ownedPlugin, FARM_INTEGRATION_PLUGIN_OWNER, { value: owner });
323
- Object.defineProperty(ownedPlugin, FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME, {
324
- value: owner.serverRuntime
325
- });
326
- if (integration) {
327
- setFarmPluginIntegrationContext(ownedPlugin, integration);
328
- }
329
- return ownedPlugin;
330
- }
331
- function getIntegrationProviders(integrations) {
332
- if (!integrations) {
333
- return [];
334
- }
335
- const providers = [];
336
- for (const integration of Object.values(integrations)) {
337
- if (!integration || !isFarmIntegration(integration) || !integration.providers?.length) {
338
- continue;
339
- }
340
- for (const provider of integration.providers) {
341
- providers.push({
342
- name: provider.name,
343
- type: provider.type,
344
- props: provider.props,
345
- supportsIsolatedHydration: provider.supportsIsolatedHydration,
346
- component: provider.component
347
- });
348
- }
349
- }
350
- return providers;
351
- }
352
- function isFarmIntegrationProviderComponentReference(value) {
353
- return Boolean(
354
- value && typeof value === "object" && "module" in value && typeof value.module === "string" && value.module.length > 0
355
- );
356
- }
357
- function getIntegrationDocumentNavigationMatchers(integrations) {
358
- if (!integrations) {
359
- return [];
360
- }
361
- const matchers = [];
362
- for (const integration of Object.values(integrations)) {
363
- if (!integration || !isFarmIntegration(integration) || !integration.documentNavigations?.length) {
364
- continue;
365
- }
366
- for (const navigation of integration.documentNavigations) {
367
- const items = Array.isArray(navigation.matcher) ? navigation.matcher : [navigation.matcher];
368
- for (const item of items) {
369
- matchers.push(item);
370
- }
371
- }
372
- }
373
- return matchers;
374
- }
375
- function getIntegrationSchemas(integrations) {
376
- if (!integrations) {
377
- return {};
378
- }
379
- const schemaEntries = Object.entries(integrations).map(([key, integration]) => {
380
- const schema = integration && isFarmIntegration(integration) ? integration.schema : void 0;
381
- return schema ? [key, schema] : null;
382
- }).filter((value) => value !== null);
383
- return Object.fromEntries(schemaEntries);
384
- }
385
- function getRegisteredIntegrationRuntime(key) {
386
- return getIntegrationRuntimeRegistry().get(key);
387
- }
388
- function getRegisteredIntegrations() {
389
- return Object.fromEntries(
390
- Array.from(getIntegrationRuntimeRegistry().entries()).map(([key, runtime]) => [
391
- key,
392
- runtime.integration
393
- ])
394
- );
395
- }
396
- function getRegisteredIntegrationSchemas() {
397
- return getIntegrationSchemas(getRegisteredIntegrations());
398
- }
399
- function matchIntegrationRoute(integrations, input) {
400
- if (!integrations) {
401
- return null;
402
- }
403
- const method = normalizeIntegrationRequestMethod(input.method);
404
- if (!method) {
405
- return null;
406
- }
407
- const pathSegments = canonicalizeRequestPathSegments(input.pathname);
408
- for (const [key, integration] of Object.entries(integrations)) {
409
- if (!integration || !isFarmIntegration(integration)) {
410
- continue;
411
- }
412
- const routes = normalizeIntegrationRoutes(integration.routes || []);
413
- for (const route of routes) {
414
- if (!matchesMethod(route.methods, method)) {
415
- continue;
416
- }
417
- const params = matchPathSegments(route[INTEGRATION_ROUTE_SEGMENTS], pathSegments);
418
- if (!params) {
419
- continue;
420
- }
421
- return {
422
- key,
423
- integration,
424
- route: {
425
- path: route.path,
426
- methods: route.methods
427
- },
428
- params
429
- };
430
- }
431
- }
432
- return null;
433
- }
434
- function matchRegisteredIntegrationRoute(input) {
435
- return matchIntegrationRoute(getRegisteredIntegrations(), input);
436
- }
437
- function createClientSafeIntegrationAPI(api2) {
438
- if (!api2) {
439
- return void 0;
440
- }
441
- const entries = Object.entries(api2).map(([key, value]) => {
442
- if (value && typeof value === "object" && value.kind === "farm-integration-api-operation") {
443
- const operation = value;
444
- return [
445
- key,
446
- defineIntegrationAPIOperation({
447
- path: operation.path,
448
- method: operation.method,
449
- bodyFormat: operation.bodyFormat,
450
- responseFormat: operation.responseFormat,
451
- credentials: operation.credentials,
452
- isServer: operation.isServer
453
- })
454
- ];
455
- }
456
- if (value && typeof value === "object") {
457
- return [key, createClientSafeIntegrationAPI(value)];
458
- }
459
- return [key, value];
460
- });
461
- return Object.fromEntries(entries);
462
- }
463
- function getRegisteredIntegrationAPIManifest() {
464
- const manifestEntries = Object.entries(getRegisteredIntegrations()).map(([key, integration]) => {
465
- const api2 = createClientSafeIntegrationAPI(integration.api);
466
- return api2 ? [key, api2] : null;
467
- }).filter((value) => value !== null);
468
- return Object.fromEntries(manifestEntries);
469
- }
470
- function getIntegrationRuntimeEnv() {
471
- return typeof process !== "undefined" ? process.env : {};
472
- }
473
- function isIntegrationConfigDefinition(value) {
474
- return !!value && typeof value === "object" && ("schema" in value || "env" in value || "defaults" in value || "input" in value || "resolve" in value);
475
- }
476
- function mergeIntegrationConfigValue(current, next) {
477
- if (next === void 0) {
478
- return current;
479
- }
480
- if (isPlainIntegrationConfigObject(current) && isPlainIntegrationConfigObject(next)) {
481
- return {
482
- ...current,
483
- ...next
484
- };
485
- }
486
- return next;
487
- }
488
- function isPlainIntegrationConfigObject(value) {
489
- return !!value && typeof value === "object" && !Array.isArray(value);
490
- }
491
- async function resolveIntegrationConfigPart(value, context) {
492
- if (typeof value === "function") {
493
- return value(context);
494
- }
495
- return value;
496
- }
497
- function resolveIntegrationEnvConfig(env) {
498
- if (!env) {
499
- return void 0;
500
- }
501
- const runtimeEnv = getIntegrationRuntimeEnv();
502
- const config = {};
503
- for (const [key, names] of Object.entries(env)) {
504
- const envNames = Array.isArray(names) ? names : [names];
505
- const value = envNames.map((name) => runtimeEnv[name]).find((entry) => entry !== void 0);
506
- if (value !== void 0) {
507
- config[key] = value;
508
- }
509
- }
510
- return config;
511
- }
512
- async function parseIntegrationConfigSchema(integration, schema, value) {
513
- const parser = schema.safeParseAsync || schema.safeParse;
514
- if (parser) {
515
- const result = await parser.call(schema, value);
516
- if (result.success) {
517
- return result.data;
518
- }
519
- throw createIntegrationConfigValidationError(integration, result.error);
520
- }
521
- if (schema["~standard"]?.validate) {
522
- const result = await schema["~standard"].validate(value);
523
- if ("value" in result) {
524
- return result.value;
525
- }
526
- throw createIntegrationConfigValidationError(integration, {
527
- issues: result.issues
528
- });
529
- }
530
- if (schema.parse) {
531
- try {
532
- return await schema.parse(value);
533
- } catch (error) {
534
- throw createIntegrationConfigValidationError(
535
- integration,
536
- normalizeIntegrationValidationError(error)
537
- );
538
- }
539
- }
540
- throw new Error(
541
- `Integration "${integration.type}" config schema must expose safeParse, safeParseAsync, parse, or ~standard.validate.`
542
- );
543
- }
544
- function createIntegrationConfigValidationError(integration, error) {
545
- const issues = Array.isArray(error.issues) && error.issues.length > 0 ? error.issues.map((issue) => {
546
- const normalizedPath = normalizeIntegrationValidationPath(issue.path);
547
- const path = normalizedPath.length ? `${normalizedPath.join(".")}: ` : "";
548
- return `${path}${issue.message || "Invalid config"}`;
549
- }).join("; ") : error.message || "Invalid config";
550
- return new Error(`Integration "${integration.type}" config validation failed: ${issues}`);
551
- }
552
- async function resolveIntegrationConfig(integration, context) {
553
- const config = integration.config;
554
- if (!config) {
555
- return void 0;
556
- }
557
- if (!isIntegrationConfigDefinition(config)) {
558
- return parseIntegrationConfigSchema(integration, config, {});
559
- }
560
- let value = {};
561
- value = mergeIntegrationConfigValue(
562
- value,
563
- await resolveIntegrationConfigPart(config.defaults, context)
564
- );
565
- value = mergeIntegrationConfigValue(value, resolveIntegrationEnvConfig(config.env));
566
- value = mergeIntegrationConfigValue(
567
- value,
568
- await resolveIntegrationConfigPart(config.input, context)
569
- );
570
- value = mergeIntegrationConfigValue(value, await config.resolve?.(context));
571
- return config.schema ? parseIntegrationConfigSchema(integration, config.schema, value) : value;
572
- }
573
- function createIntegrationLifecycleLogger(integration, phase) {
574
- const write = (level, message, meta) => {
575
- if (!integration.log) {
576
- return;
577
- }
578
- void Promise.resolve(
579
- integration.log({
580
- category: integration.category,
581
- slot: integration.category,
582
- type: integration.type,
583
- phase,
584
- level,
585
- message,
586
- meta,
587
- context: /* @__PURE__ */ new Map()
588
- })
589
- ).catch(() => {
590
- });
591
- };
592
- return {
593
- info(message, meta) {
594
- write("info", message, meta);
595
- },
596
- warn(message, meta) {
597
- write("warn", message, meta);
598
- },
599
- error(message, meta) {
600
- write("error", message, meta);
601
- }
602
- };
603
- }
604
- async function emitIntegrationLog(integration, event) {
605
- try {
606
- await integration.log?.(event);
607
- } catch {
608
- }
609
- }
610
- var INTEGRATION_DATA_HEADER = "x-farm-integration-data";
611
- var INTEGRATION_DATA_HEADER_MAX_LENGTH = 16 * 1024;
612
- var BLOCKED_INTEGRATION_DATA_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
613
- function isFarmIntegrationData(value) {
614
- return !!value && typeof value === "object" && !Array.isArray(value);
615
- }
616
- function isPlainIntegrationDataObject(value) {
617
- if (!isFarmIntegrationData(value)) {
618
- return false;
619
- }
620
- const prototype = Object.getPrototypeOf(value);
621
- return prototype === Object.prototype || prototype === null;
622
- }
623
- function sanitizeIntegrationDataValue(value) {
624
- if (Array.isArray(value)) {
625
- return value.map((item) => sanitizeIntegrationDataValue(item));
626
- }
627
- if (!isPlainIntegrationDataObject(value)) {
628
- return value;
629
- }
630
- const sanitized = {};
631
- for (const [key, item] of Object.entries(value)) {
632
- if (BLOCKED_INTEGRATION_DATA_KEYS.has(key)) {
633
- continue;
634
- }
635
- sanitized[key] = sanitizeIntegrationDataValue(item);
636
- }
637
- return sanitized;
638
- }
639
- function normalizeIntegrationData(value) {
640
- if (!isFarmIntegrationData(value)) {
641
- return {};
642
- }
643
- const sanitized = sanitizeIntegrationDataValue(value);
644
- return isFarmIntegrationData(sanitized) ? sanitized : {};
645
- }
646
- function getIntegrationDataHeaderByteLength(value) {
647
- return new TextEncoder().encode(value).byteLength;
648
- }
649
- function parseIntegrationDataHeader(request) {
650
- const raw = request.headers.get(INTEGRATION_DATA_HEADER);
651
- if (!raw) {
652
- return {};
653
- }
654
- if (getIntegrationDataHeaderByteLength(raw) > INTEGRATION_DATA_HEADER_MAX_LENGTH) {
655
- return {};
656
- }
657
- try {
658
- const value = JSON.parse(raw);
659
- return normalizeIntegrationData(value);
660
- } catch {
661
- return {};
662
- }
663
- }
664
- function resolveIntegrationData(request, data) {
665
- return {
666
- ...parseIntegrationDataHeader(request),
667
- ...normalizeIntegrationData(data)
668
- };
669
- }
670
- function createIntegrationPlugin(integrationKey, integration) {
671
- const routes = normalizeIntegrationRoutes(integration.routes || []);
672
- const middleware = [...integration.middleware || []];
673
- const cleanupCallbacks = [];
674
- let integrationConfigPromise;
675
- const runCleanup = async () => {
676
- const callbacks = cleanupCallbacks.splice(0).reverse();
677
- for (const callback of callbacks) {
678
- await callback();
679
- }
680
- };
681
- const createLifecycleContext = async (context, phase, options = {}) => {
682
- const args = createIntegrationRouteArgs({
683
- integration,
684
- config: context.config
685
- });
686
- const configContext = {
687
- key: integrationKey,
688
- integration,
689
- appConfig: context.config,
690
- config: context.config,
691
- args,
692
- env: getIntegrationRuntimeEnv(),
693
- isDev: context.isDev,
694
- isProd: context.isProd
695
- };
696
- integrationConfigPromise ?? (integrationConfigPromise = resolveIntegrationConfig(integration, configContext));
697
- return {
698
- ...configContext,
699
- integrationConfig: await integrationConfigPromise,
700
- log: createIntegrationLifecycleLogger(integration, phase),
701
- reason: options.reason,
702
- async cleanup(callback) {
703
- if (callback) {
704
- cleanupCallbacks.push(callback);
705
- return;
706
- }
707
- await runCleanup();
708
- }
709
- };
710
- };
711
- const plugin = {
712
- name: `farm:integration:${integration.category}:${integration.type}`,
713
- enforce: "pre",
714
- async init(context) {
715
- getIntegrationRuntimeRegistry().set(integrationKey, {
716
- integration,
717
- config: context.config,
718
- isDev: context.isDev,
719
- isProd: context.isProd
720
- });
721
- await createLifecycleContext(context, "validate");
722
- if (integration.validate) {
723
- await integration.validate(await createLifecycleContext(context, "validate"));
724
- }
725
- if (integration.setup) {
726
- await integration.setup(await createLifecycleContext(context, "setup"));
727
- }
728
- if (!integration.log) {
729
- return;
730
- }
731
- for (const route of routes) {
732
- await emitIntegrationLog(integration, {
733
- category: integration.category,
734
- slot: integration.category,
735
- type: integration.type,
736
- phase: "registered",
737
- route: {
738
- kind: "route",
739
- path: route.path,
740
- methods: route.methods
741
- },
742
- context: /* @__PURE__ */ new Map()
743
- });
744
- }
745
- for (const entry of middleware) {
746
- await emitIntegrationLog(integration, {
747
- category: integration.category,
748
- slot: integration.category,
749
- type: integration.type,
750
- phase: "registered",
751
- route: {
752
- kind: "middleware",
753
- path: normalizeMatcher(entry.matcher),
754
- methods: ["ALL"]
755
- },
756
- context: /* @__PURE__ */ new Map()
757
- });
758
- }
759
- },
760
- async ready(context) {
761
- if (integration.ready) {
762
- await integration.ready(await createLifecycleContext(context, "ready"));
763
- }
764
- },
765
- async shutdown(payload, context) {
766
- try {
767
- if (integration.dispose) {
768
- await integration.dispose(
769
- await createLifecycleContext(context, "dispose", {
770
- reason: payload.reason
771
- })
772
- );
773
- }
774
- } finally {
775
- await runCleanup();
776
- }
777
- },
778
- async beforeRequest(req, res, context) {
779
- if (req.url && !req.url.startsWith("/")) return;
780
- const fullUrl = `http://${req.headers.host || "localhost"}${req.url || "/"}`;
781
- const url = new URL(fullUrl);
782
- const pathname = url.pathname;
783
- const pathSegments = canonicalizeRequestPathSegments(pathname);
784
- const method = normalizeIntegrationRequestMethod(req.method);
785
- const requestId = getRequestId(req);
786
- let bodyLoaded = false;
787
- let requestBody;
788
- const getRequestBody = async () => {
789
- if (!bodyLoaded) {
790
- bodyLoaded = true;
791
- if (req.method && req.method !== "GET" && req.method !== "HEAD") {
792
- requestBody = await readNodeRequestBody(
793
- req,
794
- resolveFarmServerConfig(context.config.server).bodySizeLimit
795
- );
796
- }
797
- }
798
- return requestBody;
799
- };
800
- const createHandlerRequest = async () => {
801
- try {
802
- return withFarmRequestClientAddress(
803
- createWebRequest(req, fullUrl, await getRequestBody()),
804
- resolveFarmServerConfig(context.config.server).trustProxy,
805
- req.socket?.remoteAddress
806
- );
807
- } catch (error) {
808
- const response = createFarmRequestBodyErrorResponse(error);
809
- if (!response) throw error;
810
- await sendWebResponse(res, response);
811
- return null;
812
- }
813
- };
814
- for (const entry of middleware) {
815
- const params = resolveIntegrationMiddlewareParams(entry, pathname, context.config);
816
- if (!params) {
817
- continue;
818
- }
819
- const request = await createHandlerRequest();
820
- if (!request) return;
821
- const handlerContext = createIntegrationHandlerContext({
822
- integration,
823
- route: {
824
- kind: "middleware",
825
- path: normalizeMatcher(entry.matcher),
826
- methods: ["ALL"]
827
- },
828
- request,
829
- rawRequest: req,
830
- params,
831
- pathname,
832
- requestId,
833
- pluginContext: context
834
- });
835
- const startedAt = Date.now();
836
- await emitIntegrationLog(integration, {
837
- category: integration.category,
838
- slot: integration.category,
839
- type: integration.type,
840
- phase: "request:start",
841
- route: {
842
- kind: "middleware",
843
- path: normalizeMatcher(entry.matcher),
844
- methods: ["ALL"]
845
- },
846
- request,
847
- requestId,
848
- context: handlerContext.req.snapshot()
849
- });
850
- try {
851
- const response = await entry.handler(request, handlerContext);
852
- const forwardedCookies = takeForwardedIntegrationSetCookies(handlerContext);
853
- if (forwardedCookies.length > 0) {
854
- const setCookieHeaders = new Headers();
855
- for (const cookie of forwardedCookies) {
856
- setCookieHeaders.append("set-cookie", cookie);
857
- }
858
- applyWebResponseHeaders(res, setCookieHeaders, { appendSetCookie: true });
859
- }
860
- if (response) {
861
- await sendWebResponse(res, response);
862
- await emitIntegrationLog(integration, {
863
- category: integration.category,
864
- slot: integration.category,
865
- type: integration.type,
866
- phase: "request:end",
867
- route: {
868
- kind: "middleware",
869
- path: normalizeMatcher(entry.matcher),
870
- methods: ["ALL"]
871
- },
872
- request,
873
- response,
874
- requestId,
875
- durationMs: Date.now() - startedAt,
876
- context: handlerContext.req.snapshot()
877
- });
878
- return;
879
- }
880
- await emitIntegrationLog(integration, {
881
- category: integration.category,
882
- slot: integration.category,
883
- type: integration.type,
884
- phase: "request:end",
885
- route: {
886
- kind: "middleware",
887
- path: normalizeMatcher(entry.matcher),
888
- methods: ["ALL"]
889
- },
890
- request,
891
- requestId,
892
- durationMs: Date.now() - startedAt,
893
- context: handlerContext.req.snapshot()
894
- });
895
- } catch (error) {
896
- await emitIntegrationLog(integration, {
897
- category: integration.category,
898
- slot: integration.category,
899
- type: integration.type,
900
- phase: "request:error",
901
- route: {
902
- kind: "middleware",
903
- path: normalizeMatcher(entry.matcher),
904
- methods: ["ALL"]
905
- },
906
- request,
907
- requestId,
908
- durationMs: Date.now() - startedAt,
909
- error,
910
- context: handlerContext.req.snapshot()
911
- });
912
- throw error;
913
- }
914
- }
915
- for (const route of routes) {
916
- const params = method && matchesMethod(route.methods, method) ? matchPathSegments(route[INTEGRATION_ROUTE_SEGMENTS], pathSegments) : null;
917
- if (!params) {
918
- continue;
919
- }
920
- const request = await createHandlerRequest();
921
- if (!request) return;
922
- const handlerContext = createIntegrationHandlerContext({
923
- integration,
924
- route: {
925
- kind: "route",
926
- path: route.path,
927
- methods: route.methods
928
- },
929
- request,
930
- rawRequest: req,
931
- params,
932
- pathname,
933
- requestId,
934
- pluginContext: context
935
- });
936
- const startedAt = Date.now();
937
- await emitIntegrationLog(integration, {
938
- category: integration.category,
939
- slot: integration.category,
940
- type: integration.type,
941
- phase: "request:start",
942
- route: {
943
- kind: "route",
944
- path: route.path,
945
- methods: route.methods
946
- },
947
- request,
948
- requestId,
949
- context: handlerContext.req.snapshot()
950
- });
951
- try {
952
- const validation = await validateIntegrationRouteInput(route, request, url);
953
- if (!validation.success) {
954
- await sendWebResponse(res, validation.response);
955
- await emitIntegrationLog(integration, {
956
- category: integration.category,
957
- slot: integration.category,
958
- type: integration.type,
959
- phase: "request:end",
960
- route: {
961
- kind: "route",
962
- path: route.path,
963
- methods: route.methods
964
- },
965
- request,
966
- response: validation.response,
967
- requestId,
968
- durationMs: Date.now() - startedAt,
969
- context: handlerContext.req.snapshot()
970
- });
971
- return;
972
- }
973
- handlerContext.input = validation.input;
974
- for (const middlewareEntry of route.middleware || []) {
975
- const middlewareResponse = await middlewareEntry.handler(request, handlerContext);
976
- if (middlewareResponse) {
977
- await sendWebResponse(res, middlewareResponse);
978
- await emitIntegrationLog(integration, {
979
- category: integration.category,
980
- slot: integration.category,
981
- type: integration.type,
982
- phase: "request:end",
983
- route: {
984
- kind: "route",
985
- path: route.path,
986
- methods: route.methods
987
- },
988
- request,
989
- response: middlewareResponse,
990
- requestId,
991
- durationMs: Date.now() - startedAt,
992
- context: handlerContext.req.snapshot()
993
- });
994
- return;
995
- }
996
- }
997
- const beforeResponse = await runIntegrationRouteBeforeHooks(
998
- route,
999
- request,
1000
- handlerContext
1001
- );
1002
- if (beforeResponse) {
1003
- const response2 = await runIntegrationRouteAfterHooks(
1004
- route,
1005
- request,
1006
- handlerContext,
1007
- beforeResponse
1008
- );
1009
- await sendWebResponse(res, response2);
1010
- await emitIntegrationLog(integration, {
1011
- category: integration.category,
1012
- slot: integration.category,
1013
- type: integration.type,
1014
- phase: "request:end",
1015
- route: {
1016
- kind: "route",
1017
- path: route.path,
1018
- methods: route.methods
1019
- },
1020
- request,
1021
- response: response2,
1022
- requestId,
1023
- durationMs: Date.now() - startedAt,
1024
- context: handlerContext.req.snapshot()
1025
- });
1026
- return;
1027
- }
1028
- const handlerResponse = await route.handler(request, handlerContext);
1029
- const response = await runIntegrationRouteAfterHooks(
1030
- route,
1031
- request,
1032
- handlerContext,
1033
- handlerResponse
1034
- );
1035
- await sendWebResponse(res, response);
1036
- await emitIntegrationLog(integration, {
1037
- category: integration.category,
1038
- slot: integration.category,
1039
- type: integration.type,
1040
- phase: "request:end",
1041
- route: {
1042
- kind: "route",
1043
- path: route.path,
1044
- methods: route.methods
1045
- },
1046
- request,
1047
- response,
1048
- requestId,
1049
- durationMs: Date.now() - startedAt,
1050
- context: handlerContext.req.snapshot()
1051
- });
1052
- return;
1053
- } catch (error) {
1054
- await emitIntegrationLog(integration, {
1055
- category: integration.category,
1056
- slot: integration.category,
1057
- type: integration.type,
1058
- phase: "request:error",
1059
- route: {
1060
- kind: "route",
1061
- path: route.path,
1062
- methods: route.methods
1063
- },
1064
- request,
1065
- requestId,
1066
- durationMs: Date.now() - startedAt,
1067
- error,
1068
- context: handlerContext.req.snapshot()
1069
- });
1070
- throw error;
1071
- }
1072
- }
1073
- }
1074
- };
1075
- Object.defineProperty(plugin, FARM_INTEGRATION_PLUGIN_SERVER_RUNTIME, {
1076
- value: integration.serverRuntime !== false
1077
- });
1078
- return plugin;
1079
- }
1080
- function createIntegrationHandlerContext(input) {
1081
- const req = createIntegrationRequestContextStore(
1082
- input.rawRequest,
1083
- input.request,
1084
- input.pluginContext
1085
- );
1086
- return {
1087
- request: input.request,
1088
- requestId: input.requestId,
1089
- url: new URL(input.request.url),
1090
- pathname: input.pathname,
1091
- method: input.request.method,
1092
- params: input.params,
1093
- input: {},
1094
- args: createIntegrationRouteArgs({
1095
- integration: input.integration,
1096
- config: input.pluginContext.config
1097
- }),
1098
- data: resolveIntegrationData(input.request),
1099
- integration: {
1100
- category: input.integration.category,
1101
- slot: input.integration.category,
1102
- type: input.integration.type,
1103
- instance: input.integration.instance
1104
- },
1105
- route: input.route,
1106
- req,
1107
- requestContext: req,
1108
- config: input.pluginContext.config,
1109
- isDev: input.pluginContext.isDev,
1110
- isProd: input.pluginContext.isProd
1111
- };
1112
- }
1113
- var INTEGRATION_ROUTE_SEGMENTS = /* @__PURE__ */ Symbol("farm.integrationRouteSegments");
1114
- var EMPTY_NORMALIZED_INTEGRATION_ROUTES = [];
1115
- var normalizedIntegrationRoutesCache = /* @__PURE__ */ new WeakMap();
1116
- function normalizeIntegrationRoutes(routes) {
1117
- if (routes.length === 0) {
1118
- return EMPTY_NORMALIZED_INTEGRATION_ROUTES;
1119
- }
1120
- const cached = normalizedIntegrationRoutesCache.get(routes);
1121
- if (cached) {
1122
- return cached;
1123
- }
1124
- const normalized = routes.map((route, index) => {
1125
- assertUniqueRouteParameters(route.path, "api");
1126
- return {
1127
- index,
1128
- route: {
1129
- ...route,
1130
- methods: normalizeIntegrationRouteMethods(route),
1131
- input: normalizeIntegrationRouteInputSchemas(route),
1132
- [INTEGRATION_ROUTE_SEGMENTS]: splitPath(route.path)
1133
- },
1134
- specificity: getRoutePatternSpecificity(route.path, "api")
1135
- };
1136
- }).sort(
1137
- (left, right) => compareRouteSpecificity(left.specificity, right.specificity) || left.index - right.index
1138
- ).map(({ route }) => route);
1139
- normalizedIntegrationRoutesCache.set(routes, normalized);
1140
- return normalized;
1141
- }
1142
- function normalizeIntegrationRouteMethods(route) {
1143
- const input = route.methods && route.methods.length > 0 ? [...route.methods] : route.method ? [route.method] : ["ALL"];
1144
- return input.map((method) => String(method).toUpperCase());
1145
- }
1146
- function normalizeIntegrationRouteInputSchemas(route) {
1147
- const input = {
1148
- ...route.input
1149
- };
1150
- if (route.body) {
1151
- input.body = route.body;
1152
- }
1153
- if (route.query) {
1154
- input.query = route.query;
1155
- }
1156
- return input.body || input.query ? input : void 0;
1157
- }
1158
- async function validateIntegrationRouteInput(route, request, url) {
1159
- if (request.method.toUpperCase() === "QUERY" && !request.headers.has("content-type")) {
1160
- return {
1161
- success: false,
1162
- response: Response.json(
1163
- {
1164
- error: "Invalid QUERY request",
1165
- message: "QUERY requests must include a Content-Type header."
1166
- },
1167
- { status: 400 }
1168
- )
1169
- };
1170
- }
1171
- const schemas = route.input;
1172
- if (!schemas?.body && !schemas?.query) {
1173
- return {
1174
- success: true,
1175
- input: {}
1176
- };
1177
- }
1178
- const input = {};
1179
- const issues = [];
1180
- if (schemas.query) {
1181
- const queryResult = await parseIntegrationInputSchema(
1182
- "query",
1183
- schemas.query,
1184
- createQueryInput(url.searchParams)
1185
- );
1186
- if (queryResult.success) {
1187
- input.query = queryResult.data;
1188
- } else {
1189
- issues.push(...queryResult.issues);
1190
- }
1191
- }
1192
- if (schemas.body) {
1193
- const bodyInput = await readIntegrationValidationBody(
1194
- request,
1195
- getIntegrationRouteBodyFormat(route)
1196
- );
1197
- if (bodyInput.success) {
1198
- const bodyResult = await parseIntegrationInputSchema("body", schemas.body, bodyInput.data);
1199
- if (bodyResult.success) {
1200
- input.body = bodyResult.data;
1201
- } else {
1202
- issues.push(...bodyResult.issues);
1203
- }
1204
- } else {
1205
- issues.push(bodyInput.issue);
1206
- }
1207
- }
1208
- if (issues.length > 0) {
1209
- return {
1210
- success: false,
1211
- response: createIntegrationValidationResponse(issues)
1212
- };
1213
- }
1214
- return {
1215
- success: true,
1216
- input
1217
- };
1218
- }
1219
- async function parseIntegrationInputSchema(source, schema, value) {
1220
- const parser = schema.safeParseAsync || schema.safeParse;
1221
- if (parser) {
1222
- const result = await parser.call(schema, value);
1223
- if (result.success) {
1224
- return {
1225
- success: true,
1226
- data: result.data
1227
- };
1228
- }
1229
- return {
1230
- success: false,
1231
- issues: normalizeIntegrationValidationIssues(source, result.error)
1232
- };
1233
- }
1234
- if (schema["~standard"]?.validate) {
1235
- const result = await schema["~standard"].validate(value);
1236
- if ("value" in result) {
1237
- return {
1238
- success: true,
1239
- data: result.value
1240
- };
1241
- }
1242
- return {
1243
- success: false,
1244
- issues: normalizeIntegrationValidationIssues(source, {
1245
- issues: result.issues
1246
- })
1247
- };
1248
- }
1249
- if (schema.parse) {
1250
- try {
1251
- return {
1252
- success: true,
1253
- data: await schema.parse(value)
1254
- };
1255
- } catch (error) {
1256
- return {
1257
- success: false,
1258
- issues: normalizeIntegrationValidationIssues(
1259
- source,
1260
- normalizeIntegrationValidationError(error)
1261
- )
1262
- };
1263
- }
1264
- }
1265
- return {
1266
- success: false,
1267
- issues: [
1268
- {
1269
- source,
1270
- message: "Input schema must expose safeParse, safeParseAsync, parse, or ~standard.validate."
1271
- }
1272
- ]
1273
- };
1274
- }
1275
- function createIntegrationValidationResponse(issues) {
1276
- return Response.json(
1277
- {
1278
- error: "Integration route input validation failed",
1279
- issues
1280
- },
1281
- {
1282
- status: 400
1283
- }
1284
- );
1285
- }
1286
- function normalizeIntegrationValidationIssues(source, error) {
1287
- if (Array.isArray(error.issues) && error.issues.length > 0) {
1288
- return toPublicValidationIssues(error).map((issue) => ({ source, ...issue }));
1289
- }
1290
- return [
1291
- {
1292
- source,
1293
- path: [],
1294
- message: "Invalid input"
1295
- }
1296
- ];
1297
- }
1298
- function normalizeIntegrationValidationPath(path) {
1299
- return (path || []).map((segment) => {
1300
- const key = typeof segment === "object" && segment !== null && "key" in segment ? segment.key : segment;
1301
- return typeof key === "symbol" ? key.description || key.toString() : key;
1302
- });
1303
- }
1304
- function normalizeIntegrationValidationError(error) {
1305
- if (error && typeof error === "object") {
1306
- return error;
1307
- }
1308
- return {
1309
- message: error instanceof Error ? error.message : String(error || "Invalid input")
1310
- };
1311
- }
1312
- async function readIntegrationValidationBody(request, format) {
1313
- if (request.method === "GET" || request.method === "HEAD" || format === "none") {
1314
- return {
1315
- success: true,
1316
- data: void 0
1317
- };
1318
- }
1319
- try {
1320
- if (format === "form") {
1321
- return {
1322
- success: true,
1323
- data: createFormInput(await request.clone().formData())
1324
- };
1325
- }
1326
- const text = await request.clone().text();
1327
- if (text.trim().length === 0) {
1328
- return {
1329
- success: true,
1330
- data: void 0
1331
- };
1332
- }
1333
- return {
1334
- success: true,
1335
- data: JSON.parse(text)
1336
- };
1337
- } catch (error) {
1338
- return {
1339
- success: false,
1340
- issue: {
1341
- source: "body",
1342
- path: [],
1343
- message: format === "json" ? "Expected a valid JSON request body." : error instanceof Error && error.message ? error.message : "Could not parse request body."
1344
- }
1345
- };
1346
- }
1347
- }
1348
- function getIntegrationRouteBodyFormat(route) {
1349
- return route.bodyFormat || route.__operation?.bodyFormat || "json";
1350
- }
1351
- function createIntegrationRouteArgs(input) {
1352
- let clientPromise;
1353
- let ormPromise;
1354
- const getClient = () => {
1355
- clientPromise ?? (clientPromise = import("./storage.mjs").then(
1356
- ({ resolveStorageRuntimeClient }) => resolveStorageRuntimeClient(input.config.storage)
1357
- ));
1358
- return clientPromise;
1359
- };
1360
- const getOrm = () => {
1361
- if (!input.integration.schema) {
1362
- throw new Error(
1363
- `Integration "${input.integration.type}" does not define a schema for ctx.args.db.`
1364
- );
1365
- }
1366
- ormPromise ?? (ormPromise = import("./integration-orm-CO23MSFE.mjs").then(
1367
- ({ createIntegrationOrm }) => createIntegrationOrm({
1368
- schema: input.integration.schema,
1369
- config: input.config
1370
- })
1371
- ));
1372
- return ormPromise;
1373
- };
1374
- return {
1375
- db: createLazyIntegrationOrmClient(getOrm),
1376
- getDb: getOrm,
1377
- storage: {
1378
- getClient,
1379
- getOrm
1380
- }
1381
- };
1382
- }
1383
- function createLazyIntegrationOrmClient(resolveOrm) {
1384
- const modelProxyCache = /* @__PURE__ */ new Map();
1385
- return new Proxy(
1386
- {},
1387
- {
1388
- get(_target, prop) {
1389
- if (prop === "then") {
1390
- return void 0;
1391
- }
1392
- if (prop === "transaction" || prop === "batch") {
1393
- return async (...args) => {
1394
- const orm = await resolveOrm();
1395
- const member = orm[prop];
1396
- if (typeof member !== "function") {
1397
- throw new Error(`Integration ORM does not expose "${String(prop)}".`);
1398
- }
1399
- return member.apply(orm, args);
1400
- };
1401
- }
1402
- if (prop === "$driver") {
1403
- return void 0;
1404
- }
1405
- if (!modelProxyCache.has(prop)) {
1406
- modelProxyCache.set(prop, createLazyIntegrationOrmModel(resolveOrm, prop));
1407
- }
1408
- return modelProxyCache.get(prop);
1409
- }
1410
- }
1411
- );
1412
- }
1413
- function createLazyIntegrationOrmModel(resolveOrm, modelName) {
1414
- return new Proxy(
1415
- {},
1416
- {
1417
- get(_target, prop) {
1418
- if (prop === "then") {
1419
- return void 0;
1420
- }
1421
- return async (...args) => {
1422
- const orm = await resolveOrm();
1423
- const model = orm[modelName];
1424
- const member = model?.[prop];
1425
- if (typeof member !== "function") {
1426
- throw new Error(
1427
- `Integration ORM model "${String(modelName)}" does not expose "${String(prop)}".`
1428
- );
1429
- }
1430
- return member.apply(model, args);
1431
- };
1432
- }
1433
- }
1434
- );
1435
- }
1436
- async function runIntegrationRouteBeforeHooks(route, request, context) {
1437
- const hookContext = context;
1438
- hookContext.response = void 0;
1439
- for (const hook of route.before || []) {
1440
- const response = await hook(request, hookContext);
1441
- if (response) {
1442
- hookContext.response = response;
1443
- return response;
1444
- }
1445
- if (hookContext.response) {
1446
- return hookContext.response;
1447
- }
1448
- }
1449
- return void 0;
1450
- }
1451
- async function runIntegrationRouteAfterHooks(route, request, context, response) {
1452
- const hookContext = context;
1453
- let currentResponse = response;
1454
- for (const hook of route.after || []) {
1455
- hookContext.response = currentResponse;
1456
- const nextResponse = await hook(request, hookContext);
1457
- currentResponse = nextResponse || hookContext.response || currentResponse;
1458
- }
1459
- hookContext.response = currentResponse;
1460
- return currentResponse;
1461
- }
1462
- function createQueryInput(searchParams) {
1463
- const input = {};
1464
- searchParams.forEach((value, key) => {
1465
- if (key === "__proto__" || key === "constructor" || key === "prototype") return;
1466
- const existing = input[key];
1467
- if (existing === void 0) {
1468
- input[key] = value;
1469
- return;
1470
- }
1471
- input[key] = Array.isArray(existing) ? [...existing, value] : [existing, value];
1472
- });
1473
- return input;
1474
- }
1475
- function createFormInput(formData) {
1476
- const input = {};
1477
- formData.forEach((value, key) => {
1478
- if (key === "__proto__" || key === "constructor" || key === "prototype") return;
1479
- const existing = input[key];
1480
- if (existing === void 0) {
1481
- input[key] = value;
1482
- return;
1483
- }
1484
- input[key] = Array.isArray(existing) ? [...existing, value] : [existing, value];
1485
- });
1486
- return input;
1487
- }
1488
- async function dispatchIntegrationRequest(runtime, request, options = {}) {
1489
- const serverConfig = resolveFarmServerConfig(runtime.config.server);
1490
- try {
1491
- request = await bufferFarmRequestBody(request, serverConfig.bodySizeLimit);
1492
- } catch (error) {
1493
- const response = createFarmRequestBodyErrorResponse(error);
1494
- if (response) return response;
1495
- throw error;
1496
- }
1497
- request = withFarmRequestClientAddress(request, serverConfig.trustProxy, options.clientAddress);
1498
- const integration = runtime.integration;
1499
- const url = new URL(request.url);
1500
- const pathname = url.pathname;
1501
- const requestId = request.headers.get("x-request-id") || options.currentRequest?.headers.get("x-request-id") || String(Date.now());
1502
- const routes = normalizeIntegrationRoutes(integration.routes || []);
1503
- const pathSegments = canonicalizeRequestPathSegments(pathname);
1504
- const method = normalizeIntegrationRequestMethod(request.method);
1505
- const middleware = [...integration.middleware || []];
1506
- const forwardedSetCookies = [];
1507
- for (const entry of middleware) {
1508
- if (options.ranMiddleware?.has(entry)) continue;
1509
- const params = resolveIntegrationMiddlewareParams(entry, pathname, runtime.config);
1510
- if (!params) {
1511
- continue;
1512
- }
1513
- options.ranMiddleware?.add(entry);
1514
- const handlerContext = createServerIntegrationHandlerContext({
1515
- runtime,
1516
- route: {
1517
- kind: "middleware",
1518
- path: normalizeMatcher(entry.matcher),
1519
- methods: ["ALL"]
1520
- },
1521
- request,
1522
- params,
1523
- pathname,
1524
- requestId,
1525
- currentRequest: options.currentRequest,
1526
- data: options.data,
1527
- internal: options.internal === true
1528
- });
1529
- const startedAt = Date.now();
1530
- await emitIntegrationLog(integration, {
1531
- category: integration.category,
1532
- slot: integration.category,
1533
- type: integration.type,
1534
- phase: "request:start",
1535
- route: {
1536
- kind: "middleware",
1537
- path: normalizeMatcher(entry.matcher),
1538
- methods: ["ALL"]
1539
- },
1540
- request,
1541
- requestId,
1542
- context: handlerContext.req.snapshot()
1543
- });
1544
- try {
1545
- const response = await entry.handler(request, handlerContext);
1546
- forwardedSetCookies.push(...takeForwardedIntegrationSetCookies(handlerContext));
1547
- if (response) {
1548
- await emitIntegrationLog(integration, {
1549
- category: integration.category,
1550
- slot: integration.category,
1551
- type: integration.type,
1552
- phase: "request:end",
1553
- route: {
1554
- kind: "middleware",
1555
- path: normalizeMatcher(entry.matcher),
1556
- methods: ["ALL"]
1557
- },
1558
- request,
1559
- response,
1560
- requestId,
1561
- durationMs: Date.now() - startedAt,
1562
- context: handlerContext.req.snapshot()
1563
- });
1564
- return appendIntegrationForwardedCookies(response, forwardedSetCookies);
1565
- }
1566
- await emitIntegrationLog(integration, {
1567
- category: integration.category,
1568
- slot: integration.category,
1569
- type: integration.type,
1570
- phase: "request:end",
1571
- route: {
1572
- kind: "middleware",
1573
- path: normalizeMatcher(entry.matcher),
1574
- methods: ["ALL"]
1575
- },
1576
- request,
1577
- requestId,
1578
- durationMs: Date.now() - startedAt,
1579
- context: handlerContext.req.snapshot()
1580
- });
1581
- } catch (error) {
1582
- await emitIntegrationLog(integration, {
1583
- category: integration.category,
1584
- slot: integration.category,
1585
- type: integration.type,
1586
- phase: "request:error",
1587
- route: {
1588
- kind: "middleware",
1589
- path: normalizeMatcher(entry.matcher),
1590
- methods: ["ALL"]
1591
- },
1592
- request,
1593
- requestId,
1594
- durationMs: Date.now() - startedAt,
1595
- error,
1596
- context: handlerContext.req.snapshot()
1597
- });
1598
- throw error;
1599
- }
1600
- }
1601
- for (const route of routes) {
1602
- const params = method && matchesMethod(route.methods, method) ? matchPathSegments(route[INTEGRATION_ROUTE_SEGMENTS], pathSegments) : null;
1603
- if (!params) {
1604
- continue;
1605
- }
1606
- const handlerContext = createServerIntegrationHandlerContext({
1607
- runtime,
1608
- route: {
1609
- kind: "route",
1610
- path: route.path,
1611
- methods: route.methods
1612
- },
1613
- request,
1614
- params,
1615
- pathname,
1616
- requestId,
1617
- currentRequest: options.currentRequest,
1618
- data: options.data,
1619
- internal: options.internal === true
1620
- });
1621
- const startedAt = Date.now();
1622
- await emitIntegrationLog(integration, {
1623
- category: integration.category,
1624
- slot: integration.category,
1625
- type: integration.type,
1626
- phase: "request:start",
1627
- route: {
1628
- kind: "route",
1629
- path: route.path,
1630
- methods: route.methods
1631
- },
1632
- request,
1633
- requestId,
1634
- context: handlerContext.req.snapshot()
1635
- });
1636
- try {
1637
- const validation = await validateIntegrationRouteInput(route, request, url);
1638
- if (!validation.success) {
1639
- await emitIntegrationLog(integration, {
1640
- category: integration.category,
1641
- slot: integration.category,
1642
- type: integration.type,
1643
- phase: "request:end",
1644
- route: {
1645
- kind: "route",
1646
- path: route.path,
1647
- methods: route.methods
1648
- },
1649
- request,
1650
- response: validation.response,
1651
- requestId,
1652
- durationMs: Date.now() - startedAt,
1653
- context: handlerContext.req.snapshot()
1654
- });
1655
- return appendIntegrationForwardedCookies(validation.response, forwardedSetCookies);
1656
- }
1657
- handlerContext.input = validation.input;
1658
- for (const middlewareEntry of route.middleware || []) {
1659
- const middlewareResponse = await middlewareEntry.handler(request, handlerContext);
1660
- forwardedSetCookies.push(...takeForwardedIntegrationSetCookies(handlerContext));
1661
- if (middlewareResponse) {
1662
- await emitIntegrationLog(integration, {
1663
- category: integration.category,
1664
- slot: integration.category,
1665
- type: integration.type,
1666
- phase: "request:end",
1667
- route: {
1668
- kind: "route",
1669
- path: route.path,
1670
- methods: route.methods
1671
- },
1672
- request,
1673
- response: middlewareResponse,
1674
- requestId,
1675
- durationMs: Date.now() - startedAt,
1676
- context: handlerContext.req.snapshot()
1677
- });
1678
- return appendIntegrationForwardedCookies(middlewareResponse, forwardedSetCookies);
1679
- }
1680
- }
1681
- const beforeResponse = await runIntegrationRouteBeforeHooks(route, request, handlerContext);
1682
- if (beforeResponse) {
1683
- const response2 = await runIntegrationRouteAfterHooks(
1684
- route,
1685
- request,
1686
- handlerContext,
1687
- beforeResponse
1688
- );
1689
- await emitIntegrationLog(integration, {
1690
- category: integration.category,
1691
- slot: integration.category,
1692
- type: integration.type,
1693
- phase: "request:end",
1694
- route: {
1695
- kind: "route",
1696
- path: route.path,
1697
- methods: route.methods
1698
- },
1699
- request,
1700
- response: response2,
1701
- requestId,
1702
- durationMs: Date.now() - startedAt,
1703
- context: handlerContext.req.snapshot()
1704
- });
1705
- return appendIntegrationForwardedCookies(response2, forwardedSetCookies);
1706
- }
1707
- const handlerResponse = await route.handler(request, handlerContext);
1708
- const response = await runIntegrationRouteAfterHooks(
1709
- route,
1710
- request,
1711
- handlerContext,
1712
- handlerResponse
1713
- );
1714
- await emitIntegrationLog(integration, {
1715
- category: integration.category,
1716
- slot: integration.category,
1717
- type: integration.type,
1718
- phase: "request:end",
1719
- route: {
1720
- kind: "route",
1721
- path: route.path,
1722
- methods: route.methods
1723
- },
1724
- request,
1725
- response,
1726
- requestId,
1727
- durationMs: Date.now() - startedAt,
1728
- context: handlerContext.req.snapshot()
1729
- });
1730
- return appendIntegrationForwardedCookies(response, forwardedSetCookies);
1731
- } catch (error) {
1732
- await emitIntegrationLog(integration, {
1733
- category: integration.category,
1734
- slot: integration.category,
1735
- type: integration.type,
1736
- phase: "request:error",
1737
- route: {
1738
- kind: "route",
1739
- path: route.path,
1740
- methods: route.methods
1741
- },
1742
- request,
1743
- requestId,
1744
- durationMs: Date.now() - startedAt,
1745
- error,
1746
- context: handlerContext.req.snapshot()
1747
- });
1748
- throw error;
1749
- }
1750
- }
1751
- if (forwardedSetCookies.length > 0) {
1752
- options.onForwardedCookies?.(forwardedSetCookies);
1753
- }
1754
- return null;
1755
- }
1756
- async function dispatchIntegrationRequests(integrations, runtime, request, options = {}) {
1757
- const setCookies = [];
1758
- if (!integrations) {
1759
- return { response: null, setCookies };
1760
- }
1761
- for (const integration of Object.values(integrations)) {
1762
- if (!integration || !isFarmIntegration(integration)) {
1763
- continue;
1764
- }
1765
- const hasMiddleware = (integration.middleware || []).length > 0;
1766
- const hasRoutes = normalizeIntegrationRoutes(integration.routes || []).length > 0;
1767
- if (!hasMiddleware && !hasRoutes) {
1768
- continue;
1769
- }
1770
- const response = await dispatchIntegrationRequest(
1771
- { ...runtime, integration },
1772
- // Each dispatch buffers the body it is given, so hand every integration
1773
- // its own clone rather than a Request another dispatch already read.
1774
- request.clone(),
1775
- {
1776
- currentRequest: options.currentRequest,
1777
- ranMiddleware: options.ranMiddleware,
1778
- clientAddress: options.clientAddress,
1779
- onForwardedCookies: (cookies) => setCookies.push(...cookies)
1780
- }
1781
- );
1782
- if (response) {
1783
- return {
1784
- response: appendIntegrationForwardedCookies(response, setCookies),
1785
- setCookies: []
1786
- };
1787
- }
1788
- }
1789
- return { response: null, setCookies };
1790
- }
1791
- globalThis[INTEGRATION_REQUEST_DISPATCHER_KEY] = dispatchIntegrationRequest;
1792
- function createIntegrationRequestContextStore(rawRequest, request, pluginContext) {
1793
- return {
1794
- get(key) {
1795
- const requestValue = pluginContext.requestContext.get(request, key);
1796
- if (requestValue !== void 0) {
1797
- return requestValue;
1798
- }
1799
- return pluginContext.requestContext.get(rawRequest, key);
1800
- },
1801
- set(key, value, options) {
1802
- pluginContext.requestContext.set(rawRequest, key, value, options);
1803
- pluginContext.requestContext.set(request, key, value, options);
1804
- },
1805
- has(key) {
1806
- return pluginContext.requestContext.has(request, key) || pluginContext.requestContext.has(rawRequest, key);
1807
- },
1808
- delete(key) {
1809
- const deletedRequest = pluginContext.requestContext.delete(request, key);
1810
- const deletedRaw = pluginContext.requestContext.delete(rawRequest, key);
1811
- return deletedRequest || deletedRaw;
1812
- },
1813
- clear() {
1814
- pluginContext.requestContext.clear(rawRequest);
1815
- pluginContext.requestContext.clear(request);
1816
- },
1817
- snapshot(options) {
1818
- const merged = pluginContext.requestContext.getAll(rawRequest, options);
1819
- const requestSnapshot = pluginContext.requestContext.getAll(request, options);
1820
- for (const [key, value] of requestSnapshot) {
1821
- merged.set(key, value);
1822
- }
1823
- return merged;
1824
- }
1825
- };
1826
- }
1827
- function createServerIntegrationHandlerContext(input) {
1828
- const req = createServerIntegrationRequestContextStore(input.request, input.currentRequest);
1829
- if (input.internal) {
1830
- req.set(FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, true);
1831
- }
1832
- return {
1833
- request: input.request,
1834
- requestId: input.requestId,
1835
- url: new URL(input.request.url),
1836
- pathname: input.pathname,
1837
- method: input.request.method,
1838
- params: input.params,
1839
- input: {},
1840
- args: createIntegrationRouteArgs({
1841
- integration: input.runtime.integration,
1842
- config: input.runtime.config
1843
- }),
1844
- data: resolveIntegrationData(input.request, input.data),
1845
- integration: {
1846
- category: input.runtime.integration.category,
1847
- slot: input.runtime.integration.category,
1848
- type: input.runtime.integration.type,
1849
- instance: input.runtime.integration.instance
1850
- },
1851
- route: input.route,
1852
- req,
1853
- requestContext: req,
1854
- config: input.runtime.config,
1855
- isDev: input.runtime.isDev,
1856
- isProd: input.runtime.isProd
1857
- };
1858
- }
1859
- function createServerIntegrationRequestContextStore(request, currentRequest) {
1860
- return {
1861
- get(key) {
1862
- const requestValue = getRequestContext(request, key);
1863
- if (requestValue !== void 0) {
1864
- return requestValue;
1865
- }
1866
- if (currentRequest) {
1867
- return getRequestContext(currentRequest, key);
1868
- }
1869
- return void 0;
1870
- },
1871
- set(key, value, options) {
1872
- setRequestContext(request, key, value, options);
1873
- if (currentRequest) {
1874
- setRequestContext(currentRequest, key, value, options);
1875
- }
1876
- },
1877
- has(key) {
1878
- return hasRequestContext(request, key) || !!currentRequest && hasRequestContext(currentRequest, key);
1879
- },
1880
- delete(key) {
1881
- const deletedRequest = deleteRequestContext(request, key);
1882
- const deletedCurrent = currentRequest ? deleteRequestContext(currentRequest, key) : false;
1883
- return deletedRequest || deletedCurrent;
1884
- },
1885
- clear() {
1886
- clearRequestContext(request);
1887
- if (currentRequest) {
1888
- clearRequestContext(currentRequest);
1889
- }
1890
- },
1891
- snapshot(options) {
1892
- const merged = currentRequest ? getRequestContextSnapshot(currentRequest, options) : /* @__PURE__ */ new Map();
1893
- const requestSnapshot = getRequestContextSnapshot(request, options);
1894
- for (const [key, value] of requestSnapshot) {
1895
- merged.set(key, value);
1896
- }
1897
- return merged;
1898
- }
1899
- };
1900
- }
1901
- function createWebRequest(req, fullUrl, body) {
1902
- const headers = new Headers();
1903
- for (const [key, value] of Object.entries(req.headers)) {
1904
- if (value == null) {
1905
- continue;
1906
- }
1907
- if (Array.isArray(value)) {
1908
- for (const item of value) {
1909
- headers.append(key, item);
1910
- }
1911
- continue;
1912
- }
1913
- headers.set(key, value);
1914
- }
1915
- return new Request(fullUrl, {
1916
- method: req.method,
1917
- headers,
1918
- body
1919
- });
1920
- }
1921
- function normalizeIntegrationRequestMethod(method) {
1922
- return method ? method.toUpperCase() : void 0;
1923
- }
1924
- function matchesMethod(methods, normalizedMethod) {
1925
- return methods.some((candidate) => candidate === "ALL" || candidate === normalizedMethod);
1926
- }
1927
- function getRequestId(req) {
1928
- const headerValue = req.headers["x-request-id"];
1929
- if (Array.isArray(headerValue)) {
1930
- return headerValue[0] || String(Date.now());
1931
- }
1932
- return headerValue || String(Date.now());
1933
- }
1934
- function normalizeMatcher(matcher) {
1935
- if (!matcher) {
1936
- return "/(.*)";
1937
- }
1938
- return typeof matcher === "string" ? matcher : matcher.join(", ");
1939
- }
1940
-
1941
- export {
1942
- FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY,
1943
- FARM_INTEGRATION_SET_COOKIES_KEY,
1944
- forwardIntegrationSetCookies,
1945
- defineIntegrationSchema,
1946
- getFarmIntegrationPluginServerRuntime,
1947
- getFarmIntegrationPluginOwner,
1948
- createIntegrationRoute,
1949
- integrationRoute,
1950
- defineIntegration,
1951
- resolveIntegrationPlugins,
1952
- getIntegrationProviders,
1953
- isFarmIntegrationProviderComponentReference,
1954
- getIntegrationDocumentNavigationMatchers,
1955
- getIntegrationSchemas,
1956
- getRegisteredIntegrationRuntime,
1957
- getRegisteredIntegrations,
1958
- getRegisteredIntegrationSchemas,
1959
- matchIntegrationRoute,
1960
- matchRegisteredIntegrationRoute,
1961
- getRegisteredIntegrationAPIManifest,
1962
- dispatchIntegrationRequest,
1963
- dispatchIntegrationRequests
1964
- };