@farm.js/core 0.1.87 → 0.2.0-beta.0

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 (142) hide show
  1. package/dist/analyzer-B2TRJT3B.cjs +17 -0
  2. package/dist/{analyzer-W4EB7DHL.mjs → analyzer-PWHYGER6.mjs} +2 -2
  3. package/dist/api/route-manager.cjs +3 -3
  4. package/dist/api/route-manager.mjs +2 -2
  5. package/dist/api.cjs +4 -4
  6. package/dist/api.mjs +3 -3
  7. package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
  8. package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
  9. package/dist/{chunk-WSQ3S3NV.cjs → chunk-3MY6TNNE.cjs} +13 -12
  10. package/dist/{chunk-A4WWKG2B.cjs → chunk-5ZWXTIGE.cjs} +2 -2
  11. package/dist/{chunk-HYL372GW.cjs → chunk-6266WH6X.cjs} +1 -1
  12. package/dist/chunk-65LZRVCZ.mjs +18 -0
  13. package/dist/{chunk-ZCX2XJPY.cjs → chunk-7LBNWL3L.cjs} +2 -2
  14. package/dist/{chunk-4FGTNYHE.mjs → chunk-BJHXFEAF.mjs} +2 -2
  15. package/dist/chunk-BQHIJOZM.cjs +13 -0
  16. package/dist/{chunk-VCZ4EM5K.cjs → chunk-CFLRUCN7.cjs} +143 -136
  17. package/dist/{chunk-IM422XKU.cjs → chunk-CNGGEHXY.cjs} +2 -2
  18. package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
  19. package/dist/{chunk-XMVZXZ32.cjs → chunk-ERV422FO.cjs} +2 -2
  20. package/dist/{chunk-33WR5XV5.cjs → chunk-FEWCWBOF.cjs} +4 -4
  21. package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
  22. package/dist/{chunk-HQ2VAJLW.mjs → chunk-GV5D5EM6.mjs} +1 -1
  23. package/dist/{chunk-6MZSTPD2.mjs → chunk-H47EH24T.mjs} +1 -1
  24. package/dist/{chunk-OBVBII5K.cjs → chunk-HU4R2PPW.cjs} +2 -2
  25. package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
  26. package/dist/{chunk-HFRG2IQS.mjs → chunk-JDO3X7RB.mjs} +5 -4
  27. package/dist/{chunk-XFUPWRKT.cjs → chunk-JGUMFTZT.cjs} +4 -4
  28. package/dist/chunk-JIGWHFA5.mjs +32 -0
  29. package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
  30. package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
  31. package/dist/{chunk-K5FLQJW5.mjs → chunk-L6ZL35ZJ.mjs} +6 -4
  32. package/dist/{chunk-Q73LRKLP.mjs → chunk-LUGQUU4S.mjs} +1 -1
  33. package/dist/{chunk-LIWVPE72.mjs → chunk-M4CNAZMS.mjs} +23 -16
  34. package/dist/{chunk-QLRI2BX5.mjs → chunk-MM4U2NNI.mjs} +4 -4
  35. package/dist/{chunk-5D73SKF3.mjs → chunk-MRULVIH3.mjs} +1 -1
  36. package/dist/{chunk-LBJOHMTB.mjs → chunk-MZPPT5NA.mjs} +1 -1
  37. package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
  38. package/dist/{chunk-U3A46QFD.cjs → chunk-PA3VZNWU.cjs} +6 -6
  39. package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
  40. package/dist/{chunk-TI4BZV6M.cjs → chunk-PQ6DBVJ2.cjs} +53 -53
  41. package/dist/chunk-PTAGDZ7I.mjs +13 -0
  42. package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
  43. package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
  44. package/dist/chunk-QZUCVJZJ.cjs +18 -0
  45. package/dist/{chunk-EZYNIADW.mjs → chunk-SCOKBXHS.mjs} +45 -29
  46. package/dist/{chunk-CXHVRHM2.cjs → chunk-SG5RFGV6.cjs} +2 -2
  47. package/dist/{chunk-VCI776NG.cjs → chunk-SUACCCZG.cjs} +12 -10
  48. package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
  49. package/dist/{chunk-SDNYULFS.cjs → chunk-TQFIZRON.cjs} +157 -141
  50. package/dist/{chunk-7BNVUIGL.cjs → chunk-VMGQOP7X.cjs} +2 -2
  51. package/dist/{chunk-4SJ22WTT.mjs → chunk-W3ZBLFLU.mjs} +1 -1
  52. package/dist/{chunk-26HESRBL.mjs → chunk-WOTAU3BN.mjs} +1 -1
  53. package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
  54. package/dist/{chunk-3F55K4MC.mjs → chunk-WPB6HJC7.mjs} +1 -1
  55. package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
  56. package/dist/{chunk-O7K4HMAQ.mjs → chunk-XJJQAFZX.mjs} +1 -1
  57. package/dist/{chunk-RGYS5OPL.cjs → chunk-XRYLMTYF.cjs} +3 -3
  58. package/dist/{chunk-QSDIJ45N.mjs → chunk-YCHIR3X6.mjs} +1 -1
  59. package/dist/chunk-YIGUFJMR.cjs +32 -0
  60. package/dist/{chunk-A2PPQ5LB.mjs → chunk-ZOD6EYWE.mjs} +1 -1
  61. package/dist/client.cjs +8 -6
  62. package/dist/client.d.mts +5 -5
  63. package/dist/client.d.ts +5 -5
  64. package/dist/client.mjs +7 -5
  65. package/dist/{devtools-GWJZPWIW.mjs → devtools-2CRVXV7E.mjs} +1 -1
  66. package/dist/{devtools-GPIKZ5AV.cjs → devtools-RL4AU5KD.cjs} +2 -2
  67. package/dist/docs.cjs +3 -3
  68. package/dist/docs.mjs +2 -2
  69. package/dist/environment/vite.cjs +3 -3
  70. package/dist/environment/vite.mjs +2 -2
  71. package/dist/i18n/client.cjs +11 -10
  72. package/dist/i18n/client.mjs +3 -2
  73. package/dist/index.cjs +30 -28
  74. package/dist/index.d.mts +4 -4
  75. package/dist/index.d.ts +4 -4
  76. package/dist/index.mjs +25 -23
  77. package/dist/internal/build-runtime.cjs +17 -17
  78. package/dist/internal/build-runtime.mjs +16 -16
  79. package/dist/internal/cli-runtime.cjs +5 -5
  80. package/dist/internal/cli-runtime.mjs +4 -4
  81. package/dist/internal/client-error-overlay.cjs +4 -4
  82. package/dist/internal/client-error-overlay.mjs +1 -1
  83. package/dist/internal/client-runtime.cjs +11 -12
  84. package/dist/internal/client-runtime.d.mts +6 -4
  85. package/dist/internal/client-runtime.d.ts +6 -4
  86. package/dist/internal/client-runtime.mjs +11 -12
  87. package/dist/internal/config-runtime.cjs +3 -3
  88. package/dist/internal/config-runtime.mjs +2 -2
  89. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  90. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  91. package/dist/internal/islands-boot.cjs +20 -15
  92. package/dist/internal/islands-boot.mjs +6 -1
  93. package/dist/internal/native-server-fns.cjs +4 -4
  94. package/dist/internal/native-server-fns.mjs +3 -3
  95. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  96. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  97. package/dist/internal/production-runtime.cjs +4 -4
  98. package/dist/internal/production-runtime.mjs +3 -3
  99. package/dist/internal/spa-router.cjs +4 -3
  100. package/dist/internal/spa-router.d.mts +1 -1
  101. package/dist/internal/spa-router.d.ts +1 -1
  102. package/dist/internal/spa-router.mjs +3 -2
  103. package/dist/{manager-PX4QN4HK.cjs → manager-D4DZRBRS.cjs} +4 -4
  104. package/dist/{manager-OMTC5FOJ.mjs → manager-PKPQGBAE.mjs} +3 -3
  105. package/dist/{navigation-delegate.d-ChfinbWB.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
  106. package/dist/{navigation-delegate.d-fMgELdAe.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
  107. package/dist/navigation.cjs +6 -5
  108. package/dist/navigation.d.mts +2 -2
  109. package/dist/navigation.d.ts +2 -2
  110. package/dist/navigation.mjs +5 -4
  111. package/dist/plugin.cjs +12 -12
  112. package/dist/plugin.mjs +11 -11
  113. package/dist/query/client.cjs +8 -7
  114. package/dist/query/client.mjs +3 -2
  115. package/dist/renderer-client.cjs +14 -13
  116. package/dist/renderer-client.d.mts +3 -3
  117. package/dist/renderer-client.d.ts +3 -3
  118. package/dist/renderer-client.mjs +5 -4
  119. package/dist/{router.d-D5Mp7bpO.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
  120. package/dist/{router.d-DrQ1QDFk.d.mts → router.d-YKVirmj4.d.mts} +1 -1
  121. package/dist/{rsc-pipeline-TQOSDWOU.cjs → rsc-pipeline-3DYC5ZXW.cjs} +3 -3
  122. package/dist/{rsc-pipeline-KLMQU3YP.mjs → rsc-pipeline-LRB4ZG6I.mjs} +2 -2
  123. package/dist/{runtime-BDPBO65S.mjs → runtime-3WJNNAAR.mjs} +2 -2
  124. package/dist/{runtime-CQSCRVZ7.cjs → runtime-CRFF32H6.cjs} +4 -4
  125. package/dist/server.cjs +47 -33
  126. package/dist/server.mjs +27 -13
  127. package/dist/{spa-router.d-CXgvy-7L.d.mts → spa-router.d-DGmropfK.d.mts} +3 -1
  128. package/dist/{spa-router.d-BXxoU3Cv.d.ts → spa-router.d-nE1jHNGt.d.ts} +3 -1
  129. package/dist/{store-core.d-D00BsbnO.d.ts → store-core.d-B5cwOd8g.d.ts} +2 -2
  130. package/dist/{store-core.d-CDbVAbTn.d.mts → store-core.d-C-gATBwd.d.mts} +2 -2
  131. package/dist/testing.cjs +2 -2
  132. package/dist/testing.mjs +2 -2
  133. package/dist/version.cjs +2 -2
  134. package/dist/version.mjs +1 -1
  135. package/dist/vite.cjs +12 -12
  136. package/dist/vite.mjs +11 -11
  137. package/package.json +3 -3
  138. package/dist/analyzer-LLU2Z6I4.cjs +0 -17
  139. package/dist/chunk-SBDWCDS6.cjs +0 -8
  140. package/dist/chunk-YX6AFPXC.mjs +0 -8
  141. /package/dist/{chunk-ALOFMAFA.mjs → chunk-BGEA4K7C.mjs} +0 -0
  142. /package/dist/{chunk-MZR22RAC.cjs → chunk-IRPXOTEN.cjs} +0 -0
@@ -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 _chunkHYL372GWcjs = require('./chunk-HYL372GW.cjs');
3
+ var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {
@@ -90,7 +90,7 @@ function createFarmProductionSiteReporter(options) {
90
90
  schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
91
91
  eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
92
92
  packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
93
- packageVersion: sanitizeDetail(_chunkHYL372GWcjs.FARM_VERSION, "unknown"),
93
+ packageVersion: sanitizeDetail(_chunk6266WH6Xcjs.FARM_VERSION, "unknown"),
94
94
  renderer: sanitizeDetail(options.renderer, "custom"),
95
95
  deployTarget: sanitizeDetail(options.deployTarget, "custom")
96
96
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  compiledFarmI18nMessages,
3
3
  getFarmI18nClientState
4
- } from "./chunk-FLMALEY2.mjs";
4
+ } from "./chunk-GGD57DJA.mjs";
5
5
 
6
6
  // src/i18n/client-runtime.ts
7
7
  import IntlMessageFormat from "intl-messageformat";
@@ -4,7 +4,7 @@
4
4
  var _chunkZSVFI7JMcjs = require('./chunk-ZSVFI7JM.cjs');
5
5
 
6
6
 
7
- var _chunkA4WWKG2Bcjs = require('./chunk-A4WWKG2B.cjs');
7
+ var _chunk5ZWXTIGEcjs = require('./chunk-5ZWXTIGE.cjs');
8
8
 
9
9
 
10
10
 
@@ -838,7 +838,7 @@ async function generateFarmTypeArtifacts(options) {
838
838
  }
839
839
  }
840
840
  if (shouldGenerateApi) {
841
- const generator = new (0, _chunkA4WWKG2Bcjs.APITypeGenerator)(appDirs);
841
+ const generator = new (0, _chunk5ZWXTIGEcjs.APITypeGenerator)(appDirs);
842
842
  const apiRoutes = generator.scanAPIRoutes();
843
843
  const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
844
844
  const pluginRoutes = _chunkVGVRGGP4cjs.resolvePluginRoutes.call(void 0,
@@ -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 _chunkXFUPWRKTcjs = require('./chunk-XFUPWRKT.cjs');
3
+ var _chunkJGUMFTZTcjs = require('./chunk-JGUMFTZT.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(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
357
+ route: routeTemplate(_chunkJGUMFTZTcjs.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(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
413
+ route: routeTemplate(_chunkJGUMFTZTcjs.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(_chunkXFUPWRKTcjs.getFarmRouteLabel.call(void 0, route)),
499
+ route: routeTemplate(_chunkJGUMFTZTcjs.getFarmRouteLabel.call(void 0, route)),
500
500
  ...path ? { path } : {},
501
501
  agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
502
502
  kind: "mcp.tool",
@@ -1,3 +1,6 @@
1
+ import {
2
+ resolveFarmNavigationURL
3
+ } from "./chunk-JIGWHFA5.mjs";
1
4
  import {
2
5
  createFarmLocaleCookie
3
6
  } from "./chunk-UJIBSFUE.mjs";
@@ -9,27 +12,6 @@ import {
9
12
  resolveFarmLocalePath
10
13
  } from "./chunk-4QBFYEDC.mjs";
11
14
 
12
- // src/client/navigation-url.ts
13
- var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
14
- function isFarmBlockedNavigationURL(url) {
15
- if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
16
- console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
17
- return true;
18
- }
19
- function isFarmScriptURL(href) {
20
- try {
21
- return new URL(href, "http://farm.invalid").protocol === "javascript:";
22
- } catch {
23
- return false;
24
- }
25
- }
26
- function isFarmExternalNavigationURL(url, currentOrigin) {
27
- return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
28
- }
29
- function resolveFarmNavigationURL(href, documentUrl) {
30
- return new URL(href, documentUrl);
31
- }
32
-
33
15
  // src/i18n/client-state.ts
34
16
  var listeners = /* @__PURE__ */ new Set();
35
17
  var compiledFarmI18nMessages = /* @__PURE__ */ new Map();
@@ -76,10 +58,6 @@ function rememberFarmLinkLocale(anchor) {
76
58
  }
77
59
 
78
60
  export {
79
- isFarmBlockedNavigationURL,
80
- isFarmScriptURL,
81
- isFarmExternalNavigationURL,
82
- resolveFarmNavigationURL,
83
61
  compiledFarmI18nMessages,
84
62
  getFarmI18nClientState,
85
63
  subscribeFarmI18n,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YFTGIHNC.mjs";
4
4
  import {
5
5
  isFarmAPIRouteFileName
6
- } from "./chunk-YX6AFPXC.mjs";
6
+ } from "./chunk-PTAGDZ7I.mjs";
7
7
  import {
8
8
  registerAPIRouteShape
9
9
  } from "./chunk-2LKUR5QJ.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  APITypeGenerator
3
- } from "./chunk-HQ2VAJLW.mjs";
3
+ } from "./chunk-GV5D5EM6.mjs";
4
4
  import {
5
5
  resolveRouteOpenAPIConfig
6
6
  } from "./chunk-NRWEY2CM.mjs";
@@ -1,6 +1,6 @@
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(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkA4WWKG2Bcjs = require('./chunk-A4WWKG2B.cjs');
3
+ var _chunk5ZWXTIGEcjs = require('./chunk-5ZWXTIGE.cjs');
4
4
 
5
5
 
6
6
  var _chunkVWIW47FWcjs = require('./chunk-VWIW47FW.cjs');
@@ -678,7 +678,7 @@ var OpenAPIManager = class {
678
678
  this.config = config;
679
679
  this.mountedRoutes = context.routes;
680
680
  this.generator = new OpenAPIGenerator(this.appDir, config, context);
681
- this.apiTypeGenerator = new (0, _chunkA4WWKG2Bcjs.APITypeGenerator)(appDirs);
681
+ this.apiTypeGenerator = new (0, _chunk5ZWXTIGEcjs.APITypeGenerator)(appDirs);
682
682
  }
683
683
  getRoutes() {
684
684
  if (!this.mountedRoutes) return this.apiTypeGenerator.scanAPIRoutes();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  useRouter
3
- } from "./chunk-VPGEYX5Y.mjs";
3
+ } from "./chunk-WX752VMN.mjs";
4
4
  import {
5
5
  getRouter
6
- } from "./chunk-PO5MZIWK.mjs";
6
+ } from "./chunk-QBXS4TNG.mjs";
7
7
  import {
8
8
  applyFarmBasePath
9
9
  } from "./chunk-SF3JB56B.mjs";
@@ -5,8 +5,9 @@ import {
5
5
  findProgrammaticRouteFilesInDir
6
6
  } from "./chunk-URBP6DLH.mjs";
7
7
  import {
8
+ hasPolyroutePlugin,
8
9
  isFarmAPIRouteFileName
9
- } from "./chunk-YX6AFPXC.mjs";
10
+ } from "./chunk-PTAGDZ7I.mjs";
10
11
  import {
11
12
  _runWithFarmI18nRequest
12
13
  } from "./chunk-O7JEFGUV.mjs";
@@ -137,7 +138,7 @@ var APIRouteManager = class _APIRouteManager {
137
138
  /**
138
139
  * Recursively find all route.ts files
139
140
  */
140
- findRouteFiles(dir) {
141
+ findRouteFiles(dir, polyroute = hasPolyroutePlugin(this.viteServer?.config?.plugins)) {
141
142
  const files = [];
142
143
  if (!fs.existsSync(dir)) {
143
144
  return files;
@@ -146,8 +147,8 @@ var APIRouteManager = class _APIRouteManager {
146
147
  for (const entry of entries) {
147
148
  const fullPath = path.join(dir, entry.name);
148
149
  if (entry.isDirectory()) {
149
- files.push(...this.findRouteFiles(fullPath));
150
- } else if (isFarmAPIRouteFileName(entry.name)) {
150
+ files.push(...this.findRouteFiles(fullPath, polyroute));
151
+ } else if (isFarmAPIRouteFileName(entry.name, polyroute)) {
151
152
  files.push(fullPath);
152
153
  }
153
154
  }
@@ -4,7 +4,7 @@
4
4
  var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
5
5
 
6
6
 
7
- var _chunkIM422XKUcjs = require('./chunk-IM422XKU.cjs');
7
+ var _chunkCNGGEHXYcjs = require('./chunk-CNGGEHXY.cjs');
8
8
 
9
9
 
10
10
  var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
@@ -29,7 +29,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
29
29
  var _chunk7Q7UB4TLcjs = require('./chunk-7Q7UB4TL.cjs');
30
30
 
31
31
 
32
- var _chunkHYL372GWcjs = require('./chunk-HYL372GW.cjs');
32
+ var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
33
33
 
34
34
 
35
35
  var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
@@ -288,7 +288,7 @@ function createFarmAppManifest(input, registered = []) {
288
288
  return {
289
289
  schemaVersion: 1,
290
290
  app: app ? {
291
- ...app.version ? { farm: _chunkHYL372GWcjs.FARM_VERSION } : {},
291
+ ...app.version ? { farm: _chunk6266WH6Xcjs.FARM_VERSION } : {},
292
292
  ...app.renderer ? { renderer: input.renderer } : {},
293
293
  basePath: input.basePath,
294
294
  ...app.build ? { build: input.build } : {}
@@ -319,7 +319,7 @@ function resolveFarmSiteUrl() {
319
319
  asUrl(read("RAILWAY_PUBLIC_DOMAIN"))
320
320
  ];
321
321
  for (const candidate of candidates) {
322
- const origin = candidate ? _chunkIM422XKUcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
322
+ const origin = candidate ? _chunkCNGGEHXYcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
323
323
  if (origin) return origin;
324
324
  }
325
325
  return null;
@@ -0,0 +1,32 @@
1
+ // src/client/navigation-url.ts
2
+ var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
3
+ function isFarmBlockedNavigationURL(url) {
4
+ if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
5
+ console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
6
+ return true;
7
+ }
8
+ function isFarmScriptURL(href) {
9
+ try {
10
+ return new URL(href, "http://farm.invalid").protocol === "javascript:";
11
+ } catch {
12
+ return false;
13
+ }
14
+ }
15
+ function isFarmSameDocumentFragment(href, currentHref) {
16
+ const fragment = href.indexOf("#");
17
+ return fragment >= 0 && href.slice(0, fragment) === currentHref.split("#", 1)[0];
18
+ }
19
+ function isFarmExternalNavigationURL(url, currentOrigin) {
20
+ return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
21
+ }
22
+ function resolveFarmNavigationURL(href, documentUrl) {
23
+ return new URL(href, documentUrl);
24
+ }
25
+
26
+ export {
27
+ isFarmBlockedNavigationURL,
28
+ isFarmScriptURL,
29
+ isFarmSameDocumentFragment,
30
+ isFarmExternalNavigationURL,
31
+ resolveFarmNavigationURL
32
+ };
@@ -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 _chunk2PJVEL56cjs = require('./chunk-2PJVEL56.cjs');
4
+ var _chunkPCAEJNQFcjs = require('./chunk-PCAEJNQF.cjs');
5
5
 
6
6
  // src/i18n/client-runtime.ts
7
7
  var _intlmessageformat = require('intl-messageformat'); var _intlmessageformat2 = _interopRequireDefault(_intlmessageformat);
@@ -11,10 +11,10 @@ var translate = (key, values, rich = false) => {
11
11
  const message = readOwnMessage(snapshot.messages, key);
12
12
  if (message === void 0) return key;
13
13
  const cacheKey = `${snapshot.locale}\0${key}\0${message}`;
14
- let formatter = _chunk2PJVEL56cjs.compiledFarmI18nMessages.get(cacheKey);
14
+ let formatter = _chunkPCAEJNQFcjs.compiledFarmI18nMessages.get(cacheKey);
15
15
  if (!formatter) {
16
16
  formatter = new (0, _intlmessageformat2.default)(message, snapshot.locale);
17
- _chunk2PJVEL56cjs.compiledFarmI18nMessages.set(cacheKey, formatter);
17
+ _chunkPCAEJNQFcjs.compiledFarmI18nMessages.set(cacheKey, formatter);
18
18
  }
19
19
  const result = formatter.format(values);
20
20
  if (rich) return Array.isArray(result) && result.length === 1 ? result[0] : result;
@@ -31,7 +31,7 @@ function createFarmClientTranslator() {
31
31
  return ((key, ...args) => t(key, ...args));
32
32
  }
33
33
  function requireSnapshot() {
34
- const snapshot = _chunk2PJVEL56cjs.getFarmI18nClientState.call(void 0, );
34
+ const snapshot = _chunkPCAEJNQFcjs.getFarmI18nClientState.call(void 0, );
35
35
  if (!snapshot) {
36
36
  throw new Error("Farm i18n is not configured or has not been hydrated.");
37
37
  }
@@ -5,10 +5,13 @@ var _chunkJIBEFLQ7cjs = require('./chunk-JIBEFLQ7.cjs');
5
5
 
6
6
 
7
7
 
8
+ var _chunkPCAEJNQFcjs = require('./chunk-PCAEJNQF.cjs');
8
9
 
9
10
 
10
11
 
11
- var _chunk2PJVEL56cjs = require('./chunk-2PJVEL56.cjs');
12
+
13
+
14
+ var _chunkYIGUFJMRcjs = require('./chunk-YIGUFJMR.cjs');
12
15
 
13
16
 
14
17
  var _chunkPENBZAHJcjs = require('./chunk-PENBZAHJ.cjs');
@@ -313,12 +316,12 @@ var SPARouter = class {
313
316
  viewTransition = false,
314
317
  refresh = false
315
318
  } = options;
316
- const url = _chunk2PJVEL56cjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
317
- if (_chunk2PJVEL56cjs.isFarmBlockedNavigationURL.call(void 0, url)) return;
319
+ const url = _chunkYIGUFJMRcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
320
+ if (_chunkYIGUFJMRcjs.isFarmBlockedNavigationURL.call(void 0, url)) return;
318
321
  const pathname = url.pathname;
319
322
  const search = url.search;
320
323
  const fullPath = pathname + search;
321
- if (_chunk2PJVEL56cjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin) || _chunk2PJVEL56cjs.isFarmLocaleChangeHref.call(void 0, url.toString()) || this.options.shouldUseDocumentNavigation(pathname)) {
324
+ if (_chunkYIGUFJMRcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin) || _chunkPCAEJNQFcjs.isFarmLocaleChangeHref.call(void 0, url.toString()) || this.options.shouldUseDocumentNavigation(pathname)) {
322
325
  this.cancelActiveNavigation();
323
326
  if (replace) window.location.replace(url.toString());
324
327
  else window.location.assign(url.toString());
@@ -465,9 +468,10 @@ var SPARouter = class {
465
468
  await this.whenNavigationSettles();
466
469
  if (this.destroyed) return;
467
470
  }
468
- if (_chunk2PJVEL56cjs.isFarmLocaleChangeHref.call(void 0, href)) return;
469
- const url = _chunk2PJVEL56cjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
470
- if (_chunk2PJVEL56cjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin)) return;
471
+ if (_chunkPCAEJNQFcjs.isFarmLocaleChangeHref.call(void 0, href)) return;
472
+ const url = _chunkYIGUFJMRcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href);
473
+ if (_chunkYIGUFJMRcjs.isFarmExternalNavigationURL.call(void 0, url, window.location.origin)) return;
474
+ if (_chunkYIGUFJMRcjs.isFarmSameDocumentFragment.call(void 0, url.href, window.location.href)) return;
471
475
  if (this.options.shouldUseDocumentNavigation(url.pathname)) return;
472
476
  const fullPath = url.pathname + url.search;
473
477
  const interceptFrom = window.location.pathname + window.location.search;
@@ -629,7 +633,7 @@ var SPARouter = class {
629
633
  this.writePageState(action, readPageState(), href, false);
630
634
  }
631
635
  async commitNavigation(options) {
632
- const historyUrl = _chunk2PJVEL56cjs.resolveFarmNavigationURL.call(void 0,
636
+ const historyUrl = _chunkYIGUFJMRcjs.resolveFarmNavigationURL.call(void 0,
633
637
  options.pageData.canonicalPath || options.fullPath,
634
638
  window.location.href
635
639
  );
@@ -654,13 +658,13 @@ var SPARouter = class {
654
658
  }
655
659
  this.currentHistoryIndex = nextHistoryIndex;
656
660
  this.currentHistoryKey = historyKey;
657
- const resolvedHistoryUrl = _chunk2PJVEL56cjs.resolveFarmNavigationURL.call(void 0, historyPath, window.location.href);
661
+ const resolvedHistoryUrl = _chunkYIGUFJMRcjs.resolveFarmNavigationURL.call(void 0, historyPath, window.location.href);
658
662
  this.currentHistoryPath = resolvedHistoryUrl.pathname + resolvedHistoryUrl.search;
659
663
  this.currentHistoryHash = resolvedHistoryUrl.hash;
660
664
  this.currentInterceptFrom = historyState[FARM_INTERCEPT_FROM_KEY];
661
665
  notifyRouterHistoryChange();
662
666
  this.updateDocumentMetadata(options.pageData.metadata);
663
- _chunk2PJVEL56cjs._hydrateFarmI18n.call(void 0, options.pageData.i18n);
667
+ _chunkPCAEJNQFcjs._hydrateFarmI18n.call(void 0, options.pageData.i18n);
664
668
  if (this.onNavigate) {
665
669
  await this.onNavigate(options.pageData, { refresh: options.refresh === true });
666
670
  }
@@ -915,7 +919,7 @@ var SPARouter = class {
915
919
  }
916
920
  if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
917
921
  this.updateDocumentMetadata(pageData.metadata);
918
- _chunk2PJVEL56cjs._hydrateFarmI18n.call(void 0, pageData.i18n);
922
+ _chunkPCAEJNQFcjs._hydrateFarmI18n.call(void 0, pageData.i18n);
919
923
  if (this.onNavigate) {
920
924
  await this.onNavigate(pageData);
921
925
  }
@@ -1049,7 +1053,7 @@ var SPARouter = class {
1049
1053
  }
1050
1054
  writePageState(action, state, href, notify = true) {
1051
1055
  if (typeof window === "undefined") return;
1052
- const url = href ? _chunk2PJVEL56cjs.resolveFarmNavigationURL.call(void 0, href, window.location.href).toString() : window.location.href;
1056
+ const url = href ? _chunkYIGUFJMRcjs.resolveFarmNavigationURL.call(void 0, href, window.location.href).toString() : window.location.href;
1053
1057
  const parsedUrl = new URL(url);
1054
1058
  const nextPath = parsedUrl.pathname + parsedUrl.search;
1055
1059
  const historyPath = nextPath + parsedUrl.hash;
@@ -9,13 +9,14 @@ import {
9
9
  } from "./chunk-IYEY3JWJ.mjs";
10
10
  import {
11
11
  APIRouteConflictError
12
- } from "./chunk-HFRG2IQS.mjs";
12
+ } from "./chunk-JDO3X7RB.mjs";
13
13
  import {
14
14
  findProgrammaticRouteFilesInDir
15
15
  } from "./chunk-URBP6DLH.mjs";
16
16
  import {
17
+ hasPolyroutePlugin,
17
18
  isFarmAPIRouteFileName
18
- } from "./chunk-YX6AFPXC.mjs";
19
+ } from "./chunk-PTAGDZ7I.mjs";
19
20
  import {
20
21
  API_ROUTE_METHODS,
21
22
  FARM_INTERNAL_SERVER_ERROR_BODY,
@@ -276,6 +277,7 @@ function farmApiPlugin(options = {}) {
276
277
  name: "@farm.js/core:api",
277
278
  enforce: "pre",
278
279
  configureServer(server) {
280
+ const polyroute = hasPolyroutePlugin(server.config.plugins);
279
281
  projectRoot = server.config.root;
280
282
  devServer = server;
281
283
  const discoverFileRoutes = async (apiDir) => {
@@ -293,7 +295,7 @@ function farmApiPlugin(options = {}) {
293
295
  const fullPath = path.join(dir, entry.name);
294
296
  if (entry.isDirectory()) {
295
297
  files.push(...findRouteFiles(fullPath));
296
- } else if (isFarmAPIRouteFileName(entry.name)) {
298
+ } else if (isFarmAPIRouteFileName(entry.name, polyroute)) {
297
299
  files.push(fullPath);
298
300
  }
299
301
  }
@@ -611,7 +613,7 @@ function farmApiPlugin(options = {}) {
611
613
  }
612
614
  return [];
613
615
  }
614
- if (normalizedFile.includes("/api/") && fileName.startsWith("route.")) {
616
+ if (normalizedFile.includes("/api/") && isFarmAPIRouteFileName(fileName, hasPolyroutePlugin(server.config.plugins))) {
615
617
  const shortPath = normalizedFile.split("/api/")[1] || normalizedFile;
616
618
  log(`API route updated: ${shortPath}`);
617
619
  for (const mod of modules) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-O7K4HMAQ.mjs";
3
+ } from "./chunk-XJJQAFZX.mjs";
4
4
 
5
5
  // src/deployment-environment.ts
6
6
  function isFarmProductionDeploymentEnvironment(env = process.env) {
@@ -44,7 +44,7 @@ import {
44
44
  resolveFarmIslxActionsMode,
45
45
  resolveFarmRouteRootStrategy,
46
46
  toBakedMarkdownSourcePath
47
- } from "./chunk-QLRI2BX5.mjs";
47
+ } from "./chunk-MM4U2NNI.mjs";
48
48
  import {
49
49
  generateFarmClientPluginEntryCode,
50
50
  hasFarmServerRuntimePlugins,
@@ -59,10 +59,10 @@ import {
59
59
  import {
60
60
  generateFarmTypeArtifacts,
61
61
  resolveRouteRenderingConfig
62
- } from "./chunk-4SJ22WTT.mjs";
62
+ } from "./chunk-W3ZBLFLU.mjs";
63
63
  import {
64
64
  _setFarmInfraAnalyticsWebMCPRoute
65
- } from "./chunk-5D73SKF3.mjs";
65
+ } from "./chunk-MRULVIH3.mjs";
66
66
  import {
67
67
  createFarmRouteRenderPlan,
68
68
  farmPathGuardCoversEndpoint,
@@ -89,13 +89,13 @@ import {
89
89
  resolveFarmMCPRouteLabel,
90
90
  resolveFarmMarkdownRouteLabel,
91
91
  setFarmRouteLabel
92
- } from "./chunk-4FGTNYHE.mjs";
92
+ } from "./chunk-BJHXFEAF.mjs";
93
93
  import {
94
94
  FARM_DEFAULT_MCP_PATH
95
95
  } from "./chunk-HR4N2K4V.mjs";
96
96
  import {
97
97
  isFarmPreviewDeploymentEnvironment
98
- } from "./chunk-Q73LRKLP.mjs";
98
+ } from "./chunk-LUGQUU4S.mjs";
99
99
  import {
100
100
  createFarmServerFnBoundaryModule,
101
101
  isFarmServerFnBoundaryId,
@@ -146,7 +146,7 @@ import {
146
146
  usePackageScanCacheFile,
147
147
  withFarmSourceSnapshotOf,
148
148
  wrapFarmIslandContainers
149
- } from "./chunk-26HESRBL.mjs";
149
+ } from "./chunk-WOTAU3BN.mjs";
150
150
  import {
151
151
  generateFarmDocsAdapterClientRuntime,
152
152
  getFarmDocsAdapterConfigModule
@@ -247,7 +247,11 @@ import {
247
247
  } from "./chunk-IYEY3JWJ.mjs";
248
248
  import {
249
249
  APIRouteManager
250
- } from "./chunk-HFRG2IQS.mjs";
250
+ } from "./chunk-JDO3X7RB.mjs";
251
+ import {
252
+ hasPolyroutePlugin,
253
+ isFarmAPIRouteFileName
254
+ } from "./chunk-PTAGDZ7I.mjs";
251
255
  import {
252
256
  getFarmI18nClientSnapshot
253
257
  } from "./chunk-O7JEFGUV.mjs";
@@ -310,7 +314,7 @@ import {
310
314
  } from "./chunk-EILUVBKS.mjs";
311
315
  import {
312
316
  FARM_VERSION
313
- } from "./chunk-O7K4HMAQ.mjs";
317
+ } from "./chunk-XJJQAFZX.mjs";
314
318
  import {
315
319
  DEFAULT_FARM_API_BASE_PATH
316
320
  } from "./chunk-W6QLRQ3V.mjs";
@@ -1283,13 +1287,13 @@ function loadFarmDocsSearchDevRuntime() {
1283
1287
  return import("./search-client-GIXIEU75.mjs");
1284
1288
  }
1285
1289
  function loadFarmOpenAPIDevRuntime() {
1286
- return import("./manager-OMTC5FOJ.mjs");
1290
+ return import("./manager-PKPQGBAE.mjs");
1287
1291
  }
1288
1292
  function loadFarmWorkflowsDevRuntime() {
1289
1293
  return import("./workflows.mjs");
1290
1294
  }
1291
1295
  function loadFarmDevtoolsSnapshotRuntime() {
1292
- return import("./devtools-GWJZPWIW.mjs");
1296
+ return import("./devtools-2CRVXV7E.mjs");
1293
1297
  }
1294
1298
  function loadFarmDevtoolsUIRuntime() {
1295
1299
  return import("./devtools-ui-BOG33MT5.mjs");
@@ -2635,9 +2639,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2635
2639
  const match = /\/(?:page|layout|loading|error)(\.[^./]+)$/.exec(normalized);
2636
2640
  return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/`)) && !!match && routeModuleExtensions.has(match[1].toLowerCase());
2637
2641
  };
2642
+ const polyroute = hasPolyroutePlugin(server.config.plugins);
2638
2643
  const isApiRouteFile = (file) => {
2639
2644
  const normalized = file.replace(/\\/g, "/");
2640
- return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && /route\.(ts|tsx|js|jsx)$/.test(normalized);
2645
+ return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && isFarmAPIRouteFileName(path6.posix.basename(normalized), polyroute);
2641
2646
  };
2642
2647
  const isProgrammaticRouteFile = (file) => {
2643
2648
  const normalized = file.replace(/\\/g, "/");
@@ -2699,7 +2704,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2699
2704
  if (isI18nCatalogFile(file)) {
2700
2705
  farmApp?.getI18nRuntime().reload().then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => logger.warn(`i18n catalog reload failed: ${error.message}`));
2701
2706
  }
2702
- const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isRendererRouteFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
2707
+ const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || polyroute && isApiRouteFile(file) || isRendererRouteFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
2703
2708
  if (isRouteRefreshEvent) {
2704
2709
  if (!queuedRouteFiles) {
2705
2710
  const files = /* @__PURE__ */ new Set();
@@ -5430,7 +5435,10 @@ if (import.meta.hot) {
5430
5435
  )
5431
5436
  ))
5432
5437
  return modules;
5433
- if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && getFarmAppDirectories(currentFarmConfig).some(
5438
+ if (currentFarmConfig && isFarmAPIRouteFileName(
5439
+ path6.posix.basename(normalizedFile),
5440
+ hasPolyroutePlugin(server2.config.plugins)
5441
+ ) && getFarmAppDirectories(currentFarmConfig).some(
5434
5442
  (appDir) => normalizedFile.startsWith(`${toPosixPath(appDir)}/api/`)
5435
5443
  )) {
5436
5444
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
@@ -6202,7 +6210,7 @@ import { createClientPluginManager } from '@farm.js/core/plugin/client'
6202
6210
  // Not @farm.js/core/client: that module's graph imports react, which other renderers' apps lack.
6203
6211
  import { SPARouter } from '@farm.js/core/internal/spa-router'
6204
6212
  import { isFarmRouteActive } from '@farm.js/core/router'
6205
- import { installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
6213
+ import { installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
6206
6214
  import { reviveDeferredData } from '@farm.js/core/deferred'
6207
6215
  import {
6208
6216
  createFarmDeploymentMismatchError,
@@ -8112,8 +8120,7 @@ document.addEventListener('click', function(event) {
8112
8120
  if (href.startsWith('#')) return;
8113
8121
 
8114
8122
  // Don't intercept if target is set to open in new window
8115
- const linkTarget = target.getAttribute('target');
8116
- if (linkTarget && linkTarget !== '_self') return;
8123
+ if (!targetsCurrentContext(target)) return;
8117
8124
 
8118
8125
  // Don't intercept modifier clicks (Ctrl+Click = new tab)
8119
8126
  if (isModifierEvent(event)) return;
@@ -9,7 +9,7 @@ import {
9
9
  collectSSGPages,
10
10
  matchSSGPage,
11
11
  resolveRouteRenderingConfigFromFile
12
- } from "./chunk-4SJ22WTT.mjs";
12
+ } from "./chunk-W3ZBLFLU.mjs";
13
13
  import {
14
14
  resolveFarmRendererRoutes
15
15
  } from "./chunk-YNPVG2GG.mjs";
@@ -59,7 +59,7 @@ import {
59
59
  } from "./chunk-PEQJ4UUT.mjs";
60
60
  import {
61
61
  listFarmMCPLlmsTxtLinks
62
- } from "./chunk-4FGTNYHE.mjs";
62
+ } from "./chunk-BJHXFEAF.mjs";
63
63
  import {
64
64
  FARM_DEFAULT_MCP_PATH,
65
65
  collectFarmDefaultMCPPages,
@@ -104,7 +104,7 @@ import {
104
104
  traceFarmSourceReads,
105
105
  usesFarmServerTree,
106
106
  withFarmSourceSnapshot
107
- } from "./chunk-26HESRBL.mjs";
107
+ } from "./chunk-WOTAU3BN.mjs";
108
108
  import {
109
109
  _setDefaultFarmThemeConfig,
110
110
  getTheme
@@ -304,7 +304,7 @@ import {
304
304
  } from "./chunk-EILUVBKS.mjs";
305
305
  import {
306
306
  FARM_VERSION
307
- } from "./chunk-O7K4HMAQ.mjs";
307
+ } from "./chunk-XJJQAFZX.mjs";
308
308
  import {
309
309
  normalizeFarmAPIConfig
310
310
  } from "./chunk-W6QLRQ3V.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFarmRouteLabel
3
- } from "./chunk-4FGTNYHE.mjs";
3
+ } from "./chunk-BJHXFEAF.mjs";
4
4
  import {
5
5
  _classifyFarmMCPSession,
6
6
  _farmMCPClientSession,
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-D2VAANBS.mjs";
19
19
  import {
20
20
  FARM_VERSION
21
- } from "./chunk-O7K4HMAQ.mjs";
21
+ } from "./chunk-XJJQAFZX.mjs";
22
22
 
23
23
  // src/mobile/analyzer.ts
24
24
  import { createHash } from "crypto";
@@ -4,11 +4,13 @@ import {
4
4
  import {
5
5
  buildFarmRoutePath
6
6
  } from "./chunk-BRNPLD22.mjs";
7
+ import {
8
+ localizeActiveFarmHref
9
+ } from "./chunk-GGD57DJA.mjs";
7
10
  import {
8
11
  isFarmScriptURL,
9
- localizeActiveFarmHref,
10
12
  resolveFarmNavigationURL
11
- } from "./chunk-FLMALEY2.mjs";
13
+ } from "./chunk-JIGWHFA5.mjs";
12
14
  import {
13
15
  getFarmSearchPreserveRoutes
14
16
  } from "./chunk-VDQZV6BX.mjs";