@farm.js/core 0.1.39 → 0.1.41

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 (374) hide show
  1. package/dist/{agent-mcp-HcTYQmNX.d.ts → agent-mcp-BOqIxJLI.d.mts} +8 -2
  2. package/dist/{agent-mcp-BhneNPb4.d.mts → agent-mcp-D0eZKfci.d.ts} +8 -2
  3. package/dist/{agent-mcp-handler-OLRMZONF.mjs → agent-mcp-handler-HVV5LNXF.mjs} +6 -6
  4. package/dist/{agent-mcp-handler-MRGP3WJ3.cjs → agent-mcp-handler-YKG7KVCY.cjs} +7 -7
  5. package/dist/agent-runtime.cjs +10 -6
  6. package/dist/agent-runtime.d.mts +6 -8
  7. package/dist/agent-runtime.d.ts +6 -8
  8. package/dist/agent-runtime.mjs +9 -5
  9. package/dist/api/client.cjs +3 -3
  10. package/dist/api/client.d.mts +3 -3
  11. package/dist/api/client.d.ts +3 -3
  12. package/dist/api/client.mjs +2 -2
  13. package/dist/api/route-manager.cjs +15 -13
  14. package/dist/api/route-manager.d.mts +8 -10
  15. package/dist/api/route-manager.d.ts +8 -10
  16. package/dist/api/route-manager.mjs +14 -12
  17. package/dist/api/runtime.cjs +12 -10
  18. package/dist/api/runtime.d.mts +7 -9
  19. package/dist/api/runtime.d.ts +7 -9
  20. package/dist/api/runtime.mjs +11 -9
  21. package/dist/{api-client-CyFtZFJ4.d.ts → api-client-BJv9mTbO.d.ts} +2 -2
  22. package/dist/{api-client-BjMmY8OD.d.mts → api-client-Dk9QOLwr.d.mts} +2 -2
  23. package/dist/api.cjs +17 -15
  24. package/dist/api.d.mts +10 -12
  25. package/dist/api.d.ts +10 -12
  26. package/dist/api.mjs +16 -14
  27. package/dist/{app-DVzmmbNO.d.mts → app-CzTSMJaf.d.mts} +12 -5
  28. package/dist/{app-CMkoghtp.d.ts → app-DM8e1z3G.d.ts} +12 -5
  29. package/dist/app-markdown.cjs +7 -6
  30. package/dist/app-markdown.d.mts +7 -9
  31. package/dist/app-markdown.d.ts +7 -9
  32. package/dist/app-markdown.mjs +6 -5
  33. package/dist/cache.cjs +6 -3
  34. package/dist/cache.d.mts +23 -2
  35. package/dist/cache.d.ts +23 -2
  36. package/dist/cache.mjs +5 -2
  37. package/dist/{chunk-EGCTIS5F.mjs → chunk-24SP5TGU.mjs} +1 -1
  38. package/dist/{chunk-2ZYGC6SS.cjs → chunk-25LPIZSX.cjs} +3 -3
  39. package/dist/{chunk-ARC7I3O2.mjs → chunk-26RUNDIR.mjs} +1 -1
  40. package/dist/{chunk-472NCAZ7.cjs → chunk-2FUIT2G2.cjs} +3 -3
  41. package/dist/{chunk-YFYUYWL7.cjs → chunk-32TZ3QTP.cjs} +723 -454
  42. package/dist/{chunk-CQMVIOYP.mjs → chunk-35WS7P2V.mjs} +29 -131
  43. package/dist/{chunk-QTXBII4Z.cjs → chunk-3TB5QGUW.cjs} +5 -5
  44. package/dist/chunk-45QJHGZM.cjs +1063 -0
  45. package/dist/{chunk-677THUVP.mjs → chunk-4C7KTKX7.mjs} +1 -1
  46. package/dist/{chunk-FUZEBRP3.mjs → chunk-4GP3XZ4Z.mjs} +5 -3
  47. package/dist/{chunk-KTSUBU2E.mjs → chunk-4KQDHTWX.mjs} +2 -2
  48. package/dist/chunk-4TLUFAIP.cjs +92 -0
  49. package/dist/chunk-4U5XZDLG.cjs +80 -0
  50. package/dist/{chunk-P664ZVTV.mjs → chunk-4ZZNPK25.mjs} +2 -2
  51. package/dist/{chunk-KIIMAWOJ.cjs → chunk-5NAVKJCZ.cjs} +35 -105
  52. package/dist/{chunk-LSKZMJMP.cjs → chunk-64SBBZDU.cjs} +38 -1
  53. package/dist/chunk-6BWKJ6QS.cjs +43 -0
  54. package/dist/{chunk-JSROZYYO.cjs → chunk-6D24SDKO.cjs} +1 -20
  55. package/dist/chunk-6IZWX6ES.cjs +74 -0
  56. package/dist/{chunk-QRKIMN7T.mjs → chunk-6LVRDOAW.mjs} +32 -6
  57. package/dist/{chunk-YWN746US.cjs → chunk-6MVFHNYZ.cjs} +85 -54
  58. package/dist/{chunk-VWBHM3F6.mjs → chunk-6PKXK4TY.mjs} +3 -3
  59. package/dist/chunk-6QOLZITB.cjs +22 -0
  60. package/dist/{chunk-OAHTRMIC.mjs → chunk-724JLMS4.mjs} +11 -11
  61. package/dist/chunk-7GNWGLWB.mjs +14 -0
  62. package/dist/{chunk-34UCJRQO.cjs → chunk-7RNAKBWF.cjs} +2 -2
  63. package/dist/{chunk-U6QLDL3G.mjs → chunk-7UEEHAW7.mjs} +1 -1
  64. package/dist/{chunk-UPJLHLJU.cjs → chunk-ALPWLT27.cjs} +4 -4
  65. package/dist/{chunk-ATSDUUFK.mjs → chunk-AX7S67YV.mjs} +33 -40
  66. package/dist/{chunk-MSSFIQGM.mjs → chunk-B2GSRB3P.mjs} +41 -10
  67. package/dist/chunk-BGGWKZ2V.mjs +6096 -0
  68. package/dist/{chunk-H5CLOUZS.cjs → chunk-BMOBTMDR.cjs} +5 -5
  69. package/dist/{chunk-Q2KB32T4.mjs → chunk-BPNRQ5BA.mjs} +6 -6
  70. package/dist/{chunk-E2ROOWQC.cjs → chunk-BPOTSHDO.cjs} +24 -87
  71. package/dist/chunk-BRYPZIMB.mjs +6 -0
  72. package/dist/{chunk-WFRT7JPX.mjs → chunk-BYQVROIP.mjs} +2 -2
  73. package/dist/{chunk-HALDNTIV.mjs → chunk-BYR3RQPB.mjs} +10 -73
  74. package/dist/{chunk-5PWXMJOH.cjs → chunk-C5KVWHIH.cjs} +36 -36
  75. package/dist/chunk-CALY6QG6.mjs +963 -0
  76. package/dist/{chunk-WC5UV2HQ.cjs → chunk-CBXBGM72.cjs} +2 -2
  77. package/dist/{chunk-WW46B6HA.cjs → chunk-CGR525MJ.cjs} +84 -45
  78. package/dist/{chunk-6V4TDWEC.cjs → chunk-CGVPXIRN.cjs} +18 -1
  79. package/dist/chunk-COABSY3U.mjs +196 -0
  80. package/dist/chunk-CZS6OACQ.mjs +63 -0
  81. package/dist/{chunk-SGBJ247Q.cjs → chunk-D4ROBNTK.cjs} +2 -2
  82. package/dist/{chunk-WEW2JVA4.cjs → chunk-D5IHNDHI.cjs} +6 -6
  83. package/dist/{chunk-QG775BRV.cjs → chunk-D64OPY6A.cjs} +72 -54
  84. package/dist/{chunk-QUCXCDE2.cjs → chunk-EH3464KF.cjs} +1 -1
  85. package/dist/{chunk-75HN5IZ3.mjs → chunk-ENOBPDKZ.mjs} +21 -19
  86. package/dist/{chunk-HD5CF3OE.mjs → chunk-ETPEZLS3.mjs} +2 -2
  87. package/dist/{chunk-HRETEZ2Z.cjs → chunk-EX4MKHXN.cjs} +37 -35
  88. package/dist/{chunk-TO4GJ56K.cjs → chunk-FEYQCYT7.cjs} +58 -18
  89. package/dist/chunk-FGH3ZXTP.mjs +1063 -0
  90. package/dist/{chunk-CUM5NYL5.mjs → chunk-FIAPD365.mjs} +1 -1
  91. package/dist/{chunk-HYTZYOW2.mjs → chunk-FJGIVDA5.mjs} +1197 -7906
  92. package/dist/chunk-FVPXT2JR.cjs +63 -0
  93. package/dist/{chunk-MYIZXDZA.mjs → chunk-FWCGUVVL.mjs} +1 -1
  94. package/dist/{chunk-D2ULAULS.cjs → chunk-FXFKIJDA.cjs} +9 -7
  95. package/dist/{chunk-RW63BOV7.cjs → chunk-GB7LDGY5.cjs} +2 -2
  96. package/dist/chunk-GC3EM6H4.mjs +80 -0
  97. package/dist/{chunk-E3UK5IIB.cjs → chunk-GS3WR5HX.cjs} +5 -3
  98. package/dist/{chunk-QFW2IH5E.mjs → chunk-GZTUT75U.mjs} +5 -2
  99. package/dist/chunk-H3EGVQE5.mjs +22 -0
  100. package/dist/chunk-HANGSYMB.mjs +67 -0
  101. package/dist/{chunk-RSOJ7DRT.mjs → chunk-HCSVR4YZ.mjs} +1 -58
  102. package/dist/{chunk-QYMZOOC5.mjs → chunk-HJ64F4GS.mjs} +12 -44
  103. package/dist/{chunk-P3PLW4FR.mjs → chunk-HKFBMHCD.mjs} +4 -4
  104. package/dist/{chunk-BXDJXFQG.cjs → chunk-I5MG3TKE.cjs} +4 -4
  105. package/dist/{chunk-VNGH5MLF.mjs → chunk-I6UVKUYK.mjs} +1 -1
  106. package/dist/{chunk-EPYU2EBL.mjs → chunk-IF4NU2NG.mjs} +1 -1
  107. package/dist/{chunk-WXJLNP33.cjs → chunk-IFWSR7YZ.cjs} +9 -7
  108. package/dist/{chunk-IVLZZZEI.mjs → chunk-IM7DY3ED.mjs} +1 -1
  109. package/dist/{chunk-W36M2BQ4.mjs → chunk-IN6RCKLL.mjs} +6 -5
  110. package/dist/{chunk-F5QO4FNE.mjs → chunk-INQ64HTJ.mjs} +43 -11
  111. package/dist/{chunk-SDOTRX3V.cjs → chunk-JEIG3EWE.cjs} +8 -8
  112. package/dist/{chunk-UWPLULNK.mjs → chunk-JGHCKIRI.mjs} +84 -24
  113. package/dist/{chunk-BFJTHYTN.mjs → chunk-JIYYX7WU.mjs} +10 -8
  114. package/dist/{chunk-CIOT4HGT.cjs → chunk-JOTUZIM4.cjs} +14 -14
  115. package/dist/{chunk-SKVTP5PR.mjs → chunk-JOW4HDJO.mjs} +1 -62
  116. package/dist/{chunk-6MVFL3R5.cjs → chunk-JR4QCLJY.cjs} +1 -58
  117. package/dist/{chunk-CGBDNNSM.cjs → chunk-KEXK442I.cjs} +44 -12
  118. package/dist/{chunk-FUCSUGDM.cjs → chunk-KF6VDJH7.cjs} +3 -3
  119. package/dist/{chunk-EA5K5BKU.mjs → chunk-KNHBTJP6.mjs} +18 -1
  120. package/dist/{chunk-MVL2RAJW.mjs → chunk-KYN5ODF6.mjs} +1 -1
  121. package/dist/{chunk-LMPAPBUA.cjs → chunk-L6A26QT5.cjs} +36 -68
  122. package/dist/{chunk-RVXFINNS.cjs → chunk-L6HYACBE.cjs} +31 -31
  123. package/dist/chunk-LFHCG2DU.mjs +43 -0
  124. package/dist/{chunk-5OKBARDN.cjs → chunk-LIZTLA5F.cjs} +12 -11
  125. package/dist/{chunk-HXRYZWTA.mjs → chunk-LLUA2LSC.mjs} +3 -3
  126. package/dist/{chunk-B5J2YVG7.cjs → chunk-LYIZHJTK.cjs} +2 -2
  127. package/dist/{chunk-3UEVPCGW.mjs → chunk-MEASUNVY.mjs} +6 -1
  128. package/dist/{chunk-FZ6YYU2W.mjs → chunk-MGMF4VP7.mjs} +38 -1
  129. package/dist/{chunk-CNNOLE4O.mjs → chunk-MHHCLYXU.mjs} +1 -1
  130. package/dist/{chunk-HRSAQ23K.cjs → chunk-MHN4UR5U.cjs} +4 -4
  131. package/dist/{chunk-3LOLJTFV.cjs → chunk-MN4TQJ3W.cjs} +11 -11
  132. package/dist/{chunk-PGZDEPTM.cjs → chunk-MY5PZYAD.cjs} +10 -10
  133. package/dist/{chunk-ZXH4TS3F.cjs → chunk-NBPNUQYO.cjs} +3 -64
  134. package/dist/{chunk-VXEEATVD.cjs → chunk-NFG4PUPI.cjs} +2 -2
  135. package/dist/{chunk-INL3THCU.mjs → chunk-O7USYJ4U.mjs} +1 -1
  136. package/dist/{chunk-4ZFL5GFN.cjs → chunk-OILHPMFX.cjs} +86 -26
  137. package/dist/{chunk-AJQTP4OO.mjs → chunk-OJ7JP7RJ.mjs} +1 -1
  138. package/dist/chunk-OQ4YXWH4.cjs +6097 -0
  139. package/dist/{chunk-DMEPTZTI.mjs → chunk-P2UJF4SS.mjs} +47 -7
  140. package/dist/{chunk-T5OJPTVN.cjs → chunk-P4TYB4SF.cjs} +2 -2
  141. package/dist/chunk-P7XDC7UJ.mjs +92 -0
  142. package/dist/{chunk-SHLXACIO.cjs → chunk-PJ42JESY.cjs} +1 -9
  143. package/dist/{chunk-5ULKUBIA.cjs → chunk-PN676AZF.cjs} +6 -6
  144. package/dist/{chunk-YKZRDB5Z.mjs → chunk-PYHPXPSW.mjs} +2 -2
  145. package/dist/{chunk-KMTGADN3.mjs → chunk-QCVIRVHE.mjs} +1 -9
  146. package/dist/{chunk-5D2JIPLH.cjs → chunk-QEILRWVV.cjs} +36 -138
  147. package/dist/{chunk-XKG2BLFN.cjs → chunk-QIBP5EFA.cjs} +18 -35
  148. package/dist/{chunk-ZUPXLIGB.mjs → chunk-R65GCA6A.mjs} +647 -378
  149. package/dist/{chunk-BWIQR4DH.cjs → chunk-RHGK2JEN.cjs} +56 -63
  150. package/dist/{chunk-AS2VPMEE.cjs → chunk-ROQ4C4LJ.cjs} +1465 -8174
  151. package/dist/{chunk-QV4VE2OW.mjs → chunk-S6ENKNNG.mjs} +5 -3
  152. package/dist/{chunk-RWFLWR5J.cjs → chunk-S7MTDRYA.cjs} +17 -15
  153. package/dist/{chunk-PVZE2JGJ.mjs → chunk-SGB4IW7K.mjs} +43 -25
  154. package/dist/{chunk-GKBWWRBG.mjs → chunk-SVPGWJZF.mjs} +12 -12
  155. package/dist/{chunk-EKN7NSZO.cjs → chunk-SZLNU3GJ.cjs} +8 -5
  156. package/dist/chunk-TI7UANHI.cjs +77 -0
  157. package/dist/{chunk-6BK3K2GB.mjs → chunk-UIDWEU7M.mjs} +83 -44
  158. package/dist/{chunk-MLY2RP5R.mjs → chunk-ULQOP5UI.mjs} +6 -2
  159. package/dist/chunk-UNJZGVPU.cjs +6 -0
  160. package/dist/{chunk-5BWWFHR2.mjs → chunk-UQUEANTY.mjs} +3 -3
  161. package/dist/chunk-VDRM36QB.cjs +963 -0
  162. package/dist/chunk-VHRS3MCW.cjs +196 -0
  163. package/dist/{chunk-SOP2EAA6.mjs → chunk-VLPII2JJ.mjs} +1 -1
  164. package/dist/{chunk-RG4A6LB2.cjs → chunk-VNPXKF3G.cjs} +7 -7
  165. package/dist/chunk-VQDBNVOO.cjs +14 -0
  166. package/dist/chunk-VQGKD7RV.mjs +25 -0
  167. package/dist/{chunk-6HB6V3R7.mjs → chunk-VTBXE6QG.mjs} +10 -27
  168. package/dist/{chunk-ZMSZZXOR.mjs → chunk-WDMIW6Q6.mjs} +0 -19
  169. package/dist/{chunk-NBBEQLOK.cjs → chunk-WLHA5USH.cjs} +9 -9
  170. package/dist/{chunk-BZHXGVMA.mjs → chunk-WMBRZI5V.mjs} +5 -3
  171. package/dist/{chunk-4WVJLURN.mjs → chunk-WMHG64DA.mjs} +1 -1
  172. package/dist/{chunk-JCYYXBAJ.cjs → chunk-WROEFVNO.cjs} +3 -3
  173. package/dist/{chunk-A657YSP4.cjs → chunk-WSOBCAYO.cjs} +37 -35
  174. package/dist/{chunk-IWZKTWHZ.cjs → chunk-WU7ZS3EM.cjs} +7 -2
  175. package/dist/{chunk-J63ZH5OQ.cjs → chunk-X3GMHKO3.cjs} +2 -2
  176. package/dist/{chunk-POSPE3IO.mjs → chunk-X3NGFVRF.mjs} +61 -21
  177. package/dist/{chunk-VT4WFRHA.mjs → chunk-XUC6CFLE.mjs} +1 -1
  178. package/dist/chunk-Y5RG6B7S.mjs +77 -0
  179. package/dist/{chunk-EIPC3FDA.cjs → chunk-YWCYV7QC.cjs} +9 -5
  180. package/dist/{chunk-WLL43JMO.mjs → chunk-YYQVGKO5.mjs} +7 -5
  181. package/dist/chunk-YZAKIXRL.cjs +67 -0
  182. package/dist/chunk-ZQRCSUSB.cjs +25 -0
  183. package/dist/{chunk-6XWDE2P2.cjs → chunk-ZTP3BJG6.cjs} +64 -24
  184. package/dist/{chunk-ZMMBIVQM.mjs → chunk-ZZGQD7A4.mjs} +16 -86
  185. package/dist/{client-plugins-CsCuCLBz.d.mts → client-plugins-CkYwvDJ0.d.mts} +2545 -2665
  186. package/dist/{client-plugins-D0ke-Hc8.d.ts → client-plugins-DfeKd0sD.d.ts} +2545 -2665
  187. package/dist/client-plugins.d.mts +6 -8
  188. package/dist/client-plugins.d.ts +6 -8
  189. package/dist/client.cjs +5 -5
  190. package/dist/client.d.mts +12 -13
  191. package/dist/client.d.ts +12 -13
  192. package/dist/client.mjs +4 -4
  193. package/dist/client.react-server.mjs +2 -0
  194. package/dist/config.d.mts +6 -8
  195. package/dist/config.d.ts +6 -8
  196. package/dist/{devtools-LW4QQ5J3.cjs → devtools-2YHAJYH6.cjs} +21 -18
  197. package/dist/{devtools-5AFIPVUJ.mjs → devtools-N3QLRIQU.mjs} +20 -17
  198. package/dist/docs.cjs +23 -20
  199. package/dist/docs.d.mts +7 -9
  200. package/dist/docs.d.ts +7 -9
  201. package/dist/docs.mjs +22 -19
  202. package/dist/{endpoint-CA-TNX60.d.ts → endpoint-BOE0IAaG.d.ts} +6 -3
  203. package/dist/{endpoint-CCHFqyTE.d.mts → endpoint-DGZRZHux.d.mts} +6 -3
  204. package/dist/environment/vite.cjs +6 -2
  205. package/dist/environment/vite.d.mts +11 -2
  206. package/dist/environment/vite.d.ts +11 -2
  207. package/dist/environment/vite.mjs +5 -1
  208. package/dist/headers.cjs +4 -4
  209. package/dist/headers.mjs +3 -3
  210. package/dist/image/server.cjs +7 -3
  211. package/dist/image/server.d.mts +10 -2
  212. package/dist/image/server.d.ts +10 -2
  213. package/dist/image/server.mjs +6 -2
  214. package/dist/image/sharp.cjs +12 -10
  215. package/dist/image/sharp.d.mts +1 -1
  216. package/dist/image/sharp.d.ts +1 -1
  217. package/dist/image/sharp.mjs +4 -2
  218. package/dist/{image-config-Duob7wER.d.ts → image-config-BpH1q5R8.d.mts} +4 -1
  219. package/dist/{image-config-Duob7wER.d.mts → image-config-BpH1q5R8.d.ts} +4 -1
  220. package/dist/image.d.mts +1 -1
  221. package/dist/image.d.ts +1 -1
  222. package/dist/index.cjs +90 -68
  223. package/dist/index.d.mts +28 -145
  224. package/dist/index.d.ts +28 -145
  225. package/dist/index.mjs +103 -81
  226. package/dist/{integration-api-BPJo5oXb.d.ts → integration-api-BuPHMeKz.d.ts} +2 -2
  227. package/dist/{integration-api-0y4FXJpC.d.mts → integration-api-DWyMmvrR.d.mts} +2 -2
  228. package/dist/integration-orm-P2II2EBK.cjs +14 -0
  229. package/dist/{integration-orm-KV5B3BGZ.mjs → integration-orm-RBKCIQYZ.mjs} +4 -3
  230. package/dist/integrations.cjs +7 -5
  231. package/dist/integrations.d.mts +8 -10
  232. package/dist/integrations.d.ts +8 -10
  233. package/dist/integrations.mjs +6 -4
  234. package/dist/internal/app-markdown-runtime.cjs +6 -5
  235. package/dist/internal/app-markdown-runtime.d.mts +7 -9
  236. package/dist/internal/app-markdown-runtime.d.ts +7 -9
  237. package/dist/internal/app-markdown-runtime.mjs +5 -4
  238. package/dist/internal/build-runtime.cjs +57 -56
  239. package/dist/internal/build-runtime.d.mts +8 -10
  240. package/dist/internal/build-runtime.d.ts +8 -10
  241. package/dist/internal/build-runtime.mjs +56 -55
  242. package/dist/internal/cli-runtime.cjs +37 -31
  243. package/dist/internal/cli-runtime.mjs +37 -31
  244. package/dist/internal/client-error-overlay.cjs +4 -4
  245. package/dist/internal/client-error-overlay.mjs +1 -1
  246. package/dist/internal/compression-runtime.d.mts +6 -8
  247. package/dist/internal/compression-runtime.d.ts +6 -8
  248. package/dist/internal/config-runtime.cjs +21 -18
  249. package/dist/internal/config-runtime.d.mts +7 -9
  250. package/dist/internal/config-runtime.d.ts +7 -9
  251. package/dist/internal/config-runtime.mjs +20 -17
  252. package/dist/internal/docs-precompiled-runtime.cjs +3 -3
  253. package/dist/internal/docs-precompiled-runtime.mjs +2 -2
  254. package/dist/internal/infra-analytics-runtime.cjs +7 -7
  255. package/dist/internal/infra-analytics-runtime.mjs +5 -5
  256. package/dist/internal/metadata-image-runtime.cjs +4 -3
  257. package/dist/internal/metadata-image-runtime.mjs +3 -2
  258. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  259. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  260. package/dist/internal/production-node-env.cjs +2 -2
  261. package/dist/internal/production-node-env.mjs +1 -1
  262. package/dist/internal/production-runtime.cjs +53 -28
  263. package/dist/internal/production-runtime.d.mts +46 -15
  264. package/dist/internal/production-runtime.d.ts +46 -15
  265. package/dist/internal/production-runtime.mjs +57 -32
  266. package/dist/layers-CM5i6T7z.d.mts +55 -0
  267. package/dist/layers-CM5i6T7z.d.ts +55 -0
  268. package/dist/markdown.cjs +4 -4
  269. package/dist/markdown.d.mts +6 -8
  270. package/dist/markdown.d.ts +6 -8
  271. package/dist/markdown.mjs +3 -3
  272. package/dist/middleware.cjs +16 -10
  273. package/dist/middleware.d.mts +8 -10
  274. package/dist/middleware.d.ts +8 -10
  275. package/dist/middleware.mjs +19 -13
  276. package/dist/navigation.cjs +4 -4
  277. package/dist/navigation.d.mts +9 -10
  278. package/dist/navigation.d.ts +9 -10
  279. package/dist/navigation.mjs +3 -3
  280. package/dist/{nitro-MPZJGPXK.mjs → nitro-KDACKNHU.mjs} +3 -2
  281. package/dist/{nitro-7F65EZZS.cjs → nitro-NPGU6VBT.cjs} +4 -3
  282. package/dist/observability.cjs +2 -2
  283. package/dist/observability.mjs +1 -1
  284. package/dist/plugin-DBBZ4JI2.cjs +32 -0
  285. package/dist/plugin-SYMK7PQ2.mjs +32 -0
  286. package/dist/plugin.cjs +56 -43
  287. package/dist/plugin.d.mts +25 -8
  288. package/dist/plugin.d.ts +25 -8
  289. package/dist/plugin.mjs +57 -44
  290. package/dist/{production-runtime-DfRP0cV0.d.mts → production-runtime-BTkXQdYy.d.mts} +17 -3
  291. package/dist/{production-runtime-BaI3WHnV.d.ts → production-runtime-DFC7pgbp.d.ts} +17 -3
  292. package/dist/query/client.cjs +2 -2
  293. package/dist/query/client.mjs +3 -3
  294. package/dist/{render-plan-Dg8RBYFa.d.mts → render-plan-5rFeWmk7.d.mts} +1 -1
  295. package/dist/{render-plan-CfIdJKAf.d.ts → render-plan-BoAK9xFC.d.ts} +1 -1
  296. package/dist/renderer-client.d.mts +8 -9
  297. package/dist/renderer-client.d.ts +8 -9
  298. package/dist/{request-DfE02G_A.d.mts → request-BxBWigtl.d.mts} +1 -1
  299. package/dist/{request-CEbHIIl4.d.ts → request-fciwmd3n.d.ts} +1 -1
  300. package/dist/request.cjs +3 -3
  301. package/dist/request.d.mts +7 -9
  302. package/dist/request.d.ts +7 -9
  303. package/dist/request.mjs +2 -2
  304. package/dist/{route-rendering-C4oHbv6C.d.ts → route-rendering-BCM1QzEf.d.mts} +1 -1
  305. package/dist/{route-rendering-BHyOfXjD.d.mts → route-rendering-BLZT0IP0.d.ts} +1 -1
  306. package/dist/{router-uRN_29Em.d.ts → router-CkheNX3-.d.ts} +1 -1
  307. package/dist/{router-DwhA61SB.d.mts → router-DyZJWc1_.d.mts} +1 -1
  308. package/dist/routes.cjs +6 -5
  309. package/dist/routes.d.mts +6 -8
  310. package/dist/routes.d.ts +6 -8
  311. package/dist/routes.mjs +5 -4
  312. package/dist/{runtime-COk03hmx.d.ts → runtime-DfU4sKa5.d.ts} +3 -3
  313. package/dist/{runtime-BEdHhN4C.d.mts → runtime-wexvUN5J.d.mts} +3 -3
  314. package/dist/{schema-dev-notice-Y7MQEFGN.cjs → schema-dev-notice-5JPE67AI.cjs} +6 -4
  315. package/dist/{schema-dev-notice-O67CPXJ6.mjs → schema-dev-notice-WLPZ6WKU.mjs} +4 -2
  316. package/dist/server-action-security.cjs +4 -3
  317. package/dist/server-action-security.mjs +3 -2
  318. package/dist/server-client-bridge-DKWDl5NB.d.mts +7 -0
  319. package/dist/server-client-bridge-DKWDl5NB.d.ts +7 -0
  320. package/dist/server-fn-client.d.mts +3 -3
  321. package/dist/server-fn-client.d.ts +3 -3
  322. package/dist/server-fn.cjs +8 -7
  323. package/dist/server-fn.d.mts +1 -1
  324. package/dist/server-fn.d.ts +1 -1
  325. package/dist/server-fn.mjs +7 -6
  326. package/dist/server-plugins.cjs +5 -5
  327. package/dist/server-plugins.d.mts +7 -9
  328. package/dist/server-plugins.d.ts +7 -9
  329. package/dist/server-plugins.mjs +4 -4
  330. package/dist/server-query-client.d.mts +1 -1
  331. package/dist/server-query-client.d.ts +1 -1
  332. package/dist/server-query.cjs +9 -8
  333. package/dist/server-query.d.mts +1 -1
  334. package/dist/server-query.d.ts +1 -1
  335. package/dist/server-query.mjs +8 -7
  336. package/dist/server.cjs +97 -73
  337. package/dist/server.d.mts +18 -13
  338. package/dist/server.d.ts +18 -13
  339. package/dist/server.mjs +82 -58
  340. package/dist/{spa-router-DrVOBVGg.d.ts → spa-router-CcejECnG.d.ts} +2 -2
  341. package/dist/{spa-router-w4aFOuyn.d.mts → spa-router-DgsMXqfX.d.mts} +2 -2
  342. package/dist/ssg-1FGaFISl.d.ts +184 -0
  343. package/dist/ssg-Bg4bMMhM.d.mts +184 -0
  344. package/dist/storage.cjs +6 -2
  345. package/dist/storage.d.mts +9 -1
  346. package/dist/storage.d.ts +9 -1
  347. package/dist/storage.mjs +5 -1
  348. package/dist/testing.cjs +20 -18
  349. package/dist/testing.d.mts +7 -9
  350. package/dist/testing.d.ts +7 -9
  351. package/dist/testing.mjs +16 -14
  352. package/dist/theme/server.cjs +4 -4
  353. package/dist/theme/server.mjs +3 -3
  354. package/dist/{utils-Dhuqwmd2.d.ts → utils-8wtTYiH4.d.mts} +1 -1
  355. package/dist/{utils-BtYehqeU.d.mts → utils-Dxbh6Hgj.d.ts} +1 -1
  356. package/dist/version.cjs +2 -2
  357. package/dist/version.mjs +1 -1
  358. package/dist/vite.cjs +75 -46
  359. package/dist/vite.d.mts +130 -11
  360. package/dist/vite.d.ts +130 -11
  361. package/dist/vite.mjs +76 -47
  362. package/dist/{workflows-jZ4BcdoZ.d.ts → workflows-IWP1ddBm.d.mts} +5 -2
  363. package/dist/{workflows-jZ4BcdoZ.d.mts → workflows-IWP1ddBm.d.ts} +5 -2
  364. package/dist/workflows.cjs +4 -3
  365. package/dist/workflows.d.mts +1 -1
  366. package/dist/workflows.d.ts +1 -1
  367. package/dist/workflows.mjs +3 -2
  368. package/package.json +3 -1
  369. package/dist/chunk-3SDFA7UF.cjs +0 -701
  370. package/dist/chunk-DAO7JGTS.mjs +0 -73
  371. package/dist/chunk-E5GNDG5F.mjs +0 -701
  372. package/dist/chunk-SYQ3MOWW.cjs +0 -73
  373. package/dist/chunk-ULASELLA.cjs +0 -48
  374. package/dist/integration-orm-55F7CII5.cjs +0 -13
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkD2ULAULScjs = require('./chunk-D2ULAULS.cjs');
3
+ var _chunkFXFKIJDAcjs = require('./chunk-FXFKIJDA.cjs');
4
4
 
