@farm.js/core 0.1.83 → 0.1.85

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 (115) hide show
  1. package/dist/{analyzer-Y6IY26HI.mjs → analyzer-R6KNJ6IO.mjs} +2 -2
  2. package/dist/analyzer-XVY76XMM.cjs +17 -0
  3. package/dist/{app.d-eSm7jgoc.d.mts → app.d-Bvpc2eJq.d.mts} +1 -1
  4. package/dist/{app.d-CVPu_hoD.d.ts → app.d-DEKpJEp4.d.ts} +1 -1
  5. package/dist/{chunk-R3VLM2MW.mjs → chunk-2DMOB6BH.mjs} +5 -5
  6. package/dist/{chunk-3CZ4MJHW.cjs → chunk-3HWNYLQV.cjs} +1 -1
  7. package/dist/{chunk-NGTZHWBG.cjs → chunk-3OKSEJ33.cjs} +31 -10
  8. package/dist/{chunk-B5SJYXJK.mjs → chunk-3TCFONUE.mjs} +16 -7
  9. package/dist/{chunk-U56Z3755.mjs → chunk-4QCMTIBM.mjs} +9 -9
  10. package/dist/{chunk-DZTWUEBB.cjs → chunk-7TPLDPNC.cjs} +10 -10
  11. package/dist/{chunk-55UJGUBP.cjs → chunk-BBX4RPOV.cjs} +13 -13
  12. package/dist/{chunk-RGTZAM6Y.mjs → chunk-BCCCPFHQ.mjs} +25 -4
  13. package/dist/{chunk-IABI62FH.cjs → chunk-BZN5HX7Y.cjs} +2 -2
  14. package/dist/{chunk-FFWSER54.mjs → chunk-CDZ55QRD.mjs} +1 -1
  15. package/dist/{chunk-IAIRQAHA.mjs → chunk-CWUQBECF.mjs} +1 -1
  16. package/dist/{chunk-BBVLOEND.cjs → chunk-F7JVO3OZ.cjs} +4 -4
  17. package/dist/{chunk-NDWI6FDH.mjs → chunk-GFVPQ25Z.mjs} +132 -33
  18. package/dist/{chunk-5X5GJU5A.cjs → chunk-GLNVLCUH.cjs} +6 -6
  19. package/dist/{chunk-JHRJ5V2F.cjs → chunk-H6C45DCF.cjs} +165 -162
  20. package/dist/{chunk-LN6FAYNB.cjs → chunk-HKJIUZS5.cjs} +2 -2
  21. package/dist/{chunk-ORBBAA7B.mjs → chunk-J7VIXTPQ.mjs} +1 -1
  22. package/dist/{chunk-HRH7OKBQ.cjs → chunk-L3BSHASB.cjs} +4 -4
  23. package/dist/{chunk-ELNRKD4V.mjs → chunk-L5HDCDFT.mjs} +1 -1
  24. package/dist/chunk-MAPHNGTF.cjs +98 -0
  25. package/dist/{chunk-RE5E2G5S.cjs → chunk-MNUYXZV7.cjs} +2 -18
  26. package/dist/{chunk-YSU3WCW6.mjs → chunk-MYSH5Y4E.mjs} +1 -1
  27. package/dist/{chunk-EFI6QWBQ.cjs → chunk-OYM6VJEF.cjs} +35 -26
  28. package/dist/{chunk-43N3X6OO.mjs → chunk-PQR5A7R2.mjs} +1 -1
  29. package/dist/{chunk-3DAJXBSL.cjs → chunk-Q7GB3I4O.cjs} +2 -2
  30. package/dist/{chunk-A5BHJHDF.cjs → chunk-QUHDVJMR.cjs} +3 -3
  31. package/dist/chunk-RJBUI5AN.mjs +18 -0
  32. package/dist/chunk-RQ6XX5IN.mjs +98 -0
  33. package/dist/{chunk-OM6JIIJU.cjs → chunk-RVJQHQCG.cjs} +4 -4
  34. package/dist/{chunk-WCSBYQOT.cjs → chunk-TOUC6BR3.cjs} +4 -4
  35. package/dist/{chunk-WZV2G2A6.mjs → chunk-U6HUVY5R.mjs} +90 -29
  36. package/dist/{chunk-SLIXHUMS.cjs → chunk-UEQC4ZLP.cjs} +446 -347
  37. package/dist/{chunk-7X2CYE66.cjs → chunk-WYTK7HQS.cjs} +261 -200
  38. package/dist/{chunk-DPUZVGXH.mjs → chunk-X7RSOEMQ.mjs} +33 -30
  39. package/dist/{chunk-NKVBWPXR.mjs → chunk-XIXAUXV3.mjs} +1 -1
  40. package/dist/{chunk-RNJX3MD6.mjs → chunk-YS647ASS.mjs} +1 -1
  41. package/dist/{chunk-VQ6IXALL.mjs → chunk-YX532KEF.mjs} +2 -2
  42. package/dist/{chunk-K3GHY7GY.mjs → chunk-Z3LOPHSO.mjs} +1 -1
  43. package/dist/{client-component.d-DLknFP8l.d.ts → client-component.d-CZG02pIh.d.ts} +2 -1
  44. package/dist/{client-component.d-DLMCzmUx.d.mts → client-component.d-miqIXyQv.d.mts} +2 -1
  45. package/dist/{devtools-OI52TCSD.mjs → devtools-34ZQWX3M.mjs} +4 -4
  46. package/dist/{devtools-ZM2AR36W.cjs → devtools-SXL5RFE5.cjs} +6 -6
  47. package/dist/docs.cjs +6 -6
  48. package/dist/docs.mjs +5 -5
  49. package/dist/environment/vite.cjs +5 -5
  50. package/dist/environment/vite.mjs +4 -4
  51. package/dist/index.cjs +26 -25
  52. package/dist/index.d.mts +2 -2
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.mjs +26 -25
  55. package/dist/internal/build-runtime.cjs +26 -25
  56. package/dist/internal/build-runtime.mjs +25 -24
  57. package/dist/internal/cli-runtime.cjs +8 -8
  58. package/dist/internal/cli-runtime.mjs +7 -7
  59. package/dist/internal/client-error-overlay.cjs +4 -4
  60. package/dist/internal/client-error-overlay.mjs +1 -1
  61. package/dist/internal/client-runtime.d.mts +3 -37
  62. package/dist/internal/client-runtime.d.ts +3 -37
  63. package/dist/internal/config-runtime.cjs +6 -6
  64. package/dist/internal/config-runtime.mjs +5 -5
  65. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  66. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  67. package/dist/internal/islands-runtime.cjs +15 -8
  68. package/dist/internal/islands-runtime.d.mts +2 -3
  69. package/dist/internal/islands-runtime.d.ts +2 -3
  70. package/dist/internal/islands-runtime.mjs +15 -8
  71. package/dist/internal/islands-server-tree.cjs +8 -0
  72. package/dist/internal/islands-server-tree.d.mts +5 -0
  73. package/dist/internal/islands-server-tree.d.ts +5 -0
  74. package/dist/internal/islands-server-tree.mjs +8 -0
  75. package/dist/internal/islx-actions-server.d.mts +0 -3
  76. package/dist/internal/islx-actions-server.d.ts +0 -3
  77. package/dist/internal/native-server-fns.cjs +4 -4
  78. package/dist/internal/native-server-fns.mjs +3 -3
  79. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  80. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  81. package/dist/internal/production-runtime.cjs +15 -15
  82. package/dist/internal/production-runtime.mjs +21 -21
  83. package/dist/internal/renderer-islands.cjs +47 -0
  84. package/dist/internal/renderer-islands.d.mts +32 -0
  85. package/dist/internal/renderer-islands.d.ts +32 -0
  86. package/dist/internal/renderer-islands.mjs +47 -0
  87. package/dist/island-runtime.d-BA7EPo1v.d.ts +38 -0
  88. package/dist/island-runtime.d-BBS_YUSX.d.mts +38 -0
  89. package/dist/plugin.cjs +20 -19
  90. package/dist/plugin.d.mts +1 -1
  91. package/dist/plugin.d.ts +1 -1
  92. package/dist/plugin.mjs +19 -18
  93. package/dist/renderer.cjs +8 -2
  94. package/dist/renderer.d.mts +81 -1
  95. package/dist/renderer.d.ts +81 -1
  96. package/dist/renderer.mjs +7 -1
  97. package/dist/{rsc-pipeline-MFJZGDPE.cjs → rsc-pipeline-ESPGX4VX.cjs} +9 -9
  98. package/dist/{rsc-pipeline-TRZVFCBX.mjs → rsc-pipeline-MW2V3WEE.mjs} +8 -8
  99. package/dist/{runtime-MJUG2HGR.cjs → runtime-FCMLEBTX.cjs} +13 -14
  100. package/dist/{runtime-O4Y3Z6V3.mjs → runtime-KGSOEMLT.mjs} +10 -11
  101. package/dist/server.cjs +50 -50
  102. package/dist/server.d.mts +2 -2
  103. package/dist/server.d.ts +2 -2
  104. package/dist/server.mjs +28 -28
  105. package/dist/version.cjs +2 -2
  106. package/dist/version.mjs +1 -1
  107. package/dist/vite.cjs +20 -19
  108. package/dist/vite.d.mts +8 -2
  109. package/dist/vite.d.ts +8 -2
  110. package/dist/vite.mjs +19 -18
  111. package/package.json +13 -3
  112. package/dist/analyzer-WGH6J2HN.cjs +0 -17
  113. package/dist/chunk-4QENVMG7.mjs +0 -34
  114. package/dist/{chunk-NEKO3HM2.cjs → chunk-4B6YJ5DS.cjs} +2 -2
  115. package/dist/{chunk-CA2HBLXP.mjs → chunk-4EEAPBNV.mjs} +3 -3
