@farm.js/core 0.1.60 → 0.1.62
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.
- package/dist/{agent-mcp.d-C-2S9bnP.d.mts → agent-mcp.d-BKZ3UNbt.d.mts} +1 -1
- package/dist/{agent-mcp.d-SIoCUP1I.d.ts → agent-mcp.d-C1zr_nGS.d.ts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-2AHWJJR7.cjs +15 -0
- package/dist/analyzer-YESYU3GK.mjs +15 -0
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +2 -2
- package/dist/api.cjs +5 -5
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +4 -4
- package/dist/{app-manifest.d-DrSAHskY.d.mts → app-manifest.d-BpvhfKRH.d.mts} +1 -1
- package/dist/{app-manifest.d-Tb3CJpL4.d.ts → app-manifest.d-ntch_bvA.d.ts} +1 -1
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/{app.d-CmWlYpZJ.d.ts → app.d-AE8_v3Db.d.ts} +4 -10
- package/dist/{app.d-D6QQM_kk.d.mts → app.d-CysWA_8v.d.mts} +4 -10
- package/dist/{chunk-FORSVMEJ.mjs → chunk-2CNKQC3G.mjs} +1 -1
- package/dist/{chunk-ZFUKPWFC.mjs → chunk-2JYBLE63.mjs} +416 -208
- package/dist/{chunk-QRX4JRBO.cjs → chunk-3CCAICF7.cjs} +5 -5
- package/dist/{chunk-ANHZ6SUL.mjs → chunk-3TXKFRSO.mjs} +1 -1
- package/dist/{chunk-BHJAYPYU.mjs → chunk-3UZVPO72.mjs} +1 -1
- package/dist/{chunk-6UUH4N4J.mjs → chunk-43V3ANPQ.mjs} +1 -1
- package/dist/chunk-4EBC7EMW.cjs +8 -0
- package/dist/{chunk-VZY7MAVS.cjs → chunk-4IHMHFQB.cjs} +27 -1
- package/dist/{chunk-FK25QSVC.cjs → chunk-4P5634G6.cjs} +2 -2
- package/dist/{chunk-4JTQPOKO.cjs → chunk-53ZCZ46B.cjs} +2 -2
- package/dist/{chunk-NQJDO7K7.cjs → chunk-545WJ5UG.cjs} +321 -37
- package/dist/{chunk-VU3MYZPO.mjs → chunk-5FE5YT2N.mjs} +26 -0
- package/dist/{chunk-A5BJKSZE.cjs → chunk-5IQ2ERQA.cjs} +2 -2
- package/dist/{chunk-SJRCWF4Z.mjs → chunk-5Y22WNTO.mjs} +2 -2
- package/dist/{chunk-U4BJKNIR.cjs → chunk-752XUZIM.cjs} +11 -6
- package/dist/{chunk-JBK7UJOI.cjs → chunk-AJB3DHN6.cjs} +2 -2
- package/dist/{chunk-YB44NKC2.cjs → chunk-AXVRUDMB.cjs} +2 -2
- package/dist/{chunk-LJVNMGE3.mjs → chunk-BM2LH2JM.mjs} +8 -3
- package/dist/{chunk-YI6FKTTN.cjs → chunk-BT4SEFLC.cjs} +261 -38
- package/dist/{chunk-LIFUPCXW.cjs → chunk-CFG4QERR.cjs} +13 -2
- package/dist/{chunk-3OWVWZ6R.cjs → chunk-CLFEQGET.cjs} +6 -6
- package/dist/{chunk-OZK2DS44.mjs → chunk-CROAFCMW.mjs} +1 -1
- package/dist/{chunk-2KTYMMWT.mjs → chunk-DPE53XWL.mjs} +1 -1
- package/dist/{chunk-3PX4AIXO.mjs → chunk-DQF3QLOH.mjs} +258 -35
- package/dist/{chunk-FSQMN2MQ.mjs → chunk-E46NXBNJ.mjs} +1 -1
- package/dist/{chunk-EGVC4LIG.mjs → chunk-E4RDMG3K.mjs} +1 -1
- package/dist/{chunk-X2CZTWQA.mjs → chunk-ECKQFEX2.mjs} +1 -1
- package/dist/{chunk-MTWXOEI4.cjs → chunk-EXXFSZOC.cjs} +246 -193
- package/dist/{chunk-UYSTTPYJ.cjs → chunk-GGNJAGGE.cjs} +643 -435
- package/dist/{chunk-XTG73QZA.cjs → chunk-GVOMPU3Y.cjs} +12 -8
- package/dist/{chunk-ZP32GNJQ.cjs → chunk-I32V5CZL.cjs} +14 -13
- package/dist/{chunk-37PYUEK5.mjs → chunk-IOF4KXMP.mjs} +7 -3
- package/dist/{chunk-ILMTRGBG.mjs → chunk-IQIKPKFP.mjs} +157 -45
- package/dist/{chunk-5JNUYGNF.cjs → chunk-IWRLV46X.cjs} +2 -2
- package/dist/{chunk-KPOMS5RO.cjs → chunk-J3GFOQOL.cjs} +3 -3
- package/dist/{chunk-NHD7BAKD.mjs → chunk-JCEFKP5M.mjs} +41 -25
- package/dist/{analyzer-LCSI3NSH.cjs → chunk-JEJQGZI7.cjs} +16 -13
- package/dist/{chunk-LB3DPQP6.cjs → chunk-JLDNXURZ.cjs} +23 -23
- package/dist/{chunk-VGG74PSU.cjs → chunk-L2JG337G.cjs} +2 -2
- package/dist/chunk-L4RTTTVE.mjs +8 -0
- package/dist/chunk-LEJDW34D.cjs +115 -0
- package/dist/{analyzer-22BEYV7S.mjs → chunk-LVWGURLD.mjs} +6 -3
- package/dist/{chunk-Z5A6CNV2.mjs → chunk-MK5E44WP.mjs} +1 -1
- package/dist/{chunk-T4EW7AAD.mjs → chunk-NKRZLQUK.mjs} +2 -2
- package/dist/{chunk-HPWB57PZ.mjs → chunk-NT3QDN2E.mjs} +1 -1
- package/dist/{chunk-T7I62A4C.mjs → chunk-OUWRNHTV.mjs} +81 -28
- package/dist/{chunk-GFT5AHAT.mjs → chunk-QDWMCFTH.mjs} +12 -1
- package/dist/{chunk-AER5I65K.mjs → chunk-QTD6EMN2.mjs} +1 -1
- package/dist/{chunk-UDJY2ZGY.cjs → chunk-RMUD75WT.cjs} +413 -301
- package/dist/chunk-RZNCMRD3.mjs +141 -0
- package/dist/{chunk-D7LTCK3U.mjs → chunk-SA7MLSP4.mjs} +11 -6
- package/dist/{chunk-2FRLSDBT.cjs → chunk-SM25ZC4S.cjs} +1 -1
- package/dist/{chunk-3YMLUNL2.cjs → chunk-SVXOCTQ2.cjs} +1 -1
- package/dist/{chunk-W2RZ73IU.cjs → chunk-SYXPWJ7N.cjs} +8 -8
- package/dist/{chunk-F6Y7ZAPQ.mjs → chunk-T46NNU4D.mjs} +6 -3
- package/dist/{chunk-IFHPDLIS.mjs → chunk-TGULJSHD.mjs} +5 -4
- package/dist/{chunk-JPIUGDK4.mjs → chunk-TZVUF5JJ.mjs} +1 -1
- package/dist/chunk-UWI3SJAK.cjs +141 -0
- package/dist/{chunk-JI5D7MXY.mjs → chunk-UYRI6U3P.mjs} +1 -1
- package/dist/{chunk-D2X5MUF5.cjs → chunk-V727H3RI.cjs} +47 -31
- package/dist/{chunk-ZMHAFH4R.mjs → chunk-VM7X5CKC.mjs} +2 -2
- package/dist/{chunk-VPTWKOCY.mjs → chunk-VWW4Q3BJ.mjs} +287 -6
- package/dist/{chunk-4P23B7DU.cjs → chunk-WKJQ2FJA.cjs} +3 -3
- package/dist/{chunk-HASX6DC7.cjs → chunk-WKPBIT5Q.cjs} +8 -8
- package/dist/{chunk-RAWWCDCT.cjs → chunk-WYAXRIYP.cjs} +3 -3
- package/dist/{chunk-3TL3AH25.cjs → chunk-X4K7TYN6.cjs} +12 -7
- package/dist/chunk-XCXHQBMM.mjs +115 -0
- package/dist/{chunk-DPJ66FSI.cjs → chunk-XX32BOMM.cjs} +7 -7
- package/dist/{chunk-2IAPKPEB.cjs → chunk-YN6BHOYY.cjs} +6 -6
- package/dist/{chunk-CBKRS3M4.cjs → chunk-Z7P2BTZ3.cjs} +7 -6
- package/dist/{chunk-SX7EECTS.mjs → chunk-ZBUAOGMY.mjs} +1 -1
- package/dist/{chunk-RPUJHJHE.mjs → chunk-ZFWYCVKS.mjs} +4 -3
- package/dist/{chunk-IFXSBJPN.cjs → chunk-ZVIEFTUA.cjs} +20 -17
- package/dist/{chunk-EXUONJYV.mjs → chunk-ZZI56IUY.mjs} +3 -3
- package/dist/{programmatic-routes-client.d-CLG2N1yH.d.ts → client-component.d-Bgt3x5Fu.d.ts} +18 -3
- package/dist/{programmatic-routes-client.d-CPbNqtIi.d.mts → client-component.d-BoqC2MLC.d.mts} +18 -3
- package/dist/{client-plugins.d-vXrbcfJ1.d.ts → client-plugins.d-BcqIy4au.d.ts} +1 -1
- package/dist/{client-plugins.d-CgQQ-EAv.d.mts → client-plugins.d-CWyYBxXf.d.mts} +1 -1
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/{config.d-DqZkLwef.d.ts → config.d-qt-mE8O5.d.mts} +6 -2
- package/dist/{config.d-DqZkLwef.d.mts → config.d-qt-mE8O5.d.ts} +6 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/cron.cjs +12 -2
- package/dist/cron.d.mts +101 -3
- package/dist/cron.d.ts +101 -3
- package/dist/cron.mjs +11 -1
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/{devtools-KQZ6SRCJ.mjs → devtools-NUVXYG7I.mjs} +6 -6
- package/dist/{devtools-UF6JYHUN.cjs → devtools-SVRSGPNC.cjs} +8 -8
- package/dist/docs.cjs +9 -9
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +8 -8
- package/dist/image/server.cjs +3 -3
- package/dist/image/server.mjs +2 -2
- package/dist/image/sharp.cjs +10 -10
- package/dist/image/sharp.mjs +2 -2
- package/dist/index.cjs +42 -27
- package/dist/{index.d-Dmfb7Kb_.d.mts → index.d-BDaiu2i5.d.mts} +1 -1
- package/dist/{index.d-DlCELfhf.d.ts → index.d-nAncqTXz.d.ts} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +42 -27
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.cjs +27 -22
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +26 -21
- package/dist/internal/cli-runtime.cjs +12 -11
- package/dist/internal/cli-runtime.mjs +11 -10
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +5 -5
- package/dist/internal/config-runtime.d.ts +5 -5
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/form-actions.cjs +4 -4
- package/dist/internal/form-actions.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/native-server-fns.cjs +25 -0
- package/dist/internal/native-server-fns.d.mts +42 -0
- package/dist/internal/native-server-fns.d.ts +42 -0
- package/dist/internal/native-server-fns.mjs +25 -0
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-node-env.cjs +2 -2
- package/dist/internal/production-node-env.mjs +1 -1
- package/dist/internal/production-runtime.cjs +16 -10
- package/dist/internal/production-runtime.d.mts +39 -12
- package/dist/internal/production-runtime.d.ts +39 -12
- package/dist/internal/production-runtime.mjs +15 -9
- package/dist/internal/react-cache.cjs +51 -0
- package/dist/internal/react-cache.d.mts +3 -0
- package/dist/internal/react-cache.d.ts +3 -0
- package/dist/internal/react-cache.mjs +51 -0
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/middleware.cjs +3 -3
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +2 -2
- package/dist/mobile.d.mts +10 -4
- package/dist/mobile.d.ts +10 -4
- package/dist/{modules-VHD7BELU.mjs → modules-KOKD4XS6.mjs} +2 -2
- package/dist/modules-QTP7WJPD.cjs +13 -0
- package/dist/native-server-fn-handler-GLRHAYWV.mjs +28 -0
- package/dist/native-server-fn-handler-J5MYRXN6.cjs +28 -0
- package/dist/native-specs-5OLED4MM.cjs +15 -0
- package/dist/{native-specs-BD7HOTMJ.mjs → native-specs-LDV6IZ4N.mjs} +1 -1
- package/dist/{native-tree-VWNW2MQ2.mjs → native-tree-AS5L3ID3.mjs} +2 -2
- package/dist/{native-tree-6G5O53O3.cjs → native-tree-Z2WYUJEV.cjs} +3 -3
- package/dist/native.cjs +1 -1
- package/dist/native.d.mts +5 -5
- package/dist/native.d.ts +5 -5
- package/dist/native.mjs +1 -1
- package/dist/{navigation-delegate.d-JXx40JzR.d.ts → navigation-delegate.d-BbUHRXxG.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CnOTWOyi.d.mts → navigation-delegate.d-CSCm8ZxL.d.mts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/{nitro-FLN6DRGJ.mjs → nitro-DD4QCA66.mjs} +5 -5
- package/dist/{nitro-HXAZZQKY.cjs → nitro-VRDX2H4M.cjs} +8 -8
- package/dist/plugin.cjs +19 -18
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +18 -17
- package/dist/{port-WOOQ3V56.mjs → port-UFUZL6RI.mjs} +2 -2
- package/dist/{port-C6GBH4C6.cjs → port-VTLHPZOI.cjs} +10 -10
- package/dist/{production-runtime.d-CP5s6RuY.d.mts → production-runtime.d-CcQiDko5.d.mts} +1 -1
- package/dist/{production-runtime.d-N-cE3pmy.d.ts → production-runtime.d-DgT24A0f.d.ts} +1 -1
- package/dist/{render-plan.d-DZ-qjjdG.d.mts → render-plan.d-BH9WF-JZ.d.mts} +1 -1
- package/dist/{render-plan.d-B9lAP3uX.d.ts → render-plan.d-CyrX6MDs.d.ts} +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/{request.d-BiicaNxb.d.ts → request.d-BB8M8bcD.d.ts} +1 -1
- package/dist/{request.d-DV0oeUit.d.mts → request.d-CUrPnCW7.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering.d-BrIKA51A.d.mts → route-rendering.d-CYxlzaFm.d.mts} +1 -1
- package/dist/{route-rendering.d-Iss0C7GR.d.ts → route-rendering.d-DYqZMIf4.d.ts} +1 -1
- package/dist/{router.d-mNTbOGV_.d.mts → router.d-7o24CD8u.d.mts} +1 -1
- package/dist/{router.d-DjGn_al7.d.ts → router.d-DaKo507j.d.ts} +1 -1
- package/dist/{routes.d-BKSjHuH9.d.ts → routes.d-BknKQcTu.d.ts} +7 -1
- package/dist/{routes.d-qd8Qf4LG.d.mts → routes.d-D1IrO9KK.d.mts} +7 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-SVLBTY7H.cjs → rsc-pipeline-OF2I7PCX.cjs} +8 -8
- package/dist/{rsc-pipeline-WBLBDQXA.mjs → rsc-pipeline-RFLHDAKD.mjs} +7 -7
- package/dist/{runtime-DGUOWSMF.cjs → runtime-LBTK62AD.cjs} +70 -47
- package/dist/{runtime-HFZTVNFF.mjs → runtime-M6UJCSLA.mjs} +38 -15
- package/dist/{runtime.d-Bm_4hP5T.d.ts → runtime.d-CN73a-IL.d.ts} +1 -1
- package/dist/{runtime.d-BNVbojF1.d.mts → runtime.d-CcNuzhX6.d.mts} +1 -1
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +38 -37
- package/dist/server.d.mts +10 -10
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +23 -22
- package/dist/{spa-router.d-DHDoXxDE.d.mts → spa-router.d-CNi77LZm.d.mts} +2 -2
- package/dist/{spa-router.d-DAtnNoBe.d.ts → spa-router.d-Cvgf5QP4.d.ts} +2 -2
- package/dist/testing.cjs +6 -6
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +4 -4
- package/dist/{utils.d-DwZ-KLSB.d.ts → utils.d-C3H-14_Y.d.ts} +1 -1
- package/dist/{utils.d-uKZcKJk4.d.mts → utils.d-D8VfzZYn.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -18
- package/dist/vite.d.mts +5 -5
- package/dist/vite.d.ts +5 -5
- package/dist/vite.mjs +20 -17
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +12 -2
- package/dist/modules-WT5D3AWY.cjs +0 -13
- package/dist/native-specs-IQQRJOOW.cjs +0 -15
|
@@ -59,19 +59,21 @@ var _chunkLT4VAF5Zcjs = require('./chunk-LT4VAF5Z.cjs');
|
|
|
59
59
|
var _chunkDQJ2CIH7cjs = require('./chunk-DQJ2CIH7.cjs');
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var _chunk3CCAICF7cjs = require('./chunk-3CCAICF7.cjs');
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
var _chunkYI6FKTTNcjs = require('./chunk-YI6FKTTN.cjs');
|
|
66
65
|
|
|
67
66
|
|
|
68
|
-
var
|
|
67
|
+
var _chunkBT4SEFLCcjs = require('./chunk-BT4SEFLC.cjs');
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
69
71
|
|
|
70
72
|
|
|
71
73
|
var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
72
74
|
|
|
73
75
|
|
|
74
|
-
var
|
|
76
|
+
var _chunkI32V5CZLcjs = require('./chunk-I32V5CZL.cjs');
|
|
75
77
|
|
|
76
78
|
|
|
77
79
|
var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
|
|
@@ -83,7 +85,7 @@ var _chunkLNVGXUL3cjs = require('./chunk-LNVGXUL3.cjs');
|
|
|
83
85
|
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
84
86
|
|
|
85
87
|
|
|
86
|
-
var
|
|
88
|
+
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
87
89
|
|
|
88
90
|
|
|
89
91
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -100,6 +102,9 @@ var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
|
100
102
|
|
|
101
103
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
102
104
|
|
|
105
|
+
|
|
106
|
+
var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
|
|
107
|
+
|
|
103
108
|
// src/mcp-config.ts
|
|
104
109
|
var _module = require('module');
|
|
105
110
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -135,27 +140,295 @@ async function resolveFarmMCPPlugin(config, options) {
|
|
|
135
140
|
return runtime.createFarmMCPPlugin(config);
|
|
136
141
|
}
|
|
137
142
|
|
|
143
|
+
// src/cron-scan.ts
|
|
144
|
+
var LANGS = {
|
|
145
|
+
ts: "ts",
|
|
146
|
+
tsx: "tsx",
|
|
147
|
+
js: "jsx",
|
|
148
|
+
jsx: "jsx"
|
|
149
|
+
};
|
|
150
|
+
var parseAst;
|
|
151
|
+
async function loadParseAst() {
|
|
152
|
+
if (!parseAst) {
|
|
153
|
+
const { createRequire: createRequire3 } = await import("module");
|
|
154
|
+
parseAst = createRequire3(typeof __filename === "string" ? __filename : _chunkBTZ5O6VMcjs.define_import_meta_default.url)(
|
|
155
|
+
"rolldown/parseAst"
|
|
156
|
+
).parseAst;
|
|
157
|
+
}
|
|
158
|
+
return parseAst;
|
|
159
|
+
}
|
|
160
|
+
function unwrap(node) {
|
|
161
|
+
while (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "TSNonNullExpression" || node.type === "ParenthesizedExpression") {
|
|
162
|
+
node = node.expression;
|
|
163
|
+
}
|
|
164
|
+
return node;
|
|
165
|
+
}
|
|
166
|
+
function* walkNodes(value) {
|
|
167
|
+
if (!value || typeof value !== "object") return;
|
|
168
|
+
if (Array.isArray(value)) {
|
|
169
|
+
for (const item of value) yield* walkNodes(item);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const node = value;
|
|
173
|
+
if (typeof node.type === "string") yield node;
|
|
174
|
+
for (const key of Object.keys(node)) {
|
|
175
|
+
if (key === "type" || key === "start" || key === "end" || key === "loc" || key === "range") {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
yield* walkNodes(node[key]);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function notLiteral(file, key) {
|
|
182
|
+
throw new TypeError(
|
|
183
|
+
`The \`${key}\` option of cronRoute() in ${file} is not a literal. The build reads scheduling options from the source without running the module, so write \`${key}\` out literally or move the job to the \`cron\` config in farm.config.ts.`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
function literalValue(node, file, key) {
|
|
187
|
+
if (!node) notLiteral(file, key);
|
|
188
|
+
switch (node.type) {
|
|
189
|
+
case "Literal":
|
|
190
|
+
if (node.regex || typeof node.value === "bigint") notLiteral(file, key);
|
|
191
|
+
return node.value;
|
|
192
|
+
case "TemplateLiteral":
|
|
193
|
+
if (node.expressions.length > 0) notLiteral(file, key);
|
|
194
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _ => _.quasis, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.value, 'optionalAccess', _4 => _4.cooked]), () => ( notLiteral(file, key)));
|
|
195
|
+
case "UnaryExpression":
|
|
196
|
+
if (node.operator === "-" && node.argument.type === "Literal" && typeof node.argument.value === "number") {
|
|
197
|
+
return -node.argument.value;
|
|
198
|
+
}
|
|
199
|
+
notLiteral(file, key);
|
|
200
|
+
break;
|
|
201
|
+
case "ArrayExpression": {
|
|
202
|
+
const items = [];
|
|
203
|
+
for (const element of node.elements) {
|
|
204
|
+
if (!element || element.type === "SpreadElement") notLiteral(file, key);
|
|
205
|
+
items.push(literalValue(unwrap(element), file, key));
|
|
206
|
+
}
|
|
207
|
+
return items;
|
|
208
|
+
}
|
|
209
|
+
case "ObjectExpression": {
|
|
210
|
+
const object = {};
|
|
211
|
+
for (const property of node.properties) {
|
|
212
|
+
if (property.type !== "Property" || property.computed || property.kind !== "init") {
|
|
213
|
+
notLiteral(file, key);
|
|
214
|
+
}
|
|
215
|
+
const propertyKey = property.key.type === "Identifier" ? property.key.name : property.key.value;
|
|
216
|
+
if (typeof propertyKey !== "string" || propertyKey === "__proto__") notLiteral(file, key);
|
|
217
|
+
object[propertyKey] = literalValue(unwrap(property.value), file, key);
|
|
218
|
+
}
|
|
219
|
+
return object;
|
|
220
|
+
}
|
|
221
|
+
case "TSAsExpression":
|
|
222
|
+
case "TSSatisfiesExpression":
|
|
223
|
+
case "TSNonNullExpression":
|
|
224
|
+
case "ParenthesizedExpression":
|
|
225
|
+
return literalValue(node.expression, file, key);
|
|
226
|
+
}
|
|
227
|
+
notLiteral(file, key);
|
|
228
|
+
}
|
|
229
|
+
function optionProperty(object, name) {
|
|
230
|
+
return _optionalChain([object, 'access', _5 => _5.properties, 'access', _6 => _6.find, 'call', _7 => _7(
|
|
231
|
+
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
232
|
+
), 'optionalAccess', _8 => _8.value]);
|
|
233
|
+
}
|
|
234
|
+
function cronRouteLocalNames(program) {
|
|
235
|
+
const locals = /* @__PURE__ */ new Set();
|
|
236
|
+
for (const statement of program.body) {
|
|
237
|
+
if (statement.type !== "ImportDeclaration") continue;
|
|
238
|
+
for (const specifier of statement.specifiers) {
|
|
239
|
+
if (specifier.type !== "ImportSpecifier") continue;
|
|
240
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _9 => _9.imported, 'optionalAccess', _10 => _10.name]), () => ( _optionalChain([specifier, 'access', _11 => _11.imported, 'optionalAccess', _12 => _12.value])));
|
|
241
|
+
if (imported === "cronRoute") locals.add(specifier.local.name);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return locals;
|
|
245
|
+
}
|
|
246
|
+
function scannedJobFromOptions(optionsNode, file, routePath) {
|
|
247
|
+
const scheduleNode = optionProperty(optionsNode, "schedule");
|
|
248
|
+
if (!scheduleNode) return null;
|
|
249
|
+
if (optionsNode.properties.some((entry) => entry.type === "SpreadElement")) {
|
|
250
|
+
throw new TypeError(
|
|
251
|
+
`The cronRoute() options in ${file} spread another object next to \`schedule\`, so the build cannot read the job statically. Write every scheduling option literally in the call.`
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
const read = (key) => {
|
|
255
|
+
const node = optionProperty(optionsNode, key);
|
|
256
|
+
return node === void 0 ? void 0 : literalValue(unwrap(node), file, key);
|
|
257
|
+
};
|
|
258
|
+
const name = readScannedName(read("name"), file, routePath);
|
|
259
|
+
const schedule = readScannedSchedule(read("schedule"), file, name);
|
|
260
|
+
const description = read("description");
|
|
261
|
+
if (description !== void 0 && typeof description !== "string") {
|
|
262
|
+
throw new TypeError(
|
|
263
|
+
`The \`description\` option of cronRoute() in ${file} must be a string literal.`
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
const timeoutMs = read("timeoutMs");
|
|
267
|
+
if (timeoutMs !== void 0 && (typeof timeoutMs !== "number" || !Number.isFinite(timeoutMs) || timeoutMs <= 0)) {
|
|
268
|
+
throw new TypeError(
|
|
269
|
+
`The \`timeoutMs\` option of cronRoute() in ${file} must be a positive number literal in milliseconds.`
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
const enabled = read("enabled");
|
|
273
|
+
if (enabled !== void 0 && typeof enabled !== "boolean") {
|
|
274
|
+
throw new TypeError(
|
|
275
|
+
`The \`enabled\` option of cronRoute() in ${file} must be \`true\` or \`false\`.`
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
const input = read("input");
|
|
279
|
+
return {
|
|
280
|
+
name,
|
|
281
|
+
schedule,
|
|
282
|
+
path: routePath,
|
|
283
|
+
...typeof description === "string" && description.trim() ? { description: description.trim() } : {},
|
|
284
|
+
...input !== void 0 ? { input } : {},
|
|
285
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
286
|
+
filePath: file,
|
|
287
|
+
enabled: enabled !== false
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function readScannedName(value, file, routePath) {
|
|
291
|
+
if (value === void 0) {
|
|
292
|
+
const defaultName = routePath === "/api" ? "" : routePath.slice("/api/".length);
|
|
293
|
+
if (!defaultName) {
|
|
294
|
+
throw new TypeError(
|
|
295
|
+
`The scheduled cronRoute() in ${file} sits at the \`/api\` root, which has no default job name. Set the \`name\` option.`
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
return defaultName;
|
|
299
|
+
}
|
|
300
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
301
|
+
throw new TypeError(
|
|
302
|
+
`The \`name\` option of cronRoute() in ${file} must be a non-empty string literal.`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
if (!value.split("/").every((segment) => _chunkBT4SEFLCcjs.FARM_CRON_NAME_SEGMENT_PATTERN.test(segment))) {
|
|
306
|
+
throw new TypeError(
|
|
307
|
+
`The \`name\` option ${JSON.stringify(value)} of cronRoute() in ${file} is invalid. Each "/"-separated segment must start with a letter or number and contain only letters, numbers, dots, underscores, or hyphens.`
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
return value;
|
|
311
|
+
}
|
|
312
|
+
function readScannedSchedule(value, file, name) {
|
|
313
|
+
const raw = Array.isArray(value) ? value : [value];
|
|
314
|
+
if (raw.length === 0) {
|
|
315
|
+
throw new TypeError(
|
|
316
|
+
`The \`schedule\` option of cronRoute() in ${file} must list at least one cron expression.`
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
try {
|
|
320
|
+
return [...new Set(raw.map((entry) => _chunkBT4SEFLCcjs.normalizeCronExpression.call(void 0, name, entry)))];
|
|
321
|
+
} catch (error) {
|
|
322
|
+
throw new TypeError(`${error.message} (from the cronRoute() options in ${file})`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
async function scanFarmCronRouteJobs(options) {
|
|
326
|
+
const [path4, fs] = await Promise.all([import("path"), import("fs/promises")]);
|
|
327
|
+
const apiDir = path4.join(options.root, options.srcDir || "src", "app", "api");
|
|
328
|
+
try {
|
|
329
|
+
if (!(await fs.stat(apiDir)).isDirectory()) return [];
|
|
330
|
+
} catch (e2) {
|
|
331
|
+
return [];
|
|
332
|
+
}
|
|
333
|
+
const { glob } = await import("tinyglobby");
|
|
334
|
+
const files = (await glob("**/route.{ts,tsx,js,jsx}", {
|
|
335
|
+
cwd: apiDir,
|
|
336
|
+
absolute: true,
|
|
337
|
+
expandDirectories: false
|
|
338
|
+
})).sort();
|
|
339
|
+
const jobs = [];
|
|
340
|
+
const byName = /* @__PURE__ */ new Map();
|
|
341
|
+
for (const file of files) {
|
|
342
|
+
const code = await fs.readFile(file, "utf8");
|
|
343
|
+
if (!code.includes("cronRoute")) continue;
|
|
344
|
+
const parse = await loadParseAst();
|
|
345
|
+
const lang = _nullishCoalesce(LANGS[path4.extname(file).slice(1)], () => ( "tsx"));
|
|
346
|
+
let program;
|
|
347
|
+
try {
|
|
348
|
+
program = parse(code, { lang });
|
|
349
|
+
} catch (error) {
|
|
350
|
+
throw new TypeError(
|
|
351
|
+
`The route file ${file} could not be parsed while reading its cronRoute() schedule: ${error.message}`
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
const locals = cronRouteLocalNames(program);
|
|
355
|
+
if (locals.size === 0) continue;
|
|
356
|
+
const relativeDir = path4.relative(apiDir, path4.dirname(file)).split(path4.sep).join("/");
|
|
357
|
+
const routePath = relativeDir === "" || relativeDir === "." ? "/api" : `/api/${relativeDir}`;
|
|
358
|
+
for (const node of walkNodes(program)) {
|
|
359
|
+
if (node.type !== "CallExpression" || _optionalChain([node, 'access', _13 => _13.callee, 'optionalAccess', _14 => _14.type]) !== "Identifier" || !locals.has(node.callee.name)) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
const optionsArgument = _optionalChain([node, 'access', _15 => _15.arguments, 'optionalAccess', _16 => _16[1]]);
|
|
363
|
+
if (!optionsArgument || optionsArgument.type === "SpreadElement") continue;
|
|
364
|
+
const optionsNode = unwrap(optionsArgument);
|
|
365
|
+
if (optionsNode.type !== "ObjectExpression") continue;
|
|
366
|
+
const job = scannedJobFromOptions(optionsNode, file, routePath);
|
|
367
|
+
if (!job) continue;
|
|
368
|
+
if (/[[\]]/.test(routePath)) {
|
|
369
|
+
throw new TypeError(
|
|
370
|
+
`The scheduled cronRoute() in ${file} sits under a dynamic segment, and a scheduler cannot fill route params. Move the schedule to a static route.`
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
const existing = byName.get(job.name);
|
|
374
|
+
if (existing !== void 0) {
|
|
375
|
+
throw new TypeError(
|
|
376
|
+
`Farm cron job ${JSON.stringify(job.name)} is defined twice: in ${existing} and in ${file}. Rename or remove one of them.`
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
byName.set(job.name, file);
|
|
380
|
+
jobs.push(job);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return jobs;
|
|
384
|
+
}
|
|
385
|
+
function mergeFarmCronJobs(config, scanned) {
|
|
386
|
+
const configNames = new Set(config.jobs.map((job) => job.name));
|
|
387
|
+
const jobs = [...config.jobs];
|
|
388
|
+
for (const scannedJob of scanned) {
|
|
389
|
+
if (configNames.has(scannedJob.name)) {
|
|
390
|
+
throw new TypeError(
|
|
391
|
+
`Farm cron job ${JSON.stringify(scannedJob.name)} is defined twice: in the \`cron\` config in farm.config.ts and in ${scannedJob.filePath}. Rename or remove one of them.`
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
if (!scannedJob.enabled) continue;
|
|
395
|
+
const { filePath: _filePath, enabled: _enabled, ...job } = scannedJob;
|
|
396
|
+
jobs.push(job);
|
|
397
|
+
}
|
|
398
|
+
if (jobs.length === config.jobs.length) return config;
|
|
399
|
+
return { ...config, enabled: jobs.length > 0, jobs };
|
|
400
|
+
}
|
|
401
|
+
async function resolveProjectCronJobs(options) {
|
|
402
|
+
const resolved = _chunkBT4SEFLCcjs.resolveCronConfig.call(void 0, options.cron);
|
|
403
|
+
if (resolved === options.cron || options.cron === false) return resolved;
|
|
404
|
+
const scanned = await scanFarmCronRouteJobs({
|
|
405
|
+
root: options.root || process.cwd(),
|
|
406
|
+
srcDir: options.srcDir
|
|
407
|
+
});
|
|
408
|
+
return mergeFarmCronJobs(resolved, scanned);
|
|
409
|
+
}
|
|
410
|
+
|
|
138
411
|
// src/config.ts
|
|
139
412
|
|
|
140
413
|
|
|
141
414
|
// src/agent-config.ts
|
|
142
415
|
var DEFAULT_JSON_LD = { type: "WebSite" };
|
|
143
416
|
function resolveFarmAgentConfig(input, context = {}) {
|
|
144
|
-
const jsonLd = _optionalChain([input, 'optionalAccess',
|
|
417
|
+
const jsonLd = _optionalChain([input, 'optionalAccess', _17 => _17.jsonLd]);
|
|
145
418
|
return {
|
|
146
419
|
jsonLd: jsonLd === void 0 ? { ...DEFAULT_JSON_LD } : !jsonLd ? false : jsonLd === true ? {} : jsonLd,
|
|
147
|
-
noindexPreviews: _chunkDZPR2W6Ucjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess',
|
|
420
|
+
noindexPreviews: _chunkDZPR2W6Ucjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _18 => _18.noindexPreviews])),
|
|
148
421
|
// The docs engine answers /llms.txt with its own pages; a default here would replace it.
|
|
149
422
|
// llms-full.txt renders every listed page, so it stays opt-in.
|
|
150
|
-
llmsTxt: _chunkMEQN6DDAcjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess',
|
|
423
|
+
llmsTxt: _chunkMEQN6DDAcjs.resolveFarmLlmsTxtConfig.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _19 => _19.llmsTxt]), () => ( (context.docs ? false : { full: false })))),
|
|
151
424
|
// Same rule as llms.txt: the docs engine answers /sitemap.xml with its own pages.
|
|
152
|
-
sitemap: _chunkDZPR2W6Ucjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess',
|
|
153
|
-
crawlers: _chunkDZPR2W6Ucjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess',
|
|
154
|
-
apiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess',
|
|
155
|
-
aiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess',
|
|
156
|
-
manifest: _chunkSG57PX7Kcjs.resolveFarmAppManifestConfig.call(void 0, _optionalChain([input, 'optionalAccess',
|
|
425
|
+
sitemap: _chunkDZPR2W6Ucjs.resolveFarmAgentSitemap.call(void 0, _nullishCoalesce(_optionalChain([input, 'optionalAccess', _20 => _20.sitemap]), () => ( !context.docs))),
|
|
426
|
+
crawlers: _chunkDZPR2W6Ucjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _21 => _21.crawlers])),
|
|
427
|
+
apiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _22 => _22.apiCatalog]), "apiCatalog", false),
|
|
428
|
+
aiCatalog: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _23 => _23.aiCatalog]), "aiCatalog", true),
|
|
429
|
+
manifest: _chunkSG57PX7Kcjs.resolveFarmAppManifestConfig.call(void 0, _optionalChain([input, 'optionalAccess', _24 => _24.manifest])),
|
|
157
430
|
// Same rule as llms.txt: the docs engine serves its own MCP server at /mcp.
|
|
158
|
-
mcp: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess',
|
|
431
|
+
mcp: resolveFarmAgentBoolean(_optionalChain([input, 'optionalAccess', _25 => _25.mcp]), "mcp", !context.docs)
|
|
159
432
|
};
|
|
160
433
|
}
|
|
161
434
|
function resolveFarmAgentBoolean(input, key, fallback) {
|
|
@@ -182,7 +455,7 @@ async function frameworkDeclaredByApp(root) {
|
|
|
182
455
|
return true;
|
|
183
456
|
}
|
|
184
457
|
}
|
|
185
|
-
} catch (
|
|
458
|
+
} catch (e3) {
|
|
186
459
|
}
|
|
187
460
|
return false;
|
|
188
461
|
}
|
|
@@ -221,7 +494,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
221
494
|
try {
|
|
222
495
|
const requireFromApp = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
|
|
223
496
|
configEntryPath = requireFromApp.resolve(FRAMEWORK_CONFIG_ENTRY);
|
|
224
|
-
} catch (
|
|
497
|
+
} catch (e4) {
|
|
225
498
|
noticeOnce(
|
|
226
499
|
"declared-not-installed",
|
|
227
500
|
warn,
|
|
@@ -234,7 +507,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
234
507
|
/* @vite-ignore */
|
|
235
508
|
_url.pathToFileURL.call(void 0, configEntryPath).href
|
|
236
509
|
);
|
|
237
|
-
const withDocs = _optionalChain([frameworkConfig, 'optionalAccess',
|
|
510
|
+
const withDocs = _optionalChain([frameworkConfig, 'optionalAccess', _26 => _26.withDocs]);
|
|
238
511
|
if (typeof withDocs !== "function") {
|
|
239
512
|
noticeOnce(
|
|
240
513
|
"missing-withdocs",
|
|
@@ -244,7 +517,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
|
244
517
|
return userConfig;
|
|
245
518
|
}
|
|
246
519
|
const applied = withDocs(userConfig);
|
|
247
|
-
const adapter = _optionalChain([applied, 'optionalAccess',
|
|
520
|
+
const adapter = _optionalChain([applied, 'optionalAccess', _27 => _27.docs, 'optionalAccess', _28 => _28.adapter]);
|
|
248
521
|
if (!isSupportedAdapterDescriptor(adapter)) {
|
|
249
522
|
noticeOnce(
|
|
250
523
|
"unsupported-descriptor",
|
|
@@ -350,7 +623,7 @@ var PLATFORM_BUILD_ENV_TARGETS = [
|
|
|
350
623
|
];
|
|
351
624
|
function detectPlatformDeployTarget(env = process.env) {
|
|
352
625
|
for (const [key, target] of PLATFORM_BUILD_ENV_TARGETS) {
|
|
353
|
-
const value = _optionalChain([env, 'access',
|
|
626
|
+
const value = _optionalChain([env, 'access', _29 => _29[key], 'optionalAccess', _30 => _30.trim, 'call', _31 => _31(), 'access', _32 => _32.toLowerCase, 'call', _33 => _33()]);
|
|
354
627
|
if (value === "1" || value === "true") return target;
|
|
355
628
|
}
|
|
356
629
|
return void 0;
|
|
@@ -389,7 +662,7 @@ function resolveDeployConfig(config, overrides = {}) {
|
|
|
389
662
|
);
|
|
390
663
|
}
|
|
391
664
|
}
|
|
392
|
-
const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access',
|
|
665
|
+
const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access', _34 => _34.vercel, 'optionalAccess', _35 => _35.outputDirectory]) : resolvedTarget === "cloudflare" ? _optionalChain([deploy, 'access', _36 => _36.cloudflare, 'optionalAccess', _37 => _37.outputDir]) : resolvedTarget === "netlify" ? _optionalChain([deploy, 'access', _38 => _38.netlify, 'optionalAccess', _39 => _39.outputDir]) : void 0;
|
|
393
666
|
const outputDir = overrides.outputDir || deploy.outputDir || deploy.output || platformOutput || getDefaultDeployOutputDir(resolvedTarget, preset, distDir);
|
|
394
667
|
return {
|
|
395
668
|
...deploy,
|
|
@@ -565,7 +838,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
565
838
|
config: { entry: "docs", docsPath: "/docs" }
|
|
566
839
|
};
|
|
567
840
|
}
|
|
568
|
-
const fileDocsConfig = omitDocsRoots(_optionalChain([loadedConfig, 'optionalAccess',
|
|
841
|
+
const fileDocsConfig = omitDocsRoots(_optionalChain([loadedConfig, 'optionalAccess', _40 => _40.config]));
|
|
569
842
|
const inlineRawDocsConfig = omitDocsRoots(docsOptions.config);
|
|
570
843
|
const inlineDocsConfig = sanitizeDocsConfig(inlineRawDocsConfig);
|
|
571
844
|
const directDocsConfig = sanitizeDocsConfig({
|
|
@@ -611,7 +884,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
611
884
|
const configFileName = loadedConfig ? _path2.default.relative(root, loadedConfig.configPath) || loadedConfig.configPath : "the docs config";
|
|
612
885
|
const roots = await resolveDocsRoots(
|
|
613
886
|
[
|
|
614
|
-
{ field: `roots in ${configFileName}`, roots: docsRootsOf(_optionalChain([loadedConfig, 'optionalAccess',
|
|
887
|
+
{ field: `roots in ${configFileName}`, roots: docsRootsOf(_optionalChain([loadedConfig, 'optionalAccess', _41 => _41.config])), file: true },
|
|
615
888
|
{ field: "docs.config.roots", roots: docsRootsOf(docsOptions.config) },
|
|
616
889
|
{ field: "docs.roots", roots: docsOptions.roots }
|
|
617
890
|
],
|
|
@@ -635,7 +908,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
635
908
|
...docsOptions.adapter ? { adapter: docsOptions.adapter } : {},
|
|
636
909
|
...docsOptions.prerender === true ? { prerender: true } : {},
|
|
637
910
|
contentDir,
|
|
638
|
-
configPath: _optionalChain([loadedConfig, 'optionalAccess',
|
|
911
|
+
configPath: _optionalChain([loadedConfig, 'optionalAccess', _42 => _42.configPath]),
|
|
639
912
|
config: {
|
|
640
913
|
...mergedDocsConfig,
|
|
641
914
|
entry: docsEntry,
|
|
@@ -756,7 +1029,7 @@ function validateConfigRouteSources(routes, field) {
|
|
|
756
1029
|
return routes;
|
|
757
1030
|
}
|
|
758
1031
|
async function resolveConfig(userConfig, mode) {
|
|
759
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access',
|
|
1032
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _43 => _43.experimental, 'optionalAccess', _44 => _44.serverComponents]));
|
|
760
1033
|
const projectRoot = userConfig.root || process.cwd();
|
|
761
1034
|
const layerResolution = await _chunk5Y2P454Ocjs.resolveFarmLayers.call(void 0, userConfig, {
|
|
762
1035
|
root: projectRoot,
|
|
@@ -797,9 +1070,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
797
1070
|
);
|
|
798
1071
|
}
|
|
799
1072
|
const root = userConfig.root || process.cwd();
|
|
800
|
-
const desktopSetup = await _optionalChain([globalThis, 'access',
|
|
1073
|
+
const desktopSetup = await _optionalChain([globalThis, 'access', _45 => _45[/* @__PURE__ */ Symbol.for("@farm.js/core/desktop-setup")], 'optionalCall', _46 => _46(userConfig, root, mode)]);
|
|
801
1074
|
if (desktopSetup) userConfig = desktopSetup.userConfig;
|
|
802
|
-
const deploy = resolveDeployConfig(userConfig, _optionalChain([desktopSetup, 'optionalAccess',
|
|
1075
|
+
const deploy = resolveDeployConfig(userConfig, _optionalChain([desktopSetup, 'optionalAccess', _47 => _47.deploy]));
|
|
803
1076
|
const srcDir = userConfig.srcDir || "src";
|
|
804
1077
|
_chunkBPNOYILCcjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
|
|
805
1078
|
const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
|
|
@@ -808,9 +1081,10 @@ async function resolveConfig(userConfig, mode) {
|
|
|
808
1081
|
const env = _chunk3EIPOTZVcjs.resolveEnv.call(void 0, userConfig.env, process.env);
|
|
809
1082
|
_chunk3EIPOTZVcjs.setEnv.call(void 0, env);
|
|
810
1083
|
const api = await _chunkPMJSG4JScjs.resolveFarmAPIConfig.call(void 0, userConfig.api, { root, mode, env });
|
|
1084
|
+
const cron = await resolveProjectCronJobs({ root, srcDir, cron: userConfig.cron });
|
|
811
1085
|
const auth = _chunkBPNOYILCcjs.resolveFarmAuthConfig.call(void 0, userConfig.auth);
|
|
812
1086
|
const mcp = resolveFarmMCPConfig(userConfig.mcp);
|
|
813
|
-
if (auth.enabled && _optionalChain([userConfig, 'access',
|
|
1087
|
+
if (auth.enabled && _optionalChain([userConfig, 'access', _48 => _48.integrations, 'optionalAccess', _49 => _49.auth])) {
|
|
814
1088
|
throw new Error(
|
|
815
1089
|
"Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
|
|
816
1090
|
);
|
|
@@ -820,7 +1094,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
820
1094
|
mode
|
|
821
1095
|
});
|
|
822
1096
|
const nativeMCPPlugin = await resolveFarmMCPPlugin(mcp, { root });
|
|
823
|
-
if (nativeMCPPlugin && _optionalChain([userConfig, 'access',
|
|
1097
|
+
if (nativeMCPPlugin && _optionalChain([userConfig, 'access', _50 => _50.plugins, 'optionalAccess', _51 => _51.some, 'call', _52 => _52((plugin) => _optionalChain([plugin, 'optionalAccess', _53 => _53.name]) === "farm:api-mcp")])) {
|
|
824
1098
|
throw new Error(
|
|
825
1099
|
"Choose either the top-level `mcp` config or `apiMcp()` in `plugins`; they configure the same MCP transport."
|
|
826
1100
|
);
|
|
@@ -835,6 +1109,12 @@ async function resolveConfig(userConfig, mode) {
|
|
|
835
1109
|
basePath,
|
|
836
1110
|
integrations: () => integrations
|
|
837
1111
|
}) : null;
|
|
1112
|
+
let nativeServerFnAppDirs = [];
|
|
1113
|
+
const nativeServerFnPlugin = userConfig.mobile !== void 0 && userConfig.mobile !== null ? (await import("./native-server-fn-handler-J5MYRXN6.cjs")).createFarmNativeServerFnPlugin({
|
|
1114
|
+
resolve: (await import("./internal/native-server-fns.cjs")).createFarmDevNativeServerFnResolver(
|
|
1115
|
+
{ root, srcDir, appDirs: () => nativeServerFnAppDirs }
|
|
1116
|
+
)
|
|
1117
|
+
}) : null;
|
|
838
1118
|
const openapi = {
|
|
839
1119
|
enabled: false,
|
|
840
1120
|
route: "/docs/reference",
|
|
@@ -861,8 +1141,8 @@ async function resolveConfig(userConfig, mode) {
|
|
|
861
1141
|
md,
|
|
862
1142
|
mdx,
|
|
863
1143
|
migrations: resolveMigrationsConfig(userConfig.migrations),
|
|
864
|
-
cron
|
|
865
|
-
workflows:
|
|
1144
|
+
cron,
|
|
1145
|
+
workflows: _chunk3CCAICF7cjs.resolveWorkflowsConfig.call(void 0, userConfig.workflows),
|
|
866
1146
|
api,
|
|
867
1147
|
observability: _nullishCoalesce(userConfig.observability, () => ( false)),
|
|
868
1148
|
telemetry: userConfig.telemetry !== false,
|
|
@@ -879,16 +1159,17 @@ async function resolveConfig(userConfig, mode) {
|
|
|
879
1159
|
serverActions: false,
|
|
880
1160
|
// Islands mode hydrates client components as islands (RFC 0003); an app can still pick
|
|
881
1161
|
// isolatedClientHydration itself.
|
|
882
|
-
isolatedClientHydration: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access',
|
|
1162
|
+
isolatedClientHydration: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _54 => _54.experimental, 'optionalAccess', _55 => _55.serverComponents])) === "islands" ? "enabled" : "off",
|
|
883
1163
|
ppr: false,
|
|
884
1164
|
...userConfig.experimental
|
|
885
1165
|
},
|
|
886
1166
|
agent: resolveFarmAgentConfig(userConfig.agent, { docs: docs.enabled }),
|
|
887
|
-
desktop: _nullishCoalesce(_optionalChain([desktopSetup, 'optionalAccess',
|
|
1167
|
+
desktop: _nullishCoalesce(_optionalChain([desktopSetup, 'optionalAccess', _56 => _56.desktop]), () => ( null)),
|
|
888
1168
|
...userConfig.mobile !== void 0 ? { mobileClient: true } : {},
|
|
889
1169
|
plugins: [
|
|
890
1170
|
...mobileSessionPlugin ? [mobileSessionPlugin] : [],
|
|
891
|
-
...
|
|
1171
|
+
...nativeServerFnPlugin ? [nativeServerFnPlugin] : [],
|
|
1172
|
+
..._chunkI32V5CZLcjs.resolveIntegrationPlugins.call(void 0, integrations),
|
|
892
1173
|
...nativeMCPPlugin ? [nativeMCPPlugin] : [],
|
|
893
1174
|
...userConfig.plugins || []
|
|
894
1175
|
],
|
|
@@ -911,8 +1192,8 @@ async function resolveConfig(userConfig, mode) {
|
|
|
911
1192
|
middleware: validateMiddlewareConfig(userConfig.middleware) || {},
|
|
912
1193
|
notFound: userConfig.notFound || {},
|
|
913
1194
|
context: userConfig.context || (() => void 0),
|
|
914
|
-
server:
|
|
915
|
-
serverActions:
|
|
1195
|
+
server: _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, userConfig.server),
|
|
1196
|
+
serverActions: _chunk4P5634G6cjs.resolveServerActionsConfig.call(void 0, userConfig.serverActions),
|
|
916
1197
|
security,
|
|
917
1198
|
deploymentId,
|
|
918
1199
|
distDir: userConfig.distDir || ".farm",
|
|
@@ -925,6 +1206,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
925
1206
|
vite: typeof userConfig.vite === "function" ? userConfig.vite({}) : userConfig.vite || {}
|
|
926
1207
|
};
|
|
927
1208
|
_chunkLSHX2H5Gcjs.assertPluginDependencies.call(void 0, resolved.plugins, resolved.integrations);
|
|
1209
|
+
if (nativeServerFnPlugin) {
|
|
1210
|
+
nativeServerFnAppDirs = (await import("./layers-DMRXRL7F.cjs")).getFarmAppDirectories(resolved);
|
|
1211
|
+
}
|
|
928
1212
|
return resolved;
|
|
929
1213
|
}
|
|
930
1214
|
function formatConfigLoadError(error) {
|
|
@@ -933,13 +1217,13 @@ function formatConfigLoadError(error) {
|
|
|
933
1217
|
try {
|
|
934
1218
|
const value = Reflect.get(error, property);
|
|
935
1219
|
if (typeof value === "string" && value) return value;
|
|
936
|
-
} catch (
|
|
1220
|
+
} catch (e5) {
|
|
937
1221
|
}
|
|
938
1222
|
}
|
|
939
1223
|
}
|
|
940
1224
|
try {
|
|
941
1225
|
return String(error);
|
|
942
|
-
} catch (
|
|
1226
|
+
} catch (e6) {
|
|
943
1227
|
return "Unknown config loader error";
|
|
944
1228
|
}
|
|
945
1229
|
}
|
|
@@ -5,6 +5,29 @@ var FARM_NODE_ENV_MODULE_SOURCE = `if (!process.env.NODE_ENV) process.env.NODE_E
|
|
|
5
5
|
var FARM_DESKTOP_ENV_MODULE_FILE = "farm-desktop-env.mjs";
|
|
6
6
|
var FARM_DESKTOP_ENV_MODULE_SOURCE = `process.env.FARM_PLATFORM = "desktop";
|
|
7
7
|
${FARM_NODE_ENV_MODULE_SOURCE}`;
|
|
8
|
+
var FARM_SERVER_MODULE_FILE = "farm-server.mjs";
|
|
9
|
+
var FARM_COMPILE_CACHE_DIR = ".compile-cache";
|
|
10
|
+
function createFarmCompileCacheLauncher(serverModuleFile) {
|
|
11
|
+
return `import { dirname, join } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
// A deployment that set NODE_COMPILE_CACHE itself already chose a location.
|
|
15
|
+
if (!process.env.NODE_COMPILE_CACHE) {
|
|
16
|
+
try {
|
|
17
|
+
const { enableCompileCache } = await import("node:module");
|
|
18
|
+
enableCompileCache?.(join(dirname(fileURLToPath(import.meta.url)), ${JSON.stringify(FARM_COMPILE_CACHE_DIR)}));
|
|
19
|
+
} catch {
|
|
20
|
+
// Node without the API, or an output directory it cannot write: start uncached.
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const farmServer = await import(${JSON.stringify(`./${serverModuleFile}`)});
|
|
25
|
+
|
|
26
|
+
// The built server starts on import and exports a placeholder default. Pass it through so
|
|
27
|
+
// the entry's module shape is the one Nitro emitted.
|
|
28
|
+
export default farmServer.default;
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
8
31
|
var FARM_DESKTOP_READY_PREFIX = "farm:ready ";
|
|
9
32
|
var nodeServerSource = (desktop) => `const socketPath = process.env.NITRO_UNIX_SOCKET;
|
|
10
33
|
const server = serve({
|
|
@@ -426,6 +449,9 @@ export {
|
|
|
426
449
|
FARM_NODE_ENV_MODULE_SOURCE,
|
|
427
450
|
FARM_DESKTOP_ENV_MODULE_FILE,
|
|
428
451
|
FARM_DESKTOP_ENV_MODULE_SOURCE,
|
|
452
|
+
FARM_SERVER_MODULE_FILE,
|
|
453
|
+
FARM_COMPILE_CACHE_DIR,
|
|
454
|
+
createFarmCompileCacheLauncher,
|
|
429
455
|
createFarmNodeServerEntry,
|
|
430
456
|
createFarmBunServerEntry,
|
|
431
457
|
withProductionNodeEnv
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkUNJZGVPUcjs = require('./chunk-UNJZGVPU.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
7
7
|
|
|
8
8
|
// src/image-pattern.ts
|
|
9
9
|
var compiledPatterns = /* @__PURE__ */ new WeakMap();
|
|
@@ -582,7 +582,7 @@ function createOptimizedImageResponse(request, image) {
|
|
|
582
582
|
// document, it still cannot run script or load anything.
|
|
583
583
|
"content-security-policy": "default-src 'none'; sandbox"
|
|
584
584
|
});
|
|
585
|
-
if (
|
|
585
|
+
if (_chunkCFG4QERRcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), image.etag)) {
|
|
586
586
|
headers.delete("content-length");
|
|
587
587
|
return new Response(null, { status: 304, headers });
|
|
588
588
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readFarmNativeWebSpec
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-43V3ANPQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isPlainObject,
|
|
6
6
|
readAppPackageJson
|
|
@@ -43,7 +43,7 @@ function scanFarmMobileAppModules(options) {
|
|
|
43
43
|
specs.push({ name: match[2], file });
|
|
44
44
|
}
|
|
45
45
|
const android = entries.filter((entry) => entry.endsWith(".kt")).map((entry) => path.join(dir, entry));
|
|
46
|
-
const ios = entries.filter((entry) =>
|
|
46
|
+
const ios = entries.filter((entry) => /\.(?:mm|m|h|swift)$/.test(entry)).map((entry) => path.join(dir, entry));
|
|
47
47
|
if (specs.length === 0 && android.length === 0 && ios.length === 0) return void 0;
|
|
48
48
|
return { dir, specs, android, ios };
|
|
49
49
|
}
|
|
@@ -180,15 +180,20 @@ async function scanRoutePatterns(options) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
if (!options.platformFiles) return { pages, modules };
|
|
183
|
+
const nativeOnlyPages = /* @__PURE__ */ new Set();
|
|
183
184
|
for (const [pattern, files] of nativePages) {
|
|
184
|
-
if (
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
);
|
|
185
|
+
if (pages.has(pattern)) continue;
|
|
186
|
+
if (files.native) {
|
|
187
|
+
nativeOnlyPages.add(pattern);
|
|
188
|
+
continue;
|
|
189
189
|
}
|
|
190
|
+
const file = path.relative(root, Object.values(files)[0]);
|
|
191
|
+
const dir = path.dirname(file);
|
|
192
|
+
throw new Error(
|
|
193
|
+
`${file.replace(/\\/g, "/")} has no web page next to it. Add ${path.join(dir, "page.tsx").replace(/\\/g, "/")} (the route's web screen and fallback), or ${path.join(dir, "page.native.tsx").replace(/\\/g, "/")} to make the route native-only on both OSes.`
|
|
194
|
+
);
|
|
190
195
|
}
|
|
191
|
-
return { pages, modules, pageFiles, nativePages, nativeLayouts };
|
|
196
|
+
return { pages, modules, pageFiles, nativePages, nativeLayouts, nativeOnlyPages };
|
|
192
197
|
}
|
|
193
198
|
function scanPlatformRouteFiles(appDir, files, nativePages, nativeLayouts) {
|
|
194
199
|
const seen = /* @__PURE__ */ new Map();
|