5
5
 
6
6
 
@@ -17,17 +17,19 @@ var _chunkD2ULAULScjs = require('./chunk-D2ULAULS.cjs');
17
17
 
18
18
 
19
19
 
20
+ var _chunkBPOTSHDOcjs = require('./chunk-BPOTSHDO.cjs');
20
21
 
21
22
 
22
23
 
23
24
 
24
- var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
25
25
 
26
+ var _chunk4U5XZDLGcjs = require('./chunk-4U5XZDLG.cjs');
26
27
 
27
- var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
28
28
 
29
+ var _chunk6D24SDKOcjs = require('./chunk-6D24SDKO.cjs');
29
30
 
30
- var _chunkBWIQR4DHcjs = require('./chunk-BWIQR4DH.cjs');
31
+
32
+ var _chunkRHGK2JENcjs = require('./chunk-RHGK2JEN.cjs');
31
33
 
32
34
 
33
35
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -40,8 +42,8 @@ function collectSchemaDependencies(owners) {
40
42
  const claimedKeys = /* @__PURE__ */ new Map();
41
43
  for (const owner of owners) {
42
44
  try {
43
- known.set(owner.name, _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner.name, owner.schema));
44
- for (const model of _chunkE2ROOWQCcjs.collectSchemaModels.call(void 0, [[owner.name, owner.schema, owner.models]])) {
45
+ known.set(owner.name, _chunk6D24SDKOcjs.resolveSchemaModels.call(void 0, owner.name, owner.schema));
46
+ for (const model of _chunkBPOTSHDOcjs.collectSchemaModels.call(void 0, [[owner.name, owner.schema, owner.models]])) {
45
47
  creators.set(model.modelName.toLowerCase(), owner.name);
46
48
  claimedKeys.set(model.modelKey, owner.name);
47
49
  }
@@ -65,12 +67,12 @@ function collectSchemaDependencies(owners) {
65
67
  if (creator && creator !== owner.name) needs.add(creator);
66
68
  }, "add");
67
69
  try {
68
- for (const model of _chunkE2ROOWQCcjs.collectSchemaModels.call(void 0, [[owner.name, owner.schema, owner.models]])) {
70
+ for (const model of _chunkBPOTSHDOcjs.collectSchemaModels.call(void 0, [[owner.name, owner.schema, owner.models]])) {
69
71
  for (const field of Object.values(model.model.fields)) {
70
72
  if (field.reference) add(referencedTable(owner.name, field.reference.model));
71
73
  }
72
74
  }
73
- for (const extension of _chunkE2ROOWQCcjs.collectSchemaExtensions.call(void 0, owner.name, owner.schema, owner.models)) {
75
+ for (const extension of _chunk4U5XZDLGcjs.collectSchemaExtensions.call(void 0, owner.name, owner.schema, owner.models)) {
74
76
  add(extension.table);
75
77
  }
76
78
  } catch (e2) {
@@ -119,17 +121,17 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, withTimeout, "withTimeout");
119
121
  var formatSeconds = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`, "formatSeconds");
120
122
  function collectSchemaOwners(config) {
121
123
  const owners = [];
122
- const integrationSchemas = _chunkBWIQR4DHcjs.getIntegrationSchemas.call(void 0, config.integrations);
124
+ const integrationSchemas = _chunkRHGK2JENcjs.getIntegrationSchemas.call(void 0, config.integrations);
123
125
  let integrationClient;
124
126
  for (const [name, schema] of Object.entries(integrationSchemas)) {
125
127
  owners.push({
126
128
  name,
127
129
  kind: "integration",
128
130
  schema,
129
- resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (resolved) => _nullishCoalesce(integrationClient, () => ( (integrationClient = _chunkD2ULAULScjs.resolveIntegrationOrmRuntimeClient.call(void 0, { config: resolved })))), "resolveClient")
131
+ resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (resolved) => _nullishCoalesce(integrationClient, () => ( (integrationClient = _chunkFXFKIJDAcjs.resolveIntegrationOrmRuntimeClient.call(void 0, { config: resolved })))), "resolveClient")
130
132
  });
131
133
  }
132
- for (const declaration of _chunkE2ROOWQCcjs.findSchemaTableOwners.call(void 0, config)) {
134
+ for (const declaration of _chunkBPOTSHDOcjs.findSchemaTableOwners.call(void 0, config)) {
133
135
  if (owners.some((owner) => owner.name === declaration.name)) continue;
134
136
  owners.push({
135
137
  name: declaration.name,
@@ -159,7 +161,7 @@ function resolveSchemaExecutor(client, owner, timeoutMs) {
159
161
  if (candidate === void 0 || candidate === null) continue;
160
162
  let adapter;
161
163
  try {
162
- adapter = _chunkE2ROOWQCcjs.createSchemaExecutor.call(void 0, candidate, owner);
164
+ adapter = _chunkBPOTSHDOcjs.createSchemaExecutor.call(void 0, candidate, owner);
163
165
  } catch (e3) {
164
166
  continue;
165
167
  }
@@ -179,7 +181,7 @@ function resolveSchemaExecutor(client, owner, timeoutMs) {
179
181
  return void 0;
180
182
  }
181
183
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveSchemaExecutor, "resolveSchemaExecutor");
182
- var describeReferencedTable = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (database, table) => _chunkE2ROOWQCcjs.describeSchemaTable.call(void 0, database.executor, database.dialect, table), "describeReferencedTable");
184
+ var describeReferencedTable = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (database, table) => _chunkBPOTSHDOcjs.describeSchemaTable.call(void 0, database.executor, database.dialect, table), "describeReferencedTable");
183
185
  async function checkSchema(config, options = {}) {
184
186
  const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( DEFAULT_TIMEOUT_MS));
185
187
  if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
@@ -191,7 +193,7 @@ async function checkSchema(config, options = {}) {
191
193
  const issues = [];
192
194
  const declared = /* @__PURE__ */ new Map();
193
195
  for (const candidate of _nullishCoalesce(config.plugins, () => ( []))) {
194
- const declaration = _chunkE2ROOWQCcjs.readSchemaTables.call(void 0, candidate);
196
+ const declaration = _chunk4U5XZDLGcjs.readSchemaTables.call(void 0, candidate);
195
197
  if (!declaration) continue;
196
198
  const schemas = _nullishCoalesce(declared.get(declaration.name), () => ( []));
197
199
  if (!schemas.includes(declaration.schema)) schemas.push(declaration.schema);
@@ -212,8 +214,8 @@ async function checkSchema(config, options = {}) {
212
214
  const ownedModels = /* @__PURE__ */ new Map();
213
215
  for (const owner of owners) {
214
216
  try {
215
- knownModels.set(owner.name, _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner.name, owner.schema));
216
- ownedModels.set(owner.name, _chunkE2ROOWQCcjs.collectSchemaModels.call(void 0, [[owner.name, owner.schema, owner.models]]));
217
+ knownModels.set(owner.name, _chunk6D24SDKOcjs.resolveSchemaModels.call(void 0, owner.name, owner.schema));
218
+ ownedModels.set(owner.name, _chunkBPOTSHDOcjs.collectSchemaModels.call(void 0, [[owner.name, owner.schema, owner.models]]));
217
219
  } catch (error) {
218
220
  issues.push({
219
221
  severity: "error",
@@ -329,7 +331,7 @@ async function checkSchema(config, options = {}) {
329
331
  for (const owner of owners) {
330
332
  if (!ownedModels.has(owner.name)) continue;
331
333
  try {
332
- const owned = _chunkE2ROOWQCcjs.collectSchemaExtensions.call(void 0, owner.name, owner.schema, owner.models);
334
+ const owned = _chunk4U5XZDLGcjs.collectSchemaExtensions.call(void 0, owner.name, owner.schema, owner.models);
333
335
  extensions.set(owner.name, owned);
334
336
  for (const extension of owned) {
335
337
  for (const { field } of extension.fields) {
@@ -369,9 +371,9 @@ async function checkSchema(config, options = {}) {
369
371
  const database = databases.get(owner.name);
370
372
  if (!models || !database) continue;
371
373
  try {
372
- const crossOwner = await _chunkE2ROOWQCcjs.planCrossOwnerReferences.call(void 0,
374
+ const crossOwner = await _chunkBPOTSHDOcjs.planCrossOwnerReferences.call(void 0,
373
375
  owner,
374
- _chunkE2ROOWQCcjs.findSchemaTableOwners.call(void 0, config),
376
+ _chunkBPOTSHDOcjs.findSchemaTableOwners.call(void 0, config),
375
377
  database.dialect,
376
378
  database.executor
377
379
  );
@@ -384,7 +386,7 @@ async function checkSchema(config, options = {}) {
384
386
  onDelete: reference.onDelete
385
387
  };
386
388
  }
387
- const stepPlan = _optionalChain([owner, 'access', _30 => _30.migrations, 'optionalAccess', _31 => _31.length]) ? await _chunkE2ROOWQCcjs.planOwnerSchemaSteps.call(void 0, {
389
+ const stepPlan = _optionalChain([owner, 'access', _30 => _30.migrations, 'optionalAccess', _31 => _31.length]) ? await _chunkBPOTSHDOcjs.planOwnerSchemaSteps.call(void 0, {
388
390
  owner: owner.name,
389
391
  schema: owner.schema,
390
392
  steps: owner.migrations,
@@ -399,15 +401,15 @@ async function checkSchema(config, options = {}) {
399
401
  const plan = await checkOwnerTables(
400
402
  owner,
401
403
  // What a pending rename will produce is not missing yet.
402
- _chunkE2ROOWQCcjs.withoutRenameTargets.call(void 0, models, stepPlan),
404
+ _chunkBPOTSHDOcjs.withoutRenameTargets.call(void 0, models, stepPlan),
403
405
  database.dialect,
404
406
  database.executor,
405
407
  issues
406
408
  );
407
409
  const pending = plan.statements.length + (_nullishCoalesce(_optionalChain([plan, 'access', _32 => _32.upgrades, 'optionalAccess', _33 => _33.length]), () => ( 0)));
408
- const state = pending > 0 ? await _chunkE2ROOWQCcjs.readSchemaState.call(void 0, database.executor, database.dialect, owner.name) : void 0;
409
- const changes = state ? _chunkE2ROOWQCcjs.diffSchemaSnapshots.call(void 0, state.snapshot, _chunkE2ROOWQCcjs.createSchemaSnapshot.call(void 0, models)) : void 0;
410
- if (state && changes && _chunkE2ROOWQCcjs.hasSchemaChanges.call(void 0, changes)) {
410
+ const state = pending > 0 ? await _chunkBPOTSHDOcjs.readSchemaState.call(void 0, database.executor, database.dialect, owner.name) : void 0;
411
+ const changes = state ? _chunkBPOTSHDOcjs.diffSchemaSnapshots.call(void 0, state.snapshot, _chunkBPOTSHDOcjs.createSchemaSnapshot.call(void 0, models)) : void 0;
412
+ if (state && changes && _chunkBPOTSHDOcjs.hasSchemaChanges.call(void 0, changes)) {
411
413
  const versions = state.version && owner.version && state.version !== owner.version ? `upgraded ${state.version} \u2192 ${owner.version}` : "changed since it was last migrated";
412
414
  issues.push({
413
415
  severity: "warning",
@@ -444,7 +446,7 @@ async function checkSchema(config, options = {}) {
444
446
  }
445
447
  _chunkS3JO3N4Hcjs.__name.call(void 0, checkSchema, "checkSchema");
446
448
  async function checkOwnerTables(owner, models, dialect, executor, issues) {
447
- const plan = await _chunkE2ROOWQCcjs.planSchemaMigration.call(void 0, models, dialect, executor);
449
+ const plan = await _chunkBPOTSHDOcjs.planSchemaMigration.call(void 0, models, dialect, executor);
448
450
  const present = /* @__PURE__ */ new Set([
449
451
  ...plan.upToDate,
450
452
  ...plan.drift.map((drift) => drift.table),
@@ -525,7 +527,7 @@ async function checkOwnerTables(owner, models, dialect, executor, issues) {
525
527
  table: key.table,
526
528
  column: key.column,
527
529
  message: `"${key.table}.${key.column}" has no foreign key to "${key.referencedTable}.${key.referencedColumn}", which ${owner.name} could have.`,
528
- hint: dialect === "sqlite" ? "SQLite can only add a foreign key when it creates the table." : `Allow it with \`${_chunkE2ROOWQCcjs.describeForeignKeyApproval.call(void 0, { owner: owner.name, modelKey: key.modelKey })}\` in farm.config, then run \`farm ${owner.name} migrate --apply\`. Rows that point at nothing are checked first.`
530
+ hint: dialect === "sqlite" ? "SQLite can only add a foreign key when it creates the table." : `Allow it with \`${_chunkBPOTSHDOcjs.describeForeignKeyApproval.call(void 0, { owner: owner.name, modelKey: key.modelKey })}\` in farm.config, then run \`farm ${owner.name} migrate --apply\`. Rows that point at nothing are checked first.`
529
531
  });
530
532
  }
531
533
  return plan;
@@ -609,9 +611,9 @@ async function checkReferences(owner, models, database, databases, resolveTarget
609
611
  continue;
610
612
  }
611
613
  if (database.dialect === "sqlite" || dialect === "sqlite") continue;
612
- const expected = _chunkE2ROOWQCcjs.getSqlColumnType.call(void 0, field, database.dialect);
613
- const mine = _chunkE2ROOWQCcjs.columnTypeFamily.call(void 0, expected);
614
- const theirs = _chunkE2ROOWQCcjs.columnTypeFamily.call(void 0, column.type);
614
+ const expected = _chunkBPOTSHDOcjs.getSqlColumnType.call(void 0, field, database.dialect);
615
+ const mine = _chunkBPOTSHDOcjs.columnTypeFamily.call(void 0, expected);
616
+ const theirs = _chunkBPOTSHDOcjs.columnTypeFamily.call(void 0, column.type);
615
617
  if (mine && theirs && mine !== theirs) {
616
618
  issues.push({
617
619
  severity: "warning",
@@ -630,7 +632,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, checkReferences, "checkReferences");
630
632
  async function checkExtensions(owner, extensions, databaseForTable, ownDatabase, allowExtend, issues) {
631
633
  for (const extension of extensions) {
632
634
  const database = _nullishCoalesce(databaseForTable(extension.table), () => ( ownDatabase));
633
- const table = await _chunkE2ROOWQCcjs.describeSchemaTable.call(void 0, database.executor, database.dialect, extension.table);
635
+ const table = await _chunkBPOTSHDOcjs.describeSchemaTable.call(void 0, database.executor, database.dialect, extension.table);
634
636
  const columns = extension.fields.map(({ field }) => field.name);
635
637
  if (!table) {
636
638
  issues.push({
@@ -643,7 +645,7 @@ async function checkExtensions(owner, extensions, databaseForTable, ownDatabase,
643
645
  });
644
646
  continue;
645
647
  }
646
- const allowed = _chunkE2ROOWQCcjs.isSchemaExtensionAllowed.call(void 0, allowExtend, extension);
648
+ const allowed = _chunk4U5XZDLGcjs.isSchemaExtensionAllowed.call(void 0, allowExtend, extension);
647
649
  for (const { field } of extension.fields) {
648
650
  const existing = table.columns.find(
649
651
  (column) => database.dialect === "postgres" ? column.name === field.name : column.name.toLowerCase() === field.name.toLowerCase()
@@ -657,14 +659,14 @@ async function checkExtensions(owner, extensions, databaseForTable, ownDatabase,
657
659
  table: extension.table,
658
660
  column: field.name,
659
661
  message: `${owner.name} needs "${extension.table}.${field.name}", which does not exist.`,
660
- hint: allowed ? `Add it with ${command}. If your ORM owns "${extension.table}", add the column to its schema instead.` : `Allow it in farm.config with \`${_chunkE2ROOWQCcjs.describeSchemaExtensionApproval.call(void 0, extension)}\`, then add it with ${command}. If your ORM owns "${extension.table}", add the column to its schema instead.`
662
+ hint: allowed ? `Add it with ${command}. If your ORM owns "${extension.table}", add the column to its schema instead.` : `Allow it in farm.config with \`${_chunk4U5XZDLGcjs.describeSchemaExtensionApproval.call(void 0, extension)}\`, then add it with ${command}. If your ORM owns "${extension.table}", add the column to its schema instead.`
661
663
  });
662
664
  continue;
663
665
  }
664
666
  if (database.dialect === "sqlite") continue;
665
- const expected = _chunkE2ROOWQCcjs.getSqlColumnType.call(void 0, field, database.dialect);
666
- const mine = _chunkE2ROOWQCcjs.columnTypeFamily.call(void 0, expected);
667
- const theirs = _chunkE2ROOWQCcjs.columnTypeFamily.call(void 0, existing.type);
667
+ const expected = _chunkBPOTSHDOcjs.getSqlColumnType.call(void 0, field, database.dialect);
668
+ const mine = _chunkBPOTSHDOcjs.columnTypeFamily.call(void 0, expected);
669
+ const theirs = _chunkBPOTSHDOcjs.columnTypeFamily.call(void 0, existing.type);
668
670
  if (mine && theirs && mine !== theirs) {
669
671
  issues.push({
670
672
  severity: "warning",
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkYWN746UScjs = require('./chunk-YWN746US.cjs');
3
+ var _chunk6MVFHNYZcjs = require('./chunk-6MVFHNYZ.cjs');
4
4
 
5
5
 
6
6
  var _chunkARJWXNQLcjs = require('./chunk-ARJWXNQL.cjs');
@@ -50,6 +50,11 @@ function createEndpoint(pathOrOptions, optionsOrHandler, maybeHandler) {
50
50
  if (typeof handler !== "function") {
51
51
  throw new TypeError("createEndpoint requires a handler function");
52
52
  }
53
+ if (options.use !== void 0) {
54
+ throw new TypeError(
55
+ "createEndpoint does not support the `use` option. Move these functions to `middleware`: each receives the endpoint context and returns an object, true, false, or a Response."
56
+ );
57
+ }
53
58
  const middleware = normalizeEndpointMiddleware(options.middleware);
54
59
  const errors = normalizeEndpointErrors(options.errors);
55
60
  const error = createEndpointErrorHandler(errors);
@@ -220,7 +225,7 @@ async function applyEndpointInvalidations(declaration, context, result) {
220
225
  "Endpoint invalidates must resolve to an array of { key }, { path }, or { tag } targets"
221
226
  );
222
227
  }
223
- return _chunkYWN746UScjs.applyFarmCacheInvalidationTargets.call(void 0, targets);
228
+ return _chunk6MVFHNYZcjs.applyFarmCacheInvalidationTargets.call(void 0, targets);
224
229
  }
225
230
  _chunkS3JO3N4Hcjs.__name.call(void 0, applyEndpointInvalidations, "applyEndpointInvalidations");
226
231
  function createInitialEndpointContext(value) {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
3
+ var _chunkGS3WR5HXcjs = require('./chunk-GS3WR5HX.cjs');
4
4
 
5
5
 
6
6
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -44,7 +44,7 @@ function emitFarmAgentRead(request, surface, status, view) {
44
44
  } catch (e) {
45
45
  return;
46
46
  }
47
- _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
47
+ _chunkGS3WR5HXcjs.emitFarmEvent.call(void 0, {
48
48
  type: "agent.read",
49
49
  surface,
50
50
  route,
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  _setAppRequestView,
3
3
  _setCspNonceResolver,
4
- _setCurrentRequestResolver
5
- } from "./chunk-QRKIMN7T.mjs";
4
+ _setCurrentRequestResolver,
5
+ _setSharedCacheScopeRunner
6
+ } from "./chunk-6LVRDOAW.mjs";
6
7
  import {
7
8
  __name
8
9
  } from "./chunk-LPEX4YW6.mjs";
@@ -23,6 +24,26 @@ function getRequestStore() {
23
24
  }
24
25
  __name(getRequestStore, "getRequestStore");
25
26
  var requestStore = getRequestStore();
27
+ var SHARED_CACHE_SCOPE_KEY = /* @__PURE__ */ Symbol.for("@farm.js/core/shared-cache-scope");
28
+ function getSharedCacheScopeStore() {
29
+ const runtime = globalThis;
30
+ const existing = runtime[SHARED_CACHE_SCOPE_KEY];
31
+ if (existing instanceof AsyncLocalStorage) return existing;
32
+ const storage = new AsyncLocalStorage();
33
+ runtime[SHARED_CACHE_SCOPE_KEY] = storage;
34
+ return storage;
35
+ }
36
+ __name(getSharedCacheScopeStore, "getSharedCacheScopeStore");
37
+ var sharedCacheScope = getSharedCacheScopeStore();
38
+ _setSharedCacheScopeRunner((label, fn) => sharedCacheScope.run(label, fn));
39
+ function _assertRequestReadAllowed(api) {
40
+ const scope = sharedCacheScope.getStore();
41
+ if (!scope) return;
42
+ throw new Error(
43
+ `${api} cannot be called inside ${scope}: its result is cached and shared by every request, so one visitor's request data would be served to others. Read it outside the cached function and pass the value in as an argument, which also makes it part of the cache key.`
44
+ );
45
+ }
46
+ __name(_assertRequestReadAllowed, "_assertRequestReadAllowed");
26
47
  var REQUEST_READS_KEY = /* @__PURE__ */ Symbol.for("@farm.js/core/request-reads");
27
48
  function getRequestReads() {
28
49
  const runtime = globalThis;
@@ -42,32 +63,49 @@ function getAppRequestView(request) {
42
63
  if (request.method !== "GET" && request.method !== "HEAD") {
43
64
  countRequestRead(request);
44
65
  view = request;
66
+ try {
67
+ guardRequestReads(view, request, request.headers, request.clone);
68
+ } catch {
69
+ }
45
70
  } else {
46
71
  view = new Request(request);
47
- Object.defineProperties(view, {
48
- // The rendered request's own signal, so aborting it reaches the handler unchanged.
49
- signal: { configurable: true, get: /* @__PURE__ */ __name(() => request.signal, "get") },
50
- headers: {
51
- configurable: true,
52
- get() {
53
- countRequestRead(request);
54
- return request.headers;
55
- }
56
- },
57
- clone: {
58
- configurable: true,
59
- value() {
60
- countRequestRead(request);
61
- return request.clone();
62
- }
63
- }
64
- });
72
+ Object.defineProperty(view, "signal", { configurable: true, get: /* @__PURE__ */ __name(() => request.signal, "get") });
73
+ guardRequestReads(view, request, request.headers, request.clone);
65
74
  }
66
75
  appRequestViews.set(request, view);
67
76
  return view;
68
77
  }
69
78
  __name(getAppRequestView, "getAppRequestView");
70
- _setCurrentRequestResolver(() => requestStore.getStore());
79
+ function guardRequestReads(view, request, requestHeaders, clone) {
80
+ Object.defineProperties(view, {
81
+ headers: {
82
+ configurable: true,
83
+ get() {
84
+ _assertRequestReadAllowed("request.headers");
85
+ countRequestRead(request);
86
+ return requestHeaders;
87
+ }
88
+ },
89
+ clone: {
90
+ configurable: true,
91
+ value() {
92
+ _assertRequestReadAllowed("request.clone()");
93
+ countRequestRead(request);
94
+ return clone.call(request);
95
+ }
96
+ }
97
+ });
98
+ }
99
+ __name(guardRequestReads, "guardRequestReads");
100
+ _setCurrentRequestResolver(
101
+ () => {
102
+ _assertRequestReadAllowed(
103
+ "A helper that reads the current request (such as auth.user() or the server api client)"
104
+ );
105
+ return requestStore.getStore();
106
+ },
107
+ () => requestStore.getStore()
108
+ );
71
109
  var CSP_NONCE_STORAGE_KEY = /* @__PURE__ */ Symbol.for("@farm.js/core/csp-nonce-storage");
72
110
  function getCspNonceStore() {
73
111
  const runtime = globalThis;
@@ -166,6 +204,7 @@ async function _runWithCurrentRequest(request, fn) {
166
204
  }
167
205
  __name(_runWithCurrentRequest, "_runWithCurrentRequest");
168
206
  function getCurrentRequest() {
207
+ _assertRequestReadAllowed("getCurrentRequest()");
169
208
  const request = requestStore.getStore();
170
209
  if (!request) {
171
210
  throw new Error(
@@ -186,6 +225,7 @@ function getCurrentRequestOrNull() {
186
225
  __name(getCurrentRequestOrNull, "getCurrentRequestOrNull");
187
226
 
188
227
  export {
228
+ _assertRequestReadAllowed,
189
229
  _runWithFarmCspNonce,
190
230
  resolveFarmRequestURL,
191
231
  resolveFarmWebRequestOrigin,
@@ -7,7 +7,7 @@ import {
7
7
  isAPIRouteRef,
8
8
  resolveServerFnInvalidateTargets,
9
9
  settleServerFnOptimisticUpdates
10
- } from "./chunk-ARC7I3O2.mjs";
10
+ } from "./chunk-26RUNDIR.mjs";
11
11
  import {
12
12
  notifyClientObserver
13
13
  } from "./chunk-72AK62H5.mjs";
@@ -0,0 +1,77 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-LPEX4YW6.mjs";
4
+
5
+ // src/plugin-runtime-endpoint.ts
6
+ function normalizeFarmPluginRuntimeEndpointPath(pathname, label = "Farm plugin runtime endpoint") {
7
+ if (typeof pathname !== "string" || pathname.trim() !== pathname || pathname.length === 0) {
8
+ throw new TypeError(`${label} path must be a non-empty pathname without surrounding spaces`);
9
+ }
10
+ if (!pathname.startsWith("/") || pathname.startsWith("//") || pathname.includes("?") || pathname.includes("#") || pathname.includes("*")) {
11
+ throw new TypeError(`${label} path must be an exact pathname such as "/status"`);
12
+ }
13
+ if (pathname.includes("\\") || Array.from(pathname).some((character) => {
14
+ const code = character.charCodeAt(0);
15
+ return code <= 31 || code >= 127 && code <= 159;
16
+ })) {
17
+ throw new TypeError(`${label} path cannot contain backslashes or control characters`);
18
+ }
19
+ for (const segment of pathname.split("/").slice(1)) {
20
+ let decoded = segment;
21
+ try {
22
+ decoded = decodeURIComponent(segment);
23
+ } catch {
24
+ throw new TypeError(`${label} path contains a malformed percent escape`);
25
+ }
26
+ if (decoded.includes("/") || decoded.includes("\\")) {
27
+ throw new TypeError(`${label} path cannot contain percent-encoded path separators`);
28
+ }
29
+ if (Array.from(decoded).some((character) => {
30
+ const code = character.charCodeAt(0);
31
+ return code <= 31 || code >= 127 && code <= 159;
32
+ })) {
33
+ throw new TypeError(`${label} path cannot contain control characters`);
34
+ }
35
+ if (decoded === "." || decoded === "..") {
36
+ throw new TypeError(`${label} path cannot contain dot segments`);
37
+ }
38
+ }
39
+ return normalizeRuntimeEndpointRequestPath(pathname);
40
+ }
41
+ __name(normalizeFarmPluginRuntimeEndpointPath, "normalizeFarmPluginRuntimeEndpointPath");
42
+ function normalizeRuntimeEndpointRequestPath(pathname) {
43
+ return pathname.length > 1 ? pathname.replace(/\/+$/, "") || "/" : pathname;
44
+ }
45
+ __name(normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
46
+ function farmPluginMayAffectRuntimePath(plugin, pathname) {
47
+ const runtime = plugin.runtime;
48
+ const endpoints = runtime?.endpoints;
49
+ const hasUnscopedRequestHooks = Boolean(
50
+ plugin.init || plugin.ready || plugin.shutdown || runtime?.context || runtime?.before || runtime?.after || runtime?.error || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
51
+ );
52
+ if (hasUnscopedRequestHooks) return true;
53
+ if (Array.isArray(endpoints) && endpoints.length > 0) {
54
+ const normalizedPathname = normalizeRuntimeEndpointRequestPath(pathname);
55
+ return endpoints.some(
56
+ (endpoint) => normalizeFarmPluginRuntimeEndpointPath(
57
+ endpoint.path,
58
+ `Farm plugin "${plugin.name}" runtime endpoint`
59
+ ) === normalizedPathname
60
+ );
61
+ }
62
+ return Boolean(plugin.setup || runtime?.start || runtime?.close);
63
+ }
64
+ __name(farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
65
+ function _farmPluginsKeepResponsesPrivate(plugins) {
66
+ return plugins.some(
67
+ (plugin) => typeof plugin?.runtime?.before === "function" && plugin.runtime.cache !== "public"
68
+ );
69
+ }
70
+ __name(_farmPluginsKeepResponsesPrivate, "_farmPluginsKeepResponsesPrivate");
71
+
72
+ export {
73
+ normalizeFarmPluginRuntimeEndpointPath,
74
+ normalizeRuntimeEndpointRequestPath,
75
+ farmPluginMayAffectRuntimePath,
76
+ _farmPluginsKeepResponsesPrivate
77
+ };
@@ -3,21 +3,24 @@
3
3
  var _chunkAI7QMY7Ocjs = require('./chunk-AI7QMY7O.cjs');
4
4
 
5
5
 
6
- var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
7
6
 
7
+ var _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.cjs');
8
8
 
9
- var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
9
+
10
+ var _chunk6IZWX6EScjs = require('./chunk-6IZWX6ES.cjs');
10
11
 
11
12
 
12
13
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
13
14
 
14
15
  // src/headers.ts
15
16
  function headers() {
16
- return new Headers(_chunk6XWDE2P2cjs.getCurrentRequest.call(void 0, ).headers);
17
+ _chunkZTP3BJG6cjs._assertRequestReadAllowed.call(void 0, "headers()");
18
+ return new Headers(_chunkZTP3BJG6cjs.getCurrentRequest.call(void 0, ).headers);
17
19
  }
18
20
  _chunkS3JO3N4Hcjs.__name.call(void 0, headers, "headers");
19
21
  function cookies() {
20
- const cookieHeader = _chunk6XWDE2P2cjs.getCurrentRequest.call(void 0, ).headers.get("cookie") || "";
22
+ _chunkZTP3BJG6cjs._assertRequestReadAllowed.call(void 0, "cookies()");
23
+ const cookieHeader = _chunkZTP3BJG6cjs.getCurrentRequest.call(void 0, ).headers.get("cookie") || "";
21
24
  const parsed = _chunkAI7QMY7Ocjs.parseRequestCookieHeader.call(void 0, cookieHeader);
22
25
  return {
23
26
  get(name) {
@@ -39,7 +42,8 @@ function cookies() {
39
42
  }
40
43
  _chunkS3JO3N4Hcjs.__name.call(void 0, cookies, "cookies");
41
44
  function getCspNonce() {
42
- return _chunkULASELLAcjs._resolveCurrentCspNonce.call(void 0, );
45
+ _chunkZTP3BJG6cjs._assertRequestReadAllowed.call(void 0, "getCspNonce()");
46
+ return _chunk6IZWX6EScjs._resolveCurrentCspNonce.call(void 0, );
43
47
  }
44
48
  _chunkS3JO3N4Hcjs.__name.call(void 0, getCspNonce, "getCspNonce");
45
49
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  findProgrammaticRouteFilesInDir
3
- } from "./chunk-MYIZXDZA.mjs";
3
+ } from "./chunk-FWCGUVVL.mjs";
4
4
  import {
5
5
  isFarmAPIRouteFileName
6
6
  } from "./chunk-CU625VAY.mjs";
@@ -17,21 +17,23 @@ import {
17
17
  matchAPIRouteAtBasePath,
18
18
  mergePluginAPIRoutes,
19
19
  resolveAPIRouteEndpoint
20
- } from "./chunk-6HB6V3R7.mjs";
20
+ } from "./chunk-VTBXE6QG.mjs";
21
21
  import {
22
22
  registerAPIRouteShape
23
23
  } from "./chunk-W3B4PKAW.mjs";
24
24
  import {
25
25
  createProgrammaticRouteModuleId
26
- } from "./chunk-EA5K5BKU.mjs";
26
+ } from "./chunk-KNHBTJP6.mjs";
27
27
  import {
28
28
  getFarmRouteRuntimeConfig,
29
29
  normalizeFarmRouteRuntimeConfig
30
30
  } from "./chunk-2J7W2WND.mjs";
31
31
  import {
32
- loadFarmDevModule,
33
32
  toFileModuleUrl
34
- } from "./chunk-KMTGADN3.mjs";
33
+ } from "./chunk-7GNWGLWB.mjs";
34
+ import {
35
+ loadFarmDevModule
36
+ } from "./chunk-QCVIRVHE.mjs";
35
37
  import {
36
38
  logger
37
39
  } from "./chunk-KI3MESHB.mjs";
@@ -0,0 +1,67 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
4
+
5
+ // src/middleware/server.ts
6
+ var _async_hooks = require('async_hooks');
7
+ var MIDDLEWARE_DATA_STORE_KEY = /* @__PURE__ */ Symbol.for("farm.middlewareDataStore");
8
+ var MIDDLEWARE_CONTEXT_STORE_KEY = /* @__PURE__ */ Symbol.for("farm.middlewareContextStore");
9
+ function getGlobalMiddlewareStore(key) {
10
+ const state = globalThis;
11
+ const existing = state[key];
12
+ if (existing instanceof _async_hooks.AsyncLocalStorage) {
13
+ return existing;
14
+ }
15
+ const store = new (0, _async_hooks.AsyncLocalStorage)();
16
+ state[key] = store;
17
+ return store;
18
+ }
19
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getGlobalMiddlewareStore, "getGlobalMiddlewareStore");
20
+ var middlewareStore = getGlobalMiddlewareStore(MIDDLEWARE_DATA_STORE_KEY);
21
+ var middlewareContextStore = getGlobalMiddlewareStore(MIDDLEWARE_CONTEXT_STORE_KEY);
22
+ function toMiddlewareMap(data) {
23
+ if (data instanceof Map) {
24
+ return new Map(data);
25
+ }
26
+ return new Map(Object.entries(data));
27
+ }
28
+ _chunkS3JO3N4Hcjs.__name.call(void 0, toMiddlewareMap, "toMiddlewareMap");
29
+ function _clearCurrentMiddlewareData() {
30
+ middlewareStore.enterWith(/* @__PURE__ */ new Map());
31
+ }
32
+ _chunkS3JO3N4Hcjs.__name.call(void 0, _clearCurrentMiddlewareData, "_clearCurrentMiddlewareData");
33
+ function _clearCurrentMiddlewareContext() {
34
+ middlewareContextStore.enterWith(/* @__PURE__ */ new Map());
35
+ }
36
+ _chunkS3JO3N4Hcjs.__name.call(void 0, _clearCurrentMiddlewareContext, "_clearCurrentMiddlewareContext");
37
+ async function _runWithMiddlewareData(data, fn) {
38
+ return middlewareStore.run(toMiddlewareMap(data), fn);
39
+ }
40
+ _chunkS3JO3N4Hcjs.__name.call(void 0, _runWithMiddlewareData, "_runWithMiddlewareData");
41
+ async function _runWithMiddlewareContext(context, fn) {
42
+ return middlewareContextStore.run(toMiddlewareMap(context), fn);
43
+ }
44
+ _chunkS3JO3N4Hcjs.__name.call(void 0, _runWithMiddlewareContext, "_runWithMiddlewareContext");
45
+ function getMiddlewareData() {
46
+ return middlewareStore.getStore() || /* @__PURE__ */ new Map();
47
+ }
48
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getMiddlewareData, "getMiddlewareData");
49
+ function getMiddlewareValue(key) {
50
+ const data = getMiddlewareData();
51
+ return data.get(key);
52
+ }
53
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getMiddlewareValue, "getMiddlewareValue");
54
+ function getMiddlewareContext() {
55
+ return middlewareContextStore.getStore() || /* @__PURE__ */ new Map();
56
+ }
57
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getMiddlewareContext, "getMiddlewareContext");
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+ exports._clearCurrentMiddlewareData = _clearCurrentMiddlewareData; exports._clearCurrentMiddlewareContext = _clearCurrentMiddlewareContext; exports._runWithMiddlewareData = _runWithMiddlewareData; exports._runWithMiddlewareContext = _runWithMiddlewareContext; exports.getMiddlewareData = getMiddlewareData; exports.getMiddlewareValue = getMiddlewareValue; exports.getMiddlewareContext = getMiddlewareContext;
@@ -0,0 +1,25 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
4
+
5
+ // src/schema-capabilities.ts
6
+ function assertNoSchemaListField(field, fieldPath, target) {
7
+ if (!field.list) {
8
+ return;
9
+ }
10
+ throw new Error(
11
+ `Schema field "${fieldPath}" declares list: true, but ${target} does not support list fields. Use type: "json" for an array value or model the values in a related table.`
12
+ );
13
+ }
14
+ _chunkS3JO3N4Hcjs.__name.call(void 0, assertNoSchemaListField, "assertNoSchemaListField");
15
+
16
+ // src/schema-reference.ts
17
+ function isDatabaseEnforcedReference(reference) {
18
+ return reference.enforced === void 0 || reference.enforced === "db";
19
+ }
20
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isDatabaseEnforcedReference, "isDatabaseEnforcedReference");
21
+
22
+
23
+
24
+
25
+ exports.assertNoSchemaListField = assertNoSchemaListField; exports.isDatabaseEnforcedReference = isDatabaseEnforcedReference;