@@ -18,7 +18,7 @@ var _chunkHR5GU4UUcjs = require('./chunk-HR5GU4UU.cjs');
18
18
  var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
19
19
 
20
20
 
21
- var _chunk55UJGUBPcjs = require('./chunk-55UJGUBP.cjs');
21
+ var _chunkBBX4RPOVcjs = require('./chunk-BBX4RPOV.cjs');
22
22
 
23
23
 
24
24
 
@@ -599,7 +599,7 @@ async function resolveAPIContext(options) {
599
599
  config: options.config,
600
600
  configPath: options.configPath
601
601
  }));
602
- const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunk55UJGUBPcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
602
+ const docs = isResolvedDocsConfig(docsInput) ? docsInput : await _chunkBBX4RPOVcjs.resolveDocsConfig.call(void 0, docsInput, { root, srcDir });
603
603
  const guardedPaths = new Set(_nullishCoalesce(_optionalChain([runtimeConfig, 'optionalAccess', _25 => _25.guardedPaths]), () => ( [])));
604
604
  return {
605
605
  root,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readAliases,
3
3
  resolveFile
4
- } from "./chunk-FFWSER54.mjs";
4
+ } from "./chunk-CDZ55QRD.mjs";
5
5
  import {
6
6
  transformFarmServerFns
7
7
  } from "./chunk-GNZIAJGB.mjs";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunk5X5GJU5Acjs = require('./chunk-5X5GJU5A.cjs');
