@farm.js/core 0.1.23 → 0.1.25

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 (156) hide show
  1. package/dist/agent-runtime.d.mts +1 -1
  2. package/dist/agent-runtime.d.ts +1 -1
  3. package/dist/api/route-manager.cjs +4 -4
  4. package/dist/api/route-manager.d.mts +1 -1
  5. package/dist/api/route-manager.d.ts +1 -1
  6. package/dist/api/route-manager.mjs +3 -3
  7. package/dist/api/runtime.cjs +3 -3
  8. package/dist/api/runtime.mjs +2 -2
  9. package/dist/api.cjs +7 -7
  10. package/dist/api.d.mts +2 -2
  11. package/dist/api.d.ts +2 -2
  12. package/dist/api.mjs +6 -6
  13. package/dist/{app-BV-7wV5q.d.ts → app-BF-ctoxh.d.ts} +3 -3
  14. package/dist/{app-BZDWwwFa.d.mts → app-ZuWrAMc_.d.mts} +3 -3
  15. package/dist/app-markdown.cjs +4 -4
  16. package/dist/app-markdown.d.mts +2 -2
  17. package/dist/app-markdown.d.ts +2 -2
  18. package/dist/app-markdown.mjs +3 -3
  19. package/dist/{chunk-MVUREHPN.mjs → chunk-2BIJGZR3.mjs} +1 -1
  20. package/dist/chunk-2ITKVAIF.cjs +1077 -0
  21. package/dist/{chunk-47H7VENP.mjs → chunk-2KI3CL3N.mjs} +1 -1
  22. package/dist/{chunk-KNPRCKXK.cjs → chunk-3TQWUUNP.cjs} +9 -7
  23. package/dist/{chunk-GZ3ZPTQV.mjs → chunk-52SH7TKB.mjs} +2 -2
  24. package/dist/{chunk-BDJNP7AQ.mjs → chunk-5YYJ6Q2L.mjs} +10 -3
  25. package/dist/{chunk-OYDRPBBV.cjs → chunk-65P6OGYN.cjs} +73 -3
  26. package/dist/{chunk-JIKGGIOL.mjs → chunk-6D242YGO.mjs} +1 -1
  27. package/dist/{chunk-AH7HOAQ3.cjs → chunk-6K4SPQWL.cjs} +9 -4
  28. package/dist/{chunk-LYM7HY34.cjs → chunk-AXYTGLF3.cjs} +4 -4
  29. package/dist/{chunk-2QLBIPFT.cjs → chunk-B6ZCT36X.cjs} +4 -4
  30. package/dist/{chunk-IMBMOEWT.cjs → chunk-BD2U4ZL6.cjs} +8 -8
  31. package/dist/{chunk-2M435BUE.mjs → chunk-CEYUWDWA.mjs} +7 -5
  32. package/dist/{chunk-I5YBCWQ6.cjs → chunk-CFNOGDUS.cjs} +2 -2
  33. package/dist/{chunk-XI3GWPUS.cjs → chunk-CRQPYWLK.cjs} +14 -14
  34. package/dist/{chunk-ISTFC3MZ.cjs → chunk-E3RDL2DA.cjs} +48 -5
  35. package/dist/{chunk-QTBEAKCJ.cjs → chunk-H7CJRJ4L.cjs} +16 -16
  36. package/dist/{chunk-VPY755R2.mjs → chunk-N2Z4ZFDE.mjs} +25 -11
  37. package/dist/{chunk-DNLQMFER.cjs → chunk-O5DVPF3R.cjs} +26 -19
  38. package/dist/{chunk-WNUBR4CA.mjs → chunk-QGG336NI.mjs} +1 -1
  39. package/dist/{chunk-4DKZ6JR3.cjs → chunk-QYMRIVG6.cjs} +184 -130
  40. package/dist/{chunk-III667SJ.cjs → chunk-R7LCG3BT.cjs} +189 -175
  41. package/dist/{chunk-7BC6GAL7.mjs → chunk-RR6UGYUT.mjs} +44 -1
  42. package/dist/{chunk-LQIRVSBY.cjs → chunk-RYDW7GPR.cjs} +13 -13
  43. package/dist/{chunk-PGQBL5DN.mjs → chunk-T2OPSH6S.mjs} +72 -2
  44. package/dist/{chunk-5UX4C5QI.mjs → chunk-TKDY6AJP.mjs} +1 -1
  45. package/dist/{chunk-VXCA7RZP.cjs → chunk-TTVHACQV.cjs} +1 -1
  46. package/dist/{chunk-OFEY6KHO.mjs → chunk-U4MP7XTD.mjs} +504 -27
  47. package/dist/{chunk-YJJLXIIS.cjs → chunk-U74A3P2P.cjs} +7 -7
  48. package/dist/{chunk-72VJRKJD.mjs → chunk-VZWO3XVL.mjs} +2 -2
  49. package/dist/{chunk-7LU4IOXQ.mjs → chunk-WJYCI56T.mjs} +87 -33
  50. package/dist/{chunk-EHUZ2MKO.mjs → chunk-WOI2HOGA.mjs} +1 -1
  51. package/dist/{chunk-N255VYFP.mjs → chunk-XM4ZDVD7.mjs} +8 -3
  52. package/dist/{chunk-YGMK6ESJ.mjs → chunk-XME4TCLB.mjs} +2 -2
  53. package/dist/{client-plugins-B_XzCegf.d.mts → client-plugins-DPG0NeZN.d.mts} +41 -3
  54. package/dist/{client-plugins-CKsXQfXY.d.ts → client-plugins-Fgni-_25.d.ts} +41 -3
  55. package/dist/client-plugins.d.mts +1 -1
  56. package/dist/client-plugins.d.ts +1 -1
  57. package/dist/client.cjs +4 -4
  58. package/dist/client.d.mts +5 -5
  59. package/dist/client.d.ts +5 -5
  60. package/dist/client.mjs +3 -3
  61. package/dist/config.d.mts +1 -1
  62. package/dist/config.d.ts +1 -1
  63. package/dist/{devtools-UHRSZ7VA.cjs → devtools-6OA7FEF6.cjs} +4 -4
  64. package/dist/{devtools-OY4SNU3P.mjs → devtools-I7TBFOKD.mjs} +3 -3
  65. package/dist/docs.cjs +6 -6
  66. package/dist/docs.mjs +5 -5
  67. package/dist/index.cjs +24 -22
  68. package/dist/index.d.mts +13 -13
  69. package/dist/index.d.ts +13 -13
  70. package/dist/index.mjs +23 -21
  71. package/dist/integrations.d.mts +1 -1
  72. package/dist/integrations.d.ts +1 -1
  73. package/dist/internal/app-markdown-runtime.cjs +3 -3
  74. package/dist/internal/app-markdown-runtime.d.mts +1 -1
  75. package/dist/internal/app-markdown-runtime.d.ts +1 -1
  76. package/dist/internal/app-markdown-runtime.mjs +2 -2
  77. package/dist/internal/build-runtime.cjs +16 -16
  78. package/dist/internal/build-runtime.d.mts +3 -3
  79. package/dist/internal/build-runtime.d.ts +3 -3
  80. package/dist/internal/build-runtime.mjs +15 -15
  81. package/dist/internal/cli-runtime.cjs +5 -5
  82. package/dist/internal/cli-runtime.mjs +4 -4
  83. package/dist/internal/client-error-overlay.cjs +4 -4
  84. package/dist/internal/client-error-overlay.mjs +1 -1
  85. package/dist/internal/compression-runtime.d.mts +1 -1
  86. package/dist/internal/compression-runtime.d.ts +1 -1
  87. package/dist/internal/config-runtime.cjs +4 -4
  88. package/dist/internal/config-runtime.d.mts +2 -2
  89. package/dist/internal/config-runtime.d.ts +2 -2
  90. package/dist/internal/config-runtime.mjs +3 -3
  91. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  92. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  93. package/dist/internal/production-runtime.cjs +11 -5
  94. package/dist/internal/production-runtime.d.mts +30 -8
  95. package/dist/internal/production-runtime.d.ts +30 -8
  96. package/dist/internal/production-runtime.mjs +10 -4
  97. package/dist/markdown.cjs +4 -2
  98. package/dist/markdown.d.mts +63 -1
  99. package/dist/markdown.d.ts +63 -1
  100. package/dist/markdown.mjs +3 -1
  101. package/dist/{metadata-IQEblkZp.d.ts → metadata-CDnRHKVq.d.ts} +1 -1
  102. package/dist/{metadata-B08w4EYV.d.mts → metadata-D0EF7esB.d.mts} +1 -1
  103. package/dist/middleware.d.mts +3 -3
  104. package/dist/middleware.d.ts +3 -3
  105. package/dist/navigation.cjs +5 -5
  106. package/dist/navigation.d.mts +4 -4
  107. package/dist/navigation.d.ts +4 -4
  108. package/dist/navigation.mjs +4 -4
  109. package/dist/plugin.cjs +12 -12
  110. package/dist/plugin.d.mts +1 -1
  111. package/dist/plugin.d.ts +1 -1
  112. package/dist/plugin.mjs +11 -11
  113. package/dist/{production-runtime-DRSOkc-d.d.ts → production-runtime-DpCt0opU.d.ts} +1 -1
  114. package/dist/{production-runtime-C3bGFEaM.d.mts → production-runtime-x3W4wVqx.d.mts} +1 -1
  115. package/dist/query/client.cjs +6 -6
  116. package/dist/query/client.mjs +2 -2
  117. package/dist/{render-plan-CCFuMLNS.d.ts → render-plan-D5oFRVBV.d.ts} +1 -1
  118. package/dist/{render-plan-B6CKNl4e.d.mts → render-plan-tazUJalK.d.mts} +1 -1
  119. package/dist/renderer-client.cjs +5 -5
  120. package/dist/renderer-client.d.mts +3 -3
  121. package/dist/renderer-client.d.ts +3 -3
  122. package/dist/renderer-client.mjs +2 -2
  123. package/dist/{request-DgD1XsTx.d.mts → request-CXmQy5ks.d.mts} +1 -1
  124. package/dist/{request-Dn6VURbE.d.ts → request-CzZX0Aew.d.ts} +1 -1
  125. package/dist/request.d.mts +2 -2
  126. package/dist/request.d.ts +2 -2
  127. package/dist/{route-rendering-76A5I_kE.d.mts → route-rendering-B-qpe32B.d.mts} +1 -1
  128. package/dist/{route-rendering-LAmQEdyG.d.ts → route-rendering-Dw3C362T.d.ts} +1 -1
  129. package/dist/{router-BSOOGya2.d.ts → router-CLl3xHwl.d.ts} +1 -1
  130. package/dist/{router-CnrRSa9d.d.mts → router-CafM2jlw.d.mts} +1 -1
  131. package/dist/routes.d.mts +1 -1
  132. package/dist/routes.d.ts +1 -1
  133. package/dist/server-plugins.d.mts +2 -2
  134. package/dist/server-plugins.d.ts +2 -2
  135. package/dist/server.cjs +27 -27
  136. package/dist/server.d.mts +7 -7
  137. package/dist/server.d.ts +7 -7
  138. package/dist/server.mjs +12 -12
  139. package/dist/{spa-router-DnYhWCvI.d.mts → spa-router-6sJfsMlQ.d.mts} +2 -2
  140. package/dist/{spa-router-BMrSsG5b.d.ts → spa-router-DePr2aZ6.d.ts} +2 -2
  141. package/dist/testing.cjs +4 -4
  142. package/dist/testing.d.mts +1 -1
  143. package/dist/testing.d.ts +1 -1
  144. package/dist/testing.mjs +3 -3
  145. package/dist/{utils-C3GguS-Q.d.ts → utils-BBKC3cf3.d.ts} +1 -1
  146. package/dist/{utils-ABkktwku.d.mts → utils-BPHr-1mP.d.mts} +1 -1
  147. package/dist/version.cjs +2 -2
  148. package/dist/version.mjs +1 -1
  149. package/dist/vite.cjs +12 -12
  150. package/dist/vite.d.mts +1 -1
  151. package/dist/vite.d.ts +1 -1
  152. package/dist/vite.mjs +11 -11
  153. package/package.json +1 -1
  154. package/dist/chunk-BBVSJVBZ.cjs +0 -600
  155. package/dist/{chunk-XP777LRD.mjs → chunk-GDUYXFIS.mjs} +3 -3
  156. package/dist/{chunk-4PNUXIVU.cjs → chunk-YAOX43YI.cjs} +3 -3
