@farm.js/core 0.1.31 → 0.1.35
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/README.md +1 -1
- package/dist/agent-runtime.cjs +70 -15
- package/dist/agent-runtime.d.mts +4 -5
- package/dist/agent-runtime.d.ts +4 -5
- package/dist/agent-runtime.mjs +59 -4
- package/dist/api/route-manager.cjs +17 -14
- package/dist/api/route-manager.d.mts +6 -7
- package/dist/api/route-manager.d.ts +6 -7
- package/dist/api/route-manager.mjs +16 -13
- package/dist/api/runtime.cjs +12 -8
- package/dist/api/runtime.d.mts +4 -5
- package/dist/api/runtime.d.ts +4 -5
- package/dist/api/runtime.mjs +12 -8
- package/dist/api.cjs +20 -17
- package/dist/api.d.mts +7 -8
- package/dist/api.d.ts +7 -8
- package/dist/api.mjs +19 -16
- package/dist/{app-sUJ3jnTZ.d.ts → app-BXB3JZYc.d.ts} +38 -12
- package/dist/{app-DAuUTIZf.d.mts → app-D_j9AAVL.d.mts} +38 -12
- package/dist/app-markdown.cjs +8 -6
- package/dist/app-markdown.d.mts +6 -7
- package/dist/app-markdown.d.ts +6 -7
- package/dist/app-markdown.mjs +7 -5
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +10 -1
- package/dist/cache.d.ts +10 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-BXFWA23T.mjs → chunk-22LTEMGQ.mjs} +3 -3
- package/dist/{chunk-YZTASLPQ.cjs → chunk-27ZWSI3W.cjs} +2 -2
- package/dist/{chunk-WBIH66JK.mjs → chunk-2ELDTQRN.mjs} +5 -2
- package/dist/{chunk-K7CELQLK.cjs → chunk-2F2ER724.cjs} +54 -29
- package/dist/{chunk-O3DTUAX2.mjs → chunk-2G2NNLE2.mjs} +6 -77
- package/dist/{chunk-NRVGEI5I.mjs → chunk-2NNMOPDN.mjs} +4 -210
- package/dist/{chunk-CTV2TTNP.cjs → chunk-3BHT4WMP.cjs} +16 -87
- package/dist/chunk-3BU22U3M.cjs +237 -0
- package/dist/{chunk-MM5D6VLP.mjs → chunk-3KZS4SUS.mjs} +33 -14
- package/dist/{chunk-VA62MHFV.mjs → chunk-3PXS2MHU.mjs} +1 -1
- package/dist/chunk-3SDFA7UF.cjs +701 -0
- package/dist/{chunk-4IEPYMHF.mjs → chunk-3UEVPCGW.mjs} +1 -1
- package/dist/{chunk-MXDTKXO6.cjs → chunk-3UH7MRCP.cjs} +73 -26
- package/dist/{chunk-7QOCTYBS.mjs → chunk-4JHOT46A.mjs} +37 -1
- package/dist/{chunk-6L6DQR5W.mjs → chunk-4KU5Q7C2.mjs} +917 -305
- package/dist/{chunk-3FCFQP5V.cjs → chunk-4MMGO7YW.cjs} +25 -25
- package/dist/{chunk-5HGR3W6O.mjs → chunk-5SJWVY6R.mjs} +8 -0
- package/dist/{chunk-KZLND3D2.cjs → chunk-62XKI4Z3.cjs} +7 -5
- package/dist/{chunk-FJZ3DQLK.mjs → chunk-6DU6UFUE.mjs} +13 -12
- package/dist/{chunk-TEN4FIZU.mjs → chunk-6ETPZTJI.mjs} +513 -3
- package/dist/{chunk-VUMAE7NC.mjs → chunk-6TJOML4E.mjs} +92 -31
- package/dist/{chunk-3ATMYLLJ.mjs → chunk-6WCPV6G2.mjs} +1 -1
- package/dist/{chunk-FYRBX5IY.cjs → chunk-73MC7ZL6.cjs} +2 -2
- package/dist/chunk-75RZHGLS.cjs +135 -0
- package/dist/{chunk-QZRVZSPN.cjs → chunk-77GNHH2Z.cjs} +3 -3
- package/dist/{chunk-FXUUWYAX.cjs → chunk-7GLPRTTF.cjs} +12 -2
- package/dist/{chunk-A777V5WU.cjs → chunk-7L5V3KQO.cjs} +2 -2
- package/dist/{chunk-4ZQQL4IU.mjs → chunk-AHGECQEW.mjs} +1 -1
- package/dist/{chunk-RG3ZOTG5.cjs → chunk-AI7QMY7O.cjs} +10 -3
- package/dist/{chunk-YMCXWPWK.mjs → chunk-BCMSYSN2.mjs} +4 -1
- package/dist/{chunk-I6XDAKWQ.mjs → chunk-BTHHUD7Q.mjs} +14 -0
- package/dist/{chunk-LI2LMOLR.mjs → chunk-C35ZBVRD.mjs} +12 -3
- package/dist/chunk-C4SPBWFM.cjs +26 -0
- package/dist/{chunk-YQVSHTMR.mjs → chunk-CP6X4AEU.mjs} +1 -1
- package/dist/{chunk-QZCT2CQ4.mjs → chunk-CXEN47J3.mjs} +64 -2
- package/dist/{chunk-WNLBF77X.cjs → chunk-D227TIEN.cjs} +28 -16
- package/dist/{chunk-ROUTX2E5.cjs → chunk-DBNKI4NF.cjs} +12 -3
- package/dist/{chunk-J3LOGE4T.cjs → chunk-DQQOKWYA.cjs} +5 -5
- package/dist/chunk-E5GNDG5F.mjs +701 -0
- package/dist/{chunk-X7KZBF63.cjs → chunk-EFCQPQMG.cjs} +40 -4
- package/dist/{chunk-K3F2E6GS.cjs → chunk-EJQT6KZN.cjs} +2 -2
- package/dist/{chunk-3LUF2PE2.cjs → chunk-EK4QAEFZ.cjs} +67 -5
- package/dist/{chunk-VVBO3QH7.mjs → chunk-ENLZ4R3Y.mjs} +10 -1
- package/dist/{chunk-KJ2TIHZZ.cjs → chunk-EUV4YR3V.cjs} +3 -2
- package/dist/{chunk-E76XC6ZG.mjs → chunk-EZDQRNQ7.mjs} +2 -2
- package/dist/{chunk-TOVMYGYW.mjs → chunk-F2SE2VDO.mjs} +1 -1
- package/dist/{chunk-MNUGPHLN.mjs → chunk-F6Z3Y5KL.mjs} +5 -3
- package/dist/{chunk-DFLLARUK.cjs → chunk-F7JZENPF.cjs} +35 -34
- package/dist/{chunk-BSPQVJ4A.mjs → chunk-FDR64H6B.mjs} +13 -0
- package/dist/{chunk-5OVTOKGH.cjs → chunk-FFFW3OQ7.cjs} +2 -2
- package/dist/{chunk-D4JE5NNV.cjs → chunk-FNO7A7CM.cjs} +5 -5
- package/dist/{chunk-Z5HIWVDP.cjs → chunk-FTFYRMQQ.cjs} +80 -91
- package/dist/chunk-FZ6YYU2W.mjs +65 -0
- package/dist/{chunk-X7WVQMIB.mjs → chunk-G5RT7EXW.mjs} +11 -5
- package/dist/{chunk-IXUY2F5U.mjs → chunk-GCXWJJKH.mjs} +4 -7
- package/dist/{chunk-ES4B2IXW.cjs → chunk-GFHLGIYC.cjs} +8 -8
- package/dist/{chunk-SORB3MAR.cjs → chunk-GQ3Z3IZI.cjs} +17 -17
- package/dist/{chunk-75WGQVQA.cjs → chunk-HITLGIAO.cjs} +10 -1
- package/dist/{chunk-HBTUGXHS.cjs → chunk-HLJ6MBUZ.cjs} +7 -4
- package/dist/{chunk-JLCQGPXE.mjs → chunk-HMIJDL7S.mjs} +51 -62
- package/dist/{chunk-F6XEGFHO.mjs → chunk-HUMR6LSU.mjs} +11 -1
- package/dist/{chunk-IMB4PIAR.cjs → chunk-ICUQICNC.cjs} +1441 -828
- package/dist/{chunk-ZCU4NZ3M.cjs → chunk-IE7XCHH3.cjs} +4 -4
- package/dist/{chunk-I26CZYPV.cjs → chunk-IHNIDL6H.cjs} +50 -7
- package/dist/{chunk-2FQHH5SC.mjs → chunk-IHNMMXHV.mjs} +49 -24
- package/dist/{chunk-YVGAEAA5.cjs → chunk-IPXLADVO.cjs} +522 -12
- package/dist/{chunk-VHJGDMCG.cjs → chunk-IWZKTWHZ.cjs} +2 -2
- package/dist/chunk-JG6DJF5A.mjs +238 -0
- package/dist/{chunk-KROWKCUH.cjs → chunk-JGLC4TO3.cjs} +8 -1
- package/dist/{chunk-5TISYEQF.mjs → chunk-JM5XPKWH.mjs} +10 -3
- package/dist/{chunk-BJJATPEC.mjs → chunk-KN7K4VQN.mjs} +1 -1
- package/dist/{chunk-WPYFSQKK.cjs → chunk-KNBBQHO2.cjs} +15 -1
- package/dist/{chunk-XWAWFQFS.cjs → chunk-KXWRO25S.cjs} +7 -4
- package/dist/chunk-LSKZMJMP.cjs +65 -0
- package/dist/{chunk-2N5PX3LS.mjs → chunk-LYV44OIR.mjs} +7 -1
- package/dist/chunk-M7MKQXAF.cjs +87 -0
- package/dist/{chunk-IV6CQY7O.mjs → chunk-MSSFIQGM.mjs} +63 -13
- package/dist/{chunk-KH7BN726.cjs → chunk-N4UOK6ZI.cjs} +8 -2
- package/dist/{chunk-JNGIWIY6.mjs → chunk-NPC7VWJE.mjs} +2 -2
- package/dist/chunk-NRDBW4MP.mjs +45 -0
- package/dist/{chunk-ILWLPEVO.mjs → chunk-NRSN7G7E.mjs} +2 -2
- package/dist/chunk-OFZUJMCU.mjs +601 -0
- package/dist/{chunk-L4DVIHOC.mjs → chunk-OKZUAXHF.mjs} +1 -1
- package/dist/{chunk-EM6SBQKM.cjs → chunk-OMVAU7NT.cjs} +27 -2
- package/dist/{chunk-AHAJGAYD.mjs → chunk-PDOCJ6RY.mjs} +2 -2
- package/dist/{chunk-IFI5FXEZ.cjs → chunk-PFQKNERH.cjs} +562 -251
- package/dist/{chunk-S5GDHOE4.mjs → chunk-PZNL3WEG.mjs} +48 -5
- package/dist/{chunk-GZYH4OER.mjs → chunk-Q3VLETLE.mjs} +2 -2
- package/dist/{chunk-WG2KHOMN.mjs → chunk-QAU5JD57.mjs} +571 -260
- package/dist/{chunk-FV45CKBC.mjs → chunk-QCFBDFRS.mjs} +1 -1
- package/dist/{chunk-75BRBIFP.cjs → chunk-QCVE2OCI.cjs} +5 -8
- package/dist/{chunk-6ZCMSZ5U.mjs → chunk-QE6VAKLT.mjs} +1 -1
- package/dist/{chunk-QG5HNS7P.mjs → chunk-QORUJDIV.mjs} +2 -2
- package/dist/chunk-RHAZ22ZN.mjs +87 -0
- package/dist/{chunk-CUMINO7Z.cjs → chunk-RU3M2FIK.cjs} +18 -14
- package/dist/{chunk-DGXN3L4D.mjs → chunk-SAZVVAJH.mjs} +5 -5
- package/dist/{chunk-MKMBQSNQ.mjs → chunk-SC2WYWPF.mjs} +3 -3
- package/dist/{chunk-QCFFHV5H.mjs → chunk-SMHH4VDG.mjs} +1 -1
- package/dist/{chunk-UAFSBWNT.mjs → chunk-SOMHP6GF.mjs} +63 -16
- package/dist/{chunk-ND224OE2.cjs → chunk-TKSCR644.cjs} +34 -15
- package/dist/{chunk-4V7GIE2U.mjs → chunk-UAORZ7QA.mjs} +3 -3
- package/dist/{chunk-IQXFRNY2.cjs → chunk-UFDAAQFX.cjs} +2 -2
- package/dist/{chunk-6VYZOPOT.mjs → chunk-UJD4PHYB.mjs} +15 -11
- package/dist/{chunk-ZHVYQL3H.cjs → chunk-ULAWS2PA.cjs} +97 -36
- package/dist/{chunk-5ZSWG4UX.cjs → chunk-UXFQ3UDA.cjs} +14 -1
- package/dist/{chunk-MPEYMSCF.cjs → chunk-VFQT3LAO.cjs} +5 -5
- package/dist/{chunk-2FXWWUE5.cjs → chunk-VZJR7UTG.cjs} +6 -6
- package/dist/{chunk-2AKFKCHA.mjs → chunk-W7LF2J2S.mjs} +1 -1
- package/dist/chunk-WWFTAUFG.cjs +45 -0
- package/dist/{chunk-JBC2FKRW.mjs → chunk-WWIKMBRN.mjs} +2 -1
- package/dist/{chunk-75DYEVXI.cjs → chunk-X6W5FFH6.cjs} +11 -11
- package/dist/{chunk-EXLKRR4U.cjs → chunk-XBML5KMG.cjs} +12 -12
- package/dist/{chunk-PZNCMPJF.cjs → chunk-XCACDAZZ.cjs} +18 -12
- package/dist/{chunk-JATSG2ZO.mjs → chunk-XCMCS4DA.mjs} +15 -3
- package/dist/{chunk-UJ2C4ICS.cjs → chunk-XJXBIP67.cjs} +4 -4
- package/dist/{chunk-XF7Q24PF.mjs → chunk-Y7RKTKYI.mjs} +25 -0
- package/dist/{chunk-VYZSOYR4.cjs → chunk-YC6V7PWE.cjs} +1 -1
- package/dist/{chunk-F6OHXPWR.mjs → chunk-YFILVET3.mjs} +8 -1
- package/dist/{chunk-JLRDISQL.cjs → chunk-YKX5BK66.cjs} +7 -7
- package/dist/{chunk-DYEJQTDN.cjs → chunk-YSCV4SJF.cjs} +4 -4
- package/dist/chunk-YSLWRWWP.cjs +601 -0
- package/dist/{chunk-5LJCOSKT.mjs → chunk-YULD7ICZ.mjs} +1 -1
- package/dist/{chunk-2SDO73HK.cjs → chunk-YWN746US.cjs} +64 -14
- package/dist/chunk-Z2HLU4IX.cjs +238 -0
- package/dist/chunk-ZLAT2CWY.mjs +135 -0
- package/dist/{chunk-T5CERMEH.cjs → chunk-ZXGAFZDO.cjs} +2 -2
- package/dist/{client-plugins-BX2ptm4H.d.mts → client-plugins-CvIslxWi.d.mts} +232 -8
- package/dist/{client-plugins-BmxM5KW_.d.ts → client-plugins-HIyulDym.d.ts} +232 -8
- package/dist/client-plugins.d.mts +4 -5
- package/dist/client-plugins.d.ts +4 -5
- package/dist/client.cjs +10 -10
- package/dist/client.d.mts +8 -9
- package/dist/client.d.ts +8 -9
- package/dist/client.mjs +9 -9
- package/dist/config.d.mts +4 -5
- package/dist/config.d.ts +4 -5
- package/dist/{devtools-EWRDHCD5.cjs → devtools-EAUY43BS.cjs} +14 -12
- package/dist/{devtools-BPBCYOU6.mjs → devtools-EE5RIBTH.mjs} +13 -11
- package/dist/docs.cjs +17 -15
- package/dist/docs.d.mts +46 -4
- package/dist/docs.d.ts +46 -4
- package/dist/docs.mjs +16 -14
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.mjs +1 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +14 -13
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +5 -4
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +5 -4
- 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-a-8Z5kZU.d.mts → index-BJJfLxJo.d.mts} +2 -2
- package/dist/{index-BWVfxIsO.d.ts → index-CwoOP-MW.d.ts} +2 -2
- package/dist/index.cjs +75 -60
- package/dist/index.d.mts +21 -22
- package/dist/index.d.ts +21 -22
- package/dist/index.mjs +79 -64
- package/dist/integrations.cjs +7 -4
- package/dist/integrations.d.mts +4 -5
- package/dist/integrations.d.ts +4 -5
- package/dist/integrations.mjs +8 -5
- package/dist/internal/app-markdown-runtime.cjs +7 -5
- package/dist/internal/app-markdown-runtime.d.mts +17 -7
- package/dist/internal/app-markdown-runtime.d.ts +17 -7
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +44 -41
- package/dist/internal/build-runtime.d.mts +6 -7
- package/dist/internal/build-runtime.d.ts +6 -7
- package/dist/internal/build-runtime.mjs +43 -40
- package/dist/internal/cli-runtime.cjs +23 -20
- package/dist/internal/cli-runtime.mjs +22 -19
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +5 -3
- package/dist/internal/client-runtime.d.mts +9 -1
- package/dist/internal/client-runtime.d.ts +9 -1
- package/dist/internal/client-runtime.mjs +4 -2
- package/dist/internal/compression-runtime.d.mts +4 -5
- package/dist/internal/compression-runtime.d.ts +4 -5
- package/dist/internal/config-runtime.cjs +14 -12
- package/dist/internal/config-runtime.d.mts +5 -6
- package/dist/internal/config-runtime.d.ts +5 -6
- package/dist/internal/config-runtime.mjs +13 -11
- package/dist/internal/infra-analytics-runtime.cjs +4 -4
- package/dist/internal/infra-analytics-runtime.mjs +2 -2
- package/dist/internal/isolated-boundary.cjs +3 -2
- package/dist/internal/isolated-boundary.d.mts +1 -0
- package/dist/internal/isolated-boundary.d.ts +1 -0
- package/dist/internal/isolated-boundary.mjs +2 -1
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +61 -31
- package/dist/internal/production-runtime.d.mts +165 -18
- package/dist/internal/production-runtime.d.ts +165 -18
- package/dist/internal/production-runtime.mjs +57 -27
- package/dist/internal/request-cookies.cjs +4 -2
- package/dist/internal/request-cookies.d.mts +9 -1
- package/dist/internal/request-cookies.d.ts +9 -1
- package/dist/internal/request-cookies.mjs +3 -1
- package/dist/internal/server-tree.cjs +12 -0
- package/dist/internal/server-tree.d.mts +27 -0
- package/dist/internal/server-tree.d.ts +27 -0
- package/dist/internal/server-tree.mjs +12 -0
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +4 -5
- package/dist/markdown.d.ts +4 -5
- package/dist/markdown.mjs +3 -3
- package/dist/{metadata-DsEaK7mQ.d.mts → metadata-BnLDsUOS.d.ts} +16 -2
- package/dist/{metadata-fwZ3gfG6.d.ts → metadata-WGpBYcGn.d.mts} +16 -2
- package/dist/middleware.cjs +18 -8
- package/dist/middleware.d.mts +27 -9
- package/dist/middleware.d.ts +27 -9
- package/dist/middleware.mjs +18 -8
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +7 -8
- package/dist/navigation.d.ts +7 -8
- package/dist/navigation.mjs +6 -6
- package/dist/{nitro-NAKCRVHX.mjs → nitro-MXRDCXWZ.mjs} +5 -5
- package/dist/{nitro-VYDZGYFY.cjs → nitro-OVPLKPE2.cjs} +7 -7
- package/dist/{observability-BupkiN0m.d.mts → observability-CoXunYhS.d.mts} +4 -3
- package/dist/{observability-BupkiN0m.d.ts → observability-CoXunYhS.d.ts} +4 -3
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +39 -36
- package/dist/plugin.d.mts +4 -5
- package/dist/plugin.d.ts +4 -5
- package/dist/plugin.mjs +38 -35
- package/dist/{production-runtime-Baqgwtvc.d.mts → production-runtime-0sRnuYc-.d.mts} +11 -4
- package/dist/{production-runtime-DNkpFnmg.d.ts → production-runtime-Crq6CJ-2.d.ts} +11 -4
- package/dist/query/client.cjs +8 -8
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-rkIK9wd9.d.ts → render-plan-8ozZh2Qv.d.ts} +1 -1
- package/dist/{render-plan-DhwQnmmX.d.mts → render-plan-gs9GGPzw.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +10 -4
- package/dist/renderer/react/server.d.mts +2 -1
- package/dist/renderer/react/server.d.ts +2 -1
- package/dist/renderer/react/server.mjs +7 -1
- package/dist/renderer-client.cjs +40 -20
- package/dist/renderer-client.d.mts +6 -7
- package/dist/renderer-client.d.ts +6 -7
- package/dist/renderer-client.mjs +29 -9
- package/dist/renderer.d.mts +2 -0
- package/dist/renderer.d.ts +2 -0
- package/dist/{request-BcY4RYPC.d.ts → request-B5G8rLBH.d.ts} +7 -2
- package/dist/{request-CFy1BltJ.d.mts → request-fkhiynXe.d.mts} +7 -2
- package/dist/request.cjs +2 -2
- package/dist/request.d.mts +5 -6
- package/dist/request.d.ts +5 -6
- package/dist/request.mjs +1 -1
- package/dist/{resolver-PPEeiJ6M.d.ts → resolver-DadfRL6F.d.ts} +1 -1
- package/dist/{resolver-DhW0CqZN.d.mts → resolver-khasx3fU.d.mts} +1 -1
- package/dist/{route-rendering-BkS0TBlB.d.mts → route-rendering-CLnS7AZj.d.mts} +1 -1
- package/dist/{route-rendering-D4XpMjam.d.ts → route-rendering-lS5nUMua.d.ts} +1 -1
- package/dist/{router-Cq7BcZxg.d.ts → router-4iuiYnOW.d.ts} +1 -1
- package/dist/{router-C4zPlC3V.d.mts → router-ifU8Dui1.d.mts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +4 -5
- package/dist/routes.d.ts +4 -5
- package/dist/routes.mjs +2 -2
- package/dist/{runtime-BirxPwbZ.d.ts → runtime-BgDQzBiu.d.ts} +2 -2
- package/dist/{runtime-AOJge4vQ.d.mts → runtime-CV2UCV-5.d.mts} +2 -2
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +5 -6
- package/dist/server-plugins.d.ts +5 -6
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.cjs +3 -3
- package/dist/server-query-client.mjs +2 -2
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +66 -63
- package/dist/server.d.mts +13 -14
- package/dist/server.d.ts +13 -14
- package/dist/server.mjs +43 -40
- package/dist/{spa-router-DzPZH-AO.d.mts → spa-router-Bq7VCOwx.d.mts} +3 -3
- package/dist/{spa-router-B1HI3X9k.d.ts → spa-router-DaJk5Re4.d.ts} +3 -3
- package/dist/testing.cjs +22 -20
- package/dist/testing.d.mts +4 -5
- package/dist/testing.d.ts +4 -5
- package/dist/testing.mjs +18 -16
- package/dist/theme/server.cjs +4 -3
- package/dist/theme/server.mjs +3 -2
- package/dist/{types-Z0aotQ8w.d.mts → types-CnH8DOqo.d.mts} +1 -1
- package/dist/{types-Z0aotQ8w.d.ts → types-CnH8DOqo.d.ts} +1 -1
- package/dist/{utils-DMD1Hzta.d.ts → utils-BXLmFsVR.d.ts} +1 -1
- package/dist/{utils-CEBktlBG.d.mts → utils-XJn0c9bj.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +39 -36
- package/dist/vite.d.mts +4 -5
- package/dist/vite.d.ts +4 -5
- package/dist/vite.mjs +38 -35
- package/dist/{workflows-CR9ex-gz.d.ts → workflows-jZ4BcdoZ.d.mts} +1 -1
- package/dist/{workflows-CR9ex-gz.d.mts → workflows-jZ4BcdoZ.d.ts} +1 -1
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +2 -2
- package/package.json +10 -2
- package/dist/chunk-22GUSVNJ.cjs +0 -351
- package/dist/chunk-5MKEDGLD.cjs +0 -53
- package/dist/chunk-O6XNAMBV.mjs +0 -53
- package/dist/chunk-SWN467MP.cjs +0 -18
- package/dist/chunk-XGC343EY.cjs +0 -443
- package/dist/chunk-ZSH2Y4LN.mjs +0 -351
- package/dist/types-DFbjpjXX.d.mts +0 -105
- package/dist/types-DFbjpjXX.d.ts +0 -105
- /package/dist/{chunk-SUIBNSNO.cjs → chunk-SJNMVDDF.cjs} +0 -0
- /package/dist/{chunk-LNZ7JZUS.mjs → chunk-UDNPLXW7.mjs} +0 -0
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
isRouteSlotSegment,
|
|
3
|
+
parseInterceptionMarker
|
|
4
|
+
} from "./chunk-RHAZ22ZN.mjs";
|
|
5
|
+
import {
|
|
6
6
|
normalizeMiddlewareModule,
|
|
7
7
|
parseMiddlewareCookieHeader,
|
|
8
8
|
serializeMiddlewareCookie,
|
|
9
9
|
serializeMiddlewareCookieDeletion
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2NNMOPDN.mjs";
|
|
11
|
+
import {
|
|
12
|
+
compileMiddlewareConfig,
|
|
13
|
+
compileMiddlewareRoute,
|
|
14
|
+
matchesMiddlewareConfigAt,
|
|
15
|
+
matchesMiddlewareRouteAt
|
|
16
|
+
} from "./chunk-JG6DJF5A.mjs";
|
|
11
17
|
import {
|
|
12
18
|
createCliColors
|
|
13
19
|
} from "./chunk-I2BHUNBU.mjs";
|
|
@@ -18,6 +24,9 @@ import {
|
|
|
18
24
|
import {
|
|
19
25
|
logger
|
|
20
26
|
} from "./chunk-KI3MESHB.mjs";
|
|
27
|
+
import {
|
|
28
|
+
createFarmAPIMiddlewarePathnames
|
|
29
|
+
} from "./chunk-BTHHUD7Q.mjs";
|
|
21
30
|
import {
|
|
22
31
|
emitFarmEvent
|
|
23
32
|
} from "./chunk-FUZEBRP3.mjs";
|
|
@@ -31,7 +40,7 @@ import {
|
|
|
31
40
|
} from "./chunk-CBBLJMR5.mjs";
|
|
32
41
|
import {
|
|
33
42
|
resolveFarmRequestURL
|
|
34
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-FDR64H6B.mjs";
|
|
35
44
|
import {
|
|
36
45
|
stripFarmLocaleFromPathname
|
|
37
46
|
} from "./chunk-L3KT7IXV.mjs";
|
|
@@ -185,12 +194,33 @@ import * as path from "path";
|
|
|
185
194
|
|
|
186
195
|
// src/middleware/path.ts
|
|
187
196
|
function appendMiddlewareRoutePath(routePath, directoryName) {
|
|
188
|
-
|
|
197
|
+
const marker = parseInterceptionMarker(directoryName);
|
|
198
|
+
if (marker) {
|
|
199
|
+
const owner = routePath.split("/").filter(Boolean);
|
|
200
|
+
const parts = [
|
|
201
|
+
...marker.root ? [] : owner.slice(0, Math.max(0, owner.length - marker.up)),
|
|
202
|
+
...marker.remainder ? [marker.remainder] : []
|
|
203
|
+
];
|
|
204
|
+
return `/${parts.join("/")}`;
|
|
205
|
+
}
|
|
206
|
+
if (directoryName.startsWith("(") && directoryName.endsWith(")") || isRouteSlotSegment(directoryName)) {
|
|
189
207
|
return routePath;
|
|
190
208
|
}
|
|
191
209
|
return routePath === "/" ? `/${directoryName}` : `${routePath}/${directoryName}`;
|
|
192
210
|
}
|
|
193
211
|
__name(appendMiddlewareRoutePath, "appendMiddlewareRoutePath");
|
|
212
|
+
function appendMiddlewareDirectory(directory, directoryName) {
|
|
213
|
+
return directory === "" ? directoryName : `${directory}/${directoryName}`;
|
|
214
|
+
}
|
|
215
|
+
__name(appendMiddlewareDirectory, "appendMiddlewareDirectory");
|
|
216
|
+
function countSegments(value) {
|
|
217
|
+
return value.split("/").filter(Boolean).length;
|
|
218
|
+
}
|
|
219
|
+
__name(countSegments, "countSegments");
|
|
220
|
+
function compareMiddlewareRouteLocations(left, right) {
|
|
221
|
+
return countSegments(left.path) - countSegments(right.path) || left.path.localeCompare(right.path) || countSegments(left.directory) - countSegments(right.directory) || left.directory.localeCompare(right.directory);
|
|
222
|
+
}
|
|
223
|
+
__name(compareMiddlewareRouteLocations, "compareMiddlewareRouteLocations");
|
|
194
224
|
|
|
195
225
|
// src/middleware/manager.ts
|
|
196
226
|
function isMiddlewareResponse(value) {
|
|
@@ -198,13 +228,14 @@ function isMiddlewareResponse(value) {
|
|
|
198
228
|
}
|
|
199
229
|
__name(isMiddlewareResponse, "isMiddlewareResponse");
|
|
200
230
|
var _MiddlewareManager = class _MiddlewareManager {
|
|
201
|
-
constructor(appDir, viteServer, config, i18n, server) {
|
|
231
|
+
constructor(appDir, viteServer, config, i18n, server, apiBasePath) {
|
|
202
232
|
this.middleware = [];
|
|
203
233
|
this.configMiddleware = [];
|
|
204
234
|
this.appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
|
|
205
235
|
this.viteServer = viteServer;
|
|
206
236
|
this.i18n = i18n;
|
|
207
237
|
this.server = server;
|
|
238
|
+
this.toMiddlewarePathnames = createFarmAPIMiddlewarePathnames(apiBasePath);
|
|
208
239
|
this.configure(config);
|
|
209
240
|
}
|
|
210
241
|
configure(config) {
|
|
@@ -233,21 +264,16 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
233
264
|
* Discover all middleware.ts files
|
|
234
265
|
*/
|
|
235
266
|
async discover() {
|
|
236
|
-
const
|
|
267
|
+
const middlewareByDirectory = /* @__PURE__ */ new Map();
|
|
237
268
|
for (const appDir of this.appDirs) {
|
|
238
269
|
const discovered = [];
|
|
239
|
-
await this.discoverInDirectory(appDir, "/", discovered);
|
|
240
|
-
for (const
|
|
241
|
-
compileMiddlewareRoute(middleware);
|
|
242
|
-
|
|
270
|
+
await this.discoverInDirectory(appDir, "/", "", discovered);
|
|
271
|
+
for (const entry of discovered) {
|
|
272
|
+
compileMiddlewareRoute(entry.middleware);
|
|
273
|
+
middlewareByDirectory.set(entry.location.directory, entry);
|
|
243
274
|
}
|
|
244
275
|
}
|
|
245
|
-
this.middleware = Array.from(
|
|
246
|
-
this.middleware.sort((a, b) => {
|
|
247
|
-
const depthA = a.path.split("/").filter(Boolean).length;
|
|
248
|
-
const depthB = b.path.split("/").filter(Boolean).length;
|
|
249
|
-
return depthA - depthB;
|
|
250
|
-
});
|
|
276
|
+
this.middleware = Array.from(middlewareByDirectory.values()).sort((left, right) => compareMiddlewareRouteLocations(left.location, right.location)).map((entry) => entry.middleware);
|
|
251
277
|
if (process.env.FARM_VERBOSE && this.middleware.length > 0) {
|
|
252
278
|
logger.success(`Discovered ${this.middleware.length} middleware files`);
|
|
253
279
|
for (const mw of this.middleware) {
|
|
@@ -258,7 +284,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
258
284
|
/**
|
|
259
285
|
* Recursively discover middleware files
|
|
260
286
|
*/
|
|
261
|
-
async discoverInDirectory(dir, routePath, discovered) {
|
|
287
|
+
async discoverInDirectory(dir, routePath, directory, discovered) {
|
|
262
288
|
if (!fs.existsSync(dir)) {
|
|
263
289
|
return;
|
|
264
290
|
}
|
|
@@ -266,15 +292,18 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
266
292
|
if (middlewareFile) {
|
|
267
293
|
const middleware = await this.loadMiddleware(middlewareFile, routePath);
|
|
268
294
|
if (middleware) {
|
|
269
|
-
discovered.push(middleware);
|
|
295
|
+
discovered.push({ location: { path: routePath, directory }, middleware });
|
|
270
296
|
}
|
|
271
297
|
}
|
|
272
298
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
273
299
|
for (const entry of entries) {
|
|
274
|
-
if (entry.isDirectory() && !entry.name.startsWith(".")
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
300
|
+
if (entry.isDirectory() && !entry.name.startsWith(".")) {
|
|
301
|
+
await this.discoverInDirectory(
|
|
302
|
+
path.join(dir, entry.name),
|
|
303
|
+
appendMiddlewareRoutePath(routePath, entry.name),
|
|
304
|
+
appendMiddlewareDirectory(directory, entry.name),
|
|
305
|
+
discovered
|
|
306
|
+
);
|
|
278
307
|
}
|
|
279
308
|
}
|
|
280
309
|
}
|
|
@@ -329,7 +358,9 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
329
358
|
async execute(req, res) {
|
|
330
359
|
const url = resolveFarmRequestURL(req, { trustProxy: this.server?.trustProxy });
|
|
331
360
|
const pathname = url.pathname;
|
|
332
|
-
const
|
|
361
|
+
const toRoutePathname = /* @__PURE__ */ __name((value) => this.i18n?.enabled ? stripFarmLocaleFromPathname(value, this.i18n) : stripFarmBasePath(value, this.i18n?.basePath ?? "/"), "toRoutePathname");
|
|
362
|
+
const routePathname = toRoutePathname(pathname);
|
|
363
|
+
const toMiddlewarePathnames = this.toMiddlewarePathnames;
|
|
333
364
|
const method = req.method || "GET";
|
|
334
365
|
const startTime = Date.now();
|
|
335
366
|
let parentData;
|
|
@@ -345,7 +376,10 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
345
376
|
}
|
|
346
377
|
const applicable = [
|
|
347
378
|
...this.configMiddleware.map((mw) => ({ mw, routeMatch: { matched: true } })),
|
|
348
|
-
...this.middleware.map((mw) => ({
|
|
379
|
+
...this.middleware.map((mw) => ({
|
|
380
|
+
mw,
|
|
381
|
+
routeMatch: matchesMiddlewareRouteAt(toMiddlewarePathnames(routePathname), mw)
|
|
382
|
+
})).filter((entry) => entry.routeMatch.matched)
|
|
349
383
|
];
|
|
350
384
|
if (applicable.length === 0) {
|
|
351
385
|
return false;
|
|
@@ -360,12 +394,37 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
360
394
|
pc.dim(` (${(Date.now() - startTime).toFixed(2)}ms)`)
|
|
361
395
|
].join(" ");
|
|
362
396
|
console.log(log);
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
397
|
+
const ran = /* @__PURE__ */ new Set();
|
|
398
|
+
const allMiddleware = [...this.configMiddleware, ...this.middleware];
|
|
399
|
+
const globalConfig = this.globalConfig;
|
|
400
|
+
const trustProxy = this.server?.trustProxy;
|
|
401
|
+
function* applicableMiddleware() {
|
|
402
|
+
let passPathname = routePathname;
|
|
403
|
+
let pass = applicable;
|
|
404
|
+
for (; ; ) {
|
|
405
|
+
for (const entry of pass) yield { ...entry, pathname: passPathname };
|
|
406
|
+
const rewrittenPathname = toRoutePathname(
|
|
407
|
+
resolveFarmRequestURL(req, { trustProxy }).pathname
|
|
408
|
+
);
|
|
409
|
+
if (rewrittenPathname === passPathname) return;
|
|
410
|
+
passPathname = rewrittenPathname;
|
|
411
|
+
const passPathnames = toMiddlewarePathnames(passPathname);
|
|
412
|
+
if (globalConfig && !matchesMiddlewareConfigAt(passPathnames, globalConfig, ctx).matched) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
pass = allMiddleware.filter((mw) => !ran.has(mw)).map((mw) => ({
|
|
416
|
+
mw,
|
|
417
|
+
routeMatch: mw.source === "config" ? { matched: true } : matchesMiddlewareRouteAt(passPathnames, mw)
|
|
418
|
+
})).filter((entry) => entry.routeMatch.matched);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
__name(applicableMiddleware, "applicableMiddleware");
|
|
422
|
+
for (const { mw, routeMatch, pathname: passPathname } of applicableMiddleware()) {
|
|
423
|
+
const configMatch = mw.config ? this.matchesConfig(passPathname, mw.config, ctx) : { matched: true };
|
|
366
424
|
if (!configMatch.matched) {
|
|
367
425
|
continue;
|
|
368
426
|
}
|
|
427
|
+
ran.add(mw);
|
|
369
428
|
if (routeMatch.params) {
|
|
370
429
|
ctx.params = { ...ctx.params, ...routeMatch.params };
|
|
371
430
|
}
|
|
@@ -466,7 +525,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
466
525
|
* Check if pathname matches middleware config
|
|
467
526
|
*/
|
|
468
527
|
matchesConfig(pathname, config, ctx) {
|
|
469
|
-
return
|
|
528
|
+
return matchesMiddlewareConfigAt(this.toMiddlewarePathnames(pathname), config, ctx);
|
|
470
529
|
}
|
|
471
530
|
/**
|
|
472
531
|
* Reload middleware (for HMR)
|
|
@@ -501,5 +560,7 @@ var MiddlewareManager = _MiddlewareManager;
|
|
|
501
560
|
export {
|
|
502
561
|
createContext,
|
|
503
562
|
appendMiddlewareRoutePath,
|
|
563
|
+
appendMiddlewareDirectory,
|
|
564
|
+
compareMiddlewareRouteLocations,
|
|
504
565
|
MiddlewareManager
|
|
505
566
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
|
|
3
|
+
var _chunkEFCQPQMGcjs = require('./chunk-EFCQPQMG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -11,7 +11,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
11
11
|
var _url = require('url');
|
|
12
12
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
13
13
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
14
|
-
return
|
|
14
|
+
return _chunkEFCQPQMGcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
15
15
|
source,
|
|
16
16
|
filePath,
|
|
17
17
|
components: options.components,
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkG7HXGLECcjs = require('./chunk-G7HXGLEC.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
11
|
+
|
|
12
|
+
// src/mcp-catalog.ts
|
|
13
|
+
var CATALOGS = /* @__PURE__ */ Symbol.for("farm.mcp.catalogs");
|
|
14
|
+
function catalogs() {
|
|
15
|
+
const state = globalThis;
|
|
16
|
+
return _nullishCoalesce(state[CATALOGS], () => ( (state[CATALOGS] = /* @__PURE__ */ new Map())));
|
|
17
|
+
}
|
|
18
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, catalogs, "catalogs");
|
|
19
|
+
function _listFarmMCPCatalogs() {
|
|
20
|
+
return [...catalogs().values()];
|
|
21
|
+
}
|
|
22
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _listFarmMCPCatalogs, "_listFarmMCPCatalogs");
|
|
23
|
+
function _publishFarmMCPCatalog(server, tools, details) {
|
|
24
|
+
const entry = { server, tools, ...details ? { details } : {} };
|
|
25
|
+
catalogs().set(server.path, entry);
|
|
26
|
+
return () => {
|
|
27
|
+
if (catalogs().get(server.path) === entry) catalogs().delete(server.path);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _publishFarmMCPCatalog, "_publishFarmMCPCatalog");
|
|
31
|
+
var SERVERS = /* @__PURE__ */ Symbol.for("farm.mcp.servers");
|
|
32
|
+
function registeredServers() {
|
|
33
|
+
const state = globalThis;
|
|
34
|
+
return _nullishCoalesce(state[SERVERS], () => ( (state[SERVERS] = /* @__PURE__ */ new Map())));
|
|
35
|
+
}
|
|
36
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, registeredServers, "registeredServers");
|
|
37
|
+
function _listFarmRegisteredMCPServers() {
|
|
38
|
+
return [...registeredServers().values()];
|
|
39
|
+
}
|
|
40
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _listFarmRegisteredMCPServers, "_listFarmRegisteredMCPServers");
|
|
41
|
+
function registerFarmMCPServer(server) {
|
|
42
|
+
const entry = validateFarmMCPServerRegistration(server);
|
|
43
|
+
const key = _nullishCoalesce(entry.path, () => ( entry.url));
|
|
44
|
+
registeredServers().set(key, entry);
|
|
45
|
+
return () => {
|
|
46
|
+
if (registeredServers().get(key) === entry) registeredServers().delete(key);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, registerFarmMCPServer, "registerFarmMCPServer");
|
|
50
|
+
function validateFarmMCPServerRegistration(server) {
|
|
51
|
+
if (!server || typeof server !== "object") {
|
|
52
|
+
throw new TypeError("registerFarmMCPServer expects a server object.");
|
|
53
|
+
}
|
|
54
|
+
const text = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (key, required) => {
|
|
55
|
+
const value = server[key];
|
|
56
|
+
if (value === void 0 && !required) return void 0;
|
|
57
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
58
|
+
throw new TypeError(`registerFarmMCPServer ${key} must be a non-empty string.`);
|
|
59
|
+
}
|
|
60
|
+
return value.trim();
|
|
61
|
+
}, "text");
|
|
62
|
+
const name = text("name", true);
|
|
63
|
+
const version = text("version", true);
|
|
64
|
+
const title = text("title", false);
|
|
65
|
+
const description = text("description", false);
|
|
66
|
+
const { path, url } = server;
|
|
67
|
+
if (path === void 0 === (url === void 0)) {
|
|
68
|
+
throw new TypeError("registerFarmMCPServer takes exactly one of path and url.");
|
|
69
|
+
}
|
|
70
|
+
let endpoint;
|
|
71
|
+
if (path !== void 0) {
|
|
72
|
+
if (typeof path !== "string" || !/^\/(?!\/)[^?#\\\s]*$/.test(path) || path.split("/").some((segment) => segment === "." || segment === "..")) {
|
|
73
|
+
throw new TypeError(
|
|
74
|
+
"registerFarmMCPServer path must be an absolute app path without a query, hash, or dot segments."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
endpoint = { path: path.length > 1 ? path.replace(/\/+$/, "") : path };
|
|
78
|
+
} else {
|
|
79
|
+
let parsed;
|
|
80
|
+
try {
|
|
81
|
+
parsed = typeof url === "string" ? new URL(url) : void 0;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
parsed = void 0;
|
|
84
|
+
}
|
|
85
|
+
if (!parsed || parsed.protocol !== "https:" && parsed.protocol !== "http:" || parsed.username || parsed.password || parsed.search || parsed.hash) {
|
|
86
|
+
throw new TypeError(
|
|
87
|
+
"registerFarmMCPServer url must be an absolute http(s) URL without credentials, a query, or a hash."
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
endpoint = { url: `${parsed.origin}${parsed.pathname.replace(/\/+$/, "")}` };
|
|
91
|
+
}
|
|
92
|
+
const { protocolVersions } = server;
|
|
93
|
+
if (protocolVersions !== void 0 && (!Array.isArray(protocolVersions) || protocolVersions.some((version2) => typeof version2 !== "string" || !version2.trim()))) {
|
|
94
|
+
throw new TypeError("registerFarmMCPServer protocolVersions must be non-empty strings.");
|
|
95
|
+
}
|
|
96
|
+
return Object.freeze({
|
|
97
|
+
name,
|
|
98
|
+
version,
|
|
99
|
+
...title ? { title } : {},
|
|
100
|
+
...description ? { description } : {},
|
|
101
|
+
..._optionalChain([protocolVersions, 'optionalAccess', _ => _.length]) ? { protocolVersions: Object.freeze([...protocolVersions]) } : {},
|
|
102
|
+
...endpoint
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, validateFarmMCPServerRegistration, "validateFarmMCPServerRegistration");
|
|
106
|
+
function _findFarmMCPEndpointTool(method, pathname, serverBasePath) {
|
|
107
|
+
const upperMethod = method.toUpperCase();
|
|
108
|
+
for (const { server, tools } of catalogs().values()) {
|
|
109
|
+
const routes = /* @__PURE__ */ new Map();
|
|
110
|
+
for (const tool of tools) {
|
|
111
|
+
if (tool.kind === "endpoint" && tool.method === upperMethod) {
|
|
112
|
+
routes.set(tool.path, { path: tool.path, name: tool.name });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (routes.size === 0) continue;
|
|
116
|
+
const canonical = serverBasePath ? _chunkKNBBQHO2cjs.resolveFarmAPICanonicalPathname.call(void 0, pathname, serverBasePath) : pathname;
|
|
117
|
+
const match = _chunkG7HXGLECcjs.matchAPIRoute.call(void 0, routes, canonical);
|
|
118
|
+
if (match) {
|
|
119
|
+
return {
|
|
120
|
+
name: match.route.name,
|
|
121
|
+
endpoint: _chunkKNBBQHO2cjs.resolveFarmAPIServerRoutePath.call(void 0, server.path, serverBasePath)
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return void 0;
|
|
126
|
+
}
|
|
127
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _findFarmMCPEndpointTool, "_findFarmMCPEndpointTool");
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
exports._listFarmMCPCatalogs = _listFarmMCPCatalogs; exports._publishFarmMCPCatalog = _publishFarmMCPCatalog; exports._listFarmRegisteredMCPServers = _listFarmRegisteredMCPServers; exports.registerFarmMCPServer = registerFarmMCPServer; exports._findFarmMCPEndpointTool = _findFarmMCPEndpointTool;
|
|
@@ -12,7 +12,7 @@ var _chunkDVM4FKZLcjs = require('./chunk-DVM4FKZL.cjs');
|
|
|
12
12
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkUXFQ3UDAcjs = require('./chunk-UXFQ3UDA.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -41,7 +41,7 @@ function createRedirectsPlugin(redirects, {
|
|
|
41
41
|
if (overrideBeforeRequest) {
|
|
42
42
|
await overrideBeforeRequest(req, res, context);
|
|
43
43
|
}
|
|
44
|
-
const url =
|
|
44
|
+
const url = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req);
|
|
45
45
|
const routePath = _chunkDVM4FKZLcjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n);
|
|
46
46
|
const pathname = routePath.pathname;
|
|
47
47
|
for (const { redirect, pattern } of compiledRedirects) {
|
|
@@ -153,7 +153,7 @@ function createHeadersPlugin(headers, {
|
|
|
153
153
|
if (overrideBeforeRequest) {
|
|
154
154
|
await overrideBeforeRequest(req, res, context);
|
|
155
155
|
}
|
|
156
|
-
const url =
|
|
156
|
+
const url = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req);
|
|
157
157
|
const pathname = _chunkDVM4FKZLcjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n).pathname;
|
|
158
158
|
const matchedHeaders = compiledHeaders.filter(({ pattern }) => pattern.regex.test(pathname)).map(({ config }) => config.headers);
|
|
159
159
|
applyResponseHeaders(res, matchedHeaders);
|
|
@@ -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
|
|
3
|
+
var _chunkOMVAU7NTcjs = require('./chunk-OMVAU7NT.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -217,6 +217,7 @@ function parseIpv6Hextets(value) {
|
|
|
217
217
|
if (!octets) return null;
|
|
218
218
|
tail = [octets[0] << 8 | octets[1], octets[2] << 8 | octets[3]];
|
|
219
219
|
text = text.slice(0, lastColon);
|
|
220
|
+
if (text.endsWith(":")) text += ":";
|
|
220
221
|
if (text === "") return null;
|
|
221
222
|
}
|
|
222
223
|
const compressionParts = text.split("::");
|
|
@@ -264,6 +265,15 @@ function isPrivateImageAddress(address) {
|
|
|
264
265
|
if (embedsIpv4 && (h6 !== 0 || h7 !== 0)) {
|
|
265
266
|
return isPrivateIpv4([h6 >> 8, h6 & 255, h7 >> 8, h7 & 255]);
|
|
266
267
|
}
|
|
268
|
+
if (h0 === 100 && h1 === 65435) {
|
|
269
|
+
if (h2 === 1) return true;
|
|
270
|
+
if (h2 === 0 && h3 === 0 && h4 === 0 && h5 === 0) {
|
|
271
|
+
return isPrivateIpv4([h6 >> 8, h6 & 255, h7 >> 8, h7 & 255]);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (h0 === 8194) {
|
|
275
|
+
return isPrivateIpv4([h1 >> 8, h1 & 255, h2 >> 8, h2 & 255]);
|
|
276
|
+
}
|
|
267
277
|
if (zeroPrefix && h4 === 0 && h5 === 0 && h6 === 0 && (h7 === 0 || h7 === 1)) return true;
|
|
268
278
|
if ((h0 & 65024) === 64512) return true;
|
|
269
279
|
if ((h0 & 65472) === 65152) return true;
|
|
@@ -573,7 +583,7 @@ function createOptimizedImageResponse(request, image, config) {
|
|
|
573
583
|
if (image.contentType === "image/svg+xml" && config.dangerouslyAllowSVG) {
|
|
574
584
|
headers.set("content-security-policy", "default-src 'none'; sandbox");
|
|
575
585
|
}
|
|
576
|
-
if (
|
|
586
|
+
if (_chunkOMVAU7NTcjs.matchesFarmIfNoneMatch.call(void 0, request.headers.get("if-none-match"), image.etag)) {
|
|
577
587
|
headers.delete("content-length");
|
|
578
588
|
return new Response(null, { status: 304, headers });
|
|
579
589
|
}
|
|
@@ -27,7 +27,7 @@ var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
|
|
|
27
27
|
var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkFTFYRMQQcjs = require('./chunk-FTFYRMQQ.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -119,7 +119,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, withTimeout, "withTimeout");
|
|
|
119
119
|
var formatSeconds = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`, "formatSeconds");
|
|
120
120
|
function collectSchemaOwners(config) {
|
|
121
121
|
const owners = [];
|
|
122
|
-
const integrationSchemas =
|
|
122
|
+
const integrationSchemas = _chunkFTFYRMQQcjs.getIntegrationSchemas.call(void 0, config.integrations);
|
|
123
123
|
let integrationClient;
|
|
124
124
|
for (const [name, schema] of Object.entries(integrationSchemas)) {
|
|
125
125
|
owners.push({
|
|
@@ -9,17 +9,23 @@ function parseRequestCookieHeader(header) {
|
|
|
9
9
|
const separatorIndex = part.indexOf("=");
|
|
10
10
|
if (separatorIndex === -1) {
|
|
11
11
|
return {
|
|
12
|
-
name:
|
|
12
|
+
name: decodeCookieName(part),
|
|
13
13
|
value: ""
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
return {
|
|
17
|
-
name:
|
|
17
|
+
name: decodeCookieName(part.slice(0, separatorIndex).trim()),
|
|
18
18
|
value: decodeCookiePart(part.slice(separatorIndex + 1).trim())
|
|
19
19
|
};
|
|
20
20
|
}).filter((cookie) => cookie.name.length > 0);
|
|
21
21
|
}
|
|
22
22
|
_chunkS3JO3N4Hcjs.__name.call(void 0, parseRequestCookieHeader, "parseRequestCookieHeader");
|
|
23
|
+
var RESERVED_PREFIX = /^__(host|secure)-/i;
|
|
24
|
+
function decodeCookieName(raw) {
|
|
25
|
+
const decoded = decodeCookiePart(raw);
|
|
26
|
+
return RESERVED_PREFIX.test(decoded) && !RESERVED_PREFIX.test(raw) ? raw : decoded;
|
|
27
|
+
}
|
|
28
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, decodeCookieName, "decodeCookieName");
|
|
23
29
|
function decodeCookiePart(value) {
|
|
24
30
|
try {
|
|
25
31
|
return decodeURIComponent(value);
|
|
@@ -31,4 +37,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, decodeCookiePart, "decodeCookiePart");
|
|
|
31
37
|
|
|
32
38
|
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
|
|
41
|
+
exports.parseRequestCookieHeader = parseRequestCookieHeader; exports.decodeCookieName = decodeCookieName;
|
|
@@ -52,6 +52,9 @@ function resolveFarmI18nConfig(input, options = {}) {
|
|
|
52
52
|
if (sameSite !== "lax" && sameSite !== "strict" && sameSite !== "none") {
|
|
53
53
|
throw new Error('i18n.cookie.sameSite must be "lax", "strict", or "none".');
|
|
54
54
|
}
|
|
55
|
+
if (sameSite === "none" && input.cookie?.secure === false) {
|
|
56
|
+
throw new Error('i18n.cookie.secure cannot be false when i18n.cookie.sameSite is "none".');
|
|
57
|
+
}
|
|
55
58
|
const direction = {};
|
|
56
59
|
for (const [rawLocale, value] of Object.entries(input.direction || {})) {
|
|
57
60
|
const locale = canonicalizeLocale(rawLocale);
|
|
@@ -82,7 +85,7 @@ function resolveFarmI18nConfig(input, options = {}) {
|
|
|
82
85
|
),
|
|
83
86
|
path: normalizeCookiePath(input.cookie?.path),
|
|
84
87
|
sameSite,
|
|
85
|
-
secure: input.cookie?.secure ?? options.mode === "production"
|
|
88
|
+
secure: input.cookie?.secure ?? (sameSite === "none" || options.mode === "production")
|
|
86
89
|
},
|
|
87
90
|
direction
|
|
88
91
|
};
|
|
@@ -25,6 +25,19 @@ function resolveFarmAPICanonicalPathname(pathname, serverBasePath = DEFAULT_FARM
|
|
|
25
25
|
return pathname;
|
|
26
26
|
}
|
|
27
27
|
__name(resolveFarmAPICanonicalPathname, "resolveFarmAPICanonicalPathname");
|
|
28
|
+
function createFarmAPIMiddlewarePathnames(serverBasePath = DEFAULT_FARM_API_BASE_PATH) {
|
|
29
|
+
const basePath = normalizeFarmAPIBasePath(serverBasePath);
|
|
30
|
+
if (basePath === DEFAULT_FARM_API_BASE_PATH) return (pathname) => [pathname];
|
|
31
|
+
const prefix = DEFAULT_FARM_API_BASE_PATH;
|
|
32
|
+
return (pathname) => {
|
|
33
|
+
const canonical = resolveFarmAPICanonicalPathname(pathname, basePath);
|
|
34
|
+
if (canonical !== prefix && !canonical.startsWith(`${prefix}/`)) return [pathname];
|
|
35
|
+
const suffix = canonical.slice(prefix.length);
|
|
36
|
+
const publicPath = basePath === "/" ? suffix || "/" : `${basePath}${suffix}`;
|
|
37
|
+
return [.../* @__PURE__ */ new Set([pathname, canonical, publicPath])];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
__name(createFarmAPIMiddlewarePathnames, "createFarmAPIMiddlewarePathnames");
|
|
28
41
|
function resolveFarmAPIServerRoutePath(routePath, serverBasePath = DEFAULT_FARM_API_BASE_PATH) {
|
|
29
42
|
return resolveFarmAPIRequestURL(routePath, serverBasePath).pathname;
|
|
30
43
|
}
|
|
@@ -33,5 +46,6 @@ __name(resolveFarmAPIServerRoutePath, "resolveFarmAPIServerRoutePath");
|
|
|
33
46
|
export {
|
|
34
47
|
resolveFarmAPIServerBasePath,
|
|
35
48
|
resolveFarmAPICanonicalPathname,
|
|
49
|
+
createFarmAPIMiddlewarePathnames,
|
|
36
50
|
resolveFarmAPIServerRoutePath
|
|
37
51
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
markFarmClientReference,
|
|
3
|
+
updateFarmServerTreeModule
|
|
4
|
+
} from "./chunk-NRDBW4MP.mjs";
|
|
1
5
|
import {
|
|
2
6
|
__name
|
|
3
7
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -109,6 +113,11 @@ function createFarmIsolatedClientBoundary(ReactRuntime, Component, moduleReferen
|
|
|
109
113
|
}
|
|
110
114
|
__name(FarmIsolatedClientBoundary, "FarmIsolatedClientBoundary");
|
|
111
115
|
FarmIsolatedClientBoundary.displayName = `FarmIsolated(${Component.displayName || Component.name || exportName})`;
|
|
116
|
+
markFarmClientReference(FarmIsolatedClientBoundary, {
|
|
117
|
+
reference: moduleReference,
|
|
118
|
+
exportName,
|
|
119
|
+
Component
|
|
120
|
+
});
|
|
112
121
|
return FarmIsolatedClientBoundary;
|
|
113
122
|
}
|
|
114
123
|
__name(createFarmIsolatedClientBoundary, "createFarmIsolatedClientBoundary");
|
|
@@ -300,7 +309,7 @@ function createFarmIsolatedHydrationRuntime(options) {
|
|
|
300
309
|
__name(hydrate, "hydrate");
|
|
301
310
|
function updateModule(reference, module) {
|
|
302
311
|
const originals = module.__farm_client_boundary_originals__;
|
|
303
|
-
let updated =
|
|
312
|
+
let updated = updateFarmServerTreeModule(reference, module);
|
|
304
313
|
for (const [container, record] of roots) {
|
|
305
314
|
if (record.reference !== reference) continue;
|
|
306
315
|
const Component = originals?.[record.exportName];
|
|
@@ -355,7 +364,7 @@ function createFarmIsolatedHydrationRuntime(options) {
|
|
|
355
364
|
}
|
|
356
365
|
__name(createFarmIsolatedHydrationRuntime, "createFarmIsolatedHydrationRuntime");
|
|
357
366
|
function createFarmServerPageBoundary(ReactRuntime, runtime) {
|
|
358
|
-
return /* @__PURE__ */ __name(function FarmServerPage(props) {
|
|
367
|
+
return /* @__PURE__ */ __name(function FarmServerPage({ as = "div", ...props }) {
|
|
359
368
|
const ref = ReactRuntime.useRef(null);
|
|
360
369
|
const html = props.dangerouslySetInnerHTML.__html;
|
|
361
370
|
ReactRuntime.useLayoutEffect(() => {
|
|
@@ -376,7 +385,7 @@ function createFarmServerPageBoundary(ReactRuntime, runtime) {
|
|
|
376
385
|
});
|
|
377
386
|
};
|
|
378
387
|
}, [html]);
|
|
379
|
-
return ReactRuntime.createElement(
|
|
388
|
+
return ReactRuntime.createElement(as, { ...props, ref });
|
|
380
389
|
}, "FarmServerPage");
|
|
381
390
|
}
|
|
382
391
|
__name(createFarmServerPageBoundary, "createFarmServerPageBoundary");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
4
|
+
|
|
5
|
+
// src/client/navigation-url.ts
|
|
6
|
+
var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
7
|
+
function isFarmBlockedNavigationURL(url) {
|
|
8
|
+
if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
|
|
9
|
+
console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmBlockedNavigationURL, "isFarmBlockedNavigationURL");
|
|
13
|
+
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
14
|
+
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
15
|
+
}
|
|
16
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmExternalNavigationURL, "isFarmExternalNavigationURL");
|
|
17
|
+
function resolveFarmNavigationURL(href, documentUrl) {
|
|
18
|
+
return new URL(href, documentUrl);
|
|
19
|
+
}
|
|
20
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmNavigationURL, "resolveFarmNavigationURL");
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.isFarmBlockedNavigationURL = isFarmBlockedNavigationURL; exports.isFarmExternalNavigationURL = isFarmExternalNavigationURL; exports.resolveFarmNavigationURL = resolveFarmNavigationURL;
|