4
+ var _chunkGLNVLCUHcjs = require('./chunk-GLNVLCUH.cjs');
5
5
 
6
6
 
7
7
  var _chunkA4WWKG2Bcjs = require('./chunk-A4WWKG2B.cjs');
@@ -815,7 +815,7 @@ async function generateFarmTypeArtifacts(options) {
815
815
  renderer: options.renderer,
816
816
  sourceRoots
817
817
  };
818
- unifiedSections.push(await _chunk5X5GJU5Acjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
818
+ unifiedSections.push(await _chunkGLNVLCUHcjs.createRouteTypeDeclarations.call(void 0, routeOptions, unifiedTypesPath));
819
819
  result.routeTypesPath = unifiedTypesPath;
820
820
  } else if (shouldGenerateRoutes) {
821
821
  const routeOptions = {
@@ -830,11 +830,11 @@ async function generateFarmTypeArtifacts(options) {
830
830
  };
831
831
  if (options.check) {
832
832
  const routeTypesPath = resolveGeneratedPath(root, srcDir, options.routeTypesOutFile);
833
- const content = await _chunk5X5GJU5Acjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
833
+ const content = await _chunkGLNVLCUHcjs.createRouteTypeDeclarations.call(void 0, routeOptions, routeTypesPath);
834
834
  checkGeneratedFile(routeTypesPath, content, result.stalePaths);
835
835
  result.routeTypesPath = routeTypesPath;
836
836
  } else {
837
- result.routeTypesPath = await _chunk5X5GJU5Acjs.generateRouteTypes.call(void 0, routeOptions);
837
+ result.routeTypesPath = await _chunkGLNVLCUHcjs.generateRouteTypes.call(void 0, routeOptions);
838
838
  }
839
839
  }
840
840
  if (shouldGenerateApi) {
@@ -5,7 +5,7 @@ import {
5
5
  createFarmRendererHookError,
6
6
  readFarmRendererHydration,
7
7
  resolveFarmComponentExtensions
8
- } from "./chunk-RGTZAM6Y.mjs";
8
+ } from "./chunk-BCCCPFHQ.mjs";
9
9
  import {
10
10
  parseRouteSlotFile
11
11
  } from "./chunk-CYRO3WP4.mjs";
@@ -0,0 +1,98 @@
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
+
3
+ var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
4
+
5
+
6
+
7
+
8
+
9
+ var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
10
+
11
+
12
+ var _chunk3BIASUGRcjs = require('./chunk-3BIASUGR.cjs');
13
+
14
+ // src/renderer-islands.ts
15
+ var _server = require('@farm.js/islx/islands/server');
16
+ var CLIENT_ATTRIBUTE = "client:";
17
+ var responses = /* @__PURE__ */ new WeakMap();
18
+ var detached = 0;
19
+ function currentResponse() {
20
+ const request = _chunk3BIASUGRcjs._peekCurrentRequest.call(void 0, );
21
+ if (!request) return void 0;
22
+ let response = responses.get(request);
23
+ if (!response) responses.set(request, response = { next: 0, sent: /* @__PURE__ */ new Set() });
24
+ return response;
25
+ }
26
+ function islandName(reference) {
27
+ return `${reference.export} (${reference.src})`;
28
+ }
29
+ function readClientAttributes(props, reference) {
30
+ const rest = {};
31
+ let strategy;
32
+ for (const [key, value] of Object.entries(props)) {
33
+ if (!key.startsWith(CLIENT_ATTRIBUTE)) {
34
+ rest[key] = value;
35
+ continue;
36
+ }
37
+ if (value === void 0) continue;
38
+ const name = key.slice(CLIENT_ATTRIBUTE.length);
39
+ if (!_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, name)) {
40
+ throw new TypeError(
41
+ `\`${key}\` on ${islandName(reference)} is not an island strategy. Use \`client:load\`, \`client:idle\`, \`client:visible\` or \`client:interaction\`.`
42
+ );
43
+ }
44
+ if (value !== true && value !== "") {
45
+ throw new TypeError(
46
+ `\`${key}\` on ${islandName(reference)} takes no value. Write \`${key}\` alone.`
47
+ );
48
+ }
49
+ if (strategy) {
50
+ throw new TypeError(
51
+ `${islandName(reference)} has two strategies, \`client:${strategy}\` and \`${key}\`. Keep one.`
52
+ );
53
+ }
54
+ strategy = name;
55
+ }
56
+ return { props: rest, strategy };
57
+ }
58
+ var reported = /* @__PURE__ */ new Set();
59
+ function resolveFarmIsland(props, reference) {
60
+ const { props: islandProps, strategy } = readClientAttributes(props, reference);
61
+ const response = currentResponse();
62
+ const id = response ? `fi${response.next++}` : `fi-${detached++}`;
63
+ try {
64
+ const parts = _server.resolveIslandMarkup.call(void 0, {
65
+ src: reference.src,
66
+ export: reference.export,
67
+ strategy: _nullishCoalesce(_nullishCoalesce(strategy, () => ( reference.strategy)), () => ( "load")),
68
+ id,
69
+ props: islandProps,
70
+ sent: _optionalChain([response, 'optionalAccess', _ => _.sent])
71
+ });
72
+ return {
73
+ props: islandProps,
74
+ values: parts.values,
75
+ element: parts.element,
76
+ script: parts.script
77
+ };
78
+ } catch (error) {
79
+ const message = error instanceof Error ? error.message : String(error);
80
+ const key = `${reference.src}#${reference.export}:${message}`;
81
+ if (!reported.has(key)) {
82
+ reported.add(key);
83
+ console.warn(
84
+ `[Farm.js] ${message}. The server-rendered component was preserved without client hydration.`
85
+ );
86
+ }
87
+ return void 0;
88
+ }
89
+ }
90
+ function usesFarmRendererIslands(config) {
91
+ const renderer = _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, config.renderer);
92
+ return !_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && _chunk3OKSEJ33cjs.getFarmRendererCapabilities.call(void 0, renderer).islands && _optionalChain([config, 'access', _2 => _2.experimental, 'optionalAccess', _3 => _3.isolatedClientHydration]) === "enabled" && _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _4 => _4.experimental, 'optionalAccess', _5 => _5.serverComponents])) === void 0;
93
+ }
94
+
95
+
96
+
97
+
98
+ exports.resolveFarmIsland = resolveFarmIsland; exports.usesFarmRendererIslands = usesFarmRendererIslands;
@@ -1,18 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/server-components-mode.ts
2
- function resolveFarmServerComponentsMode(value) {
3
- if (value === void 0 || value === null || value === false) return void 0;
4
- if (value === true) return "islands";
5
- const mode = typeof value === "object" ? value.mode : void 0;
6
- if (mode === "rsc" || mode === "islands") return mode;
7
- throw new TypeError(
8
- 'experimental.serverComponents must be true, false, { mode: "rsc" } or { mode: "islands" }.'
9
- );
10
- }
11
- function isExplicitFarmServerComponentsMode(value) {
12
- return typeof value === "object" && value !== null;
13
- }
14
-
15
- // src/utils/source-dir.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/utils/source-dir.ts
16
2
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
17
3
  var FARM_PROJECT_SOURCE_DIRS = /* @__PURE__ */ Symbol.for("farm.projectSourceDirs");