@@ -6,7 +6,7 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
6
6
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
7
7
 
8
8
 
9
- var _chunkIMBMOEWTcjs = require('./chunk-IMBMOEWT.cjs');
9
+ var _chunkBD2U4ZL6cjs = require('./chunk-BD2U4ZL6.cjs');
10
10
 
11
11
 
12
12
  var _chunkN4RLRSWWcjs = require('./chunk-N4RLRSWW.cjs');
@@ -19,7 +19,7 @@ var _chunk2CQ74SP6cjs = require('./chunk-2CQ74SP6.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunk4PNUXIVUcjs = require('./chunk-4PNUXIVU.cjs');
22
+ var _chunkYAOX43YIcjs = require('./chunk-YAOX43YI.cjs');
23
23
 
24
24
 
25
25
  var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
@@ -105,7 +105,7 @@ function farmApiPlugin(options = {}) {
105
105
  const existing = apiRoutesCache.get(routePath);
106
106
  const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
107
107
  if (existingFile) {
108
- throw new (0, _chunkIMBMOEWTcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
108
+ throw new (0, _chunkBD2U4ZL6cjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
109
109
  }
110
110
  if (existing) {
111
111
  if (!existing.methods.includes(normalizedMethod)) {
@@ -189,7 +189,7 @@ function farmApiPlugin(options = {}) {
189
189
  const url = new URL(request.url);
190
190
  const method = request.method.toUpperCase();
191
191
  const pathname = url.pathname;
192
- const match = _chunk4PNUXIVUcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath);
192
+ const match = _chunkYAOX43YIcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath);
193
193
  if (!match) {
194
194
  return new Response(JSON.stringify({ error: "Not Found" }), {
195
195
  status: 404,
@@ -197,18 +197,18 @@ function farmApiPlugin(options = {}) {
197
197
  });
198
198
  }
199
199
  const { route, params } = match;
200
- const endpoint = _chunk4PNUXIVUcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
200
+ const endpoint = _chunkYAOX43YIcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
201
201
  if (!endpoint) {
202
202
  return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
203
203
  status: 405,
204
204
  headers: {
205
- Allow: _chunk4PNUXIVUcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
205
+ Allow: _chunkYAOX43YIcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
206
206
  "Content-Type": "application/json"
207
207
  }
208
208
  });
209
209
  }
210
210
  try {
211
- return await _chunk4PNUXIVUcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
211
+ return await _chunkYAOX43YIcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
212
212
  } catch (error) {
213
213
  return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
214
214
  status: 500,
@@ -255,7 +255,7 @@ function farmApiPlugin(options = {}) {
255
255
  const routeModule = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, filePath);
256
256
  const endpoints = {};
257
257
  const availableMethods = [];
258
- for (const method of _chunk4PNUXIVUcjs.API_ROUTE_METHODS) {
258
+ for (const method of _chunkYAOX43YIcjs.API_ROUTE_METHODS) {
259
259
  if (routeModule[method]) {
260
260
  availableMethods.push(method);
261
261
  endpoints[method] = routeModule[method];
@@ -268,7 +268,7 @@ function farmApiPlugin(options = {}) {
268
268
  log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
269
269
  }
270
270
  } catch (e) {
271
- if (e instanceof _chunkIMBMOEWTcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
271
+ if (e instanceof _chunkBD2U4ZL6cjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
272
272
  log(`API route load failed at ${filePath}: ${e.message}`);
273
273
  }
274
274
  }
@@ -295,7 +295,7 @@ function farmApiPlugin(options = {}) {
295
295
  }
296
296
  }
297
297
  } catch (e) {
298
- if (e instanceof _chunkIMBMOEWTcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
298
+ if (e instanceof _chunkBD2U4ZL6cjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
299
299
  log(`Root routes.ts load failed: ${e.message}`);
300
300
  }
301
301
  break;
@@ -326,7 +326,7 @@ function farmApiPlugin(options = {}) {
326
326
  }
327
327
  }
328
328
  } catch (e) {
329
- if (e instanceof _chunkIMBMOEWTcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
329
+ if (e instanceof _chunkBD2U4ZL6cjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
330
330
  log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
331
331
  }
332
332
  }
@@ -378,7 +378,7 @@ function farmApiPlugin(options = {}) {
378
378
  const pathname = url.split("?")[0];
379
379
  const method = req.method || "GET";
380
380
  if (discoveryPromise) await waitForDiscovery();
381
- if (!_chunk4PNUXIVUcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath)) {
381
+ if (!_chunkYAOX43YIcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, pathname, basePath)) {
382
382
  return next();
383
383
  }
384
384
  if (!apiRouterHandler) {
@@ -399,7 +399,7 @@ function farmApiPlugin(options = {}) {
399
399
  }
400
400
  const currentUrl = req.url || url;
401
401
  const currentPathname = currentUrl.split("?")[0];
402
- if (currentPathname !== pathname && !_chunk4PNUXIVUcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, currentPathname, basePath)) {
402
+ if (currentPathname !== pathname && !_chunkYAOX43YIcjs.matchAPIRouteAtBasePath.call(void 0, apiRoutesCache, currentPathname, basePath)) {
403
403
  return next();
404
404
  }
405
405
  const fullUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req);
@@ -503,7 +503,7 @@ function farmApiPlugin(options = {}) {
503
503
  log(`API router recreated`);
504
504
  } catch (e) {
505
505
  restoreRouteState(previousState);
506
- if (e instanceof _chunkIMBMOEWTcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
506
+ if (e instanceof _chunkBD2U4ZL6cjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
507
507
  log(`Root routes.ts HMR failed: ${e.message}`);
508
508
  }
509
509
  return [];
@@ -531,7 +531,7 @@ function farmApiPlugin(options = {}) {
531
531
  const routeModule = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, file);
532
532
  removeEndpointsFromFile(file);
533
533
  const availableMethods = [];
534
- for (const method of _chunk4PNUXIVUcjs.API_ROUTE_METHODS) {
534
+ for (const method of _chunkYAOX43YIcjs.API_ROUTE_METHODS) {
535
535
  if (!routeModule[method]) continue;
536
536
  availableMethods.push(method);
537
537
  addEndpoint(routePath, file, method, routeModule[method]);
@@ -541,7 +541,7 @@ function farmApiPlugin(options = {}) {
541
541
  log(`API router recreated`);
542
542
  } catch (e) {
543
543
  restoreRouteState(previousState);
544
- if (e instanceof _chunkIMBMOEWTcjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
544
+ if (e instanceof _chunkBD2U4ZL6cjs.APIRouteConflictError || e instanceof _chunkNO3WWW3Ncjs.AmbiguousRouteError) throw e;
545
545
  log(`API route HMR failed: ${e.message}`);
546
546
  }
547
547
  return [];
@@ -16,15 +16,18 @@ import {
16
16
  resolveSchemaModels
17
17
  } from "./chunk-ZMSZZXOR.mjs";
18
18
  import {
19
+ FARM_API_CATALOG_PATH,
19
20
  createDefaultErrorMarkup,
21
+ createFarmApiCatalogResponse,
20
22
  createFarmMetadataRouteResponse,
21
23
  createFarmThemeDocumentParts,
22
24
  createLateNotFoundRecovery,
23
25
  createLateRedirectRecovery,
24
26
  getDefaultErrorStatusText,
25
27
  renderFarmLocaleAlternateLinks,
26
- resolveDefaultErrorStatus
27
- } from "./chunk-PGQBL5DN.mjs";
28
+ resolveDefaultErrorStatus,
29
+ resolveFarmApiCatalogInput
30
+ } from "./chunk-T2OPSH6S.mjs";
28
31
  import {
29
32
  isFarmPreviewDeploymentEnvironment
30
33
  } from "./chunk-BOYNDCZL.mjs";
@@ -104,7 +107,7 @@ import {
104
107
  resolveFarmLlmsTxtConfig,
105
108
  resolveFarmPerformanceConfig,
106
109
  resolveFarmSecurityConfig
107
- } from "./chunk-7BC6GAL7.mjs";
110
+ } from "./chunk-RR6UGYUT.mjs";
108
111
  import {
109
112
  getPublicFarmImageConfig,
110
113
  resolveFarmImageConfig
@@ -122,12 +125,12 @@ import {
122
125
  import {
123
126
  createFarmMarkdownRouteModuleFromFile,
124
127
  loadFarmMdxComponents
125
- } from "./chunk-MVUREHPN.mjs";
128
+ } from "./chunk-2BIJGZR3.mjs";
126
129
  import {
127
130
  createFarmMarkdownSourceResponse,
128
131
  isFarmMarkdownPageFile,
129
132
  normalizeFarmMarkdownRoutePath
130
- } from "./chunk-N255VYFP.mjs";
133
+ } from "./chunk-XM4ZDVD7.mjs";
131
134
  import {
132
135
  resolveFarmMdxComponentsModulePath,
133
136
  resolveMdxConfig
@@ -141,7 +144,7 @@ import {
141
144
  getFarmMarkdownMirrorPath,
142
145
  resolveMarkdownConfig,
143
146
  resolveMarkdownMirrorTarget
144
- } from "./chunk-OFEY6KHO.mjs";
147
+ } from "./chunk-U4MP7XTD.mjs";
145
148
  import {
146
149
  resolveWorkflowsConfig
147
150
  } from "./chunk-3ATMYLLJ.mjs";
@@ -182,7 +185,7 @@ import {
182
185
  } from "./chunk-IOEH4VWN.mjs";
183
186
  import {
184
187
  APIRouteManager
185
- } from "./chunk-WNUBR4CA.mjs";
188
+ } from "./chunk-QGG336NI.mjs";
186
189
  import {
187
190
  findProgrammaticRouteFiles,
188
191
  loadProgrammaticRouteManifests
@@ -201,7 +204,7 @@ import {
201
204
  } from "./chunk-YOZYCI6Z.mjs";
202
205
  import {
203
206
  isFarmAPIPathname
204
- } from "./chunk-XP777LRD.mjs";
207
+ } from "./chunk-GDUYXFIS.mjs";
205
208
  import {
206
209
  resolveFarmAPIServerBasePath
207
210
  } from "./chunk-I6XDAKWQ.mjs";
@@ -271,7 +274,7 @@ import {
271
274
  } from "./chunk-Z2RZJZIZ.mjs";
272
275
  import {
273
276
  FARM_VERSION
274
- } from "./chunk-EHUZ2MKO.mjs";
277
+ } from "./chunk-WOI2HOGA.mjs";
275
278
  import {
276
279
  resolveFarmTrailingSlashRedirect,
277
280
  setFarmTrailingSlashPreference
@@ -290,7 +293,7 @@ import {
290
293
  mergeMetadata,
291
294
  renderMetadataHead,
292
295
  resolveFarmNotFoundMetadata
293
- } from "./chunk-2M435BUE.mjs";
296
+ } from "./chunk-CEYUWDWA.mjs";
294
297
  import {
295
298
  FARM_DEPLOYMENT_ID_HEADER,
296
299
  createFarmDeploymentCookie,
@@ -9514,7 +9517,7 @@ function loadFarmWorkflowsDevRuntime() {
9514
9517
  }
9515
9518
  __name(loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
9516
9519
  function loadFarmDevtoolsSnapshotRuntime() {
9517
- return import("./devtools-OY4SNU3P.mjs");
9520
+ return import("./devtools-I7TBFOKD.mjs");
9518
9521
  }
9519
9522
  __name(loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
9520
9523
  function loadFarmDevtoolsUIRuntime() {
@@ -10809,6 +10812,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10809
10812
  const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
10810
10813
  return docsHandler(req, res);
10811
10814
  }
10815
+ if (options.agent?.apiCatalog && stripFarmBasePath(requestPathname, farmConfig.basePath) === FARM_API_CATALOG_PATH) {
10816
+ if (await runAppMiddlewareForContentRoute()) return;
10817
+ await sendWebResponse(
10818
+ res,
10819
+ createFarmApiCatalogResponse(
10820
+ requestMethod,
10821
+ resolveFarmApiCatalogInput({ ...options, api: farmConfig.api })
10822
+ )
10823
+ );
10824
+ return;
10825
+ }
10812
10826
  const docsHeaders = new Headers();
10813
10827
  for (const [key, value] of Object.entries(req.headers)) {
10814
10828
  if (value) {
@@ -28,7 +28,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
28
28
 
29
29
 
30
30
 
31
- var _chunkISTFC3MZcjs = require('./chunk-ISTFC3MZ.cjs');
31
+ var _chunkE3RDL2DAcjs = require('./chunk-E3RDL2DA.cjs');
32
32
 
33
33
 
34
34
  var _chunkYFPGHF5Fcjs = require('./chunk-YFPGHF5F.cjs');
@@ -47,7 +47,7 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
47
47
  var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
48
48
 
49
49
 
50
- var _chunkBBVSJVBZcjs = require('./chunk-BBVSJVBZ.cjs');
50
+ var _chunk2ITKVAIFcjs = require('./chunk-2ITKVAIF.cjs');
51
51
 
52
52
 
53
53
  var _chunkUYIHRDE4cjs = require('./chunk-UYIHRDE4.cjs');
@@ -133,12 +133,19 @@ function resolveFarmAgentConfig(input) {
133
133
  const jsonLd = _optionalChain([input, 'optionalAccess', _ => _.jsonLd]);
134
134
  return {
135
135
  jsonLd: !jsonLd ? false : jsonLd === true ? {} : jsonLd,
136
- noindexPreviews: _chunkISTFC3MZcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
137
- llmsTxt: _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt])),
138
- crawlers: _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _4 => _4.crawlers]))
136
+ noindexPreviews: _chunkE3RDL2DAcjs.resolveFarmNoindexPreviews.call(void 0, _optionalChain([input, 'optionalAccess', _2 => _2.noindexPreviews])),
137
+ llmsTxt: _chunkE3RDL2DAcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([input, 'optionalAccess', _3 => _3.llmsTxt])),
138
+ crawlers: _chunkE3RDL2DAcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([input, 'optionalAccess', _4 => _4.crawlers])),
139
+ apiCatalog: resolveFarmApiCatalogEnabled(_optionalChain([input, 'optionalAccess', _5 => _5.apiCatalog]))
139
140
  };
140
141
  }
141
142
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAgentConfig, "resolveFarmAgentConfig");
143
+ function resolveFarmApiCatalogEnabled(input) {
144
+ if (input === void 0) return false;
145
+ if (typeof input !== "boolean") throw new TypeError("agent.apiCatalog must be a boolean.");
146
+ return input;
147
+ }
148
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmApiCatalogEnabled, "resolveFarmApiCatalogEnabled");
142
149
 
143
150
  // src/docs/framework-detect.ts
144
151
  var _promises = require('fs/promises');
@@ -214,7 +221,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
214
221
  /* @vite-ignore */
215
222
  _url.pathToFileURL.call(void 0, configEntryPath).href
216
223
  );
217
- const withDocs = _optionalChain([frameworkConfig, 'optionalAccess', _5 => _5.withDocs]);
224
+ const withDocs = _optionalChain([frameworkConfig, 'optionalAccess', _6 => _6.withDocs]);
218
225
  if (typeof withDocs !== "function") {
219
226
  noticeOnce(
220
227
  "missing-withdocs",
@@ -224,7 +231,7 @@ async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
224
231
  return userConfig;
225
232
  }
226
233
  const applied = withDocs(userConfig);
227
- const adapter = _optionalChain([applied, 'optionalAccess', _6 => _6.docs, 'optionalAccess', _7 => _7.adapter]);
234
+ const adapter = _optionalChain([applied, 'optionalAccess', _7 => _7.docs, 'optionalAccess', _8 => _8.adapter]);
228
235
  if (!isSupportedAdapterDescriptor(adapter)) {
229
236
  noticeOnce(
230
237
  "unsupported-descriptor",
@@ -335,7 +342,7 @@ var PLATFORM_BUILD_ENV_TARGETS = [
335
342
  ];
336
343
  function detectPlatformDeployTarget(env = process.env) {
337
344
  for (const [key, target] of PLATFORM_BUILD_ENV_TARGETS) {
338
- const value = _optionalChain([env, 'access', _8 => _8[key], 'optionalAccess', _9 => _9.trim, 'call', _10 => _10(), 'access', _11 => _11.toLowerCase, 'call', _12 => _12()]);
345
+ const value = _optionalChain([env, 'access', _9 => _9[key], 'optionalAccess', _10 => _10.trim, 'call', _11 => _11(), 'access', _12 => _12.toLowerCase, 'call', _13 => _13()]);
339
346
  if (value === "1" || value === "true") return target;
340
347
  }
341
348
  return void 0;
@@ -375,7 +382,7 @@ function resolveDeployConfig(config, overrides = {}) {
375
382
  );
376
383
  }
377
384
  }
378
- const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access', _13 => _13.vercel, 'optionalAccess', _14 => _14.outputDirectory]) : resolvedTarget === "cloudflare" ? _optionalChain([deploy, 'access', _15 => _15.cloudflare, 'optionalAccess', _16 => _16.outputDir]) : resolvedTarget === "netlify" ? _optionalChain([deploy, 'access', _17 => _17.netlify, 'optionalAccess', _18 => _18.outputDir]) : void 0;
385
+ const platformOutput = resolvedTarget === "vercel" ? _optionalChain([deploy, 'access', _14 => _14.vercel, 'optionalAccess', _15 => _15.outputDirectory]) : resolvedTarget === "cloudflare" ? _optionalChain([deploy, 'access', _16 => _16.cloudflare, 'optionalAccess', _17 => _17.outputDir]) : resolvedTarget === "netlify" ? _optionalChain([deploy, 'access', _18 => _18.netlify, 'optionalAccess', _19 => _19.outputDir]) : void 0;
379
386
  const outputDir = overrides.outputDir || deploy.outputDir || deploy.output || platformOutput || getDefaultDeployOutputDir(resolvedTarget, preset, distDir);
380
387
  return {
381
388
  ...deploy,
@@ -571,14 +578,14 @@ async function resolveDocsConfig(userDocs, options = {}) {
571
578
  config: void 0,
572
579
  configPath: void 0
573
580
  });
574
- const loadedDocsConfig = sanitizeDocsConfig(_optionalChain([loadedConfig, 'optionalAccess', _19 => _19.config]) || {});
581
+ const loadedDocsConfig = sanitizeDocsConfig(_optionalChain([loadedConfig, 'optionalAccess', _20 => _20.config]) || {});
575
582
  const mergedDocsConfig = {
576
583
  ...loadedDocsConfig,
577
584
  ...inlineDocsConfig,
578
585
  ...directDocsConfig
579
586
  };
580
587
  const runtimeDocsConfig = {
581
- ..._optionalChain([loadedConfig, 'optionalAccess', _20 => _20.config]) || {},
588
+ ..._optionalChain([loadedConfig, 'optionalAccess', _21 => _21.config]) || {},
582
589
  ...isRecord(docsOptions.config) ? docsOptions.config : {},
583
590
  ...omitUndefined({
584
591
  ...docsOptions,
@@ -604,7 +611,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
604
611
  entry: entryRoute,
605
612
  ...docsOptions.adapter ? { adapter: docsOptions.adapter } : {},
606
613
  contentDir,
607
- configPath: _optionalChain([loadedConfig, 'optionalAccess', _21 => _21.configPath]),
614
+ configPath: _optionalChain([loadedConfig, 'optionalAccess', _22 => _22.configPath]),
608
615
  config: {
609
616
  ...mergedDocsConfig,
610
617
  entry: docsEntry,
@@ -673,9 +680,9 @@ async function resolveConfig(userConfig, mode) {
673
680
  const routeRules = _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, userConfig.routeRules);
674
681
  const routeRuleRedirects = _chunkQ5B3KJBPcjs.routeRulesToRedirects.call(void 0, routeRules);
675
682
  const routeRuleHeaders = _chunkQ5B3KJBPcjs.routeRulesToHeaders.call(void 0, routeRules);
676
- const security = _chunkISTFC3MZcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
677
- const securityHeader = _chunkISTFC3MZcjs.getFarmSecurityHeader.call(void 0, security);
678
- if (_chunkISTFC3MZcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
683
+ const security = _chunkE3RDL2DAcjs.resolveFarmSecurityConfig.call(void 0, userConfig.security);
684
+ const securityHeader = _chunkE3RDL2DAcjs.getFarmSecurityHeader.call(void 0, security);
685
+ if (_chunkE3RDL2DAcjs.farmCspBlocksFrameworkInlineScripts.call(void 0, security)) {
679
686
  _chunk5QIKR7RRcjs.logger.warn(
680
687
  "security.csp blocks the inline scripts Farm injects for theming and hydration. Set security.csp.nonce to true for managed dynamic nonces and prerendered hashes, or make the governing script directive allow 'unsafe-inline' without a nonce, hash, or 'strict-dynamic' source."
681
688
  );
@@ -684,14 +691,14 @@ async function resolveConfig(userConfig, mode) {
684
691
  const root = userConfig.root || process.cwd();
685
692
  const srcDir = userConfig.srcDir || "src";
686
693
  const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
687
- const md = _chunkBBVSJVBZcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
694
+ const md = _chunk2ITKVAIFcjs.resolveMarkdownConfig.call(void 0, userConfig.md);
688
695
  const mdx = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
689
696
  const env = _chunkVEKFLAQMcjs.resolveEnv.call(void 0, userConfig.env, process.env);
690
697
  _chunkVEKFLAQMcjs.setEnv.call(void 0, env);
691
698
  const api = await _chunkS3A45T7Fcjs.resolveFarmAPIConfig.call(void 0, userConfig.api, { root, mode, env });
692
699
  const auth = _chunkQBPXNZGVcjs.resolveFarmAuthConfig.call(void 0, userConfig.auth);
693
700
  const mcp = resolveFarmMCPConfig(userConfig.mcp);
694
- if (auth.enabled && _optionalChain([userConfig, 'access', _22 => _22.integrations, 'optionalAccess', _23 => _23.auth])) {
701
+ if (auth.enabled && _optionalChain([userConfig, 'access', _23 => _23.integrations, 'optionalAccess', _24 => _24.auth])) {
695
702
  throw new Error(
696
703
  "Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
697
704
  );
@@ -701,7 +708,7 @@ async function resolveConfig(userConfig, mode) {
701
708
  mode
702
709
  });
703
710
  const nativeMCPPlugin = await resolveFarmMCPPlugin(mcp, { root });
704
- if (nativeMCPPlugin && _optionalChain([userConfig, 'access', _24 => _24.plugins, 'optionalAccess', _25 => _25.some, 'call', _26 => _26((plugin) => _optionalChain([plugin, 'optionalAccess', _27 => _27.name]) === "farm:api-mcp")])) {
711
+ if (nativeMCPPlugin && _optionalChain([userConfig, 'access', _25 => _25.plugins, 'optionalAccess', _26 => _26.some, 'call', _27 => _27((plugin) => _optionalChain([plugin, 'optionalAccess', _28 => _28.name]) === "farm:api-mcp")])) {
705
712
  throw new Error(
706
713
  "Choose either the top-level `mcp` config or `apiMcp()` in `plugins`; they configure the same MCP transport."
707
714
  );
@@ -775,7 +782,7 @@ async function resolveConfig(userConfig, mode) {
775
782
  ], "headers"),
776
783
  routeRules,
777
784
  images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, userConfig.images),
778
- performance: _chunkISTFC3MZcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
785
+ performance: _chunkE3RDL2DAcjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
779
786
  theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
780
787
  publicDir: userConfig.publicDir || "public",
781
788
  i18n: _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, userConfig.i18n, { root, mode, basePath }),
@@ -17,7 +17,7 @@ import {
17
17
  matchAPIRouteAtBasePath,
18
18
  mergePluginAPIRoutes,
19
19
  resolveAPIRouteEndpoint
20
- } from "./chunk-XP777LRD.mjs";
20
+ } from "./chunk-GDUYXFIS.mjs";
21
21
  import {
22
22
  registerAPIRouteShape
23
23
  } from "./chunk-W3B4PKAW.mjs";