@farm.js/core 0.1.43 → 0.1.44

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.
Files changed (139) hide show
  1. package/dist/{agent-mcp-3KDz4hr9.d.mts → agent-mcp-CWI-awqd.d.mts} +1 -1
  2. package/dist/{agent-mcp-6yRebHk7.d.ts → agent-mcp-EnzWYv_X.d.ts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -2
  4. package/dist/agent-runtime.d.mts +1 -1
  5. package/dist/agent-runtime.d.ts +1 -1
  6. package/dist/agent-runtime.mjs +2 -1
  7. package/dist/api/route-manager.d.mts +3 -3
  8. package/dist/api/route-manager.d.ts +3 -3
  9. package/dist/api/runtime.d.mts +2 -2
  10. package/dist/api/runtime.d.ts +2 -2
  11. package/dist/api.d.mts +3 -3
  12. package/dist/api.d.ts +3 -3
  13. package/dist/{app-8Db1zR-2.d.ts → app-CAN_2Cqo.d.ts} +4 -4
  14. package/dist/{app-DlTWv4cn.d.mts → app-DG3dE8v5.d.mts} +4 -4
  15. package/dist/{app-manifest-TRzS7ZZ9.d.mts → app-manifest-8x5VjZ0L.d.mts} +1 -1
  16. package/dist/{app-manifest-cO2jkG1F.d.ts → app-manifest-DazjgQya.d.ts} +1 -1
  17. package/dist/app-markdown.d.mts +2 -2
  18. package/dist/app-markdown.d.ts +2 -2
  19. package/dist/{chunk-OYSGGV6O.mjs → chunk-2MKTHHEU.mjs} +5 -5
  20. package/dist/{chunk-AX7S67YV.mjs → chunk-37VKVISD.mjs} +9 -173
  21. package/dist/chunk-3SAWHWDH.cjs +186 -0
  22. package/dist/{chunk-YBDSTNMH.cjs → chunk-3YJMBQ27.cjs} +1 -1
  23. package/dist/{chunk-JDJAPCR2.cjs → chunk-5GBL2LKD.cjs} +92 -90
  24. package/dist/{chunk-VIVQERJ5.cjs → chunk-AI3WVJNP.cjs} +57 -57
  25. package/dist/{chunk-RHGK2JEN.cjs → chunk-B6XAA7V6.cjs} +18 -182
  26. package/dist/{chunk-RQYTOFQM.cjs → chunk-CW6SNEN2.cjs} +2 -2
  27. package/dist/{chunk-T7J7E63D.cjs → chunk-E22SWCXB.cjs} +2 -2
  28. package/dist/{chunk-4OCEMK72.mjs → chunk-ERA5RP3L.mjs} +10 -8
  29. package/dist/{chunk-RACQTC7K.cjs → chunk-GA6JM4L6.cjs} +52 -52
  30. package/dist/chunk-GZWHCWLB.mjs +186 -0
  31. package/dist/{chunk-XARSG2TG.mjs → chunk-IOMVXBLZ.mjs} +1 -1
  32. package/dist/{chunk-VLXNGUKO.mjs → chunk-JVXW76I7.mjs} +1 -1
  33. package/dist/{chunk-LVABUXLA.cjs → chunk-LPE3ED4R.cjs} +2 -2
  34. package/dist/{chunk-NXO75WY4.mjs → chunk-OYZGFRPA.mjs} +1 -1
  35. package/dist/{chunk-7SCCY6SI.mjs → chunk-QGFKXYC7.mjs} +3 -3
  36. package/dist/{chunk-YGZH4T2X.mjs → chunk-R4J2UOV4.mjs} +1 -1
  37. package/dist/{chunk-BKPXWRTT.cjs → chunk-T44ECMEP.cjs} +6 -6
  38. package/dist/{chunk-4MRQ5OKQ.mjs → chunk-WWYXIECF.mjs} +1 -1
  39. package/dist/{chunk-GVNCWSQV.cjs → chunk-XPSGGECF.cjs} +4 -4
  40. package/dist/{chunk-ZYWJIPKQ.mjs → chunk-XUHIRBXY.mjs} +1 -1
  41. package/dist/{chunk-TESO7EFU.mjs → chunk-YFLBG2W3.mjs} +2 -2
  42. package/dist/{chunk-HUMEHX24.cjs → chunk-YN2QEMMO.cjs} +2 -2
  43. package/dist/{client-plugins-kwQuZcWq.d.ts → client-plugins-BGS0wqzc.d.ts} +16 -15
  44. package/dist/{client-plugins-Cv0OJtnM.d.mts → client-plugins-nQ0tYt4l.d.mts} +16 -15
  45. package/dist/client-plugins.d.mts +1 -1
  46. package/dist/client-plugins.d.ts +1 -1
  47. package/dist/client.d.mts +5 -5
  48. package/dist/client.d.ts +5 -5
  49. package/dist/config.d.mts +1 -1
  50. package/dist/config.d.ts +1 -1
  51. package/dist/{devtools-MLB3JJMC.cjs → devtools-5Q7VRKVH.cjs} +4 -3
  52. package/dist/{devtools-M22FEFPK.mjs → devtools-LJ4IGYGW.mjs} +3 -2
  53. package/dist/docs.cjs +5 -4
  54. package/dist/docs.d.mts +2 -2
  55. package/dist/docs.d.ts +2 -2
  56. package/dist/docs.mjs +4 -3
  57. package/dist/{index-DAl0QTZS.d.ts → index-Cy26isrh.d.ts} +1 -1
  58. package/dist/{index-CQOp8EmB.d.mts → index-y1jgR74U.d.mts} +1 -1
  59. package/dist/index.cjs +13 -11
  60. package/dist/index.d.mts +15 -15
  61. package/dist/index.d.ts +15 -15
  62. package/dist/index.mjs +14 -12
  63. package/dist/integrations.cjs +5 -3
  64. package/dist/integrations.d.mts +1 -1
  65. package/dist/integrations.d.ts +1 -1
  66. package/dist/integrations.mjs +6 -4
  67. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  68. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  69. package/dist/internal/build-runtime.cjs +11 -10
  70. package/dist/internal/build-runtime.d.mts +3 -3
  71. package/dist/internal/build-runtime.d.ts +3 -3
  72. package/dist/internal/build-runtime.mjs +10 -9
  73. package/dist/internal/cli-runtime.cjs +5 -4
  74. package/dist/internal/cli-runtime.mjs +4 -3
  75. package/dist/internal/client-error-overlay.cjs +4 -4
  76. package/dist/internal/client-error-overlay.mjs +1 -1
  77. package/dist/internal/compression-runtime.d.mts +1 -1
  78. package/dist/internal/compression-runtime.d.ts +1 -1
  79. package/dist/internal/config-runtime.cjs +4 -3
  80. package/dist/internal/config-runtime.d.mts +2 -2
  81. package/dist/internal/config-runtime.d.ts +2 -2
  82. package/dist/internal/config-runtime.mjs +3 -2
  83. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  84. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  85. package/dist/internal/production-runtime.cjs +5 -11
  86. package/dist/internal/production-runtime.d.mts +10 -10
  87. package/dist/internal/production-runtime.d.ts +10 -10
  88. package/dist/internal/production-runtime.mjs +4 -10
  89. package/dist/markdown.d.mts +1 -1
  90. package/dist/markdown.d.ts +1 -1
  91. package/dist/middleware.d.mts +3 -3
  92. package/dist/middleware.d.ts +3 -3
  93. package/dist/navigation.d.mts +4 -4
  94. package/dist/navigation.d.ts +4 -4
  95. package/dist/plugin.cjs +7 -6
  96. package/dist/plugin.d.mts +3 -3
  97. package/dist/plugin.d.ts +3 -3
  98. package/dist/plugin.mjs +6 -5
  99. package/dist/{production-runtime-5nArjFpn.d.ts → production-runtime-BVMDgHrA.d.ts} +1 -1
  100. package/dist/{production-runtime-BzsF2z5F.d.mts → production-runtime-ClFA_1KQ.d.mts} +1 -1
  101. package/dist/{render-plan-B9yQorV4.d.mts → render-plan-CoSovy_O.d.mts} +1 -1
  102. package/dist/{render-plan-fg6E_HvL.d.ts → render-plan-y2DefWf8.d.ts} +1 -1
  103. package/dist/renderer-client.d.mts +3 -3
  104. package/dist/renderer-client.d.ts +3 -3
  105. package/dist/{request-gz8vFK0n.d.ts → request-aG5Wovm5.d.ts} +1 -1
  106. package/dist/{request-C4j_g-BH.d.mts → request-cNM09Q7e.d.mts} +1 -1
  107. package/dist/request.d.mts +2 -2
  108. package/dist/request.d.ts +2 -2
  109. package/dist/{route-rendering-DamyKVi3.d.ts → route-rendering-B3uQmCWX.d.ts} +1 -1
  110. package/dist/{route-rendering-iTTOwz1f.d.mts → route-rendering-EyInfsjI.d.mts} +1 -1
  111. package/dist/{router-OVjDqVo8.d.ts → router-DNUf-Bg1.d.ts} +1 -1
  112. package/dist/{router-EoSzHlos.d.mts → router-Devibh4r.d.mts} +1 -1
  113. package/dist/routes.d.mts +1 -1
  114. package/dist/routes.d.ts +1 -1
  115. package/dist/{rsc-pipeline-YCDRJME4.cjs → rsc-pipeline-4ZJ6GUVQ.cjs} +5 -4
  116. package/dist/{rsc-pipeline-LK4K5JFK.mjs → rsc-pipeline-KK6GFDET.mjs} +4 -3
  117. package/dist/{runtime-DDH4tiuF.d.mts → runtime-9KZb8AI5.d.mts} +1 -1
  118. package/dist/{runtime-CwiuozLd.d.ts → runtime-CLr9P5kn.d.ts} +1 -1
  119. package/dist/server-plugins.d.mts +2 -2
  120. package/dist/server-plugins.d.ts +2 -2
  121. package/dist/server.cjs +22 -21
  122. package/dist/server.d.mts +9 -9
  123. package/dist/server.d.ts +9 -9
  124. package/dist/server.mjs +8 -7
  125. package/dist/{spa-router-Br4qFCWf.d.mts → spa-router-BIxh4IY-.d.mts} +2 -2
  126. package/dist/{spa-router-BsWUKH73.d.ts → spa-router-Ds6R_oe-.d.ts} +2 -2
  127. package/dist/{ssg-Donyfcxy.d.mts → ssg-ByrOVYdM.d.mts} +2 -2
  128. package/dist/{ssg-Csy2vwpi.d.ts → ssg-XnMHCyEc.d.ts} +2 -2
  129. package/dist/testing.d.mts +1 -1
  130. package/dist/testing.d.ts +1 -1
  131. package/dist/{utils-Luk72LXC.d.ts → utils-BN70ueSN.d.ts} +1 -1
  132. package/dist/{utils-d_k1ZZw0.d.mts → utils-BrjR5xRs.d.mts} +1 -1
  133. package/dist/version.cjs +2 -2
  134. package/dist/version.mjs +1 -1
  135. package/dist/vite.cjs +7 -6
  136. package/dist/vite.d.mts +4 -4
  137. package/dist/vite.d.ts +4 -4
  138. package/dist/vite.mjs +6 -5
  139. package/package.json +1 -1
@@ -3,23 +3,23 @@
3
3
  var _chunk6QOLZITBcjs = require('./chunk-6QOLZITB.cjs');
4
4
 
5
5
 
6
- var _chunkG643DQCHcjs = require('./chunk-G643DQCH.cjs');
7
6
 
8
7
 
9
8
 
9
+ var _chunk3SAWHWDHcjs = require('./chunk-3SAWHWDH.cjs');
10
10
 
11
- var _chunkALPWLT27cjs = require('./chunk-ALPWLT27.cjs');
12
11
 
12
+ var _chunkG643DQCHcjs = require('./chunk-G643DQCH.cjs');
13
13
 
14
- var _chunk64SBBZDUcjs = require('./chunk-64SBBZDU.cjs');
15
14
 
15
+ var _chunkALPWLT27cjs = require('./chunk-ALPWLT27.cjs');
16
16
 
17
17
 
18
- var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
18
+ var _chunk64SBBZDUcjs = require('./chunk-64SBBZDU.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
22
+ var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
23
23
 
24
24
 
25
25
 
@@ -44,16 +44,9 @@ var _chunkNZKJGRB3cjs = require('./chunk-NZKJGRB3.cjs');
44
44
  var _chunkDVM4FKZLcjs = require('./chunk-DVM4FKZL.cjs');
45
45
 
46
46
 
47
-
48
47
  var _chunkUS2QVW3Ecjs = require('./chunk-US2QVW3E.cjs');
49
48
 
50
49
 
51
- var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
52
-
53
-
54
- var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
55
-
56
-
57
50
 
58
51
 
59
52
 
@@ -268,17 +261,13 @@ function defineIntegration(integration) {
268
261
  };
269
262
  }
270
263
  _chunkS3JO3N4Hcjs.__name.call(void 0, defineIntegration, "defineIntegration");
271
- function isFarmIntegration(value) {
272
- return !!value && typeof value === "object" && value.kind === "farm-integration";
273
- }
274
- _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmIntegration, "isFarmIntegration");
275
264
  function resolveIntegrationPlugins(integrations) {
276
265
  if (!integrations) {
277
266
  return [];
278
267
  }
279
268
  const plugins = [];
280
269
  for (const [key, integration] of Object.entries(integrations)) {
281
- if (!integration || !isFarmIntegration(integration)) {
270
+ if (!integration || !_chunk3SAWHWDHcjs.isFarmIntegration.call(void 0, integration)) {
282
271
  continue;
283
272
  }
284
273
  for (const entry of integration.middleware || []) {
@@ -365,7 +354,7 @@ function getIntegrationProviders(integrations) {
365
354
  }
366
355
  const providers = [];
367
356
  for (const integration of Object.values(integrations)) {
368
- if (!integration || !isFarmIntegration(integration) || !_optionalChain([integration, 'access', _3 => _3.providers, 'optionalAccess', _4 => _4.length])) {
357
+ if (!integration || !_chunk3SAWHWDHcjs.isFarmIntegration.call(void 0, integration) || !_optionalChain([integration, 'access', _3 => _3.providers, 'optionalAccess', _4 => _4.length])) {
369
358
  continue;
370
359
  }
371
360
  for (const provider of integration.providers) {
@@ -393,7 +382,7 @@ function getIntegrationDocumentNavigationMatchers(integrations) {
393
382
  }
394
383
  const matchers = [];
395
384
  for (const integration of Object.values(integrations)) {
396
- if (!integration || !isFarmIntegration(integration) || !_optionalChain([integration, 'access', _5 => _5.documentNavigations, 'optionalAccess', _6 => _6.length])) {
385
+ if (!integration || !_chunk3SAWHWDHcjs.isFarmIntegration.call(void 0, integration) || !_optionalChain([integration, 'access', _5 => _5.documentNavigations, 'optionalAccess', _6 => _6.length])) {
397
386
  continue;
398
387
  }
399
388
  for (const navigation of integration.documentNavigations) {
@@ -411,7 +400,7 @@ function getIntegrationSchemas(integrations) {
411
400
  return {};
412
401
  }
413
402
  const schemaEntries = Object.entries(integrations).map(([key, integration]) => {
414
- const schema = integration && isFarmIntegration(integration) ? integration.schema : void 0;
403
+ const schema = integration && _chunk3SAWHWDHcjs.isFarmIntegration.call(void 0, integration) ? integration.schema : void 0;
415
404
  return schema ? [key, schema] : null;
416
405
  }).filter((value) => value !== null);
417
406
  return Object.fromEntries(schemaEntries);
@@ -444,7 +433,7 @@ function matchIntegrationRoute(integrations, input) {
444
433
  }
445
434
  const pathSegments = _chunkUS2QVW3Ecjs.canonicalizeRequestPathSegments.call(void 0, input.pathname);
446
435
  for (const [key, integration] of Object.entries(integrations)) {
447
- if (!integration || !isFarmIntegration(integration)) {
436
+ if (!integration || !_chunk3SAWHWDHcjs.isFarmIntegration.call(void 0, integration)) {
448
437
  continue;
449
438
  }
450
439
  const routes = normalizeIntegrationRoutes(integration.routes || []);
@@ -452,7 +441,7 @@ function matchIntegrationRoute(integrations, input) {
452
441
  if (!matchesMethod(route.methods, method)) {
453
442
  continue;
454
443
  }
455
- const params = matchPathSegments(route[INTEGRATION_ROUTE_SEGMENTS], pathSegments);
444
+ const params = _chunk3SAWHWDHcjs.matchPathSegments.call(void 0, route[INTEGRATION_ROUTE_SEGMENTS], pathSegments);
456
445
  if (!params) {
457
446
  continue;
458
447
  }
@@ -871,7 +860,7 @@ function createIntegrationPlugin(integrationKey, integration) {
871
860
  }
872
861
  }, "createHandlerRequest");
873
862
  for (const entry of middleware) {
874
- const params = resolveIntegrationMiddlewareParams(entry, pathname, context.config);
863
+ const params = _chunk3SAWHWDHcjs.resolveIntegrationMiddlewareParams.call(void 0, entry, pathname, context.config);
875
864
  if (!params) {
876
865
  continue;
877
866
  }
@@ -972,7 +961,7 @@ function createIntegrationPlugin(integrationKey, integration) {
972
961
  }
973
962
  }
974
963
  for (const route of routes) {
975
- const params = method && matchesMethod(route.methods, method) ? matchPathSegments(route[INTEGRATION_ROUTE_SEGMENTS], pathSegments) : null;
964
+ const params = method && matchesMethod(route.methods, method) ? _chunk3SAWHWDHcjs.matchPathSegments.call(void 0, route[INTEGRATION_ROUTE_SEGMENTS], pathSegments) : null;
976
965
  if (!params) {
977
966
  continue;
978
967
  }
@@ -1190,7 +1179,7 @@ function normalizeIntegrationRoutes(routes) {
1190
1179
  ...route,
1191
1180
  methods: normalizeIntegrationRouteMethods(route),
1192
1181
  input: normalizeIntegrationRouteInputSchemas(route),
1193
- [INTEGRATION_ROUTE_SEGMENTS]: splitPath(route.path)
1182
+ [INTEGRATION_ROUTE_SEGMENTS]: _chunk3SAWHWDHcjs.splitPath.call(void 0, route.path)
1194
1183
  },
1195
1184
  specificity: _chunkNO3WWW3Ncjs.getRoutePatternSpecificity.call(void 0, route.path, "api")
1196
1185
  };
@@ -1585,7 +1574,7 @@ async function dispatchIntegrationRequest(runtime, request, options = {}) {
1585
1574
  const forwardedSetCookies = [];
1586
1575
  for (const entry of middleware) {
1587
1576
  if (_optionalChain([options, 'access', _26 => _26.ranMiddleware, 'optionalAccess', _27 => _27.has, 'call', _28 => _28(entry)])) continue;
1588
- const params = resolveIntegrationMiddlewareParams(entry, pathname, runtime.config);
1577
+ const params = _chunk3SAWHWDHcjs.resolveIntegrationMiddlewareParams.call(void 0, entry, pathname, runtime.config);
1589
1578
  if (!params) {
1590
1579
  continue;
1591
1580
  }
@@ -1678,7 +1667,7 @@ async function dispatchIntegrationRequest(runtime, request, options = {}) {
1678
1667
  }
1679
1668
  }
1680
1669
  for (const route of routes) {
1681
- const params = method && matchesMethod(route.methods, method) ? matchPathSegments(route[INTEGRATION_ROUTE_SEGMENTS], pathSegments) : null;
1670
+ const params = method && matchesMethod(route.methods, method) ? _chunk3SAWHWDHcjs.matchPathSegments.call(void 0, route[INTEGRATION_ROUTE_SEGMENTS], pathSegments) : null;
1682
1671
  if (!params) {
1683
1672
  continue;
1684
1673
  }
@@ -1839,7 +1828,7 @@ async function dispatchIntegrationRequests(integrations, runtime, request, optio
1839
1828
  return { response: null, setCookies };
1840
1829
  }
1841
1830
  for (const integration of Object.values(integrations)) {
1842
- if (!integration || !isFarmIntegration(integration)) {
1831
+ if (!integration || !_chunk3SAWHWDHcjs.isFarmIntegration.call(void 0, integration)) {
1843
1832
  continue;
1844
1833
  }
1845
1834
  const hasMiddleware = (integration.middleware || []).length > 0;
@@ -2011,156 +2000,6 @@ function matchesMethod(methods, normalizedMethod) {
2011
2000
  return methods.some((candidate) => candidate === "ALL" || candidate === normalizedMethod);
2012
2001
  }
2013
2002
  _chunkS3JO3N4Hcjs.__name.call(void 0, matchesMethod, "matchesMethod");
2014
- var compiledIntegrationGuards = /* @__PURE__ */ new WeakMap();
2015
- var noMiddlewareContext = {};
2016
- function resolveIntegrationMiddlewareParams(entry, pathname, config) {
2017
- const params = resolveMatcherParams(entry.matcher, pathname);
2018
- if (params || !entry.matcher) return params;
2019
- const routePathname = resolveIntegrationRoutePathname(pathname, config);
2020
- const candidates = [.../* @__PURE__ */ new Set([pathname, ...getIntegrationAPIPathnames(config)(routePathname)])];
2021
- for (const candidate of candidates) {
2022
- if (candidate === pathname) continue;
2023
- const routeParams = resolveMatcherParams(entry.matcher, candidate);
2024
- if (routeParams) return routeParams;
2025
- }
2026
- let compiled = compiledIntegrationGuards.get(entry);
2027
- if (!compiled) {
2028
- compiled = _chunkALPWLT27cjs.compileMiddlewareConfig.call(void 0, {
2029
- matcher: typeof entry.matcher === "string" ? entry.matcher : [...entry.matcher]
2030
- });
2031
- compiledIntegrationGuards.set(entry, compiled);
2032
- }
2033
- for (const candidate of candidates) {
2034
- const result = _chunkALPWLT27cjs.matchesCompiledMiddlewareConfig.call(void 0, candidate, compiled, noMiddlewareContext);
2035
- if (result.matched) return _nullishCoalesce(result.params, () => ( {}));
2036
- }
2037
- return null;
2038
- }
2039
- _chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationMiddlewareParams, "resolveIntegrationMiddlewareParams");
2040
- function integrationMiddlewareMayHandlePath(integrations, pathname, catchAllProbe) {
2041
- if (!integrations) return false;
2042
- const covers = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (entry) => resolveIntegrationMiddlewareParams(entry, pathname, void 0) !== null, "covers");
2043
- return Object.values(integrations).some(
2044
- (integration) => isFarmIntegration(integration) && (integration.middleware || []).some((entry) => {
2045
- if (catchAllProbe === void 0) return covers(entry);
2046
- if (!entry.matcher) return false;
2047
- const specific = (Array.isArray(entry.matcher) ? entry.matcher : [entry.matcher]).filter(
2048
- (matcher) => resolveIntegrationMiddlewareParams({ matcher }, catchAllProbe, void 0) === null
2049
- );
2050
- return specific.length > 0 && covers({ matcher: specific });
2051
- })
2052
- );
2053
- }
2054
- _chunkS3JO3N4Hcjs.__name.call(void 0, integrationMiddlewareMayHandlePath, "integrationMiddlewareMayHandlePath");
2055
- var FARM_INTEGRATION_API_BASE_PATH_KEY = "__farmAPIServerBasePath";
2056
- var integrationAPIPathnames = /* @__PURE__ */ new WeakMap();
2057
- function getIntegrationAPIPathnames(config) {
2058
- if (!config) return (pathname) => [pathname];
2059
- let toPathnames = integrationAPIPathnames.get(config);
2060
- if (!toPathnames) {
2061
- const recorded = config[FARM_INTEGRATION_API_BASE_PATH_KEY];
2062
- const api2 = config.api;
2063
- const serverBasePath = typeof recorded === "string" ? recorded : typeof _optionalChain([api2, 'optionalAccess', _34 => _34.baseURL]) === "string" && typeof api2.basePath === "string" ? _chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, api2) : void 0;
2064
- toPathnames = _chunkKNBBQHO2cjs.createFarmAPIMiddlewarePathnames.call(void 0, serverBasePath);
2065
- integrationAPIPathnames.set(config, toPathnames);
2066
- }
2067
- return toPathnames;
2068
- }
2069
- _chunkS3JO3N4Hcjs.__name.call(void 0, getIntegrationAPIPathnames, "getIntegrationAPIPathnames");
2070
- function resolveIntegrationRoutePathname(pathname, config) {
2071
- const basePath = typeof _optionalChain([config, 'optionalAccess', _35 => _35.basePath]) === "string" ? config.basePath : void 0;
2072
- let routePathname = basePath ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, pathname, basePath) : pathname;
2073
- const i18n = _optionalChain([config, 'optionalAccess', _36 => _36.i18n]);
2074
- if (i18n && Array.isArray(i18n.locales) && i18n.locales.length > 0) {
2075
- routePathname = _chunkBIDYX3SLcjs.resolveFarmLocalePath.call(void 0, routePathname, {
2076
- locales: i18n.locales,
2077
- defaultLocale: i18n.defaultLocale,
2078
- routing: i18n.routing || "prefix-except-default"
2079
- }).pathname;
2080
- }
2081
- return routePathname;
2082
- }
2083
- _chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationRoutePathname, "resolveIntegrationRoutePathname");
2084
- function resolveMatcherParams(matcher, pathname) {
2085
- if (!matcher) {
2086
- return {};
2087
- }
2088
- const list = Array.isArray(matcher) ? matcher : [matcher];
2089
- let canonicalPathname;
2090
- let canonicalSegments;
2091
- for (const item of list) {
2092
- if (item === "/(.*)" || item === "*") {
2093
- return {};
2094
- }
2095
- if (item.endsWith("(.*)")) {
2096
- _nullishCoalesce(canonicalPathname, () => ( (canonicalPathname = _chunkUS2QVW3Ecjs.canonicalizeRequestPathname.call(void 0, pathname))));
2097
- const prefix = item.slice(0, -4);
2098
- if (canonicalPathname === prefix || canonicalPathname.startsWith(`${prefix}/`)) {
2099
- return {};
2100
- }
2101
- continue;
2102
- }
2103
- _nullishCoalesce(canonicalSegments, () => ( (canonicalSegments = _chunkUS2QVW3Ecjs.canonicalizeRequestPathSegments.call(void 0, pathname))));
2104
- const params = matchPathSegments(splitPath(item), canonicalSegments);
2105
- if (params) {
2106
- return params;
2107
- }
2108
- }
2109
- return null;
2110
- }
2111
- _chunkS3JO3N4Hcjs.__name.call(void 0, resolveMatcherParams, "resolveMatcherParams");
2112
- function matchPathSegments(routeSegments, pathSegments) {
2113
- const params = {};
2114
- let routeIndex = 0;
2115
- let pathIndex = 0;
2116
- while (routeIndex < routeSegments.length && pathIndex < pathSegments.length) {
2117
- const routeSegment = routeSegments[routeIndex];
2118
- const pathSegment = pathSegments[pathIndex];
2119
- if (isCatchAllSegment(routeSegment)) {
2120
- params[getSegmentParamName(routeSegment)] = pathSegments.slice(pathIndex);
2121
- return params;
2122
- }
2123
- if (isDynamicSegment(routeSegment)) {
2124
- params[getSegmentParamName(routeSegment)] = pathSegment;
2125
- routeIndex += 1;
2126
- pathIndex += 1;
2127
- continue;
2128
- }
2129
- if (routeSegment !== pathSegment) {
2130
- return null;
2131
- }
2132
- routeIndex += 1;
2133
- pathIndex += 1;
2134
- }
2135
- if (routeIndex === routeSegments.length && pathIndex === pathSegments.length) {
2136
- return params;
2137
- }
2138
- if (routeIndex === routeSegments.length - 1 && isCatchAllSegment(routeSegments[routeIndex])) {
2139
- params[getSegmentParamName(routeSegments[routeIndex])] = [];
2140
- return params;
2141
- }
2142
- return null;
2143
- }
2144
- _chunkS3JO3N4Hcjs.__name.call(void 0, matchPathSegments, "matchPathSegments");
2145
- function splitPath(value) {
2146
- return value.split("/").filter(Boolean);
2147
- }
2148
- _chunkS3JO3N4Hcjs.__name.call(void 0, splitPath, "splitPath");
2149
- function isDynamicSegment(segment) {
2150
- return segment.startsWith("[") && segment.endsWith("]");
2151
- }
2152
- _chunkS3JO3N4Hcjs.__name.call(void 0, isDynamicSegment, "isDynamicSegment");
2153
- function isCatchAllSegment(segment) {
2154
- return segment.startsWith("[...") && segment.endsWith("]");
2155
- }
2156
- _chunkS3JO3N4Hcjs.__name.call(void 0, isCatchAllSegment, "isCatchAllSegment");
2157
- function getSegmentParamName(segment) {
2158
- if (isCatchAllSegment(segment)) {
2159
- return segment.slice(4, -1);
2160
- }
2161
- return segment.slice(1, -1);
2162
- }
2163
- _chunkS3JO3N4Hcjs.__name.call(void 0, getSegmentParamName, "getSegmentParamName");
2164
2003
  function getRequestId(req) {
2165
2004
  const headerValue = req.headers["x-request-id"];
2166
2005
  if (Array.isArray(headerValue)) {
@@ -2200,7 +2039,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeMatcher, "normalizeMatcher");
2200
2039
 
2201
2040
 
2202
2041
 
2203
-
2204
-
2205
-
2206
- 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.isFarmIntegration = isFarmIntegration; exports.resolveIntegrationPlugins = resolveIntegrationPlugins; exports.getIntegrationProviders = getIntegrationProviders; 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; exports.integrationMiddlewareMayHandlePath = integrationMiddlewareMayHandlePath; exports.FARM_INTEGRATION_API_BASE_PATH_KEY = FARM_INTEGRATION_API_BASE_PATH_KEY;
2042
+ 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.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;
@@ -29,7 +29,7 @@ var _chunk4U5XZDLGcjs = require('./chunk-4U5XZDLG.cjs');
29
29
  var _chunk6D24SDKOcjs = require('./chunk-6D24SDKO.cjs');
30
30
 
31
31
 
32
- var _chunkRHGK2JENcjs = require('./chunk-RHGK2JEN.cjs');
32
+ var _chunkB6XAA7V6cjs = require('./chunk-B6XAA7V6.cjs');
33
33
 
34
34
 
35
35
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -121,7 +121,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, withTimeout, "withTimeout");
121
121
  var formatSeconds = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`, "formatSeconds");
122
122
  function collectSchemaOwners(config) {
123
123
  const owners = [];
124
- const integrationSchemas = _chunkRHGK2JENcjs.getIntegrationSchemas.call(void 0, config.integrations);
124
+ const integrationSchemas = _chunkB6XAA7V6cjs.getIntegrationSchemas.call(void 0, config.integrations);
125
125
  let integrationClient;
126
126
  for (const [name, schema] of Object.entries(integrationSchemas)) {
127
127
  owners.push({
@@ -4,7 +4,7 @@
4
4
  var _chunkAZBSVLRMcjs = require('./chunk-AZBSVLRM.cjs');
5
5
 
6
6
 
7
- var _chunkLVABUXLAcjs = require('./chunk-LVABUXLA.cjs');
7
+ var _chunkLPE3ED4Rcjs = require('./chunk-LPE3ED4R.cjs');
8
8
 
9
9
 
10
10
  var _chunkCEDPEDNWcjs = require('./chunk-CEDPEDNW.cjs');
@@ -105,7 +105,7 @@ async function createFarmRscViteConfig(userConfig, options) {
105
105
  server: { environmentName: "rsc" },
106
106
  config: {
107
107
  preset: options.preset,
108
- outputDir: options.outputDir && _chunkLVABUXLAcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
108
+ outputDir: options.outputDir && _chunkLPE3ED4Rcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
109
109
  }
110
110
  })
111
111
  ]
@@ -11,13 +11,13 @@ import {
11
11
  import {
12
12
  generateNativeMCPPluginSource,
13
13
  layoutsCanCoverSamePage
14
- } from "./chunk-ZYWJIPKQ.mjs";
14
+ } from "./chunk-XUHIRBXY.mjs";
15
15
  import {
16
16
  assertFarmDocsAdapterServesNoGuardedPages,
17
17
  compileFarmDocsAdapterEdgeManifest,
18
18
  createFarmDocsAPIHandler,
19
19
  hasFarmDocsRuntimeAdapter
20
- } from "./chunk-NXO75WY4.mjs";
20
+ } from "./chunk-OYZGFRPA.mjs";
21
21
  import {
22
22
  FARM_DOCS_LAST_MODIFIED_MANIFEST,
23
23
  createFarmDocsHandler,
@@ -45,7 +45,7 @@ import {
45
45
  getDeployTargetForPreset,
46
46
  hasCustomFarmRouteContext,
47
47
  resolveDeployOutputPath
48
- } from "./chunk-4MRQ5OKQ.mjs";
48
+ } from "./chunk-WWYXIECF.mjs";
49
49
  import {
50
50
  resolveFarmInstrumentationFile
51
51
  } from "./chunk-ZZSRYEYU.mjs";
@@ -82,7 +82,7 @@ import {
82
82
  resolveFarmIsolatedClientHydrationMode,
83
83
  resolveFarmNotFoundComponentPath,
84
84
  usesFarmServerTree
85
- } from "./chunk-7SCCY6SI.mjs";
85
+ } from "./chunk-QGFKXYC7.mjs";
86
86
  import {
87
87
  PluginManager
88
88
  } from "./chunk-FGH3ZXTP.mjs";
@@ -109,7 +109,7 @@ import {
109
109
  resolveFarmAppManifestInput,
110
110
  routeBoundaryCoversDirectory,
111
111
  stripRouteGroups
112
- } from "./chunk-TESO7EFU.mjs";
112
+ } from "./chunk-YFLBG2W3.mjs";
113
113
  import {
114
114
  farmPluginMayAffectRuntimePath
115
115
  } from "./chunk-Y5RG6B7S.mjs";
@@ -184,10 +184,12 @@ import {
184
184
  _collectFarmStorageModules
185
185
  } from "./chunk-JGHCKIRI.mjs";
186
186
  import {
187
- FARM_INTEGRATION_API_BASE_PATH_KEY,
188
187
  getFarmIntegrationPluginServerRuntime,
189
188
  getIntegrationProviders
190
- } from "./chunk-AX7S67YV.mjs";
189
+ } from "./chunk-37VKVISD.mjs";
190
+ import {
191
+ FARM_INTEGRATION_API_BASE_PATH_KEY
192
+ } from "./chunk-GZWHCWLB.mjs";
191
193
  import {
192
194
  appendMiddlewareDirectory,
193
195
  appendMiddlewareRoutePath,
@@ -222,7 +224,7 @@ import {
222
224
  } from "./chunk-BTHHUD7Q.mjs";
223
225
  import {
224
226
  FARM_VERSION
225
- } from "./chunk-YGZH4T2X.mjs";
227
+ } from "./chunk-R4J2UOV4.mjs";
226
228
  import {
227
229
  getFarmPresetRuntime
228
230
  } from "./chunk-2A3EQHXX.mjs";