18
4
  function getProjectSourceDirs() {
@@ -29,6 +15,4 @@ function getFarmProjectSourceDir(root) {
29
15
 
30
16
 
31
17
 
32
-
33
-
34
- exports.resolveFarmServerComponentsMode = resolveFarmServerComponentsMode; exports.isExplicitFarmServerComponentsMode = isExplicitFarmServerComponentsMode; exports.setFarmProjectSourceDir = setFarmProjectSourceDir; exports.getFarmProjectSourceDir = getFarmProjectSourceDir;
18
+ exports.setFarmProjectSourceDir = setFarmProjectSourceDir; exports.getFarmProjectSourceDir = getFarmProjectSourceDir;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isExplicitFarmServerComponentsMode,
3
3
  resolveFarmServerComponentsMode
4
- } from "./chunk-4QENVMG7.mjs";
4
+ } from "./chunk-BCCCPFHQ.mjs";
5
5
  import {
6
6
  logger
7
7
  } from "./chunk-U6GMCDRS.mjs";
@@ -7,8 +7,7 @@ var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
7
7
  var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
8
8
 
9
9
 
10
-
11
- var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
10
+ var _chunkMNUYXZV7cjs = require('./chunk-MNUYXZV7.cjs');
12
11
 
13
12
 
14
13
  var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
@@ -17,7 +16,8 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
17
16
 
18
17
 
19
18
 
20
- var _chunkNGTZHWBGcjs = require('./chunk-NGTZHWBG.cjs');
19
+
20
+ var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
21
21
 
22
22
 
23
23
 
@@ -28,7 +28,7 @@ var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
28
28
  var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
29
29
 
30
30
 
31
- var _chunk3CZ4MJHWcjs = require('./chunk-3CZ4MJHW.cjs');
31
+ var _chunk3HWNYLQVcjs = require('./chunk-3HWNYLQV.cjs');
32
32
 
33
33
  // src/environment-vite.ts
