@farm.js/core 0.1.36 → 0.1.38
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-BVExL8rZ.d.mts → agent-mcp-BwKlpnc7.d.mts} +1 -1
- package/dist/{agent-mcp-luzfXK-P.d.ts → agent-mcp-De1imoMS.d.ts} +1 -1
- package/dist/{agent-mcp-handler-SJAHFSPI.cjs → agent-mcp-handler-MRGP3WJ3.cjs} +5 -5
- package/dist/{agent-mcp-handler-LPJ2CADR.mjs → agent-mcp-handler-OLRMZONF.mjs} +4 -4
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +6 -6
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +8 -7
- package/dist/{app-BukwkFIu.d.mts → app-CFZt-srr.d.mts} +21 -3
- package/dist/{app-Yfa2dsFy.d.ts → app-kT_QXTdx.d.ts} +21 -3
- package/dist/app-markdown.cjs +6 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +5 -3
- package/dist/{chunk-ADEA7PN3.cjs → chunk-2DD4JMQC.cjs} +113 -22
- package/dist/chunk-2ZYGC6SS.cjs +576 -0
- package/dist/{chunk-JZVADIOD.cjs → chunk-34UCJRQO.cjs} +2 -2
- package/dist/{chunk-D2BB47NB.cjs → chunk-3LOLJTFV.cjs} +6 -6
- package/dist/{chunk-KXWRO25S.cjs → chunk-472NCAZ7.cjs} +3 -3
- package/dist/chunk-4E5QXOCL.cjs +109 -0
- package/dist/{chunk-Z2HLU4IX.cjs → chunk-4GWRFP22.cjs} +23 -2
- package/dist/{chunk-VQLJWDVW.cjs → chunk-4IE345DM.cjs} +37 -19
- package/dist/{chunk-O6WAEAX3.mjs → chunk-5BWWFHR2.mjs} +70 -15
- package/dist/{chunk-JNUWCDTF.cjs → chunk-5D2JIPLH.cjs} +2 -2
- package/dist/{chunk-BO36SELV.cjs → chunk-5OKBARDN.cjs} +2 -2
- package/dist/{chunk-AO6RYU5N.cjs → chunk-5PWXMJOH.cjs} +30 -22
- package/dist/{chunk-AHGECQEW.mjs → chunk-666CKENS.mjs} +1 -1
- package/dist/chunk-6BK3K2GB.mjs +318 -0
- package/dist/{chunk-O6I6VWKK.mjs → chunk-6HB6V3R7.mjs} +1 -1
- package/dist/{chunk-UXFQ3UDA.cjs → chunk-6XWDE2P2.cjs} +61 -4
- package/dist/{chunk-VILIPRS6.mjs → chunk-7FPTZLKH.mjs} +1 -1
- package/dist/{chunk-SC2WYWPF.mjs → chunk-7PEP3BUT.mjs} +3 -3
- package/dist/{chunk-4E5AEDKY.mjs → chunk-A3EAIURZ.mjs} +25 -7
- package/dist/{chunk-YDQZGSDS.mjs → chunk-ARC7I3O2.mjs} +1 -1
- package/dist/{chunk-LSZAVSGY.mjs → chunk-B6G5CKMC.mjs} +101 -10
- package/dist/{chunk-3KZS4SUS.mjs → chunk-BZHXGVMA.mjs} +1 -1
- package/dist/{chunk-KN7K4VQN.mjs → chunk-CNNOLE4O.mjs} +1 -1
- package/dist/{chunk-4GLOOWKE.mjs → chunk-CQMVIOYP.mjs} +1 -1
- package/dist/{chunk-2ELDTQRN.mjs → chunk-CUM5NYL5.mjs} +1 -1
- package/dist/{chunk-HITLGIAO.cjs → chunk-CY2ZQ5C6.cjs} +7 -6
- package/dist/{chunk-PZNL3WEG.mjs → chunk-DMEPTZTI.mjs} +22 -11
- package/dist/{chunk-QORUJDIV.mjs → chunk-DRLKAXDM.mjs} +2 -2
- package/dist/{chunk-DQQOKWYA.cjs → chunk-EIPC3FDA.cjs} +12 -4
- package/dist/{chunk-HOXTWRGB.mjs → chunk-EKF7KDFD.mjs} +5 -2
- package/dist/{chunk-42NHY7HW.cjs → chunk-EKN7NSZO.cjs} +62 -14
- package/dist/{chunk-YKX5BK66.cjs → chunk-EMO6K4YY.cjs} +7 -7
- package/dist/{chunk-6SJ2KJTA.mjs → chunk-EPYU2EBL.mjs} +1 -1
- package/dist/{chunk-D227TIEN.cjs → chunk-FWE7LEQC.cjs} +13 -13
- package/dist/{chunk-PTZ2TVNE.cjs → chunk-H5CLOUZS.cjs} +5 -5
- package/dist/{chunk-DTSROJ5J.mjs → chunk-HD5CF3OE.mjs} +1 -1
- package/dist/{chunk-35GKZR22.mjs → chunk-HXRYZWTA.mjs} +1 -1
- package/dist/{chunk-JG6DJF5A.mjs → chunk-HZFM2LWQ.mjs} +22 -1
- package/dist/{chunk-MKYBIIAQ.mjs → chunk-IBUQWVYA.mjs} +17 -1
- package/dist/{chunk-F2SE2VDO.mjs → chunk-IHQIOZLC.mjs} +1 -1
- package/dist/{chunk-W7LF2J2S.mjs → chunk-INL3THCU.mjs} +1 -1
- package/dist/{chunk-WZ77PUAM.mjs → chunk-IVLZZZEI.mjs} +1 -1
- package/dist/{chunk-ENLZ4R3Y.mjs → chunk-J7K2NZD6.mjs} +7 -6
- package/dist/{chunk-BPOF5U4N.mjs → chunk-JCKYH4LG.mjs} +10 -7
- package/dist/{chunk-77GNHH2Z.cjs → chunk-JCYYXBAJ.cjs} +3 -3
- package/dist/{chunk-C4SPBWFM.cjs → chunk-JEZO6VUR.cjs} +10 -1
- package/dist/{chunk-ZWM5KGAA.cjs → chunk-KCQBAKIY.cjs} +23 -20
- package/dist/{chunk-OTC5BDGO.mjs → chunk-KHKLMNI5.mjs} +12 -7
- package/dist/{chunk-DZ5ZVB2K.cjs → chunk-KKSTAEMY.cjs} +1 -1
- package/dist/{chunk-N2NAS2AM.cjs → chunk-L4DD7ODZ.cjs} +2 -2
- package/dist/{chunk-YSCV4SJF.cjs → chunk-L5H2GSUC.cjs} +4 -4
- package/dist/{chunk-OO7GXVSR.mjs → chunk-LI2F57NI.mjs} +1 -1
- package/dist/{chunk-NRSN7G7E.mjs → chunk-MLY2RP5R.mjs} +10 -2
- package/dist/{chunk-BPMATOP2.cjs → chunk-N32CC42M.cjs} +25 -20
- package/dist/{chunk-FNO7A7CM.cjs → chunk-NBBEQLOK.cjs} +34 -16
- package/dist/{chunk-XCMCS4DA.mjs → chunk-ND2CWPOD.mjs} +2 -2
- package/dist/{chunk-GQRWBCWK.mjs → chunk-OAHTRMIC.mjs} +13 -5
- package/dist/{chunk-35WV46VL.mjs → chunk-OCIEZME4.mjs} +876 -685
- package/dist/{chunk-UH6QN5NL.mjs → chunk-P664ZVTV.mjs} +2 -2
- package/dist/{chunk-TE2G5ION.cjs → chunk-PGZDEPTM.cjs} +88 -33
- package/dist/{chunk-FDR64H6B.mjs → chunk-POSPE3IO.mjs} +59 -2
- package/dist/{chunk-UVW64BCB.cjs → chunk-Q3NXS4MU.cjs} +16 -14
- package/dist/{chunk-4WCZJQUO.mjs → chunk-QFW2IH5E.mjs} +57 -9
- package/dist/{chunk-5SJWVY6R.mjs → chunk-QHSH7IH4.mjs} +9 -0
- package/dist/chunk-QRKIMN7T.mjs +48 -0
- package/dist/chunk-QTXBII4Z.cjs +632 -0
- package/dist/{chunk-CI6E3UOH.cjs → chunk-RG4A6LB2.cjs} +7 -7
- package/dist/{chunk-BJPBQNIE.cjs → chunk-RW63BOV7.cjs} +2 -2
- package/dist/{chunk-FO427P6I.cjs → chunk-RWFLWR5J.cjs} +10 -10
- package/dist/{chunk-FFFW3OQ7.cjs → chunk-S6FJO323.cjs} +2 -2
- package/dist/{chunk-EUV4YR3V.cjs → chunk-SGBJ247Q.cjs} +18 -2
- package/dist/chunk-SGBZPZUW.mjs +75 -0
- package/dist/{chunk-2NNMOPDN.mjs → chunk-SKVTP5PR.mjs} +4 -1
- package/dist/{chunk-2YTDKNH3.cjs → chunk-TGFQVLLF.cjs} +956 -765
- package/dist/{chunk-IHNIDL6H.cjs → chunk-TO4GJ56K.cjs} +22 -11
- package/dist/{chunk-276VJSM6.mjs → chunk-TUBTR2OP.mjs} +250 -118
- package/dist/{chunk-GQ3Z3IZI.cjs → chunk-TYJALEHQ.cjs} +18 -18
- package/dist/chunk-TYMMBFN2.mjs +109 -0
- package/dist/chunk-U6QLDL3G.mjs +576 -0
- package/dist/{chunk-U4KT7QP3.cjs → chunk-ULASELLA.cjs} +26 -1
- package/dist/chunk-UXHS27O6.cjs +75 -0
- package/dist/{chunk-WWIKMBRN.mjs → chunk-VNGH5MLF.mjs} +17 -1
- package/dist/{chunk-EZDQRNQ7.mjs → chunk-VT4WFRHA.mjs} +23 -5
- package/dist/{chunk-CBJJH36A.cjs → chunk-VU6AAZVY.cjs} +20 -4
- package/dist/{chunk-27ZWSI3W.cjs → chunk-VXEEATVD.cjs} +2 -2
- package/dist/{chunk-EWET4D2Y.mjs → chunk-W36M2BQ4.mjs} +3 -3
- package/dist/{chunk-4WQ6PGSJ.cjs → chunk-WEW2JVA4.cjs} +4 -4
- package/dist/{chunk-4E5WBPEG.mjs → chunk-WFRT7JPX.mjs} +8 -533
- package/dist/{chunk-T4OGRVNS.mjs → chunk-WLL43JMO.mjs} +2 -2
- package/dist/chunk-WW46B6HA.cjs +318 -0
- package/dist/{chunk-TKSCR644.cjs → chunk-WXJLNP33.cjs} +2 -2
- package/dist/{chunk-S6VYG6XU.cjs → chunk-XKG2BLFN.cjs} +2 -2
- package/dist/{chunk-4NU4GGTC.cjs → chunk-XKVVMZP5.cjs} +6 -3
- package/dist/{chunk-NMHWYWDR.cjs → chunk-YR2VBEMO.cjs} +658 -526
- package/dist/{chunk-OHLSEQ57.mjs → chunk-ZJD2PN6Z.mjs} +10 -8
- package/dist/{chunk-3BU22U3M.cjs → chunk-ZXH4TS3F.cjs} +5 -2
- package/dist/{client-plugins-r1mOtSC1.d.ts → client-plugins-BvlNhGEB.d.ts} +54 -7
- package/dist/{client-plugins-C3mK9Pol.d.mts → client-plugins-DUrIYX9B.d.mts} +54 -7
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-ERIKFEXX.mjs → devtools-JYJNOLPQ.mjs} +8 -6
- package/dist/{devtools-JZJJY5CK.cjs → devtools-VQWJANJV.cjs} +9 -7
- package/dist/docs.cjs +12 -10
- package/dist/docs.d.mts +20 -2
- package/dist/docs.d.ts +20 -2
- package/dist/docs.mjs +11 -9
- package/dist/headers.cjs +6 -4
- package/dist/headers.d.mts +11 -1
- package/dist/headers.d.ts +11 -1
- package/dist/headers.mjs +5 -3
- package/dist/i18n/client.cjs +11 -11
- package/dist/i18n/client.mjs +3 -3
- package/dist/index.cjs +62 -46
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +62 -46
- package/dist/integrations.cjs +5 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +4 -2
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +19 -5
- package/dist/internal/app-markdown-runtime.d.ts +19 -5
- package/dist/internal/app-markdown-runtime.mjs +4 -2
- package/dist/internal/build-runtime.cjs +33 -30
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +32 -29
- package/dist/internal/cli-runtime.cjs +14 -12
- package/dist/internal/cli-runtime.mjs +13 -11
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -7
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +8 -6
- package/dist/internal/docs-precompiled-runtime.cjs +19 -13
- package/dist/internal/docs-precompiled-runtime.d.mts +5 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +5 -0
- package/dist/internal/docs-precompiled-runtime.mjs +14 -8
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- 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 +6 -2
- package/dist/internal/production-node-env.d.mts +10 -1
- package/dist/internal/production-node-env.d.ts +10 -1
- package/dist/internal/production-node-env.mjs +5 -1
- package/dist/internal/production-runtime.cjs +39 -54
- package/dist/internal/production-runtime.d.mts +51 -11
- package/dist/internal/production-runtime.d.ts +51 -11
- package/dist/internal/production-runtime.mjs +39 -54
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +7 -1
- package/dist/middleware.cjs +10 -8
- package/dist/middleware.d.mts +27 -5
- package/dist/middleware.d.ts +27 -5
- package/dist/middleware.mjs +10 -8
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +6 -6
- package/dist/plugin.cjs +25 -23
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +24 -22
- package/dist/{production-runtime-CCeVZXst.d.mts → production-runtime-BQ4_WLwQ.d.mts} +1 -1
- package/dist/{production-runtime-DPnsggY3.d.ts → production-runtime-D2aMyzjr.d.ts} +1 -1
- package/dist/query/client.cjs +9 -9
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-Cw4f5E_R.d.ts → render-plan-25p4hrj4.d.ts} +1 -1
- package/dist/{render-plan-BuGaPFe6.d.mts → render-plan-DtkXMN8D.d.mts} +1 -1
- package/dist/renderer-client.cjs +12 -12
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +4 -4
- package/dist/renderer.d.mts +13 -4
- package/dist/renderer.d.ts +13 -4
- package/dist/{request-CsGARcAw.d.mts → request-DgCkIdcn.d.mts} +4 -2
- package/dist/{request-Bkg-hERy.d.ts → request-jF4jwx8f.d.ts} +4 -2
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-BUZMH_64.d.ts → route-rendering-Bji6S6a_.d.ts} +1 -1
- package/dist/{route-rendering-f11yh5dp.d.mts → route-rendering-CSBF78Ya.d.mts} +1 -1
- package/dist/{router-Cp6yRE8A.d.mts → router-B09Ui3Qm.d.mts} +1 -1
- package/dist/{router-B8CR9GbD.d.ts → router-CPB9cXtG.d.ts} +1 -1
- package/dist/routes.cjs +2 -2
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +1 -1
- package/dist/{runtime-CAEv36S_.d.mts → runtime-CM6E6yuI.d.mts} +1 -1
- package/dist/{runtime-CQVsT330.d.ts → runtime-EDMwLdjv.d.ts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +51 -49
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +29 -27
- package/dist/{spa-router-BuciWGCZ.d.ts → spa-router-B_N8XgVu.d.ts} +2 -2
- package/dist/{spa-router-DwbqGkGj.d.mts → spa-router-Cgimzfbi.d.mts} +2 -2
- package/dist/testing.cjs +8 -8
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +6 -6
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-CaoWKtYM.d.ts → utils-BNxAKAuT.d.ts} +1 -1
- package/dist/{utils-B9V0S_yL.d.mts → utils-DZciYXYl.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +25 -23
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +24 -22
- package/package.json +1 -1
- package/types/middleware.d.ts +5 -1
- package/dist/chunk-655RLQQL.mjs +0 -43
- package/dist/chunk-FXEF4PPL.mjs +0 -47
- package/dist/chunk-IZY3V5XW.mjs +0 -23
- package/dist/chunk-MRMI32SN.cjs +0 -1157
- package/dist/chunk-MT763TDW.cjs +0 -43
- package/dist/chunk-XD32KALF.cjs +0 -47
- /package/dist/{chunk-SJNMVDDF.cjs → chunk-FUCSUGDM.cjs} +0 -0
- /package/dist/{chunk-UDNPLXW7.mjs → chunk-MYIZXDZA.mjs} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkH5CLOUZScjs = require('./chunk-H5CLOUZS.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
@@ -41,10 +41,10 @@ async function handleFarmDefaultMCPRequest(request, context) {
|
|
|
41
41
|
return transportError(403, "Cross-origin requests are not allowed.");
|
|
42
42
|
}
|
|
43
43
|
const protocolHeader = request.headers.get("mcp-protocol-version");
|
|
44
|
-
if (protocolHeader && !
|
|
44
|
+
if (protocolHeader && !_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(protocolHeader.trim())) {
|
|
45
45
|
return transportError(
|
|
46
46
|
400,
|
|
47
|
-
`Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${
|
|
47
|
+
`Unsupported MCP-Protocol-Version: ${protocolHeader.slice(0, 32)}. Supported: ${_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.join(", ")}.`
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
const contentType = _nullishCoalesce(request.headers.get("content-type"), () => ( ""));
|
|
@@ -102,7 +102,7 @@ async function dispatch(method, params, request, context) {
|
|
|
102
102
|
switch (method) {
|
|
103
103
|
case "initialize": {
|
|
104
104
|
const requested = isRecord(params) ? params.protocolVersion : void 0;
|
|
105
|
-
const protocolVersion = typeof requested === "string" &&
|
|
105
|
+
const protocolVersion = typeof requested === "string" && _chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS.includes(requested) ? requested : _chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PROTOCOL_VERSIONS[0];
|
|
106
106
|
return {
|
|
107
107
|
protocolVersion,
|
|
108
108
|
capabilities: { tools: { listChanged: false } },
|
|
@@ -110,7 +110,7 @@ async function dispatch(method, params, request, context) {
|
|
|
110
110
|
name: context.server.name,
|
|
111
111
|
version: context.server.version,
|
|
112
112
|
...context.server.title ? { title: context.server.title } : {},
|
|
113
|
-
description:
|
|
113
|
+
description: _chunkH5CLOUZScjs.FARM_DEFAULT_MCP_DESCRIPTION
|
|
114
114
|
},
|
|
115
115
|
instructions: INSTRUCTIONS
|
|
116
116
|
};
|
|
@@ -118,7 +118,7 @@ async function dispatch(method, params, request, context) {
|
|
|
118
118
|
case "ping":
|
|
119
119
|
return {};
|
|
120
120
|
case "tools/list":
|
|
121
|
-
return { tools:
|
|
121
|
+
return { tools: _chunkH5CLOUZScjs.FARM_DEFAULT_MCP_TOOLS };
|
|
122
122
|
case "tools/call":
|
|
123
123
|
return callTool(params, request, context);
|
|
124
124
|
default:
|
|
@@ -130,7 +130,7 @@ async function callTool(params, request, context) {
|
|
|
130
130
|
if (!isRecord(params) || typeof params.name !== "string") {
|
|
131
131
|
throw new FarmMCPRequestError(INVALID_PARAMS, "tools/call needs a tool name.");
|
|
132
132
|
}
|
|
133
|
-
const tool =
|
|
133
|
+
const tool = _chunkH5CLOUZScjs.FARM_DEFAULT_MCP_TOOLS.find(({ name }) => name === params.name);
|
|
134
134
|
if (!tool) {
|
|
135
135
|
throw new FarmMCPRequestError(INVALID_PARAMS, `Unknown tool: ${params.name.slice(0, 64)}`);
|
|
136
136
|
}
|
|
@@ -34,7 +34,7 @@ var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
|
|
|
34
34
|
var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -1119,7 +1119,7 @@ function createApiClients(options = {}) {
|
|
|
1119
1119
|
"api is server-only. Use apiClient from createApiClients() in the browser."
|
|
1120
1120
|
);
|
|
1121
1121
|
}
|
|
1122
|
-
const currentRequest =
|
|
1122
|
+
const currentRequest = _chunkULASELLAcjs._resolveCurrentRequest.call(void 0, );
|
|
1123
1123
|
const runtime = _chunk72ADZ6GQcjs.resolveAPIRequestRuntime.call(void 0, );
|
|
1124
1124
|
if (!currentRequest || !runtime) {
|
|
1125
1125
|
throw new Error(
|
|
@@ -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 _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 _chunkFUCSUGDMcjs = require('./chunk-FUCSUGDM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
|
|
@@ -17,7 +17,7 @@ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkXKG2BLFNcjs = require('./chunk-XKG2BLFN.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
|
|
@@ -102,7 +102,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
102
102
|
await this.loadProgrammaticApiRoutes(appDir);
|
|
103
103
|
}
|
|
104
104
|
this.routes = new Map(
|
|
105
|
-
|
|
105
|
+
_chunkXKG2BLFNcjs.mergePluginAPIRoutes.call(void 0, [...this.routes.values()], this.plugins, void 0, {
|
|
106
106
|
bodySizeLimit: this.bodySizeLimit,
|
|
107
107
|
dispatch: this.dispatch
|
|
108
108
|
}).map((route) => [route.path, route])
|
|
@@ -150,7 +150,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
150
150
|
const routeModule = await this.loadModule(filePath);
|
|
151
151
|
const endpoints = {};
|
|
152
152
|
const availableMethods = [];
|
|
153
|
-
for (const method of
|
|
153
|
+
for (const method of _chunkXKG2BLFNcjs.API_ROUTE_METHODS) {
|
|
154
154
|
if (routeModule[method]) {
|
|
155
155
|
endpoints[method] = routeModule[method];
|
|
156
156
|
availableMethods.push(method);
|
|
@@ -220,7 +220,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
220
220
|
async loadProgrammaticApiRoutes(appDir) {
|
|
221
221
|
const candidateRoots = [path.dirname(appDir), appDir];
|
|
222
222
|
const routeFiles = Array.from(
|
|
223
|
-
new Set(candidateRoots.flatMap((srcRoot) =>
|
|
223
|
+
new Set(candidateRoots.flatMap((srcRoot) => _chunkFUCSUGDMcjs.findProgrammaticRouteFilesInDir.call(void 0, srcRoot)))
|
|
224
224
|
);
|
|
225
225
|
if (routeFiles.length === 0) return;
|
|
226
226
|
const { getProgrammaticRouteManifest } = await import("./routes.cjs");
|
|
@@ -332,7 +332,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
332
332
|
const url = new URL(request.url);
|
|
333
333
|
const pathname = url.pathname;
|
|
334
334
|
const method = request.method.toUpperCase();
|
|
335
|
-
const match =
|
|
335
|
+
const match = _chunkXKG2BLFNcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
336
336
|
if (!match) {
|
|
337
337
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
338
338
|
status: 404,
|
|
@@ -340,19 +340,19 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
342
|
const { route, params } = match;
|
|
343
|
-
const endpoint =
|
|
343
|
+
const endpoint = _chunkXKG2BLFNcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
344
344
|
if (!endpoint) {
|
|
345
345
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
346
346
|
status: 405,
|
|
347
347
|
headers: {
|
|
348
|
-
Allow:
|
|
348
|
+
Allow: _chunkXKG2BLFNcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
349
349
|
"Content-Type": "application/json"
|
|
350
350
|
}
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
353
|
const invoke = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
354
354
|
try {
|
|
355
|
-
return await
|
|
355
|
+
return await _chunkXKG2BLFNcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, this.bodySizeLimit);
|
|
356
356
|
} catch (error) {
|
|
357
357
|
if (options.throwOnError) throw error;
|
|
358
358
|
console.error(`[API Error] ${pathname}:`, error);
|
|
@@ -374,7 +374,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
374
374
|
return Boolean(this.matchRoute(pathname));
|
|
375
375
|
}
|
|
376
376
|
matchRoute(pathname) {
|
|
377
|
-
return
|
|
377
|
+
return _chunkXKG2BLFNcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
378
378
|
}
|
|
379
379
|
/**
|
|
380
380
|
* Get all routes for client type generation
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkJEZO6VURcjs = require('./chunk-JEZO6VUR.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkLIUGYUX3cjs = require('./chunk-LIUGYUX3.cjs');
|
|
@@ -48,7 +48,7 @@ function isFarmLocaleChangeHref(href) {
|
|
|
48
48
|
const snapshot = getFarmI18nClientState();
|
|
49
49
|
if (!snapshot || typeof window === "undefined") return false;
|
|
50
50
|
if (snapshot.routing === "none") return false;
|
|
51
|
-
const target =
|
|
51
|
+
const target = _chunkJEZO6VURcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
|
|
52
52
|
const match = _chunkBIDYX3SLcjs.resolveFarmLocalePath.call(void 0, target.pathname, snapshot);
|
|
53
53
|
const targetLocale = match.locale || snapshot.defaultLocale;
|
|
54
54
|
return targetLocale !== snapshot.locale;
|
|
@@ -321,6 +321,19 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmMarkdownViewResponse, "createFar
|
|
|
321
321
|
|
|
322
322
|
// src/markdown.ts
|
|
323
323
|
var FARM_MARKDOWN_CONTENT_TYPE = "text/markdown; charset=utf-8";
|
|
324
|
+
var FARM_MARKDOWN_PAGE_CHECK_HEADER = "x-farm-markdown-page-check";
|
|
325
|
+
var MARKDOWN_PAGE_CHECK_TOKEN = /* @__PURE__ */ Symbol.for("farm.markdownPageCheckToken");
|
|
326
|
+
function _getFarmMarkdownPageCheckToken() {
|
|
327
|
+
const state = globalThis;
|
|
328
|
+
return _nullishCoalesce(state[MARKDOWN_PAGE_CHECK_TOKEN], () => ( (state[MARKDOWN_PAGE_CHECK_TOKEN] = globalThis.crypto.randomUUID())));
|
|
329
|
+
}
|
|
330
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _getFarmMarkdownPageCheckToken, "_getFarmMarkdownPageCheckToken");
|
|
331
|
+
function _isFarmMarkdownPageCheck(value) {
|
|
332
|
+
const state = globalThis;
|
|
333
|
+
const token = state[MARKDOWN_PAGE_CHECK_TOKEN];
|
|
334
|
+
return Boolean(token) && typeof value === "string" && value === token;
|
|
335
|
+
}
|
|
336
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _isFarmMarkdownPageCheck, "_isFarmMarkdownPageCheck");
|
|
324
337
|
function farmRequestWantsMarkdown(pathname, accept) {
|
|
325
338
|
return pathname.toLowerCase().endsWith(".md") || requestAcceptsMarkdown(accept);
|
|
326
339
|
}
|
|
@@ -471,7 +484,7 @@ async function createMarkdownMirrorResponse(options) {
|
|
|
471
484
|
const cache = _nullishCoalesce(_nullishCoalesce(_optionalChain([target, 'access', _28 => _28.route, 'optionalAccess', _29 => _29.cache]), () => ( _optionalChain([options, 'access', _30 => _30.config, 'optionalAccess', _31 => _31.cache]))), () => ( false));
|
|
472
485
|
headersOut.set(
|
|
473
486
|
"Cache-Control",
|
|
474
|
-
pageCacheControl && isPrivateCacheControl(pageCacheControl) ? pageCacheControl : createMarkdownCacheHeader(cache)
|
|
487
|
+
pageCacheControl && isPrivateCacheControl(pageCacheControl) ? pageCacheControl : headers.has("cookie") || headers.has("authorization") ? "private, no-store" : createMarkdownCacheHeader(cache)
|
|
475
488
|
);
|
|
476
489
|
preserveMarkdownResponseCookies(pageResponse.headers, headersOut);
|
|
477
490
|
if (pageResponse.status >= 400) {
|
|
@@ -1359,4 +1372,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, decodeHtml, "decodeHtml");
|
|
|
1359
1372
|
|
|
1360
1373
|
|
|
1361
1374
|
|
|
1362
|
-
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
exports.createFarmMarkdownViewResponse = createFarmMarkdownViewResponse; exports.FARM_MARKDOWN_CONTENT_TYPE = FARM_MARKDOWN_CONTENT_TYPE; exports.FARM_MARKDOWN_PAGE_CHECK_HEADER = FARM_MARKDOWN_PAGE_CHECK_HEADER; exports._getFarmMarkdownPageCheckToken = _getFarmMarkdownPageCheckToken; exports._isFarmMarkdownPageCheck = _isFarmMarkdownPageCheck; exports.farmRequestWantsMarkdown = farmRequestWantsMarkdown; exports.createFarmMarkdownErrorBody = createFarmMarkdownErrorBody; exports.resolveMarkdownConfig = resolveMarkdownConfig; exports.resolveMarkdownMirrorTarget = resolveMarkdownMirrorTarget; exports.createMarkdownMirrorResponse = createMarkdownMirrorResponse; exports.applyMarkdownNegotiationHeaders = applyMarkdownNegotiationHeaders; exports.htmlToMarkdown = htmlToMarkdown; exports.farmAcceptQuality = farmAcceptQuality; exports.requestAcceptsMarkdown = requestAcceptsMarkdown; exports.getFarmMarkdownMirrorPath = getFarmMarkdownMirrorPath; exports.getFarmMarkdownAlternatePath = getFarmMarkdownAlternatePath; exports.isFarmMarkdownMirrorExposed = isFarmMarkdownMirrorExposed; exports.matchesFarmMarkdownRoutePattern = matchesFarmMarkdownRoutePattern; exports.extractFarmPageActions = extractFarmPageActions;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-LPEX4YW6.mjs";
|
|
4
|
+
|
|
5
|
+
// src/api/dev-dispatch.ts
|
|
6
|
+
import http from "http";
|
|
7
|
+
import https from "https";
|
|
8
|
+
import { Readable } from "stream";
|
|
9
|
+
function createFarmDevServerDispatch(server) {
|
|
10
|
+
return (request) => new Promise((resolve, reject) => {
|
|
11
|
+
const address = server.httpServer?.address();
|
|
12
|
+
if (!address || typeof address === "string") {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"Farm cannot dispatch an app endpoint request: the Vite dev server has no listening HTTP server."
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const url = new URL(request.url);
|
|
18
|
+
const headers = {};
|
|
19
|
+
request.headers.forEach((value, name) => {
|
|
20
|
+
headers[name] = value;
|
|
21
|
+
});
|
|
22
|
+
headers.host = url.host;
|
|
23
|
+
const secure = Boolean(server.config.server.https);
|
|
24
|
+
const outgoing = (secure ? https : http).request(
|
|
25
|
+
{
|
|
26
|
+
host: loopbackAddress(address),
|
|
27
|
+
port: address.port,
|
|
28
|
+
method: request.method,
|
|
29
|
+
path: `${url.pathname}${url.search}`,
|
|
30
|
+
headers,
|
|
31
|
+
signal: request.signal,
|
|
32
|
+
// The listener is this process's own dev server, often with a self-signed certificate.
|
|
33
|
+
...secure ? { rejectUnauthorized: false } : {}
|
|
34
|
+
},
|
|
35
|
+
(incoming) => {
|
|
36
|
+
const responseHeaders = new Headers();
|
|
37
|
+
for (const [name, value] of Object.entries(incoming.headers)) {
|
|
38
|
+
if (value === void 0) continue;
|
|
39
|
+
for (const entry of Array.isArray(value) ? value : [value]) {
|
|
40
|
+
responseHeaders.append(name, entry);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const status = incoming.statusCode ?? 502;
|
|
44
|
+
const hasBody = request.method !== "HEAD" && status !== 204 && status !== 205 && status !== 304;
|
|
45
|
+
if (!hasBody) incoming.resume();
|
|
46
|
+
try {
|
|
47
|
+
resolve(
|
|
48
|
+
new Response(
|
|
49
|
+
hasBody ? Readable.toWeb(incoming) : null,
|
|
50
|
+
{ status, statusText: incoming.statusMessage, headers: responseHeaders }
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
incoming.destroy();
|
|
55
|
+
reject(error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
outgoing.on("error", reject);
|
|
60
|
+
if (request.body) {
|
|
61
|
+
Readable.fromWeb(request.body).on("error", (error) => outgoing.destroy(error)).pipe(outgoing);
|
|
62
|
+
} else {
|
|
63
|
+
outgoing.end();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
__name(createFarmDevServerDispatch, "createFarmDevServerDispatch");
|
|
68
|
+
function loopbackAddress({ address }) {
|
|
69
|
+
return address === "0.0.0.0" ? "127.0.0.1" : address === "::" ? "::1" : address;
|
|
70
|
+
}
|
|
71
|
+
__name(loopbackAddress, "loopbackAddress");
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
createFarmDevServerDispatch
|
|
75
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-JM5XPKWH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createWebRequestFromFarmRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-POSPE3IO.mjs";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -123,6 +123,9 @@ function createRequestMiddlewareContext(ctx) {
|
|
|
123
123
|
get pathname() {
|
|
124
124
|
return ctx.pathname;
|
|
125
125
|
},
|
|
126
|
+
get routePathname() {
|
|
127
|
+
return ctx.routePathname;
|
|
128
|
+
},
|
|
126
129
|
get searchParams() {
|
|
127
130
|
return ctx.searchParams;
|
|
128
131
|
},
|