@farm.js/core 0.1.81 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-Cxi3214_.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DMqOqnOA.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-IC66UJCU.mjs → analyzer-RPU2KG4J.mjs} +2 -2
- package/dist/api/node.cjs +5 -4
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/node.mjs +4 -3
- package/dist/api/route-manager.cjs +5 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -3
- package/dist/api/runtime.cjs +4 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -2
- package/dist/api.cjs +7 -6
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +6 -5
- package/dist/{app-manifest.d-Bbxp5kes.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-C8Cswd31.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BJuSurgy.d.mts → app.d-C0ePpuaG.d.mts} +21 -4
- package/dist/{app.d-DGIoFt5D.d.ts → app.d-CIoXsAbN.d.ts} +21 -4
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-NOYKBGUK.mjs → chunk-47I2MYIR.mjs} +130 -46
- package/dist/{chunk-GY63XD6K.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/{chunk-CPZZBCPO.cjs → chunk-5MUFW5UU.cjs} +2 -2
- package/dist/{chunk-LKIG5SM6.cjs → chunk-5P65LXGU.cjs} +9 -9
- package/dist/{chunk-XOXCQGAF.mjs → chunk-63ZE6B6M.mjs} +1 -1
- package/dist/{chunk-XOGCNKB7.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-UF4BNKKJ.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-2Y2HRZQY.cjs → chunk-AIPZDBP6.cjs} +312 -228
- package/dist/{chunk-CL7BUGVB.cjs → chunk-ARORZ3MH.cjs} +286 -240
- package/dist/{chunk-ONSZP5JK.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-FYZD7DUS.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/{chunk-M6DAIE4T.cjs → chunk-BCTHOQPP.cjs} +10 -8
- package/dist/{chunk-S3IWDDQ3.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/{chunk-OO4GVGM3.mjs → chunk-CA2HBLXP.mjs} +11 -1
- package/dist/{chunk-W6C3LEXX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-YH7ENV3K.mjs → chunk-CJDBTTLB.mjs} +4 -4
- package/dist/{chunk-5N526T7Q.mjs → chunk-DAXU2NBE.mjs} +74 -18
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-46UV2E7I.cjs → chunk-DRO3NXA3.cjs} +9 -9
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-HTNJ7A4D.mjs → chunk-EL2Z6YFZ.mjs} +2 -2
- package/dist/{chunk-IM3UINTZ.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-E3HBD2K3.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-BJWJP5A4.mjs → chunk-I4DR3HCH.mjs} +3 -3
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-NSLRK5DK.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-MOGRRZMW.cjs → chunk-LM2ZDNDD.cjs} +16 -16
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-ZIYJWJV2.cjs → chunk-N2EFMN2K.cjs} +8 -8
- package/dist/{chunk-6WVRVGKC.mjs → chunk-NAHDG6UX.mjs} +1 -1
- package/dist/{chunk-OFVCWV2D.cjs → chunk-NEKO3HM2.cjs} +11 -1
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-IPG6B25T.mjs → chunk-NRCKBDYP.mjs} +78 -32
- package/dist/{chunk-POL5RCVU.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-D77OGI6X.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-OIWDEDUO.cjs → chunk-Q2VOT3K2.cjs} +392 -336
- package/dist/{chunk-RZ6XUEQS.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-2HMSSPCZ.mjs → chunk-RMLR5RMH.mjs} +4 -2
- package/dist/{chunk-ADQ2LATR.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-AHVF5GI2.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-ZKNXCRUQ.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-OUDNUFVR.cjs → chunk-VMBIKDKW.cjs} +4 -4
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-TLSGRK7E.mjs → chunk-ZIZRIZLP.mjs} +1 -1
- package/dist/{cli-runtime.d-D8O1v2_X.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-hf4L1MNP.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CX8UCQh-.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-DFwUHlOz.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-BflSNO-b.d.mts → client-plugins.d-C1WM3ieD.d.mts} +6 -1
- package/dist/{client-plugins.d-qWp8hNwd.d.ts → client-plugins.d-DcmDzcSC.d.ts} +6 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-EI5N366Z.cjs → devtools-5B7NZE6F.cjs} +10 -9
- package/dist/{devtools-XJHODO5H.mjs → devtools-C5GXZZ7E.mjs} +7 -6
- package/dist/docs.cjs +9 -8
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +8 -7
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/{handler.d-DoH5Krkq.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-C2oRihfa.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BrX53wFQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-Dj0mfYpb.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/{index.d-DzDHOttz.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-Dhc2scRl.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +27 -26
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +26 -25
- 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 -24
- package/dist/internal/cli-runtime.cjs +11 -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 +10 -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 +9 -8
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +8 -7
- package/dist/internal/infra-analytics-runtime.cjs +8 -6
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +8 -6
- package/dist/internal/islands-boot.cjs +54 -20
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +49 -15
- 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-runtime.cjs +11 -6
- package/dist/internal/production-runtime.d.mts +13 -11
- package/dist/internal/production-runtime.d.ts +13 -11
- package/dist/internal/production-runtime.mjs +10 -5
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-DwXjaOHY.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-DOaeUoWq.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{navigation-delegate.d-o3pPd9VI.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BElGUMgt.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{nitro-YLTGVGK4.mjs → nitro-FK3SZM4H.mjs} +1 -1
- package/dist/{nitro-XGIO6EQN.cjs → nitro-YDFMH5PY.cjs} +4 -4
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +21 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +20 -18
- package/dist/{render-plan.d-BD06tqFA.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-xWCRAJeR.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
- package/dist/renderer-client.cjs +48 -5
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +48 -5
- package/dist/renderer.cjs +2 -2
- package/dist/renderer.d.mts +10 -0
- package/dist/renderer.d.ts +10 -0
- package/dist/renderer.mjs +1 -1
- package/dist/{request.d-Dx82V8bz.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-DUMuWxSN.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BwBVpLtD.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-DJh6GauM.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-CJBSG5jr.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-BtkKDxUB.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-H5AXQA7A.cjs → rsc-pipeline-5AOF64FL.cjs} +10 -9
- package/dist/{rsc-pipeline-GD6KLOIG.mjs → rsc-pipeline-DNRLYOJ7.mjs} +9 -8
- package/dist/{runtime-OJ7FXFUI.mjs → runtime-EHG2FRXZ.mjs} +9 -8
- package/dist/{runtime-YWQVBC3V.cjs → runtime-ZVHG5SRB.cjs} +13 -12
- package/dist/{runtime.d-BQnD0cfC.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-C4SuZXf6.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/{server-components-status.d-rfKOcE0N.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-9rH7ZoEq.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +54 -48
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +30 -24
- package/dist/{spa-router.d-DMKiBsHH.d.ts → spa-router.d-Bjgl-Osi.d.ts} +2 -2
- package/dist/{spa-router.d-V6XLSTCy.d.mts → spa-router.d-l3G38xHa.d.mts} +2 -2
- package/dist/{ssg.d-MNedvvMB.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-BnCKPQL0.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/{store-core.d-BqJI1-ix.d.mts → store-core.d-BZjuC6Zc.d.mts} +11 -3
- package/dist/{store-core.d-Ad5biajo.d.ts → store-core.d-BaOUOPf7.d.ts} +11 -3
- package/dist/testing.cjs +5 -4
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -3
- package/dist/{utils.d-BdjHKDuT.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-BEKLWa0Z.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +20 -18
- package/package.json +2 -2
- package/dist/analyzer-435DCIQ6.cjs +0 -17
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkRMPUEH5Tcjs = require('./chunk-RMPUEH5T.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
@@ -29,7 +29,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
29
29
|
var _chunk7Q7UB4TLcjs = require('./chunk-7Q7UB4TL.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkJK26IMT7cjs = require('./chunk-JK26IMT7.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -288,7 +288,7 @@ function createFarmAppManifest(input, registered = []) {
|
|
|
288
288
|
return {
|
|
289
289
|
schemaVersion: 1,
|
|
290
290
|
app: app ? {
|
|
291
|
-
...app.version ? { farm:
|
|
291
|
+
...app.version ? { farm: _chunkJK26IMT7cjs.FARM_VERSION } : {},
|
|
292
292
|
...app.renderer ? { renderer: input.renderer } : {},
|
|
293
293
|
basePath: input.basePath,
|
|
294
294
|
...app.build ? { build: input.build } : {}
|
|
@@ -319,7 +319,7 @@ function resolveFarmSiteUrl() {
|
|
|
319
319
|
asUrl(read("RAILWAY_PUBLIC_DOMAIN"))
|
|
320
320
|
];
|
|
321
321
|
for (const candidate of candidates) {
|
|
322
|
-
const origin = candidate ?
|
|
322
|
+
const origin = candidate ? _chunkRMPUEH5Tcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
|
|
323
323
|
if (origin) return origin;
|
|
324
324
|
}
|
|
325
325
|
return null;
|
|
@@ -15,9 +15,11 @@ var _chunkUUQNJDGHcjs = require('./chunk-UUQNJDGH.cjs');
|
|
|
15
15
|
var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
var _chunk3DE6RK7Kcjs = require('./chunk-3DE6RK7K.cjs');
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
var _chunkHUGPJFOCcjs = require('./chunk-HUGPJFOC.cjs');
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
|
|
@@ -1181,7 +1183,7 @@ async function validateIntegrationRouteInput(route, request, url) {
|
|
|
1181
1183
|
}
|
|
1182
1184
|
const bodyFormat = getIntegrationRouteBodyFormat(route);
|
|
1183
1185
|
if (schemas.body && bodyFormat === "json" && request.method !== "GET" && request.method !== "HEAD") {
|
|
1184
|
-
const rejection =
|
|
1186
|
+
const rejection = _chunkHUGPJFOCcjs.rejectCrossSiteNonJSONBody.call(void 0, request, CROSS_SITE_JSON_ROUTE_BODY_MESSAGE);
|
|
1185
1187
|
if (rejection) return { success: false, response: rejection };
|
|
1186
1188
|
}
|
|
1187
1189
|
const input = {};
|
|
@@ -1291,7 +1293,7 @@ function createIntegrationValidationResponse(issues) {
|
|
|
1291
1293
|
}
|
|
1292
1294
|
function normalizeIntegrationValidationIssues(source, error) {
|
|
1293
1295
|
if (Array.isArray(error.issues) && error.issues.length > 0) {
|
|
1294
|
-
return
|
|
1296
|
+
return _chunk3DE6RK7Kcjs.toPublicValidationIssues.call(void 0, error).map((issue) => ({ source, ...issue }));
|
|
1295
1297
|
}
|
|
1296
1298
|
return [
|
|
1297
1299
|
{
|
|
@@ -1336,7 +1338,7 @@ async function readIntegrationValidationBody(request, format) {
|
|
|
1336
1338
|
data: void 0
|
|
1337
1339
|
};
|
|
1338
1340
|
}
|
|
1339
|
-
if (!_optionalChain([request, 'access', _19 => _19.headers, 'access', _20 => _20.get, 'call', _21 => _21("content-type"), 'optionalAccess', _22 => _22.trim, 'call', _23 => _23()]) && !
|
|
1341
|
+
if (!_optionalChain([request, 'access', _19 => _19.headers, 'access', _20 => _20.get, 'call', _21 => _21("content-type"), 'optionalAccess', _22 => _22.trim, 'call', _23 => _23()]) && !_chunkHUGPJFOCcjs.validateIntegrationRequestOrigin.call(void 0, request, { requireOriginMetadata: false }).ok) {
|
|
1340
1342
|
return {
|
|
1341
1343
|
success: true,
|
|
1342
1344
|
data: void 0
|
|
@@ -8,7 +8,8 @@ var DEFAULT_RENDERER_CAPABILITIES = Object.freeze({
|
|
|
8
8
|
// Conservative default: assume a re-render rebuilds until a renderer states
|
|
9
9
|
// otherwise, so callers do not silently rely on reconciliation.
|
|
10
10
|
reconcilesRerenders: false,
|
|
11
|
-
functionComponents: false
|
|
11
|
+
functionComponents: false,
|
|
12
|
+
hydrationFallback: false
|
|
12
13
|
});
|
|
13
14
|
function getFarmRendererCapabilities(renderer) {
|
|
14
15
|
const defaultStreaming = {
|
|
@@ -36,13 +37,14 @@ function getFarmRendererCapabilities(renderer) {
|
|
|
36
37
|
...Object.keys(runtimes).length > 0 ? { runtimes } : {}
|
|
37
38
|
},
|
|
38
39
|
reconcilesRerenders: _nullishCoalesce(_optionalChain([renderer, 'optionalAccess', _11 => _11.capabilities, 'optionalAccess', _12 => _12.reconcilesRerenders]), () => ( DEFAULT_RENDERER_CAPABILITIES.reconcilesRerenders)),
|
|
39
|
-
functionComponents: _nullishCoalesce(_optionalChain([renderer, 'optionalAccess', _13 => _13.capabilities, 'optionalAccess', _14 => _14.functionComponents]), () => ( DEFAULT_RENDERER_CAPABILITIES.functionComponents))
|
|
40
|
+
functionComponents: _nullishCoalesce(_optionalChain([renderer, 'optionalAccess', _13 => _13.capabilities, 'optionalAccess', _14 => _14.functionComponents]), () => ( DEFAULT_RENDERER_CAPABILITIES.functionComponents)),
|
|
41
|
+
hydrationFallback: _nullishCoalesce(_optionalChain([renderer, 'optionalAccess', _15 => _15.capabilities, 'optionalAccess', _16 => _16.hydrationFallback]), () => ( DEFAULT_RENDERER_CAPABILITIES.hydrationFallback))
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
function getFarmRendererStreamingCapabilitiesForRuntime(renderer, runtime) {
|
|
43
45
|
const streaming = getFarmRendererCapabilities(renderer).streaming;
|
|
44
46
|
if (runtime === "unknown") return { node: streaming.node, web: streaming.web };
|
|
45
|
-
return _nullishCoalesce(_optionalChain([streaming, 'access',
|
|
47
|
+
return _nullishCoalesce(_optionalChain([streaming, 'access', _17 => _17.runtimes, 'optionalAccess', _18 => _18[runtime]]), () => ( { node: streaming.node, web: streaming.web }));
|
|
46
48
|
}
|
|
47
49
|
var FARM_RENDERER_SERVER_EXPORTS = [
|
|
48
50
|
"name",
|
|
@@ -71,7 +73,7 @@ function assertFarmRendererServerModule(runtime, renderer) {
|
|
|
71
73
|
}
|
|
72
74
|
function assertFarmRendererStreamingRuntime(name, renderer, runtimeModule, runtime) {
|
|
73
75
|
const declared = getFarmRendererStreamingCapabilitiesForRuntime(renderer, runtime);
|
|
74
|
-
const runtimeDeclaration = _optionalChain([runtimeModule, 'access',
|
|
76
|
+
const runtimeDeclaration = _optionalChain([runtimeModule, 'access', _19 => _19.capabilities, 'optionalAccess', _20 => _20.streaming]);
|
|
75
77
|
if (runtimeDeclaration) {
|
|
76
78
|
const advertised = getFarmRendererStreamingCapabilitiesForRuntime(
|
|
77
79
|
{ capabilities: { streaming: runtimeDeclaration } },
|
|
@@ -107,7 +109,7 @@ function resolveFarmComponentExtensions(extensions = []) {
|
|
|
107
109
|
).filter((extension) => extension.length > 1);
|
|
108
110
|
}
|
|
109
111
|
function getFarmRendererComponentExtensions(renderer) {
|
|
110
|
-
return resolveFarmComponentExtensions(_optionalChain([renderer, 'optionalAccess',
|
|
112
|
+
return resolveFarmComponentExtensions(_optionalChain([renderer, 'optionalAccess', _21 => _21.componentExtensions]));
|
|
111
113
|
}
|
|
112
114
|
var REACT_RENDERER = Object.freeze({
|
|
113
115
|
name: "react",
|
|
@@ -145,7 +147,7 @@ var NO_RENDERER = Object.freeze({
|
|
|
145
147
|
}
|
|
146
148
|
});
|
|
147
149
|
function isFarmRendererDisabled(renderer) {
|
|
148
|
-
return renderer === false || _optionalChain([renderer, 'optionalAccess',
|
|
150
|
+
return renderer === false || _optionalChain([renderer, 'optionalAccess', _22 => _22.name]) === NO_RENDERER.name;
|
|
149
151
|
}
|
|
150
152
|
function defineRenderer(renderer) {
|
|
151
153
|
return renderer;
|
|
@@ -202,8 +204,8 @@ function createFarmReactJsxPlugin() {
|
|
|
202
204
|
return {
|
|
203
205
|
name: "farm:react-jsx",
|
|
204
206
|
config(config) {
|
|
205
|
-
if (this && _optionalChain([this, 'access',
|
|
206
|
-
if (config.esbuild === false || _optionalChain([config, 'access',
|
|
207
|
+
if (this && _optionalChain([this, 'access', _23 => _23.meta, 'optionalAccess', _24 => _24.rolldownVersion])) return;
|
|
208
|
+
if (config.esbuild === false || _optionalChain([config, 'access', _25 => _25.esbuild, 'optionalAccess', _26 => _26.jsx]) !== void 0) return;
|
|
207
209
|
return { esbuild: { jsx: "automatic" } };
|
|
208
210
|
}
|
|
209
211
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_ERROR_STYLES
|
|
3
3
|
} from "./chunk-XAXTTBUT.mjs";
|
|
4
|
+
import {
|
|
5
|
+
FARM_ISLAND_REPLAYABLE_SELECTOR
|
|
6
|
+
} from "./chunk-S32PDOLO.mjs";
|
|
4
7
|
import {
|
|
5
8
|
stampFarmCspNonce
|
|
6
9
|
} from "./chunk-22W4FNTG.mjs";
|
|
@@ -973,6 +976,12 @@ function serializeInlineValue(value) {
|
|
|
973
976
|
return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
974
977
|
}
|
|
975
978
|
|
|
979
|
+
// src/server/prehydration-hold-script.ts
|
|
980
|
+
function createPreHydrationClickQueueScript() {
|
|
981
|
+
const selector = JSON.stringify(FARM_ISLAND_REPLAYABLE_SELECTOR);
|
|
982
|
+
return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function submits(target,kind){return kind==="submit"||!!(target.form&&target.type==="submit")}function hold(event,target,kind){if(!(submits(target,kind)&&queue.some(function(item){return item.target===target}))){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
|
|
983
|
+
}
|
|
984
|
+
|
|
976
985
|
export {
|
|
977
986
|
formatRouteSegment,
|
|
978
987
|
createRouteDirectoryPattern,
|
|
@@ -1018,5 +1027,6 @@ export {
|
|
|
1018
1027
|
getDefaultErrorStatusText,
|
|
1019
1028
|
createDefaultErrorMarkup,
|
|
1020
1029
|
createFarmThemeDocumentParts,
|
|
1021
|
-
applyFarmThemeDocument
|
|
1030
|
+
applyFarmThemeDocument,
|
|
1031
|
+
createPreHydrationClickQueueScript
|
|
1022
1032
|
};
|
|
@@ -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 _chunkB2PGVHBGcjs = require('./chunk-B2PGVHBG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,6 +9,9 @@ var _chunkFYZD7DUScjs = require('./chunk-FYZD7DUS.cjs');
|
|
|
9
9
|
var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkHUGPJFOCcjs = require('./chunk-HUGPJFOC.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
14
17
|
|
|
@@ -97,7 +100,10 @@ function routeTemplate(pattern) {
|
|
|
97
100
|
var PATH = /^\/(?!\/)[\w!$%&'()*+,\-./:;=@[\]^|~]*$/;
|
|
98
101
|
var MAX_PATH_LENGTH = 1024;
|
|
99
102
|
function requestPath(request) {
|
|
100
|
-
|
|
103
|
+
return appPath(new URL(request.url).pathname);
|
|
104
|
+
}
|
|
105
|
+
function appPath(pathname) {
|
|
106
|
+
const path = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname);
|
|
101
107
|
return path.length <= MAX_PATH_LENGTH && PATH.test(path) ? path : void 0;
|
|
102
108
|
}
|
|
103
109
|
function duration(value) {
|
|
@@ -283,7 +289,8 @@ function createFarmInfraAnalyticsExporter(options, send = (input, init) => fetch
|
|
|
283
289
|
if (queue.length) diagnostic({ code: "dropped", count: queue.length });
|
|
284
290
|
queue.length = 0;
|
|
285
291
|
}
|
|
286
|
-
|
|
292
|
+
const accepting = () => !stopped && !closing;
|
|
293
|
+
return { enqueue, flush, close, accepting };
|
|
287
294
|
}
|
|
288
295
|
var CONTEXT_KEY = "farm.infra.analytics";
|
|
289
296
|
function beginRequest(request, route, waitUntil) {
|
|
@@ -347,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
347
354
|
id: uuid(),
|
|
348
355
|
requestId: metadata.id,
|
|
349
356
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
350
|
-
route: routeTemplate(
|
|
357
|
+
route: routeTemplate(_chunkB2PGVHBGcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
351
358
|
...metadata.path ? { path: metadata.path } : {},
|
|
352
359
|
agent: metadata.agent,
|
|
353
360
|
kind: "request",
|
|
@@ -383,12 +390,15 @@ function toolPayload(value) {
|
|
|
383
390
|
}
|
|
384
391
|
return { value: redacted };
|
|
385
392
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
if (!payload) return {};
|
|
393
|
+
var PAYLOAD_KEYS = ["arguments", "result"];
|
|
394
|
+
function toolPayloadFields(payload, omitted = []) {
|
|
389
395
|
const fields = {};
|
|
390
|
-
for (const key of
|
|
391
|
-
if (
|
|
396
|
+
for (const key of PAYLOAD_KEYS) {
|
|
397
|
+
if (omitted.includes(key)) {
|
|
398
|
+
(_nullishCoalesce(fields.omitted, () => ( (fields.omitted = [])))).push(key);
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
if (!payload || !(key in payload)) continue;
|
|
392
402
|
const kept = toolPayload(payload[key]);
|
|
393
403
|
if (kept === "omitted") (_nullishCoalesce(fields.omitted, () => ( (fields.omitted = [])))).push(key);
|
|
394
404
|
else if (kept) fields[key] = kept.value;
|
|
@@ -400,25 +410,126 @@ function toolEvent(metadata, event, payloads) {
|
|
|
400
410
|
id: uuid(),
|
|
401
411
|
requestId: metadata.id,
|
|
402
412
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
403
|
-
route: routeTemplate(
|
|
413
|
+
route: routeTemplate(_chunkB2PGVHBGcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
404
414
|
...metadata.path ? { path: metadata.path } : {},
|
|
405
415
|
agent: metadata.agent,
|
|
406
416
|
kind: "mcp.tool",
|
|
407
417
|
tool: event.tool,
|
|
408
418
|
outcome: event.outcome,
|
|
409
419
|
durationMs: duration(event.durationMs),
|
|
410
|
-
...payloads ? toolPayloadFields(event) : {}
|
|
420
|
+
...payloads ? toolPayloadFields(_chunkPLJMEUANcjs._farmToolCallPayload.call(void 0, event)) : {}
|
|
411
421
|
};
|
|
412
422
|
}
|
|
413
|
-
|
|
423
|
+
var FARM_WEBMCP_REPORT_PATH = "/_farm/webmcp/tool-calls";
|
|
424
|
+
var MAX_REPORT_BYTES = 32 * 1024;
|
|
425
|
+
var WEBMCP_TOOL = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
426
|
+
var PAGE_PATH = /^\/(?!\/)[\x21\x22\x24-\x3e\x40-\x5b\x5d-\x7e]*$/;
|
|
427
|
+
var MAX_PAGE_PATH = 2048;
|
|
428
|
+
var REPORT_FIELDS = /* @__PURE__ */ new Set([
|
|
429
|
+
"tool",
|
|
430
|
+
"outcome",
|
|
431
|
+
"durationMs",
|
|
432
|
+
"path",
|
|
433
|
+
...PAYLOAD_KEYS,
|
|
434
|
+
"omitted"
|
|
435
|
+
]);
|
|
436
|
+
function webMCPReport(value) {
|
|
437
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
438
|
+
const report = value;
|
|
439
|
+
if (Object.keys(report).some((key) => !REPORT_FIELDS.has(key))) return void 0;
|
|
440
|
+
const { tool, outcome, durationMs, path, omitted } = report;
|
|
441
|
+
const valid = typeof tool === "string" && WEBMCP_TOOL.test(tool) && (outcome === "success" || outcome === "error") && typeof durationMs === "number" && Number.isFinite(durationMs) && durationMs >= 0 && typeof path === "string" && path.length <= MAX_PAGE_PATH && PAGE_PATH.test(path) && (omitted === void 0 || Array.isArray(omitted) && omitted.every(
|
|
442
|
+
(key, index) => PAYLOAD_KEYS.includes(key) && omitted.indexOf(key) === index && !(key in report)
|
|
443
|
+
));
|
|
444
|
+
return valid ? report : void 0;
|
|
445
|
+
}
|
|
446
|
+
async function readReport(request) {
|
|
447
|
+
const declared = request.headers.get("content-length");
|
|
448
|
+
if (declared !== null && Number(declared) > MAX_REPORT_BYTES) return null;
|
|
449
|
+
if (!request.body) return "";
|
|
450
|
+
const reader = request.body.getReader();
|
|
451
|
+
const chunks = [];
|
|
452
|
+
let size = 0;
|
|
453
|
+
try {
|
|
454
|
+
for (; ; ) {
|
|
455
|
+
const { done, value } = await reader.read();
|
|
456
|
+
if (done) break;
|
|
457
|
+
size += value.byteLength;
|
|
458
|
+
if (size > MAX_REPORT_BYTES) return null;
|
|
459
|
+
chunks.push(value);
|
|
460
|
+
}
|
|
461
|
+
} finally {
|
|
462
|
+
void reader.cancel().catch(() => {
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
const body = new Uint8Array(size);
|
|
466
|
+
let offset = 0;
|
|
467
|
+
for (const chunk of chunks) {
|
|
468
|
+
body.set(chunk, offset);
|
|
469
|
+
offset += chunk.byteLength;
|
|
470
|
+
}
|
|
471
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(body);
|
|
472
|
+
}
|
|
473
|
+
var refuse = (status, error, headers = {}) => Response.json({ error }, { status, headers: { "cache-control": "no-store", ...headers } });
|
|
474
|
+
async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil) {
|
|
475
|
+
if (!exporter.accepting()) return refuse(404, "analytics_off");
|
|
476
|
+
if (request.method !== "POST") return refuse(405, "method", { allow: "POST" });
|
|
477
|
+
if (!_chunkHUGPJFOCcjs.validateIntegrationRequestOrigin.call(void 0, request).ok) return refuse(403, "origin");
|
|
478
|
+
const type = _optionalChain([request, 'access', _33 => _33.headers, 'access', _34 => _34.get, 'call', _35 => _35("content-type"), 'optionalAccess', _36 => _36.split, 'call', _37 => _37(";", 1), 'access', _38 => _38[0], 'optionalAccess', _39 => _39.trim, 'call', _40 => _40(), 'access', _41 => _41.toLowerCase, 'call', _42 => _42()]);
|
|
479
|
+
if (type !== "application/json") return refuse(415, "content_type");
|
|
480
|
+
let report;
|
|
481
|
+
try {
|
|
482
|
+
const text = await readReport(request);
|
|
483
|
+
if (text === null) return refuse(413, "too_large");
|
|
484
|
+
report = webMCPReport(JSON.parse(text));
|
|
485
|
+
} catch (e7) {
|
|
486
|
+
report = void 0;
|
|
487
|
+
}
|
|
488
|
+
if (!report) return refuse(400, "invalid_report");
|
|
489
|
+
let route;
|
|
490
|
+
try {
|
|
491
|
+
route = await _optionalChain([webmcp, 'access', _43 => _43.route, 'optionalCall', _44 => _44(report.path)]);
|
|
492
|
+
} catch (e8) {
|
|
493
|
+
route = void 0;
|
|
494
|
+
}
|
|
495
|
+
const path = appPath(report.path);
|
|
496
|
+
exporter.enqueue({
|
|
497
|
+
id: uuid(),
|
|
498
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
499
|
+
route: routeTemplate(_chunkB2PGVHBGcjs.getFarmRouteLabel.call(void 0, route)),
|
|
500
|
+
...path ? { path } : {},
|
|
501
|
+
agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
|
|
502
|
+
kind: "mcp.tool",
|
|
503
|
+
source: "webmcp",
|
|
504
|
+
tool: report.tool,
|
|
505
|
+
outcome: report.outcome,
|
|
506
|
+
durationMs: duration(report.durationMs),
|
|
507
|
+
...options.toolPayloads !== false ? toolPayloadFields(report, report.omitted) : {}
|
|
508
|
+
});
|
|
509
|
+
waitUntil(exporter.flush());
|
|
510
|
+
return new Response(null, { status: 204, headers: { "cache-control": "no-store" } });
|
|
511
|
+
}
|
|
512
|
+
var webMCPOptions = /* @__PURE__ */ new WeakMap();
|
|
513
|
+
function _setFarmInfraAnalyticsWebMCPRoute(plugin, route) {
|
|
514
|
+
const options = webMCPOptions.get(plugin);
|
|
515
|
+
if (options) options.route = route;
|
|
516
|
+
}
|
|
517
|
+
function _farmWebMCPReportsEnabled(plugins) {
|
|
518
|
+
return (_nullishCoalesce(plugins, () => ( []))).some((plugin) => {
|
|
519
|
+
const candidate = plugin;
|
|
520
|
+
return _optionalChain([candidate, 'optionalAccess', _45 => _45.name]) === "farm:webmcp" && _optionalChain([candidate, 'access', _46 => _46.client, 'optionalAccess', _47 => _47.public, 'optionalAccess', _48 => _48.analytics]) !== false;
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
function farmInfraAnalyticsPlugin(options, send, runtimeOptions = {}) {
|
|
414
524
|
const contextKey = `${CONTEXT_KEY}.${uuid()}`;
|
|
415
|
-
|
|
525
|
+
const webmcp = runtimeOptions.webmcp ? { ...runtimeOptions.webmcp } : void 0;
|
|
526
|
+
const plugin = {
|
|
416
527
|
name: "farm:infra-analytics",
|
|
417
528
|
enforce: "post",
|
|
418
529
|
setup(context) {
|
|
419
530
|
const state = { exporter: createFarmInfraAnalyticsExporter(options, send) };
|
|
420
531
|
context.lifecycle.onShutdown(async () => {
|
|
421
|
-
_optionalChain([state, 'access',
|
|
532
|
+
_optionalChain([state, 'access', _49 => _49.unsubscribe, 'optionalCall', _50 => _50()]);
|
|
422
533
|
await state.exporter.close();
|
|
423
534
|
});
|
|
424
535
|
return state;
|
|
@@ -426,6 +537,20 @@ function farmInfraAnalyticsPlugin(options, send) {
|
|
|
426
537
|
runtime: {
|
|
427
538
|
// Recording a request decides nothing about who may read the response.
|
|
428
539
|
cache: "public",
|
|
540
|
+
...webmcp ? {
|
|
541
|
+
endpoints: [
|
|
542
|
+
{
|
|
543
|
+
path: FARM_WEBMCP_REPORT_PATH,
|
|
544
|
+
handler: (event) => receiveWebMCPReport(
|
|
545
|
+
event.request,
|
|
546
|
+
event.state.exporter,
|
|
547
|
+
options,
|
|
548
|
+
webmcp,
|
|
549
|
+
event.waitUntil
|
|
550
|
+
)
|
|
551
|
+
}
|
|
552
|
+
]
|
|
553
|
+
} : {},
|
|
429
554
|
start(context) {
|
|
430
555
|
const { exporter } = context.state;
|
|
431
556
|
context.state.unsubscribe = _chunkPLJMEUANcjs.onFarmEvent.call(void 0,
|
|
@@ -446,6 +571,8 @@ function farmInfraAnalyticsPlugin(options, send) {
|
|
|
446
571
|
event.req.set(contextKey, beginRequest(event.request, event.route, event.waitUntil));
|
|
447
572
|
},
|
|
448
573
|
after(event) {
|
|
574
|
+
if (event.kind === "endpoint" && webmcp && _optionalChain([event, 'access', _51 => _51.route, 'optionalAccess', _52 => _52.pattern]) === FARM_WEBMCP_REPORT_PATH)
|
|
575
|
+
return;
|
|
449
576
|
const metadata = _nullishCoalesce(event.req.get(contextKey), () => ( (event.kind === "endpoint" ? beginRequest(event.request, event.route, event.waitUntil) : void 0)));
|
|
450
577
|
if (!metadata || metadata.completed || !event.state) return;
|
|
451
578
|
metadata.completed = true;
|
|
@@ -471,9 +598,12 @@ function farmInfraAnalyticsPlugin(options, send) {
|
|
|
471
598
|
}
|
|
472
599
|
}
|
|
473
600
|
};
|
|
601
|
+
if (webmcp) webMCPOptions.set(plugin, webmcp);
|
|
602
|
+
return plugin;
|
|
474
603
|
}
|
|
475
|
-
function farmInfraAnalyticsRecorder(options, send) {
|
|
604
|
+
function farmInfraAnalyticsRecorder(options, send, runtimeOptions = {}) {
|
|
476
605
|
const exporter = createFarmInfraAnalyticsExporter(options, send);
|
|
606
|
+
const webmcp = runtimeOptions.webmcp;
|
|
477
607
|
const requests = new (0, _async_hooks.AsyncLocalStorage)();
|
|
478
608
|
const unsubscribe = _chunkPLJMEUANcjs.onFarmEvent.call(void 0,
|
|
479
609
|
(event) => {
|
|
@@ -490,6 +620,9 @@ function farmInfraAnalyticsRecorder(options, send) {
|
|
|
490
620
|
if (runtime.kind === "asset") return handler();
|
|
491
621
|
const background = (promise) => waitUntil ? waitUntil(promise) : void promise.catch(() => {
|
|
492
622
|
});
|
|
623
|
+
if (webmcp && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, new URL(request.url).pathname).replace(/(.)\/+$/, "$1") === FARM_WEBMCP_REPORT_PATH) {
|
|
624
|
+
return receiveWebMCPReport(request, exporter, options, webmcp, background);
|
|
625
|
+
}
|
|
493
626
|
const metadata = beginRequest(request, runtime.route, background);
|
|
494
627
|
const startedAt = performance.now();
|
|
495
628
|
let response;
|
|
@@ -541,17 +674,19 @@ function stopReason(event) {
|
|
|
541
674
|
}
|
|
542
675
|
return `Farm Infra answered ${event.status}. Check FARMJS_API_KEY and FARMJS_PROJECT_ID, then restart the server.`;
|
|
543
676
|
}
|
|
544
|
-
function createFarmInfraAnalyticsPlugin(env = processEnv(), warn = console.warn) {
|
|
677
|
+
function createFarmInfraAnalyticsPlugin(env = processEnv(), warn = console.warn, runtimeOptions) {
|
|
545
678
|
const options = linkedOptions(env, warn);
|
|
546
|
-
return options ? farmInfraAnalyticsPlugin(options) : null;
|
|
679
|
+
return options ? farmInfraAnalyticsPlugin(options, void 0, runtimeOptions) : null;
|
|
547
680
|
}
|
|
548
|
-
function createFarmInfraAnalyticsRecorder(env = processEnv(), warn = console.warn) {
|
|
681
|
+
function createFarmInfraAnalyticsRecorder(env = processEnv(), warn = console.warn, runtimeOptions) {
|
|
549
682
|
const options = linkedOptions(env, warn);
|
|
550
|
-
return options ? farmInfraAnalyticsRecorder(options) : null;
|
|
683
|
+
return options ? farmInfraAnalyticsRecorder(options, void 0, runtimeOptions) : null;
|
|
551
684
|
}
|
|
552
685
|
|
|
553
686
|
|
|
554
687
|
|
|
555
688
|
|
|
556
689
|
|
|
557
|
-
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
exports.FARM_PRERENDER_ENV = FARM_PRERENDER_ENV; exports._setFarmInfraAnalyticsWebMCPRoute = _setFarmInfraAnalyticsWebMCPRoute; exports._farmWebMCPReportsEnabled = _farmWebMCPReportsEnabled; exports.createFarmInfraAnalyticsPlugin = createFarmInfraAnalyticsPlugin; exports.createFarmInfraAnalyticsRecorder = createFarmInfraAnalyticsRecorder;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveFarmAgentSitemap,
|
|
20
20
|
resolveFarmNoindexPreviews,
|
|
21
21
|
resolveFarmPerformanceConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NQ3Y6E2T.mjs";
|
|
23
23
|
import {
|
|
24
24
|
farmCspBlocksFrameworkInlineScripts,
|
|
25
25
|
getFarmSecurityHeader,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
isFarmRendererDisabled,
|
|
44
44
|
isReactRenderer,
|
|
45
45
|
resolveFarmRenderer
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RMLR5RMH.mjs";
|
|
47
47
|
import {
|
|
48
48
|
resolveFarmImageConfig
|
|
49
49
|
} from "./chunk-AOIUYHPH.mjs";
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
FARM_CRON_NAME_SEGMENT_PATTERN,
|
|
52
52
|
normalizeCronExpression,
|
|
53
53
|
resolveCronConfig
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-7VJXYB6S.mjs";
|
|
55
55
|
import {
|
|
56
56
|
resolveServerActionsConfig
|
|
57
57
|
} from "./chunk-NLATR3T3.mjs";
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
} from "./chunk-YWPNIYUP.mjs";
|
|
77
77
|
import {
|
|
78
78
|
resolveIntegrationPlugins
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-XRSNW4IU.mjs";
|
|
80
80
|
import {
|
|
81
81
|
compileMiddlewareConfig
|
|
82
82
|
} from "./chunk-EDPENAVO.mjs";
|