34
34
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -863,6 +863,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
863
863
  var IMPORT_SPECIFIER = /(?:\bfrom\s*|\bimport\s*\(?\s*)["']([^"'./][^"']*)["']/g;
864
864
  var STYLESHEET_IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["'][^"']+\.(?:css|scss|sass|less|styl)["']/;
865
865
  var MAX_SCANNED_FILES = 2e3;
866
+ var FARM_FONT_MODULE = "@farm.js/core/font";
866
867
  var packageScans = /* @__PURE__ */ new Map();
867
868
  var PACKAGE_SCAN_CACHE_SCHEMA = 1;
868
869
  var packageScanStamps = /* @__PURE__ */ new Map();
@@ -885,7 +886,7 @@ function usePackageScanCacheFile(file) {
885
886
  const stored = /* @__PURE__ */ new Map();
886
887
  try {
887
888
  const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
888
- if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunk3CZ4MJHWcjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
889
+ if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunk3HWNYLQVcjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
889
890
  for (const [directory, scan] of Object.entries(value.scans)) {
890
891
  if (isStoredPackageScan(scan)) stored.set(directory, scan);
891
892
  }
@@ -914,7 +915,7 @@ function persistPackageScanCache() {
914
915
  _fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
915
916
  _fs2.default.writeFileSync(
916
917
  temporary,
917
- JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunk3CZ4MJHWcjs.FARM_VERSION, scans })
918
+ JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunk3HWNYLQVcjs.FARM_VERSION, scans })
918
919
  );
919
920
  _fs2.default.renameSync(temporary, cache2.file);
920
921
  cache2.dirty = false;
@@ -987,7 +988,10 @@ function findFarmServerBundledPackage(importer, specifier) {
987
988
  } catch (e17) {
988
989
  return null;
989
990
  }
990
- return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
991
+ const scan = scanPackage(directory);
992
+ if (scan.imports.has(FARM_FONT_MODULE))
993
+ return { name: parsed.name, prebundle: false, fonts: true };
994
+ return scan.stylesheets ? { name: parsed.name, prebundle: false } : null;
991
995
  }
992
996
  function isSelfContainedPackage(manifest, importer) {
993
997
  if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
@@ -2214,7 +2218,7 @@ var PackageClientBoundaryCache = class {
2214
2218
  }
2215
2219
  const contents = JSON.stringify({
2216
2220
  schema: SCHEMA_VERSION,
2217
- farm: _chunk3CZ4MJHWcjs.FARM_VERSION,
2221
+ farm: _chunk3HWNYLQVcjs.FARM_VERSION,
2218
2222
  paths,
2219
2223
  entries
2220
2224
  });
@@ -2254,7 +2258,7 @@ function readStoredCache(file) {
2254
2258
  } catch (e37) {
2255
2259
  return null;
2256
2260
  }
2257
- if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunk3CZ4MJHWcjs.FARM_VERSION) {
2261
+ if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunk3HWNYLQVcjs.FARM_VERSION) {
2258
2262
  return null;
2259
2263
  }
2260
2264
  const { paths, entries } = value;
@@ -2265,7 +2269,7 @@ function readStoredCache(file) {
2265
2269
  const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
2266
2270
  if (usable.length > 0) valid[key] = usable;
2267
2271
  }
2268
- return { schema: SCHEMA_VERSION, farm: _chunk3CZ4MJHWcjs.FARM_VERSION, paths, entries: valid };
2272
+ return { schema: SCHEMA_VERSION, farm: _chunk3HWNYLQVcjs.FARM_VERSION, paths, entries: valid };
2269
2273
  }
2270
2274
  function isRecord(value) {
2271
2275
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -2413,7 +2417,7 @@ function readOwnHydration(scope, content, file) {
2413
2417
  try {
2414
2418
  value = scope.renderer.hydration.resolve(content, file);
2415
2419
  } catch (error) {
2416
- throw _chunkNGTZHWBGcjs.createFarmRendererHookError.call(void 0,
2420
+ throw _chunk3OKSEJ33cjs.createFarmRendererHookError.call(void 0,
2417
2421
  `${where} threw: ${error instanceof Error ? error.message : String(error)}`,
2418
2422
  error
2419
2423
  );
@@ -2424,7 +2428,7 @@ function readOwnHydration(scope, content, file) {
2424
2428
  `${where} returned ${JSON.stringify(value)}. Return \`{ hydrate?, strategy? }\`, or nothing to leave the file to Farm.`
2425
2429
  );
2426
2430
  }
2427
- return _chunkNGTZHWBGcjs.readFarmRendererHydration.call(void 0, value, where);
2431
+ return _chunk3OKSEJ33cjs.readFarmRendererHydration.call(void 0, value, where);
2428
2432
  }
2429
2433
 
2430
2434
  // src/utils/client-component.ts
@@ -2524,7 +2528,7 @@ function resolveModuleSourcePath(modulePath, root) {
2524
2528
  return null;
2525
2529
  }
2526
2530
  function getFarmClientHydrationPlanOptions(renderer, hasUnsupportedIntegrationProvider) {
2527
- return { asyncOwnerIslands: _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
2531
+ return { asyncOwnerIslands: _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
2528
2532
  }
2529
2533
  function describeSuppressedAsyncHydration(subject, reason) {
2530
2534
  const remediation = reason ? "Fix the reason above, or render the interactive UI from a synchronous owner." : 'Move the interactive UI into an eligible "use client" boundary, or render it from a synchronous owner.';
@@ -3940,7 +3944,7 @@ function getProjectImportAliases(projectRoot) {
3940
3944
  return "-";
3941
3945
  }
3942
3946
  }).join(":");
3943
- const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
3947
+ const sourceDir = _chunkMNUYXZV7cjs.getFarmProjectSourceDir.call(void 0, projectRoot);
3944
3948
  const cacheStamp = `${stamp}:${sourceDir}`;
3945
3949
  const cached = projectImportAliasCache.get(projectRoot);
3946
3950
  if (_optionalChain([cached, 'optionalAccess', _241 => _241.stamp]) === cacheStamp) return cached.aliases;
@@ -4341,6 +4345,11 @@ function resolveFarmClientOptimizeDeps(directory, root) {
4341
4345
  const exclude = /* @__PURE__ */ new Set();
4342
4346
  const imports = scanFarmPackageImports(directory, root);
4343
4347
  for (const specifier of imports.client) {
4348
+ const fonts = findFarmServerBundledPackage(importer, specifier);
4349
+ if (_optionalChain([fonts, 'optionalAccess', _260 => _260.fonts])) {
4350
+ exclude.add(fonts.name);
4351
+ continue;
4352
+ }
4344
4353
  const manifest = findFarmPackageManifest(importer, specifier);
4345
4354
  if (manifest && farmReactServerBuildReachesClientModules(importer, specifier, imports.server.has(specifier))) {
4346
4355
  exclude.add(manifest.name);
@@ -4406,20 +4415,20 @@ function transformEnvironmentFunctions(options) {
4406
4415
  function farmEnvironmentFunctionsPlugin(options = {}) {
4407
4416
  let routesFiles = /* @__PURE__ */ new Set();
4408
4417
  const componentExtensions = new Set(
4409
- _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, options.renderer || void 0)
4418
+ _chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, options.renderer || void 0)
4410
4419
  );
4411
4420
  let farmApi;
4412
4421
  let isBuild = false;
4413
4422
  let projectRoot = process.cwd();
4414
4423
  let sources;
4415
4424
  const routeSourceFiles = () => {
4416
- const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _260 => _260.getProgrammaticClientRoutes, 'call', _261 => _261()]);
4417
- if (_optionalChain([sources, 'optionalAccess', _262 => _262.for]) !== clientRoutes || !sources) {
4425
+ const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _261 => _261.getProgrammaticClientRoutes, 'call', _262 => _262()]);
4426
+ if (_optionalChain([sources, 'optionalAccess', _263 => _263.for]) !== clientRoutes || !sources) {
4418
4427
  sources = {
4419
4428
  for: clientRoutes,
4420
4429
  files: /* @__PURE__ */ new Set([
4421
4430
  ...routesFiles,
4422
- ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _263 => _263.routeSourceFiles]), () => ( []))].map(resolvedFile)
4431
+ ...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _264 => _264.routeSourceFiles]), () => ( []))].map(resolvedFile)
4423
4432
  ])
