@farm.js/core 0.2.0-beta.1 → 0.2.0-beta.2
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-handler-IUL6OPC3.cjs → agent-mcp-handler-EXOG55M4.cjs} +5 -5
- package/dist/{agent-mcp-handler-GDY5CPPW.mjs → agent-mcp-handler-VX4NDDHR.mjs} +4 -4
- package/dist/{agent-mcp.d-BdM0pIrD.d.ts → agent-mcp.d-DBaonhLg.d.ts} +1 -1
- package/dist/{agent-mcp.d-CMGqpUbk.d.mts → agent-mcp.d-DhCEzIfu.d.mts} +1 -1
- package/dist/agent-runtime.cjs +2 -2
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +1 -1
- package/dist/analyzer-OWIHFO5M.cjs +17 -0
- package/dist/{analyzer-RYSF2BM3.mjs → analyzer-T2U345WL.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/{app-manifest.d-COhjPgHn.d.ts → app-manifest.d-nLVFFd7N.d.ts} +1 -1
- package/dist/{app-manifest.d-BeDB2OVm.d.mts → app-manifest.d-uE0JGZKN.d.mts} +1 -1
- 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 +7 -5
- package/dist/{app.d-CoY-zsJt.d.ts → app.d-CwVkAUEU.d.ts} +13 -7
- package/dist/{app.d-DE5KNbmf.d.mts → app.d-DGGcNXV7.d.mts} +13 -7
- package/dist/{chunk-AG27TI6Q.mjs → chunk-23NBOP43.mjs} +3 -0
- package/dist/{chunk-OOOUYA6L.mjs → chunk-26ZTI2ZO.mjs} +4 -4
- package/dist/{chunk-CPMK7EFR.mjs → chunk-4Q263EQI.mjs} +2 -2
- package/dist/{chunk-2NOHVIJ3.cjs → chunk-5LJF4KUZ.cjs} +17 -4
- package/dist/{chunk-5AL2GXAU.mjs → chunk-7MMDEIVC.mjs} +1 -1
- package/dist/{chunk-QBXS4TNG.mjs → chunk-BL54BTVJ.mjs} +1 -1
- package/dist/{chunk-VZWAXQME.mjs → chunk-BW563VZZ.mjs} +34 -2
- package/dist/{chunk-ZPQY7O64.cjs → chunk-CBB7I6HW.cjs} +3 -3
- package/dist/{chunk-KMGHXIDA.cjs → chunk-CHOOBTDD.cjs} +2 -2
- package/dist/{chunk-ISSFWEPY.mjs → chunk-COK4IXOO.mjs} +35 -18
- package/dist/{chunk-YU2MNIIY.mjs → chunk-CRF5MOLO.mjs} +17 -4
- package/dist/{chunk-NQ3Y6E2T.mjs → chunk-CV4MOEMO.mjs} +2 -2
- package/dist/{chunk-OLKYHTLN.cjs → chunk-DA432P2F.cjs} +5 -5
- package/dist/{chunk-B3HQTGXS.cjs → chunk-DVAZ53X6.cjs} +6 -1
- package/dist/{chunk-XRSNW4IU.mjs → chunk-E72GG355.mjs} +5 -0
- package/dist/{chunk-FJGA3XWL.cjs → chunk-EA5HVG45.cjs} +2 -2
- package/dist/{chunk-NG2EZ6QS.cjs → chunk-EODGIFI7.cjs} +4 -2
- package/dist/{chunk-Y3DO7BIJ.cjs → chunk-EUZFBHPP.cjs} +3 -0
- package/dist/{chunk-KRU3XPOW.cjs → chunk-EXPVSFAG.cjs} +14 -11
- package/dist/{chunk-EACD6ND7.cjs → chunk-EZUTDTFM.cjs} +7 -7
- package/dist/{chunk-KCJBIWBM.mjs → chunk-GVORDLLV.mjs} +1 -1
- package/dist/{chunk-XGL42MQ7.mjs → chunk-HIDZM23B.mjs} +1 -1
- package/dist/{chunk-23BZ7ZH6.mjs → chunk-HNB5JHBO.mjs} +5 -2
- package/dist/{chunk-DZC2XGK4.mjs → chunk-HVGINJTO.mjs} +81 -28
- package/dist/{chunk-EBKYRP2P.mjs → chunk-I5KPOXUE.mjs} +1 -1
- package/dist/{chunk-HR5GU4UU.cjs → chunk-ILQSRLKK.cjs} +4 -4
- package/dist/{chunk-L4B7PB3H.cjs → chunk-J2EKGR6E.cjs} +1025 -480
- package/dist/{chunk-26WP75W5.cjs → chunk-JDT733EW.cjs} +41 -27
- package/dist/{chunk-W53Z4WDI.cjs → chunk-JH4CDG4G.cjs} +8 -8
- package/dist/{chunk-KQ6TYQU7.cjs → chunk-KDQKTX3Q.cjs} +4 -4
- package/dist/{chunk-PEQJ4UUT.mjs → chunk-LP6DIYGA.mjs} +2 -2
- package/dist/{chunk-Z7ZRBCAB.mjs → chunk-LQ3FISSD.mjs} +58 -37
- package/dist/{chunk-KBIM7PFQ.cjs → chunk-M4YXD6MD.cjs} +272 -219
- package/dist/{chunk-6ETHVRFO.cjs → chunk-MWAWMFG3.cjs} +407 -386
- package/dist/{chunk-ECVSRE4Y.mjs → chunk-N2BRIN7I.mjs} +1 -1
- package/dist/{chunk-MO4UTDQ6.mjs → chunk-NNNMFSXG.mjs} +1 -1
- package/dist/{chunk-V3Y3R3JJ.cjs → chunk-NOSLIDSG.cjs} +1 -1
- package/dist/{chunk-ICOJ2BC6.mjs → chunk-NWF2FTFV.mjs} +24 -10
- package/dist/{chunk-M3JYBZO2.cjs → chunk-OLIWLN4I.cjs} +2 -2
- package/dist/{chunk-YPAOC3FO.mjs → chunk-P2TGLGRR.mjs} +4 -4
- package/dist/{chunk-THGSPDFD.cjs → chunk-PAKB6JHX.cjs} +7 -7
- package/dist/{chunk-NVXU5BEG.mjs → chunk-Q637AXGZ.mjs} +172 -47
- package/dist/{chunk-ZZGQD3LL.mjs → chunk-QO24II6C.mjs} +4 -2
- package/dist/{chunk-HENPVGZC.cjs → chunk-RBSGFS5X.cjs} +66 -34
- package/dist/{chunk-IJPRCQHW.cjs → chunk-RGMUS3HO.cjs} +10 -10
- package/dist/{chunk-OIPPISQ6.cjs → chunk-RTAWQXME.cjs} +273 -148
- package/dist/{chunk-DMSXZNQR.cjs → chunk-RZI6436F.cjs} +2 -2
- package/dist/{chunk-HZY63K5C.mjs → chunk-S6MGFULY.mjs} +2 -2
- package/dist/{chunk-5GFTMTX3.cjs → chunk-SAUGKNCF.cjs} +2 -2
- package/dist/{chunk-6BMAGVDI.cjs → chunk-SCE7VWPN.cjs} +12 -12
- package/dist/{chunk-PKV3JGMS.mjs → chunk-SSFAPTRD.mjs} +1 -1
- package/dist/{chunk-ND65INFS.cjs → chunk-SWPLGPYF.cjs} +7 -7
- package/dist/{chunk-WP77JDKI.cjs → chunk-UCJCU2IL.cjs} +14 -14
- package/dist/{chunk-WX752VMN.mjs → chunk-UCRNNDNS.mjs} +1 -1
- package/dist/{chunk-27ESPHQA.cjs → chunk-UGWKNZ4U.cjs} +44 -27
- package/dist/{chunk-FLKG2PYH.cjs → chunk-UOMSGJHK.cjs} +11 -11
- package/dist/{chunk-2U2GRXP5.mjs → chunk-UWDFH3ZV.mjs} +1 -1
- package/dist/{chunk-AMMFRXFW.mjs → chunk-V5FEFFHV.mjs} +1 -1
- package/dist/{chunk-HR4N2K4V.mjs → chunk-WABOJXAA.mjs} +2 -2
- package/dist/{chunk-LTXKRIST.mjs → chunk-WANLI3ZC.mjs} +2 -2
- package/dist/{chunk-HQEYZSF3.cjs → chunk-WPURVYXT.cjs} +2 -2
- package/dist/{chunk-TE7AX6HB.mjs → chunk-WV63R4GE.mjs} +1 -1
- package/dist/{chunk-CIQCJ72N.mjs → chunk-XOLYZZDX.mjs} +693 -148
- package/dist/{chunk-4ZVKDHS6.cjs → chunk-YSRZSKQB.cjs} +4 -4
- package/dist/{cli-runtime.d-jqZ7YCsm.d.ts → cli-runtime.d-Dbl-gIoz.d.ts} +5 -5
- package/dist/{cli-runtime.d-qL44rqYO.d.mts → cli-runtime.d-oUiNuspW.d.mts} +5 -5
- package/dist/{client-component.d-BDD5aiUb.d.ts → client-component.d-CT4q7tmy.d.ts} +1 -1
- package/dist/{client-component.d-B2L2LyAr.d.mts → client-component.d-DaUqOhZT.d.mts} +1 -1
- package/dist/{client-plugins.d-Crct3m_r.d.ts → client-plugins.d-24qhjX8c.d.ts} +30 -4
- package/dist/{client-plugins.d-Dzc3vOw_.d.mts → client-plugins.d-BfGTqbAH.d.mts} +30 -4
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-JTJA2KIZ.cjs → devtools-5WDQQDTA.cjs} +6 -6
- package/dist/{devtools-5DBTT2DI.mjs → devtools-DPYIYHTI.mjs} +5 -5
- package/dist/docs.cjs +8 -8
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +7 -7
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{handler.d-B1S1ZBqS.d.mts → handler.d-GfNuz57p.d.mts} +1 -1
- package/dist/{handler.d-ZweCBJD4.d.ts → handler.d-Oca5kNSz.d.ts} +1 -1
- package/dist/{headers.d-C-yGl_f6.d.mts → headers.d-C_lsQIWA.d.mts} +1 -1
- package/dist/{headers.d-BgBdQN8x.d.ts → headers.d-b8gHJDvu.d.ts} +1 -1
- package/dist/index.cjs +33 -29
- package/dist/{index.d-13h3oDu7.d.mts → index.d-BLtjh1aS.d.mts} +1 -1
- package/dist/{index.d-CtoniAXT.d.ts → index.d-Ckv6kHFm.d.ts} +1 -1
- package/dist/index.d.mts +23 -23
- package/dist/index.d.ts +23 -23
- package/dist/index.mjs +34 -30
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +4 -2
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +3 -1
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +10 -5
- package/dist/internal/app-markdown-runtime.d.ts +10 -5
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +26 -26
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +25 -25
- package/dist/internal/cli-runtime.cjs +10 -10
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +9 -9
- 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 +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +7 -7
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +6 -6
- package/dist/internal/infra-analytics-runtime.cjs +9 -9
- package/dist/internal/infra-analytics-runtime.mjs +7 -7
- package/dist/internal/metadata-image-runtime.d.mts +2 -2
- package/dist/internal/metadata-image-runtime.d.ts +2 -2
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-node-env.cjs +2 -2
- package/dist/internal/production-node-env.mjs +1 -1
- package/dist/internal/production-runtime.cjs +12 -12
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +11 -11
- package/dist/internal/spa-router.cjs +3 -3
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/spa-router.mjs +2 -2
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-_6Un9wdK.d.mts → mount.d-BCS8mD4E.d.mts} +1 -1
- package/dist/{mount.d-DyKlRR6z.d.ts → mount.d-DEX8eref.d.ts} +1 -1
- package/dist/{native-tree-5TENEQ7Y.cjs → native-tree-52CUAP3N.cjs} +3 -3
- package/dist/{native-tree-LNO7K6JR.mjs → native-tree-AO7PQ7FR.mjs} +2 -2
- package/dist/{navigation-delegate.d-BbW1_pf_.d.ts → navigation-delegate.d-Cgi28e5Q.d.ts} +1 -1
- package/dist/{navigation-delegate.d-B9GjWbov.d.mts → navigation-delegate.d-F83ugsZW.d.mts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +19 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +18 -18
- package/dist/query/client.cjs +7 -7
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-DaM1NPnm.d.mts → render-plan.d-BkVY4aFb.d.mts} +1 -1
- package/dist/{render-plan.d-D0FV9lDT.d.ts → render-plan.d-DCF2GZdD.d.ts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +22 -11
- package/dist/renderer.d.ts +22 -11
- package/dist/{request.d-CrXC7voZ.d.ts → request.d-C5o-4dU2.d.ts} +1 -1
- package/dist/{request.d-DVSLilGx.d.mts → request.d-DMPB53-i.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CWi3UYtR.d.mts → route-rendering.d-DDvArvik.d.mts} +1 -1
- package/dist/{route-rendering.d-OfbM_rj8.d.ts → route-rendering.d-DfP6zRP7.d.ts} +1 -1
- package/dist/{router.d-YKVirmj4.d.mts → router.d-1Skf2XCO.d.mts} +1 -1
- package/dist/{router.d-Bm9FNSu3.d.ts → router.d-s40h7aoS.d.ts} +1 -1
- package/dist/routes.d.mts +3 -3
- package/dist/routes.d.ts +3 -3
- package/dist/{rsc-pipeline-W5DSWDHD.mjs → rsc-pipeline-O2YMVHUF.mjs} +7 -7
- package/dist/{rsc-pipeline-LGXJGGMW.cjs → rsc-pipeline-SFQSMVI7.cjs} +8 -8
- package/dist/{runtime-UOZKSM5S.mjs → runtime-K2X3IZAF.mjs} +6 -6
- package/dist/{runtime-YV4X5FAK.cjs → runtime-WOTVFYQY.cjs} +8 -8
- package/dist/{runtime.d-BVj6apd0.d.mts → runtime.d-Bykc5Qfg.d.mts} +1 -1
- package/dist/{runtime.d-D7QYVJGO.d.ts → runtime.d-k-9kFUsM.d.ts} +1 -1
- package/dist/{server-components-status.d-BDVcxi0z.d.mts → server-components-status.d-D-HixBe0.d.mts} +1 -1
- package/dist/{server-components-status.d-CfKDpmCH.d.ts → server-components-status.d-DLNd1C5j.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +41 -41
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +20 -20
- package/dist/{spa-router.d-DGmropfK.d.mts → spa-router.d-DIlXwm00.d.mts} +2 -2
- package/dist/{spa-router.d-nE1jHNGt.d.ts → spa-router.d-Dl-EJeJT.d.ts} +2 -2
- package/dist/{ssg.d-DS-gXUbf.d.mts → ssg.d-D2ZV0bhs.d.mts} +2 -2
- package/dist/{ssg.d-jXlUAKzg.d.ts → ssg.d-bE-ylg0e.d.ts} +2 -2
- package/dist/{store-core.d-B5cwOd8g.d.ts → store-core.d-BmdnMopD.d.ts} +2 -2
- package/dist/{store-core.d-C-gATBwd.d.mts → store-core.d-DPsCYzV7.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BODwBtkz.d.ts → utils.d-BFZQcBZV.d.ts} +1 -1
- package/dist/{utils.d-Cmj-fzds.d.mts → utils.d-nM3OHKq5.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +19 -19
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +18 -18
- package/package.json +1 -1
- package/dist/analyzer-IIWSUXSQ.cjs +0 -17
|
@@ -129,11 +129,20 @@ var MCP_CLIENTS = [
|
|
|
129
129
|
[["arcade"], "arcade", "Arcade", "other"],
|
|
130
130
|
[["Alpic"], "alpic", "Alpic", "other"],
|
|
131
131
|
[["Postman-Client"], "postman", "Postman", "other"],
|
|
132
|
-
[["gitguardian"], "gitguardian", "GitGuardian", "other"]
|
|
132
|
+
[["gitguardian"], "gitguardian", "GitGuardian", "other"],
|
|
133
|
+
[["inspector-cli", "mcp-inspector"], "inspector", "MCP Inspector", "other"],
|
|
134
|
+
[["mcp-remote-fallback-test"], "mcp-remote", "mcp-remote", "other"]
|
|
133
135
|
];
|
|
134
136
|
var MCP_CLIENT_BY_NAME = new Map(
|
|
135
137
|
MCP_CLIENTS.flatMap(([names, slug]) => names.map((name) => [name.toLowerCase(), slug]))
|
|
136
138
|
);
|
|
139
|
+
var MCP_REMOTE_SUFFIX = " (via mcp-remote";
|
|
140
|
+
function mcpClientSlug(clientInfoName) {
|
|
141
|
+
if (typeof clientInfoName !== "string") return void 0;
|
|
142
|
+
const bridged = clientInfoName.endsWith(")") ? clientInfoName.lastIndexOf(MCP_REMOTE_SUFFIX) : -1;
|
|
143
|
+
const name = bridged < 0 ? clientInfoName : clientInfoName.slice(0, bridged);
|
|
144
|
+
return _nullishCoalesce(MCP_CLIENT_BY_NAME.get(name.toLowerCase()), () => ( (bridged < 0 ? void 0 : "mcp-remote")));
|
|
145
|
+
}
|
|
137
146
|
var MCP_CLIENT_BY_SLUG = new Map(
|
|
138
147
|
MCP_CLIENTS.map(([, slug, name, family]) => [slug, { name, family, category: "harness" }])
|
|
139
148
|
);
|
|
@@ -214,8 +223,7 @@ function declared({ name, family, category }) {
|
|
|
214
223
|
return { family, category, identity: "self-reported", ...name ? { name } : {} };
|
|
215
224
|
}
|
|
216
225
|
function _farmMCPClientSession(clientInfoName) {
|
|
217
|
-
|
|
218
|
-
const slug = MCP_CLIENT_BY_NAME.get(clientInfoName.toLowerCase());
|
|
226
|
+
const slug = mcpClientSlug(clientInfoName);
|
|
219
227
|
if (!slug) return void 0;
|
|
220
228
|
const random = crypto.getRandomValues(new Uint8Array(16));
|
|
221
229
|
return `farm.${slug}.${Array.from(random, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
@@ -225,6 +233,11 @@ function _classifyFarmMCPSession(sessionId) {
|
|
|
225
233
|
const client = slug === void 0 ? void 0 : MCP_CLIENT_BY_SLUG.get(slug);
|
|
226
234
|
return client && declared(client);
|
|
227
235
|
}
|
|
236
|
+
function _classifyFarmMCPClient(clientInfoName) {
|
|
237
|
+
const slug = mcpClientSlug(clientInfoName);
|
|
238
|
+
const client = slug === void 0 ? void 0 : MCP_CLIENT_BY_SLUG.get(slug);
|
|
239
|
+
return client && declared(client);
|
|
240
|
+
}
|
|
228
241
|
function _isFarmMCPRequest(request) {
|
|
229
242
|
return isMcpRequest(request);
|
|
230
243
|
}
|
|
@@ -1592,4 +1605,4 @@ function decodeHtml(input) {
|
|
|
1592
1605
|
|
|
1593
1606
|
|
|
1594
1607
|
|
|
1595
|
-
exports.classifyFarmAgent = classifyFarmAgent; exports.classifyFarmClient = classifyFarmClient; exports._farmMCPClientSession = _farmMCPClientSession; exports.
|
|
1608
|
+
exports.classifyFarmAgent = classifyFarmAgent; exports.classifyFarmClient = classifyFarmClient; exports._farmMCPClientSession = _farmMCPClientSession; exports._classifyFarmMCPClient = _classifyFarmMCPClient; exports._isFarmMCPRequest = _isFarmMCPRequest; exports.FARM_INTERNAL_READ_HEADER = FARM_INTERNAL_READ_HEADER; exports.emitFarmAgentRead = emitFarmAgentRead; 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._resolveFarmMarkdownIndexAlias = _resolveFarmMarkdownIndexAlias; exports._getFarmMarkdownPath = _getFarmMarkdownPath; exports.farmAcceptQuality = farmAcceptQuality; exports.requestAcceptsMarkdown = requestAcceptsMarkdown; exports.getFarmMarkdownMirrorPath = getFarmMarkdownMirrorPath; exports.getFarmMarkdownAlternatePath = getFarmMarkdownAlternatePath; exports.isFarmMarkdownMirrorExposed = isFarmMarkdownMirrorExposed; exports.matchesFarmMarkdownRoutePattern = matchesFarmMarkdownRoutePattern; exports._readFarmRenderedHtml = _readFarmRenderedHtml; exports.extractFarmPageActions = extractFarmPageActions;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
resolveFarmDocsContentDir,
|
|
11
11
|
toFarmDocsMarkdownPage,
|
|
12
12
|
toFarmDocsPublicSitemapConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GVORDLLV.mjs";
|
|
14
14
|
import {
|
|
15
15
|
docsEngine,
|
|
16
16
|
loadFarmDocsEngine,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-LRPPXKCX.mjs";
|
|
19
19
|
import {
|
|
20
20
|
resolveDocsConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-26ZTI2ZO.mjs";
|
|
22
22
|
import {
|
|
23
23
|
getFarmDocsAdapterConfigModule,
|
|
24
24
|
isSecretDocsConfigKey
|
|
@@ -158,6 +158,37 @@ async function listFarmDocsAdapterPages(docs, options) {
|
|
|
158
158
|
}
|
|
159
159
|
return [...new Set(pages)];
|
|
160
160
|
}
|
|
161
|
+
async function listFarmDocsAdapterRoutes(docs, options) {
|
|
162
|
+
if (!hasFarmDocsRuntimeAdapter(docs)) return null;
|
|
163
|
+
const requireFromApp = createRequire(path.join(options.root, "package.json"));
|
|
164
|
+
const serverModule = await import(
|
|
165
|
+
/* @vite-ignore */
|
|
166
|
+
pathToFileURL(requireFromApp.resolve(docs.adapter.server)).href
|
|
167
|
+
);
|
|
168
|
+
if (typeof serverModule.listFarmDocsRoutes !== "function") return null;
|
|
169
|
+
const listRoutes = serverModule.listFarmDocsRoutes;
|
|
170
|
+
const lists = await Promise.all(
|
|
171
|
+
getFarmDocsRoots(docs).map(
|
|
172
|
+
(root) => listRoutes(createFarmDocsAdapterRuntimeConfig(root, options), { rootDir: options.root })
|
|
173
|
+
)
|
|
174
|
+
);
|
|
175
|
+
const paths = /* @__PURE__ */ new Set();
|
|
176
|
+
const prefixes = /* @__PURE__ */ new Set();
|
|
177
|
+
for (const list of lists) {
|
|
178
|
+
for (const [values, target] of [
|
|
179
|
+
[list?.paths ?? [], paths],
|
|
180
|
+
[list?.prefixes ?? [], prefixes]
|
|
181
|
+
]) {
|
|
182
|
+
if (!list || typeof list !== "object" || !Array.isArray(values) || values.some((value) => typeof value !== "string" || !value.startsWith("/"))) {
|
|
183
|
+
throw new Error(
|
|
184
|
+
`Farm docs adapter ${JSON.stringify(docs.adapter.id)} listed routes that are not absolute paths.`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
for (const value of values) target.add(value);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return { paths: [...paths], prefixes: [...prefixes] };
|
|
191
|
+
}
|
|
161
192
|
async function listFarmDocsPagePaths(docs, options) {
|
|
162
193
|
if (options.adapter) return await listFarmDocsAdapterPages(docs, options) ?? [];
|
|
163
194
|
return getFarmDocsRoots(docs).flatMap(
|
|
@@ -744,6 +775,7 @@ export {
|
|
|
744
775
|
getFarmDocsConfigModuleRoot,
|
|
745
776
|
compileFarmDocsAdapterEdgeManifest,
|
|
746
777
|
listFarmDocsAdapterPages,
|
|
778
|
+
listFarmDocsAdapterRoutes,
|
|
747
779
|
listFarmDocsPagePaths,
|
|
748
780
|
createFarmDocsAdapterHandler,
|
|
749
781
|
isFarmDocsAPIRequest,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkOLIWLN4Icjs = require('./chunk-OLIWLN4I.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
@@ -64,7 +64,7 @@ function findFarmNativeScreenFiles(appDirs) {
|
|
|
64
64
|
}
|
|
65
65
|
function collectFarmNativeServerFns(options) {
|
|
66
66
|
const { root, srcDir } = options;
|
|
67
|
-
const aliases =
|
|
67
|
+
const aliases = _chunkOLIWLN4Icjs.readAliases.call(void 0, root, srcDir);
|
|
68
68
|
const seen = /* @__PURE__ */ new Set();
|
|
69
69
|
const found = /* @__PURE__ */ new Map();
|
|
70
70
|
const queue = [...options.entries];
|
|
@@ -98,7 +98,7 @@ function collectFarmNativeServerFns(options) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
for (const candidate of _nullishCoalesce(candidates, () => ( []))) {
|
|
101
|
-
const resolved =
|
|
101
|
+
const resolved = _chunkOLIWLN4Icjs.resolveFile.call(void 0, candidate);
|
|
102
102
|
if (resolved && SCRIPT.test(resolved) && !resolved.includes(`${_path2.default.sep}node_modules${_path2.default.sep}`)) {
|
|
103
103
|
queue.push(resolved);
|
|
104
104
|
break;
|
|
@@ -10,7 +10,7 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
|
|
|
10
10
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk5LJF4KUZcjs = require('./chunk-5LJF4KUZ.cjs');
|
|
14
14
|
|
|
15
15
|
// src/mobile/native-tree.ts
|
|
16
16
|
var URLENCODED = "application/x-www-form-urlencoded";
|
|
@@ -639,7 +639,7 @@ function parsedStylesheet(css) {
|
|
|
639
639
|
}
|
|
640
640
|
function createFarmNativeTree(html, pageUrl, stylesheets) {
|
|
641
641
|
const title = _optionalChain([/<title\b[^>]*>([\s\S]*?)<\/title>/i, 'access', _25 => _25.exec, 'call', _26 => _26(html), 'optionalAccess', _27 => _27[1]]);
|
|
642
|
-
const document = parseHtml(
|
|
642
|
+
const document = parseHtml(_chunk5LJF4KUZcjs._readFarmRenderedHtml.call(void 0, html, { keepAriaHidden: true }));
|
|
643
643
|
const page = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(find(document, (element) => element.attributes.id === "__farm_page__"), () => ( find(document, (element) => element.attributes.id === "root"))), () => ( find(document, (element) => element.tag === "body"))), () => ( document));
|
|
644
644
|
const labels = /* @__PURE__ */ new Map();
|
|
645
645
|
const collectLabels = (element) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFarmRouteLabel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P2TGLGRR.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
_classifyFarmMCPClient,
|
|
6
6
|
_farmMCPClientSession,
|
|
7
7
|
_isFarmMCPRequest,
|
|
8
8
|
classifyFarmClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CRF5MOLO.mjs";
|
|
10
10
|
import {
|
|
11
11
|
validateIntegrationRequestOrigin
|
|
12
12
|
} from "./chunk-PNMAD3OS.mjs";
|
|
@@ -294,19 +294,28 @@ function createFarmInfraAnalyticsExporter(options, send = (input, init) => fetch
|
|
|
294
294
|
}
|
|
295
295
|
var CONTEXT_KEY = "farm.infra.analytics";
|
|
296
296
|
function beginRequest(request, route, waitUntil) {
|
|
297
|
-
|
|
297
|
+
const metadata = {
|
|
298
298
|
id: uuid(),
|
|
299
299
|
agent: classifyFarmClient(request),
|
|
300
|
-
mcpSession:
|
|
300
|
+
mcpSession: void 0,
|
|
301
301
|
path: requestPath(request),
|
|
302
302
|
route,
|
|
303
303
|
completed: false,
|
|
304
304
|
waitUntil
|
|
305
305
|
};
|
|
306
|
+
metadata.mcpSession = readMCPClient(request)?.then((client) => {
|
|
307
|
+
if (!client) return void 0;
|
|
308
|
+
metadata.agent = client.agent;
|
|
309
|
+
return client.session;
|
|
310
|
+
});
|
|
311
|
+
return metadata;
|
|
306
312
|
}
|
|
307
313
|
var MAX_MCP_BODY = 64 * 1024;
|
|
308
|
-
|
|
309
|
-
|
|
314
|
+
var STATELESS_MCP_VERSION = "2026-07-28";
|
|
315
|
+
var CLIENT_INFO_META = "io.modelcontextprotocol/clientInfo";
|
|
316
|
+
function readMCPClient(request) {
|
|
317
|
+
const version = request.headers.get("mcp-protocol-version");
|
|
318
|
+
if (request.headers.has("mcp-session-id") || version !== null && version < STATELESS_MCP_VERSION || !_isFarmMCPRequest(request) || !request.body || request.bodyUsed || !/json/i.test(request.headers.get("content-type") ?? "") || Number(request.headers.get("content-length")) > MAX_MCP_BODY)
|
|
310
319
|
return void 0;
|
|
311
320
|
let body;
|
|
312
321
|
try {
|
|
@@ -314,9 +323,9 @@ function readMCPClientSession(request) {
|
|
|
314
323
|
} catch {
|
|
315
324
|
return void 0;
|
|
316
325
|
}
|
|
317
|
-
return
|
|
326
|
+
return readMCPClientInfo(body).catch(() => void 0);
|
|
318
327
|
}
|
|
319
|
-
async function
|
|
328
|
+
async function readMCPClientInfo(body) {
|
|
320
329
|
const reader = body.getReader();
|
|
321
330
|
const decoder = new TextDecoder();
|
|
322
331
|
let text = "";
|
|
@@ -332,15 +341,18 @@ async function readMCPInitialize(body) {
|
|
|
332
341
|
});
|
|
333
342
|
}
|
|
334
343
|
const parsed = JSON.parse(text + decoder.decode());
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
344
|
+
for (const message of Array.isArray(parsed) ? parsed : [parsed]) {
|
|
345
|
+
const { method, params } = message ?? {};
|
|
346
|
+
const name = method === "initialize" ? params?.clientInfo?.name : params?._meta?.[CLIENT_INFO_META]?.name;
|
|
347
|
+
const agent = _classifyFarmMCPClient(name);
|
|
348
|
+
if (!agent) continue;
|
|
349
|
+
return method === "initialize" ? { agent, session: _farmMCPClientSession(name) } : { agent };
|
|
350
|
+
}
|
|
351
|
+
return void 0;
|
|
339
352
|
}
|
|
340
353
|
async function withMCPClientSession(response, metadata) {
|
|
341
354
|
const session = await metadata.mcpSession;
|
|
342
355
|
if (!session || !response.ok || response.headers.has("mcp-session-id")) return void 0;
|
|
343
|
-
metadata.agent = _classifyFarmMCPSession(session) ?? metadata.agent;
|
|
344
356
|
const headers = new Headers(response.headers);
|
|
345
357
|
headers.set("Mcp-Session-Id", session);
|
|
346
358
|
return new Response(response.body, {
|
|
@@ -520,6 +532,13 @@ function _farmWebMCPReportsEnabled(plugins) {
|
|
|
520
532
|
return candidate?.name === "farm:webmcp" && candidate.client?.public?.analytics !== false;
|
|
521
533
|
});
|
|
522
534
|
}
|
|
535
|
+
function reportToolCall(exporter, metadata, event, options) {
|
|
536
|
+
const report = () => {
|
|
537
|
+
exporter.enqueue(toolEvent(metadata, event, options.toolPayloads !== false));
|
|
538
|
+
return exporter.flush();
|
|
539
|
+
};
|
|
540
|
+
return metadata.mcpSession ? metadata.mcpSession.then(report) : report();
|
|
541
|
+
}
|
|
523
542
|
function farmInfraAnalyticsPlugin(options, send, runtimeOptions = {}) {
|
|
524
543
|
const contextKey = `${CONTEXT_KEY}.${uuid()}`;
|
|
525
544
|
const webmcp = runtimeOptions.webmcp ? { ...runtimeOptions.webmcp } : void 0;
|
|
@@ -560,8 +579,7 @@ function farmInfraAnalyticsPlugin(options, send, runtimeOptions = {}) {
|
|
|
560
579
|
if (!request) return;
|
|
561
580
|
const metadata = context.requestContext.get(request, contextKey);
|
|
562
581
|
if (!metadata) return;
|
|
563
|
-
|
|
564
|
-
metadata.waitUntil(exporter.flush());
|
|
582
|
+
metadata.waitUntil(reportToolCall(exporter, metadata, event, options));
|
|
565
583
|
},
|
|
566
584
|
{ unfiltered: true }
|
|
567
585
|
);
|
|
@@ -610,8 +628,7 @@ function farmInfraAnalyticsRecorder(options, send, runtimeOptions = {}) {
|
|
|
610
628
|
if (!isToolEvent(event)) return;
|
|
611
629
|
const metadata = requests.getStore();
|
|
612
630
|
if (!metadata) return;
|
|
613
|
-
|
|
614
|
-
metadata.waitUntil(exporter.flush());
|
|
631
|
+
metadata.waitUntil(reportToolCall(exporter, metadata, event, options));
|
|
615
632
|
},
|
|
616
633
|
{ unfiltered: true }
|
|
617
634
|
);
|
|
@@ -129,11 +129,20 @@ var MCP_CLIENTS = [
|
|
|
129
129
|
[["arcade"], "arcade", "Arcade", "other"],
|
|
130
130
|
[["Alpic"], "alpic", "Alpic", "other"],
|
|
131
131
|
[["Postman-Client"], "postman", "Postman", "other"],
|
|
132
|
-
[["gitguardian"], "gitguardian", "GitGuardian", "other"]
|
|
132
|
+
[["gitguardian"], "gitguardian", "GitGuardian", "other"],
|
|
133
|
+
[["inspector-cli", "mcp-inspector"], "inspector", "MCP Inspector", "other"],
|
|
134
|
+
[["mcp-remote-fallback-test"], "mcp-remote", "mcp-remote", "other"]
|
|
133
135
|
];
|
|
134
136
|
var MCP_CLIENT_BY_NAME = new Map(
|
|
135
137
|
MCP_CLIENTS.flatMap(([names, slug]) => names.map((name) => [name.toLowerCase(), slug]))
|
|
136
138
|
);
|
|
139
|
+
var MCP_REMOTE_SUFFIX = " (via mcp-remote";
|
|
140
|
+
function mcpClientSlug(clientInfoName) {
|
|
141
|
+
if (typeof clientInfoName !== "string") return void 0;
|
|
142
|
+
const bridged = clientInfoName.endsWith(")") ? clientInfoName.lastIndexOf(MCP_REMOTE_SUFFIX) : -1;
|
|
143
|
+
const name = bridged < 0 ? clientInfoName : clientInfoName.slice(0, bridged);
|
|
144
|
+
return MCP_CLIENT_BY_NAME.get(name.toLowerCase()) ?? (bridged < 0 ? void 0 : "mcp-remote");
|
|
145
|
+
}
|
|
137
146
|
var MCP_CLIENT_BY_SLUG = new Map(
|
|
138
147
|
MCP_CLIENTS.map(([, slug, name, family]) => [slug, { name, family, category: "harness" }])
|
|
139
148
|
);
|
|
@@ -214,8 +223,7 @@ function declared({ name, family, category }) {
|
|
|
214
223
|
return { family, category, identity: "self-reported", ...name ? { name } : {} };
|
|
215
224
|
}
|
|
216
225
|
function _farmMCPClientSession(clientInfoName) {
|
|
217
|
-
|
|
218
|
-
const slug = MCP_CLIENT_BY_NAME.get(clientInfoName.toLowerCase());
|
|
226
|
+
const slug = mcpClientSlug(clientInfoName);
|
|
219
227
|
if (!slug) return void 0;
|
|
220
228
|
const random = crypto.getRandomValues(new Uint8Array(16));
|
|
221
229
|
return `farm.${slug}.${Array.from(random, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
@@ -225,6 +233,11 @@ function _classifyFarmMCPSession(sessionId) {
|
|
|
225
233
|
const client = slug === void 0 ? void 0 : MCP_CLIENT_BY_SLUG.get(slug);
|
|
226
234
|
return client && declared(client);
|
|
227
235
|
}
|
|
236
|
+
function _classifyFarmMCPClient(clientInfoName) {
|
|
237
|
+
const slug = mcpClientSlug(clientInfoName);
|
|
238
|
+
const client = slug === void 0 ? void 0 : MCP_CLIENT_BY_SLUG.get(slug);
|
|
239
|
+
return client && declared(client);
|
|
240
|
+
}
|
|
228
241
|
function _isFarmMCPRequest(request) {
|
|
229
242
|
return isMcpRequest(request);
|
|
230
243
|
}
|
|
@@ -1566,7 +1579,7 @@ export {
|
|
|
1566
1579
|
classifyFarmAgent,
|
|
1567
1580
|
classifyFarmClient,
|
|
1568
1581
|
_farmMCPClientSession,
|
|
1569
|
-
|
|
1582
|
+
_classifyFarmMCPClient,
|
|
1570
1583
|
_isFarmMCPRequest,
|
|
1571
1584
|
FARM_INTERNAL_READ_HEADER,
|
|
1572
1585
|
emitFarmAgentRead,
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getFarmAgentPagePublicPath,
|
|
3
3
|
isFarmMetadataNoIndex,
|
|
4
4
|
resolveFarmAgentOrigin
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HIDZM23B.mjs";
|
|
6
6
|
import {
|
|
7
7
|
matchesFarmMarkdownRoutePattern
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CRF5MOLO.mjs";
|
|
9
9
|
import {
|
|
10
10
|
normalizeFarmTrailingSlashPathname
|
|
11
11
|
} from "./chunk-4O26BPUY.mjs";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk5LJF4KUZcjs = require('./chunk-5LJF4KUZ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
@@ -65,12 +65,12 @@ function collectFarmLlmsTxtPages(sources, options) {
|
|
|
65
65
|
for (const source of sources) {
|
|
66
66
|
const path = source.pattern;
|
|
67
67
|
if (path.includes("[") || pages.has(path)) continue;
|
|
68
|
-
if (include.length && !include.some((pattern) =>
|
|
68
|
+
if (include.length && !include.some((pattern) => _chunk5LJF4KUZcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
|
|
69
69
|
continue;
|
|
70
70
|
}
|
|
71
|
-
if (exclude.some((pattern) =>
|
|
71
|
+
if (exclude.some((pattern) => _chunk5LJF4KUZcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
|
|
72
72
|
if (isFarmMetadataNoIndex(source.metadata)) continue;
|
|
73
|
-
const target =
|
|
73
|
+
const target = _chunk5LJF4KUZcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? getFarmAgentPagePublicPath(_chunk5LJF4KUZcjs.getFarmMarkdownMirrorPath.call(void 0, path), options) : _chunkDVJM55D2cjs.normalizeFarmTrailingSlashPathname.call(void 0,
|
|
74
74
|
getFarmAgentPagePublicPath(path, options),
|
|
75
75
|
options.trailingSlash === true
|
|
76
76
|
);
|
|
@@ -199,7 +199,7 @@ function createFarmLlmsMarkdownReader(fetchMarkdown) {
|
|
|
199
199
|
try {
|
|
200
200
|
const response = await fetchMarkdown(
|
|
201
201
|
new Request(url, {
|
|
202
|
-
headers: { accept: "text/markdown", [
|
|
202
|
+
headers: { accept: "text/markdown", [_chunk5LJF4KUZcjs.FARM_INTERNAL_READ_HEADER]: "llms-full" }
|
|
203
203
|
})
|
|
204
204
|
);
|
|
205
205
|
const type = _nullishCoalesce(response.headers.get("content-type"), () => ( ""));
|
|
@@ -347,6 +347,7 @@ function getIntegrationProviders(integrations) {
|
|
|
347
347
|
name: provider.name,
|
|
348
348
|
type: provider.type,
|
|
349
349
|
props: provider.props,
|
|
350
|
+
islands: provider.islands,
|
|
350
351
|
supportsIsolatedHydration: provider.supportsIsolatedHydration,
|
|
351
352
|
component: provider.component
|
|
352
353
|
});
|
|
@@ -354,6 +355,9 @@ function getIntegrationProviders(integrations) {
|
|
|
354
355
|
}
|
|
355
356
|
return providers;
|
|
356
357
|
}
|
|
358
|
+
function providerSupportsIslands(provider) {
|
|
359
|
+
return (_nullishCoalesce(provider.islands, () => ( provider.supportsIsolatedHydration))) === true;
|
|
360
|
+
}
|
|
357
361
|
function isFarmIntegrationProviderComponentReference(value) {
|
|
358
362
|
return Boolean(
|
|
359
363
|
value && typeof value === "object" && "module" in value && typeof value.module === "string" && value.module.length > 0
|
|
@@ -1975,4 +1979,5 @@ function normalizeMatcher(matcher) {
|
|
|
1975
1979
|
|
|
1976
1980
|
|
|
1977
1981
|
|
|
1978
|
-
|
|
1982
|
+
|
|
1983
|
+
exports.FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY; exports.FARM_INTEGRATION_SET_COOKIES_KEY = FARM_INTEGRATION_SET_COOKIES_KEY; exports.forwardIntegrationSetCookies = forwardIntegrationSetCookies; exports.defineIntegrationSchema = defineIntegrationSchema; exports.getFarmIntegrationPluginServerRuntime = getFarmIntegrationPluginServerRuntime; exports.getFarmIntegrationPluginOwner = getFarmIntegrationPluginOwner; exports.createIntegrationRoute = createIntegrationRoute; exports.integrationRoute = integrationRoute; exports.defineIntegration = defineIntegration; exports.resolveIntegrationPlugins = resolveIntegrationPlugins; exports.getIntegrationProviders = getIntegrationProviders; exports.providerSupportsIslands = providerSupportsIslands; exports.isFarmIntegrationProviderComponentReference = isFarmIntegrationProviderComponentReference; exports.getIntegrationDocumentNavigationMatchers = getIntegrationDocumentNavigationMatchers; exports.getIntegrationSchemas = getIntegrationSchemas; exports.getRegisteredIntegrationRuntime = getRegisteredIntegrationRuntime; exports.getRegisteredIntegrations = getRegisteredIntegrations; exports.getRegisteredIntegrationSchemas = getRegisteredIntegrationSchemas; exports.matchIntegrationRoute = matchIntegrationRoute; exports.matchRegisteredIntegrationRoute = matchRegisteredIntegrationRoute; exports.getRegisteredIntegrationAPIManifest = getRegisteredIntegrationAPIManifest; exports.dispatchIntegrationRequest = dispatchIntegrationRequest; exports.dispatchIntegrationRequests = dispatchIntegrationRequests;
|
|
@@ -347,6 +347,7 @@ function getIntegrationProviders(integrations) {
|
|
|
347
347
|
name: provider.name,
|
|
348
348
|
type: provider.type,
|
|
349
349
|
props: provider.props,
|
|
350
|
+
islands: provider.islands,
|
|
350
351
|
supportsIsolatedHydration: provider.supportsIsolatedHydration,
|
|
351
352
|
component: provider.component
|
|
352
353
|
});
|
|
@@ -354,6 +355,9 @@ function getIntegrationProviders(integrations) {
|
|
|
354
355
|
}
|
|
355
356
|
return providers;
|
|
356
357
|
}
|
|
358
|
+
function providerSupportsIslands(provider) {
|
|
359
|
+
return (provider.islands ?? provider.supportsIsolatedHydration) === true;
|
|
360
|
+
}
|
|
357
361
|
function isFarmIntegrationProviderComponentReference(value) {
|
|
358
362
|
return Boolean(
|
|
359
363
|
value && typeof value === "object" && "module" in value && typeof value.module === "string" && value.module.length > 0
|
|
@@ -1964,6 +1968,7 @@ export {
|
|
|
1964
1968
|
defineIntegration,
|
|
1965
1969
|
resolveIntegrationPlugins,
|
|
1966
1970
|
getIntegrationProviders,
|
|
1971
|
+
providerSupportsIslands,
|
|
1967
1972
|
isFarmIntegrationProviderComponentReference,
|
|
1968
1973
|
getIntegrationDocumentNavigationMatchers,
|
|
1969
1974
|
getIntegrationSchemas,
|
|
@@ -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 _chunkNOSLIDSGcjs = require('./chunk-NOSLIDSG.cjs');
|
|
4
4
|
|
|
5
5
|
// src/deployment-environment.ts
|
|
6
6
|
function isFarmProductionDeploymentEnvironment(env = process.env) {
|
|
@@ -90,7 +90,7 @@ function createFarmProductionSiteReporter(options) {
|
|
|
90
90
|
schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
|
|
91
91
|
eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
|
|
92
92
|
packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
|
|
93
|
-
packageVersion: sanitizeDetail(
|
|
93
|
+
packageVersion: sanitizeDetail(_chunkNOSLIDSGcjs.FARM_VERSION, "unknown"),
|
|
94
94
|
renderer: sanitizeDetail(options.renderer, "custom"),
|
|
95
95
|
deployTarget: sanitizeDetail(options.deployTarget, "custom")
|
|
96
96
|
};
|
|
@@ -132,7 +132,7 @@ import { trapUnhandledErrors } from "#nitro/runtime/error/hooks";
|
|
|
132
132
|
import { setupCloseHooks } from "#nitro/runtime/shutdown";
|
|
133
133
|
import { startScheduleRunner } from "#nitro/runtime/task";
|
|
134
134
|
import { tracingSrvxPlugins } from "#nitro/virtual/tracing";
|
|
135
|
-
import { farmProductionLifecycle } from ${JSON.stringify(nitroEntryImport)};${desktop ? `
|
|
135
|
+
import { farmPrepareNativeRoutes, farmProductionLifecycle } from ${JSON.stringify(nitroEntryImport)};${desktop ? `
|
|
136
136
|
import { realpathSync } from "node:fs";
|
|
137
137
|
import { pathToFileURL } from "node:url";
|
|
138
138
|
import { createFarmDesktopGuard } from ${JSON.stringify(desktop.guardModule)};
|
|
@@ -196,7 +196,9 @@ if (!shutdownConfig.disabled) {
|
|
|
196
196
|
|
|
197
197
|
try {
|
|
198
198
|
await Promise.race([
|
|
199
|
-
Promise.resolve()
|
|
199
|
+
Promise.resolve()
|
|
200
|
+
.then(() => farmProductionLifecycle.start())
|
|
201
|
+
.then(() => farmPrepareNativeRoutes()),
|
|
200
202
|
startupSignalPromise,
|
|
201
203
|
]);
|
|
202
204
|
} catch (error) {
|
|
@@ -467,6 +467,9 @@ function resolveTwitterPlayers(metadata, metadataBase) {
|
|
|
467
467
|
)[0];
|
|
468
468
|
const poster = image && toSameOriginPath(image.url, metadataBase);
|
|
469
469
|
if (poster) query.set("poster", poster);
|
|
470
|
+
const pageUrl = normalizeContent(metadata.openGraph.url);
|
|
471
|
+
const page = pageUrl && toSameOriginPath(pageUrl, metadataBase);
|
|
472
|
+
if (page) query.set("page", page);
|
|
470
473
|
const size = video.width && video.height ? { width: video.width, height: video.height } : DEFAULT_TWITTER_PLAYER_SIZE;
|
|
471
474
|
const playerPath = `${FARM_VIDEO_PLAYER_PATH}?${query}`;
|
|
472
475
|
return [
|
|
@@ -29,7 +29,7 @@ var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
|
|
|
29
29
|
var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkJDT733EWcjs = require('./chunk-JDT733EW.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
|
|
@@ -92,7 +92,7 @@ function analyzeStaticRouteCandidate(mod, source, options = {}) {
|
|
|
92
92
|
if (!source) {
|
|
93
93
|
blockers.push("route source is unavailable");
|
|
94
94
|
}
|
|
95
|
-
if (options.isDynamic) {
|
|
95
|
+
if (options.isDynamic && !listsStaticPaths(mod)) {
|
|
96
96
|
blockers.push("the route has dynamic path segments");
|
|
97
97
|
}
|
|
98
98
|
if (hasExplicitRenderingConfig(mod, source)) {
|
|
@@ -285,8 +285,11 @@ function sanitizeSource(source, maskLiterals) {
|
|
|
285
285
|
function escapeRegExp(value) {
|
|
286
286
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
287
287
|
}
|
|
288
|
+
function listsStaticPaths(mod) {
|
|
289
|
+
return typeof _optionalChain([mod, 'optionalAccess', _35 => _35.getStaticPaths]) === "function" || typeof _optionalChain([mod, 'optionalAccess', _36 => _36.generateStaticParams]) === "function";
|
|
290
|
+
}
|
|
288
291
|
function hasExplicitRenderingConfig(mod, source) {
|
|
289
|
-
return typeof _optionalChain([mod, 'optionalAccess',
|
|
292
|
+
return typeof _optionalChain([mod, 'optionalAccess', _37 => _37.ssg]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _38 => _38.ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _39 => _39.experimental_ppr]) === "boolean" || typeof _optionalChain([mod, 'optionalAccess', _40 => _40.revalidate]) !== "undefined" || typeof _optionalChain([mod, 'optionalAccess', _41 => _41.dynamic]) !== "undefined" || typeof parseRouteRenderingDirective(source) !== "undefined";
|
|
290
293
|
}
|
|
291
294
|
function parseRouteRenderingDirective(source) {
|
|
292
295
|
if (!source) {
|
|
@@ -315,7 +318,7 @@ function parseKnownRenderingDirective(directive) {
|
|
|
315
318
|
const match = normalized.match(
|
|
316
319
|
/^use\s+(ssg|static|isr|ssr|dynamic|ppr)(?:\s*[;:]\s*(\d+))?\s*;?$/
|
|
317
320
|
);
|
|
318
|
-
if (!_optionalChain([match, 'optionalAccess',
|
|
321
|
+
if (!_optionalChain([match, 'optionalAccess', _42 => _42[1]])) {
|
|
319
322
|
return void 0;
|
|
320
323
|
}
|
|
321
324
|
const mode = match[1];
|
|
@@ -424,7 +427,7 @@ async function collectSSGPages(routes, loadModule, options = {}) {
|
|
|
424
427
|
continue;
|
|
425
428
|
}
|
|
426
429
|
const source = await _promises.readFile.call(void 0, route.filePath, "utf8").catch(() => void 0);
|
|
427
|
-
if (_optionalChain([options, 'access',
|
|
430
|
+
if (_optionalChain([options, 'access', _43 => _43.docsAdapterRoutes, 'optionalAccess', _44 => _44.owns, 'call', _45 => _45(route.path)]) && _chunkJDT733EWcjs.isFarmMarkdownPageFile.call(void 0, route.filePath)) {
|
|
428
431
|
ssrRoutes.push(route.path);
|
|
429
432
|
if (options.suggestStaticRendering !== false && analyzeStaticRouteCandidate(null, source, { isDynamic: route.isDynamic }).candidate) {
|
|
430
433
|
staticCandidateDocsPages += 1;
|
|
@@ -469,7 +472,7 @@ async function collectSSGPages(routes, loadModule, options = {}) {
|
|
|
469
472
|
} else {
|
|
470
473
|
ssrRoutes.push(route.path);
|
|
471
474
|
if (options.suggestStaticRendering !== false && analyzeStaticRouteCandidate(mod, source, { isDynamic: route.isDynamic }).candidate) {
|
|
472
|
-
if (_optionalChain([options, 'access',
|
|
475
|
+
if (_optionalChain([options, 'access', _46 => _46.docsAdapterRoutes, 'optionalAccess', _47 => _47.owns, 'call', _48 => _48(route.path)])) staticCandidateDocsPages += 1;
|
|
473
476
|
else staticCandidateRoutes.push(route.path);
|
|
474
477
|
}
|
|
475
478
|
}
|
|
@@ -489,7 +492,7 @@ async function collectSSGPages(routes, loadModule, options = {}) {
|
|
|
489
492
|
Add \`export const dynamic = "force-static";\` after verifying that imported code does not read cookies, headers, authentication, or other request data.`
|
|
490
493
|
);
|
|
491
494
|
}
|
|
492
|
-
if (staticCandidateDocsPages > 0 && !_optionalChain([options, 'access',
|
|
495
|
+
if (staticCandidateDocsPages > 0 && !_optionalChain([options, 'access', _49 => _49.docsAdapterRoutes, 'optionalAccess', _50 => _50.prerender])) {
|
|
493
496
|
console.warn(
|
|
494
497
|
`[Farm.js] ${staticCandidateDocsPages} docs page${staticCandidateDocsPages === 1 ? " renders" : "s render"} on each request. Set \`docs.prerender: true\` in farm.config.ts to prerender docs pages on Node and serverless targets.`
|
|
495
498
|
);
|
|
@@ -771,7 +774,7 @@ function fieldTsType(field) {
|
|
|
771
774
|
case "json":
|
|
772
775
|
return "unknown";
|
|
773
776
|
case "enum":
|
|
774
|
-
return _optionalChain([field, 'access',
|
|
777
|
+
return _optionalChain([field, 'access', _51 => _51.values, 'optionalAccess', _52 => _52.length]) ? field.values.map((value) => JSON.stringify(value)).join(" | ") : "string";
|
|
775
778
|
// id, uuid, string, text, datetime all travel as strings over JSON.
|
|
776
779
|
default:
|
|
777
780
|
return "string";
|
|
@@ -795,7 +798,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
795
798
|
const shouldGenerateApi = options.api !== false;
|
|
796
799
|
const shouldGenerateEnv = options.env !== false;
|
|
797
800
|
const shouldGenerateImages = options.images !== false;
|
|
798
|
-
const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access',
|
|
801
|
+
const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _53 => _53.i18nConfig, 'optionalAccess', _54 => _54.enabled]);
|
|
799
802
|
const sourceRoots = _chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
|
|
800
803
|
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
|
|
801
804
|
const result = {
|
|
@@ -842,7 +845,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
842
845
|
const apiRoutes = generator.scanAPIRoutes();
|
|
843
846
|
const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
|
|
844
847
|
const pluginRoutes = _chunkVGVRGGP4cjs.resolvePluginRoutes.call(void 0,
|
|
845
|
-
_optionalChain([options, 'access',
|
|
848
|
+
_optionalChain([options, 'access', _55 => _55.plugins, 'optionalAccess', _56 => _56.filter, 'call', _57 => _57((plugin) => plugin.name !== _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN)])
|
|
846
849
|
);
|
|
847
850
|
const configFiles = [
|
|
848
851
|
...(_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.configFile).filter((file) => Boolean(file)),
|
|
@@ -919,7 +922,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
919
922
|
});
|
|
920
923
|
}
|
|
921
924
|
}
|
|
922
|
-
if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access',
|
|
925
|
+
if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access', _58 => _58.i18nConfig, 'optionalAccess', _59 => _59.enabled]) && !options.i18nTypesOutFile) {
|
|
923
926
|
const { signatures } = await _chunkCYOTNHDFcjs.readFarmI18nCatalogs.call(void 0, options.i18nConfig);
|
|
924
927
|
unifiedSections.push(renderFarmI18nTypes(options.i18nConfig.locales, signatures));
|
|
925
928
|
result.i18nTypesPath = unifiedTypesPath;
|