4424
4433
  };
4425
4434
  }
@@ -4440,7 +4449,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4440
4449
  configResolved(config) {
4441
4450
  isBuild = config.command === "build";
4442
4451
  projectRoot = config.root;
4443
- farmApi = _optionalChain([config, 'access', _264 => _264.plugins, 'access', _265 => _265.find, 'call', _266 => _266((plugin) => plugin.name === "farm"), 'optionalAccess', _267 => _267.api]);
4452
+ farmApi = _optionalChain([config, 'access', _265 => _265.plugins, 'access', _266 => _266.find, 'call', _267 => _267((plugin) => plugin.name === "farm"), 'optionalAccess', _268 => _268.api]);
4444
4453
  sources = void 0;
4445
4454
  routesFiles = new Set(
4446
4455
  _chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
@@ -4453,7 +4462,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4453
4462
  transform(code, id, transformOptions) {
4454
4463
  const environment = resolveBuildEnvironment(
4455
4464
  this,
4456
- _optionalChain([transformOptions, 'optionalAccess', _268 => _268.ssr])
4465
+ _optionalChain([transformOptions, 'optionalAccess', _269 => _269.ssr])
4457
4466
  );
4458
4467
  const parse3 = (source) => this.parse(source);
4459
4468
  const result = transformEnvironmentFunctions({
@@ -4466,7 +4475,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4466
4475
  if (environment === "client" && !isBuild && !_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
4467
4476
  this.error(routeSourceError(moduleFile(id)));
4468
4477
  }
4469
- if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _269 => _269.experimental, 'optionalAccess', _270 => _270.serverComponents])) === "islands" && isApplicationScript(id)) {
4478
+ if (environment === "server" && _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _270 => _270.experimental, 'optionalAccess', _271 => _271.serverComponents])) === "islands" && isApplicationScript(id)) {
4470
4479
  const file = id.split("?", 1)[0];
4471
4480
  const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
4472
4481
  const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
@@ -4500,7 +4509,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4500
4509
  for (const id of this.getModuleIds()) {
4501
4510
  if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4502
4511
  const chain = findClientNodeBuiltinChain(id, (moduleId) => {
4503
- return _optionalChain([this, 'access', _271 => _271.getModuleInfo, 'call', _272 => _272(moduleId), 'optionalAccess', _273 => _273.importedIds]);
4512
+ return _optionalChain([this, 'access', _272 => _272.getModuleInfo, 'call', _273 => _273(moduleId), 'optionalAccess', _274 => _274.importedIds]);
4504
4513
  });
4505
4514
  if (chain) {
4506
4515
  this.error(
@@ -4518,8 +4527,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
4518
4527
  }
4519
4528
  if (!forbidden.has(moduleFile(id))) continue;
4520
4529
  const info = this.getModuleInfo(id);
4521
- if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _274 => _274.code]))) continue;
4522
- this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _275 => _275.importers, 'access', _276 => _276.map, 'call', _277 => _277(moduleFile)])));
4530
+ if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _275 => _275.code]))) continue;
4531
+ this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _276 => _276.importers, 'access', _277 => _277.map, 'call', _278 => _278(moduleFile)])));
4523
4532
  }
4524
4533
  }
4525
4534
  };
@@ -4538,8 +4547,8 @@ function resolvedFile(filePath) {
4538
4547
  }
4539
4548
  }
4540
4549
  function resolveBuildEnvironment(context, ssr) {
4541
- if (_optionalChain([context, 'access', _278 => _278.environment, 'optionalAccess', _279 => _279.name]) === "client") return "client";
4542
- if (_optionalChain([context, 'access', _280 => _280.environment, 'optionalAccess', _281 => _281.name]) === "rsc" || _optionalChain([context, 'access', _282 => _282.environment, 'optionalAccess', _283 => _283.name]) === "ssr") {
4550
+ if (_optionalChain([context, 'access', _279 => _279.environment, 'optionalAccess', _280 => _280.name]) === "client") return "client";
4551
+ if (_optionalChain([context, 'access', _281 => _281.environment, 'optionalAccess', _282 => _282.name]) === "rsc" || _optionalChain([context, 'access', _283 => _283.environment, 'optionalAccess', _284 => _284.name]) === "ssr") {
4543
4552
  return "server";
4544
4553
  }
4545
4554
  return ssr ? "server" : "client";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-NKVBWPXR.mjs";
3
+ } from "./chunk-XIXAUXV3.mjs";
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
18
18
  var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
19
19
 
20
20
 
21
- var _chunk3CZ4MJHWcjs = require('./chunk-3CZ4MJHW.cjs');
21
+ var _chunk3HWNYLQVcjs = require('./chunk-3HWNYLQV.cjs');
22
22
 
23
23
  // src/mobile/analyzer.ts
24
24
  var _crypto = require('crypto');
25
25
  var _fs = require('fs');
26
26
  var _promises = require('fs/promises');
27
27
  var _path = require('path'); var path = _interopRequireWildcard(_path);
28
- var ANALYZER_VERSION = `8:${_chunk3CZ4MJHWcjs.FARM_VERSION}`;
28
+ var ANALYZER_VERSION = `8:${_chunk3HWNYLQVcjs.FARM_VERSION}`;
29
29
  var INTRINSIC_KINDS = {};
30
30
  for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
31
31
  INTRINSIC_KINDS[tag] = "View";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunk3DAJXBSLcjs = require('./chunk-3DAJXBSL.cjs');
4
+ var _chunkQ7GB3I4Ocjs = require('./chunk-Q7GB3I4O.cjs');
5
5
 
6
6
 
7
7
  var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
@@ -64,7 +64,7 @@ function findFarmNativeScreenFiles(appDirs) {
64
64
  }
65
65
  function collectFarmNativeServerFns(options) {
66
66
  const { root, srcDir } = options;
67
- const aliases = _chunk3DAJXBSLcjs.readAliases.call(void 0, root, srcDir);
67
+ const aliases = _chunkQ7GB3I4Ocjs.readAliases.call(void 0, root, srcDir);
68
68
  const seen = /* @__PURE__ */ new Set();
69
69
  const found = /* @__PURE__ */ new Map();
70
70
  const queue = [...options.entries];
@@ -98,7 +98,7 @@ function collectFarmNativeServerFns(options) {
98
98
  }
99
99
  }
100
100
  for (const candidate of _nullishCoalesce(candidates, () => ( []))) {
101
- const resolved = _chunk3DAJXBSLcjs.resolveFile.call(void 0, candidate);
101
+ const resolved = _chunkQ7GB3I4Ocjs.resolveFile.call(void 0, candidate);
102
102
  if (resolved && SCRIPT.test(resolved) && !resolved.includes(`${_path2.default.sep}node_modules${_path2.default.sep}`)) {
103
103
  queue.push(resolved);
104
104
  break;
@@ -0,0 +1,18 @@
1
+ // src/utils/source-dir.ts
2
+ import path from "path";
3
+ var FARM_PROJECT_SOURCE_DIRS = /* @__PURE__ */ Symbol.for("farm.projectSourceDirs");
4
+ function getProjectSourceDirs() {
5
+ const globalState = globalThis;
6
+ return globalState[FARM_PROJECT_SOURCE_DIRS] ?? (globalState[FARM_PROJECT_SOURCE_DIRS] = /* @__PURE__ */ new Map());
7
+ }
8
+ function setFarmProjectSourceDir(root, srcDir) {
9
+ getProjectSourceDirs().set(path.resolve(root), srcDir);
10
+ }
11
+ function getFarmProjectSourceDir(root) {
12
+ return getProjectSourceDirs().get(path.resolve(root)) ?? "src";
13
+ }
14
+
15
+ export {
16
+ setFarmProjectSourceDir,
17
+ getFarmProjectSourceDir
18
+ };
@@ -0,0 +1,98 @@
1
+ import {
2
+ isFarmIslandStrategy
3
+ } from "./chunk-S32PDOLO.mjs";
4
+ import {
5
+ getFarmRendererCapabilities,
6
+ isReactRenderer,
7
+ resolveFarmRenderer,
8
+ resolveFarmServerComponentsMode
9
+ } from "./chunk-BCCCPFHQ.mjs";
10
+ import {
11
+ _peekCurrentRequest
12
+ } from "./chunk-VIXTAVEA.mjs";
13
+
14
+ // src/renderer-islands.ts
15
+ import { resolveIslandMarkup } from "@farm.js/islx/islands/server";
16
+ var CLIENT_ATTRIBUTE = "client:";
17
+ var responses = /* @__PURE__ */ new WeakMap();
18
+ var detached = 0;
19
+ function currentResponse() {
20
+ const request = _peekCurrentRequest();
21
+ if (!request) return void 0;
22
+ let response = responses.get(request);
23
+ if (!response) responses.set(request, response = { next: 0, sent: /* @__PURE__ */ new Set() });
24
+ return response;
25
+ }
26
+ function islandName(reference) {
27
+ return `${reference.export} (${reference.src})`;
28
+ }
29
+ function readClientAttributes(props, reference) {
30
+ const rest = {};
31
+ let strategy;
32
+ for (const [key, value] of Object.entries(props)) {
33
+ if (!key.startsWith(CLIENT_ATTRIBUTE)) {
34
+ rest[key] = value;
35
+ continue;
36
+ }
37
+ if (value === void 0) continue;
38
+ const name = key.slice(CLIENT_ATTRIBUTE.length);
39
+ if (!isFarmIslandStrategy(name)) {
40
+ throw new TypeError(
41
+ `\`${key}\` on ${islandName(reference)} is not an island strategy. Use \`client:load\`, \`client:idle\`, \`client:visible\` or \`client:interaction\`.`
42
+ );
43
+ }
44
+ if (value !== true && value !== "") {
45
+ throw new TypeError(
46
+ `\`${key}\` on ${islandName(reference)} takes no value. Write \`${key}\` alone.`
47
+ );
48
+ }
49
+ if (strategy) {
50
+ throw new TypeError(
51
+ `${islandName(reference)} has two strategies, \`client:${strategy}\` and \`${key}\`. Keep one.`
52
+ );
53
+ }
54
+ strategy = name;
55
+ }
56
+ return { props: rest, strategy };
57
+ }
58
+ var reported = /* @__PURE__ */ new Set();
59
+ function resolveFarmIsland(props, reference) {
60
+ const { props: islandProps, strategy } = readClientAttributes(props, reference);
61
+ const response = currentResponse();
62
+ const id = response ? `fi${response.next++}` : `fi-${detached++}`;
63
+ try {
64
+ const parts = resolveIslandMarkup({
65
+ src: reference.src,
66
+ export: reference.export,
67
+ strategy: strategy ?? reference.strategy ?? "load",
68
+ id,
69
+ props: islandProps,
70
+ sent: response?.sent
71
+ });
72
+ return {
73
+ props: islandProps,
74
+ values: parts.values,
75
+ element: parts.element,
76
+ script: parts.script
77
+ };
78
+ } catch (error) {
79
+ const message = error instanceof Error ? error.message : String(error);
80
+ const key = `${reference.src}#${reference.export}:${message}`;
81
+ if (!reported.has(key)) {
82
+ reported.add(key);
83
+ console.warn(
84
+ `[Farm.js] ${message}. The server-rendered component was preserved without client hydration.`
85
+ );
86
+ }
87
+ return void 0;
88
+ }
89
+ }
90
+ function usesFarmRendererIslands(config) {
91
+ const renderer = resolveFarmRenderer(config.renderer);
92
+ return !isReactRenderer(renderer) && getFarmRendererCapabilities(renderer).islands && config.experimental?.isolatedClientHydration === "enabled" && resolveFarmServerComponentsMode(config.experimental?.serverComponents) === void 0;
93
+ }
94
+
95
+ export {
96
+ resolveFarmIsland,
97
+ usesFarmRendererIslands
98
+ };
@@ -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 _chunkWCSBYQOTcjs = require('./chunk-WCSBYQOT.cjs');
3
+ var _chunkTOUC6BR3cjs = require('./chunk-TOUC6BR3.cjs');
4
4
 
5
5
 
6
6
 
@@ -354,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
354
354
  id: uuid(),
355
355
  requestId: metadata.id,
356
356
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
357
- route: routeTemplate(_chunkWCSBYQOTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
357
+ route: routeTemplate(_chunkTOUC6BR3cjs.getFarmRouteLabel.call(void 0, metadata.route)),
358
358
  ...metadata.path ? { path: metadata.path } : {},
359
359
  agent: metadata.agent,
360
360
  kind: "request",
@@ -410,7 +410,7 @@ function toolEvent(metadata, event, payloads) {
410
410
  id: uuid(),
411
411
  requestId: metadata.id,
412
412
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
413
- route: routeTemplate(_chunkWCSBYQOTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
413
+ route: routeTemplate(_chunkTOUC6BR3cjs.getFarmRouteLabel.call(void 0, metadata.route)),
414
414
  ...metadata.path ? { path: metadata.path } : {},
415
415
  agent: metadata.agent,
416
416
  kind: "mcp.tool",
@@ -496,7 +496,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
496
496
  exporter.enqueue({
497
497
  id: uuid(),
498
498
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
499
- route: routeTemplate(_chunkWCSBYQOTcjs.getFarmRouteLabel.call(void 0, route)),
499
+ route: routeTemplate(_chunkTOUC6BR3cjs.getFarmRouteLabel.call(void 0, route)),
500
500
  ...path ? { path } : {},
501
501
  agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
502
502
  kind: "mcp.tool",