@farm.js/core 0.1.28 → 0.1.30

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 (149) hide show
  1. package/dist/agent-runtime.d.mts +2 -2
  2. package/dist/agent-runtime.d.ts +2 -2
  3. package/dist/api/route-manager.d.mts +1 -1
  4. package/dist/api/route-manager.d.ts +1 -1
  5. package/dist/api/runtime.d.mts +2 -2
  6. package/dist/api/runtime.d.ts +2 -2
  7. package/dist/api.cjs +2 -2
  8. package/dist/api.d.mts +18 -4
  9. package/dist/api.d.ts +18 -4
  10. package/dist/api.mjs +1 -1
  11. package/dist/{app-DSSq6wiN.d.mts → app-DAuUTIZf.d.mts} +3 -3
  12. package/dist/app-markdown.cjs +5 -4
  13. package/dist/app-markdown.d.mts +3 -3
  14. package/dist/app-markdown.d.ts +3 -3
  15. package/dist/app-markdown.mjs +4 -3
  16. package/dist/{app-M8nVWvNU.d.ts → app-sUJ3jnTZ.d.ts} +3 -3
  17. package/dist/{chunk-N6UROPT7.mjs → chunk-2FQHH5SC.mjs} +12 -13
  18. package/dist/{chunk-2CNBR3EB.mjs → chunk-2UABTL3Y.mjs} +2 -2
  19. package/dist/{chunk-JUFRXDTK.cjs → chunk-3FCFQP5V.cjs} +17 -5
  20. package/dist/{chunk-XSPGWQWA.cjs → chunk-6CNX6Q3K.cjs} +96 -24
  21. package/dist/{chunk-NVBS5WSZ.mjs → chunk-6G3ZZ2IE.mjs} +1 -1
  22. package/dist/{chunk-QBPXNZGV.cjs → chunk-6MVFL3R5.cjs} +25 -6
  23. package/dist/{chunk-PZPDGOU5.mjs → chunk-7CXKSRKL.mjs} +11 -7
  24. package/dist/{chunk-K3YEZLSY.mjs → chunk-ATXI6LGT.mjs} +96 -24
  25. package/dist/{chunk-2DLN6HG4.mjs → chunk-BZ3CHOFX.mjs} +1 -1
  26. package/dist/{chunk-EWZ3XHKQ.cjs → chunk-BZAGKCKB.cjs} +2 -2
  27. package/dist/{chunk-FB3H4INL.mjs → chunk-D234YWNA.mjs} +1 -1
  28. package/dist/{chunk-KXGDXYUC.mjs → chunk-DGXN3L4D.mjs} +17 -5
  29. package/dist/chunk-FJ3M4CUX.cjs +46 -0
  30. package/dist/chunk-FXEF4PPL.mjs +47 -0
  31. package/dist/{chunk-ID6OVSLH.cjs → chunk-GIWC4CFJ.cjs} +175 -171
  32. package/dist/{chunk-F52CDFJM.cjs → chunk-HPQC2LHF.cjs} +435 -274
  33. package/dist/{chunk-FVCSLZWT.mjs → chunk-IVLUJUT4.mjs} +315 -154
  34. package/dist/{chunk-KOQ555NR.cjs → chunk-JFHKNFEO.cjs} +24 -20
  35. package/dist/{chunk-UX2DD2VK.mjs → chunk-K6V52QMI.mjs} +1 -1
  36. package/dist/{chunk-BYODCJD6.cjs → chunk-K7CELQLK.cjs} +12 -13
  37. package/dist/{chunk-A672WZEG.cjs → chunk-NPPL5YDT.cjs} +2 -2
  38. package/dist/{chunk-TII23GJC.cjs → chunk-NXG66MR7.cjs} +3 -3
  39. package/dist/{chunk-R6AIILII.cjs → chunk-OZVEHHMA.cjs} +15 -14
  40. package/dist/{chunk-T7HQ3I4C.mjs → chunk-PQD2AI3B.mjs} +1 -1
  41. package/dist/{chunk-VQXDC5UV.cjs → chunk-Q5JFU33Q.cjs} +4 -4
  42. package/dist/{chunk-FZC7EEPM.mjs → chunk-RSOJ7DRT.mjs} +26 -7
  43. package/dist/{chunk-ZRIE4KMG.mjs → chunk-S4K74WI4.mjs} +17 -13
  44. package/dist/{chunk-Y7GW7J46.cjs → chunk-X5TXZFMN.cjs} +1 -1
  45. package/dist/chunk-XD32KALF.cjs +47 -0
  46. package/dist/{chunk-RDV44SED.mjs → chunk-XJJVLDM6.mjs} +15 -14
  47. package/dist/{chunk-55ZY4ZA7.cjs → chunk-XLTV4VOG.cjs} +21 -16
  48. package/dist/{chunk-REGFZJEJ.mjs → chunk-YMUE7L3D.mjs} +18 -13
  49. package/dist/chunk-Z3HATSKO.mjs +46 -0
  50. package/dist/{chunk-MH24QDVJ.cjs → chunk-ZDILFMWN.cjs} +13 -13
  51. package/dist/{client-plugins-CgYNY7jF.d.mts → client-plugins-BX2ptm4H.d.mts} +7 -2
  52. package/dist/{client-plugins-Fl9Og3yB.d.ts → client-plugins-BmxM5KW_.d.ts} +7 -2
  53. package/dist/client-plugins.d.mts +2 -2
  54. package/dist/client-plugins.d.ts +2 -2
  55. package/dist/client.d.mts +5 -5
  56. package/dist/client.d.ts +5 -5
  57. package/dist/config.d.mts +2 -2
  58. package/dist/config.d.ts +2 -2
  59. package/dist/{devtools-5AREISIA.cjs → devtools-GGVPZHJX.cjs} +95 -20
  60. package/dist/{devtools-3E7ZANMZ.mjs → devtools-THVNPI2M.mjs} +79 -4
  61. package/dist/{devtools-client-4WAPJY5L.cjs → devtools-client-CXQ6PXI6.cjs} +1 -1
  62. package/dist/{devtools-client-LEUIHHAS.mjs → devtools-client-HJS2T34Y.mjs} +1 -1
  63. package/dist/docs.cjs +8 -7
  64. package/dist/docs.mjs +7 -6
  65. package/dist/index.cjs +18 -16
  66. package/dist/index.d.mts +24 -14
  67. package/dist/index.d.ts +24 -14
  68. package/dist/index.mjs +17 -15
  69. package/dist/integrations.d.mts +2 -2
  70. package/dist/integrations.d.ts +2 -2
  71. package/dist/internal/app-markdown-runtime.cjs +4 -3
  72. package/dist/internal/app-markdown-runtime.d.mts +3 -3
  73. package/dist/internal/app-markdown-runtime.d.ts +3 -3
  74. package/dist/internal/app-markdown-runtime.mjs +3 -2
  75. package/dist/internal/build-runtime.cjs +15 -13
  76. package/dist/internal/build-runtime.d.mts +4 -4
  77. package/dist/internal/build-runtime.d.ts +4 -4
  78. package/dist/internal/build-runtime.mjs +14 -12
  79. package/dist/internal/cli-runtime.cjs +7 -6
  80. package/dist/internal/cli-runtime.mjs +6 -5
  81. package/dist/internal/client-error-overlay.cjs +4 -4
  82. package/dist/internal/client-error-overlay.mjs +1 -1
  83. package/dist/internal/compression-runtime.cjs +3 -2
  84. package/dist/internal/compression-runtime.d.mts +5 -3
  85. package/dist/internal/compression-runtime.d.ts +5 -3
  86. package/dist/internal/compression-runtime.mjs +2 -1
  87. package/dist/internal/config-runtime.cjs +6 -5
  88. package/dist/internal/config-runtime.d.mts +3 -3
  89. package/dist/internal/config-runtime.d.ts +3 -3
  90. package/dist/internal/config-runtime.mjs +5 -4
  91. package/dist/internal/product-telemetry-runtime.cjs +10 -6
  92. package/dist/internal/product-telemetry-runtime.mjs +9 -5
  93. package/dist/internal/production-runtime.cjs +19 -5
  94. package/dist/internal/production-runtime.d.mts +35 -8
  95. package/dist/internal/production-runtime.d.ts +35 -8
  96. package/dist/internal/production-runtime.mjs +18 -4
  97. package/dist/markdown.cjs +3 -2
  98. package/dist/markdown.d.mts +2 -2
  99. package/dist/markdown.d.ts +2 -2
  100. package/dist/markdown.mjs +2 -1
  101. package/dist/{metadata-B0X-qtcQ.d.mts → metadata-DsEaK7mQ.d.mts} +1 -1
  102. package/dist/{metadata-BdDKgd7K.d.ts → metadata-fwZ3gfG6.d.ts} +1 -1
  103. package/dist/middleware.cjs +3 -2
  104. package/dist/middleware.d.mts +3 -3
  105. package/dist/middleware.d.ts +3 -3
  106. package/dist/middleware.mjs +2 -1
  107. package/dist/navigation.d.mts +4 -4
  108. package/dist/navigation.d.ts +4 -4
  109. package/dist/plugin.cjs +10 -9
  110. package/dist/plugin.d.mts +2 -2
  111. package/dist/plugin.d.ts +2 -2
  112. package/dist/plugin.mjs +9 -8
  113. package/dist/{production-runtime-BjgFgDIg.d.mts → production-runtime-Baqgwtvc.d.mts} +1 -1
  114. package/dist/{production-runtime-Dx_qMA3t.d.ts → production-runtime-DNkpFnmg.d.ts} +1 -1
  115. package/dist/{render-plan-_1TAWODt.d.mts → render-plan-DhwQnmmX.d.mts} +1 -1
  116. package/dist/{render-plan-B41EWmBb.d.ts → render-plan-rkIK9wd9.d.ts} +1 -1
  117. package/dist/renderer-client.d.mts +3 -3
  118. package/dist/renderer-client.d.ts +3 -3
  119. package/dist/{request-Dbf3G0zM.d.ts → request-BcY4RYPC.d.ts} +1 -1
  120. package/dist/{request-BhE4luLv.d.mts → request-CFy1BltJ.d.mts} +1 -1
  121. package/dist/request.d.mts +3 -3
  122. package/dist/request.d.ts +3 -3
  123. package/dist/{route-rendering-zzfx_GHf.d.mts → route-rendering-BkS0TBlB.d.mts} +1 -1
  124. package/dist/{route-rendering-Z7PveTZE.d.ts → route-rendering-D4XpMjam.d.ts} +1 -1
  125. package/dist/{router-BatNMsa1.d.mts → router-C4zPlC3V.d.mts} +1 -1
  126. package/dist/{router-DtNRhQl3.d.ts → router-Cq7BcZxg.d.ts} +1 -1
  127. package/dist/routes.d.mts +2 -2
  128. package/dist/routes.d.ts +2 -2
  129. package/dist/server-plugins.cjs +3 -2
  130. package/dist/server-plugins.d.mts +2 -2
  131. package/dist/server-plugins.d.ts +2 -2
  132. package/dist/server-plugins.mjs +2 -1
  133. package/dist/server.cjs +33 -28
  134. package/dist/server.d.mts +8 -8
  135. package/dist/server.d.ts +8 -8
  136. package/dist/server.mjs +16 -11
  137. package/dist/{spa-router-BE3bwU-J.d.ts → spa-router-B1HI3X9k.d.ts} +2 -2
  138. package/dist/{spa-router-DQOnHZVj.d.mts → spa-router-DzPZH-AO.d.mts} +2 -2
  139. package/dist/testing.d.mts +1 -1
  140. package/dist/testing.d.ts +1 -1
  141. package/dist/{utils-DLK1ERNl.d.mts → utils-CEBktlBG.d.mts} +1 -1
  142. package/dist/{utils-u7ZBSWAK.d.ts → utils-DMD1Hzta.d.ts} +1 -1
  143. package/dist/version.cjs +2 -2
  144. package/dist/version.mjs +1 -1
  145. package/dist/vite.cjs +10 -9
  146. package/dist/vite.d.mts +2 -2
  147. package/dist/vite.d.ts +2 -2
  148. package/dist/vite.mjs +9 -8
  149. package/package.json +1 -1
@@ -6,6 +6,9 @@ var _chunkJ63ZH5OQcjs = require('./chunk-J63ZH5OQ.cjs');
6
6
  var _chunk5MKEDGLDcjs = require('./chunk-5MKEDGLD.cjs');
7
7
 
8
8
 
9
+ var _chunkFJ3M4CUXcjs = require('./chunk-FJ3M4CUX.cjs');
10
+
11
+
9
12
  var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
10
13
 
11
14
 
@@ -14,8 +17,7 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
14
17
  // src/markdown-view.ts
15
18
  var FENCE = /^\s{0,3}(`{3,}|~{3,})/;
16
19
  var ATX_HEADING = /^\s{0,3}(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/;
17
- function parseFarmMarkdownHeadings(markdown) {
18
- const lines = markdown.split("\n");
20
+ function parseMarkdownHeadingsFromLines(lines) {
19
21
  const headings = [];
20
22
  const used = /* @__PURE__ */ new Map();
21
23
  let index = 0;
@@ -57,7 +59,7 @@ function parseFarmMarkdownHeadings(markdown) {
57
59
  }
58
60
  return headings;
59
61
  }
60
- _chunkS3JO3N4Hcjs.__name.call(void 0, parseFarmMarkdownHeadings, "parseFarmMarkdownHeadings");
62
+ _chunkS3JO3N4Hcjs.__name.call(void 0, parseMarkdownHeadingsFromLines, "parseMarkdownHeadingsFromLines");
61
63
  function slugifyHeading(text) {
62
64
  return text.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[`*_~]/g, "").toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu, "").trim().replace(/\s/g, "-");
63
65
  }
@@ -97,7 +99,7 @@ function selectFarmMarkdownView(markdown, searchParams, markdownPath) {
97
99
  ), "withinBudget");
98
100
  if (!wantsOutline && sectionId === null) return withinBudget(markdown);
99
101
  const lines = markdown.split("\n");
100
- const headings = parseFarmMarkdownHeadings(markdown);
102
+ const headings = parseMarkdownHeadingsFromLines(lines);
101
103
  const sectionText = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (heading) => lines.slice(heading.start, heading.end).join("\n").trim(), "sectionText");
102
104
  if (sectionId !== null) {
103
105
  const heading = headings.find((candidate) => candidate.id === sectionId);
@@ -116,10 +118,20 @@ ${available}
116
118
  ` : "This page has no sections.\n")
117
119
  };
118
120
  }
121
+ const offsets = [];
122
+ let offset = 0;
123
+ for (const line of lines) {
124
+ offsets.push(offset);
125
+ offset += line.length + 1;
126
+ }
119
127
  const minLevel = headings.reduce((min, heading) => Math.min(min, heading.level), 6);
120
128
  const entries = headings.map((heading) => {
121
129
  const indent = " ".repeat(heading.level - minLevel);
122
- const tokens = estimateFarmMarkdownTokens(sectionText(heading));
130
+ let last = heading.end - 1;
131
+ while (last > heading.start && lines[last].trim().length === 0) last--;
132
+ const first = lines[heading.start];
133
+ const length = offsets[last] + lines[last].trimEnd().length - offsets[heading.start] - (first.length - first.trimStart().length);
134
+ const tokens = Math.ceil(length / 4);
123
135
  return `${indent}- [${heading.text}](${viewUrl({ section: heading.id })}) ~${tokens} tokens`;
124
136
  });
125
137
  return {
@@ -211,7 +223,9 @@ The page changed after this cursor was issued. Start again at ${partUrl()}.
211
223
  const part = `${head}${lines.slice(start, end).join("\n").replace(/\n+$/, "")}${open ? `
212
224
  ${open.closer}` : ""}`;
213
225
  const next = partUrl(`${end}.${version}`);
214
- const remaining = estimateFarmMarkdownTokens(lines.slice(end).join("\n"));
226
+ let remainingLength = lines.length - end - 1;
227
+ for (let index = end; index < lines.length; index++) remainingLength += lines[index].length;
228
+ const remaining = Math.ceil(remainingLength / 4);
215
229
  return {
216
230
  status: 200,
217
231
  body: `${part}
@@ -423,19 +437,24 @@ async function createMarkdownMirrorResponse(options) {
423
437
  }
424
438
  const html = await pageResponse.text();
425
439
  const markdownPath = target.pathname === "/" ? "/index.md" : `${target.pathname}.md`;
426
- const actions = pageResponse.status >= 400 ? [] : extractFarmPageActions(html, pageUrl);
440
+ const region = pageResponse.status < 400 && /<form\b/i.test(html) ? readHtmlContentRegion(html) : void 0;
441
+ const actions = region === void 0 ? [] : extractPageActionsFromRegion(region, pageUrl);
427
442
  for (const form of actions) {
428
443
  if (!_optionalChain([form, 'access', _16 => _16.action, 'optionalAccess', _17 => _17.startsWith, 'call', _18 => _18("/")])) continue;
429
444
  const pathname = new URL(form.action, pageUrl.origin).pathname;
430
445
  const tool = _nullishCoalesce(_chunk5MKEDGLDcjs._findFarmMCPEndpointTool.call(void 0, form.method, pathname, options.apiServerBasePath), () => ( _chunk5MKEDGLDcjs._findFarmMCPEndpointTool.call(void 0, form.method, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, pathname), options.apiServerBasePath)));
431
446
  if (tool) form.tool = tool;
432
447
  }
433
- const markdown = htmlToMarkdown(html, {
434
- title: _optionalChain([target, 'access', _19 => _19.route, 'optionalAccess', _20 => _20.title]),
435
- includeMetadata: _nullishCoalesce(_optionalChain([options, 'access', _21 => _21.config, 'optionalAccess', _22 => _22.includeMetadata]), () => ( true)),
436
- sourcePath: target.pathname,
437
- actionsPath: actions.length > 0 ? `${markdownPath}?actions` : void 0
438
- });
448
+ const markdown = pageResponse.status < 400 && requestUrl.searchParams.has("actions") ? "" : convertHtmlToMarkdown(
449
+ html,
450
+ {
451
+ title: _optionalChain([target, 'access', _19 => _19.route, 'optionalAccess', _20 => _20.title]),
452
+ includeMetadata: _nullishCoalesce(_optionalChain([options, 'access', _21 => _21.config, 'optionalAccess', _22 => _22.includeMetadata]), () => ( true)),
453
+ sourcePath: target.pathname,
454
+ actionsPath: actions.length > 0 ? `${markdownPath}?actions` : void 0
455
+ },
456
+ region
457
+ );
439
458
  const headersOut = new Headers({
440
459
  "Content-Type": "text/markdown; charset=utf-8",
441
460
  "Content-Location": markdownPath,
@@ -537,13 +556,9 @@ function applyMarkdownNegotiationHeaders(response, options) {
537
556
  if (!alternatePath) {
538
557
  return response;
539
558
  }
540
- const headers = new Headers(response.headers);
541
- appendHeaderToken(headers, "Vary", "Accept");
542
- headers.append("Link", `<${alternatePath}>; rel="alternate"; type="text/markdown"`);
543
- return new Response(response.body, {
544
- status: response.status,
545
- statusText: response.statusText,
546
- headers
559
+ return _chunkFJ3M4CUXcjs._withFarmResponseHeaders.call(void 0, response, (headers) => {
560
+ appendHeaderToken(headers, "Vary", "Accept");
561
+ headers.append("Link", `<${alternatePath}>; rel="alternate"; type="text/markdown"`);
547
562
  });
548
563
  }
549
564
  _chunkS3JO3N4Hcjs.__name.call(void 0, applyMarkdownNegotiationHeaders, "applyMarkdownNegotiationHeaders");
@@ -551,9 +566,61 @@ var CODE_BLOCK_MARK = "\0";
551
566
  var CODE_BLOCK_PLACEHOLDER = /\u0000(\d+)\u0000/g;
552
567
  var BLOCK_TAGS = /<\/?(ul|ol|main|section|article|header|footer|nav|aside|div|form|fieldset|legend|figure|figcaption|table|thead|tbody|tfoot|tr|dl|dt|dd|details|summary|address)\b[^>]*>/gi;
553
568
  var BOX_TAGS = /<\/?(label|button|input|select|textarea|option|output|meter|progress|td|th)\b[^>]*>/gi;
569
+ var LAYOUT_ROW = /<(div|nav|section|header|footer|aside|main|article|figure|figcaption|dt|dd)\b([^>]*)>((?:(?!<\/?(?:div|nav|section|header|footer|aside|main|article|figure|figcaption|dt|dd|p|h[1-6]|ul|ol|li|table|pre|blockquote)\b)[\s\S])*?)<\/\1>/gi;
570
+ var HTML_TOKEN = /<\/?([a-zA-Z][\w:-]*)\b[^>]*?(\/?)>|[^<]+/g;
571
+ function separateLayoutRowItems(source) {
572
+ return source.replace(
573
+ LAYOUT_ROW,
574
+ (container, tag, attributes, content) => {
575
+ const boundaries = [];
576
+ const items = [];
577
+ let depth = 0;
578
+ let previousEnd = -1;
579
+ let item = "";
580
+ for (const match of content.matchAll(HTML_TOKEN)) {
581
+ const [token, name, selfClosing] = match;
582
+ const index = _nullishCoalesce(match.index, () => ( 0));
583
+ if (name === void 0) {
584
+ if (depth === 0) {
585
+ if (token.trim()) return container;
586
+ previousEnd = -1;
587
+ } else {
588
+ item += token;
589
+ }
590
+ continue;
591
+ }
592
+ const closing = token.startsWith("</");
593
+ const isVoid = selfClosing === "/" || VOID_TAGS.has(name.toLowerCase());
594
+ if (closing) {
595
+ depth = Math.max(0, depth - 1);
596
+ } else {
597
+ if (depth === 0 && previousEnd === index) boundaries.push(index);
598
+ if (!isVoid) depth += 1;
599
+ }
600
+ if (depth === 0) {
601
+ previousEnd = index + token.length;
602
+ items.push(decodeHtml(item).trim());
603
+ item = "";
604
+ }
605
+ }
606
+ if (boundaries.length === 0) return container;
607
+ if (items.filter(Boolean).every((text) => text.length === 1)) return container;
608
+ let separated = content;
609
+ for (const boundary of boundaries.reverse()) {
610
+ separated = `${separated.slice(0, boundary)} ${separated.slice(boundary)}`;
611
+ }
612
+ return `<${tag}${attributes}>${separated}</${tag}>`;
613
+ }
614
+ );
615
+ }
616
+ _chunkS3JO3N4Hcjs.__name.call(void 0, separateLayoutRowItems, "separateLayoutRowItems");
554
617
  function htmlToMarkdown(html, options = {}) {
618
+ return convertHtmlToMarkdown(html, options);
619
+ }
620
+ _chunkS3JO3N4Hcjs.__name.call(void 0, htmlToMarkdown, "htmlToMarkdown");
621
+ function convertHtmlToMarkdown(html, options, region) {
555
622
  const title = _nullishCoalesce(options.title, () => ( extractHtmlTitle(html)));
556
- let source = readHtmlContentRegion(html);
623
+ let source = _nullishCoalesce(region, () => ( readHtmlContentRegion(html)));
557
624
  const codeBlocks = [];
558
625
  const setAsideCodeBlock = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (code, attributes) => {
559
626
  const content = decodeHtml(stripTags(code)).trim();
@@ -594,6 +661,7 @@ ${CODE_BLOCK_MARK}${codeBlocks.length - 1}${CODE_BLOCK_MARK}
594
661
  `;
595
662
  }
596
663
  );
664
+ source = separateLayoutRowItems(source);
597
665
  source = source.replace(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi, (_, level, content) => {
598
666
  return `
599
667
 
@@ -664,7 +732,7 @@ ${markdown}` : ""}`;
664
732
  return `${markdown}
665
733
  `;
666
734
  }
667
- _chunkS3JO3N4Hcjs.__name.call(void 0, htmlToMarkdown, "htmlToMarkdown");
735
+ _chunkS3JO3N4Hcjs.__name.call(void 0, convertHtmlToMarkdown, "convertHtmlToMarkdown");
668
736
  function normalizeMarkdownRouteInput(input) {
669
737
  if (typeof input === "string") {
670
738
  return {
@@ -861,7 +929,10 @@ var FORM_ENCTYPES = /* @__PURE__ */ new Set([
861
929
  ]);
862
930
  function extractFarmPageActions(html, pageUrl) {
863
931
  if (!/<form\b/i.test(html)) return [];
864
- const region = readHtmlContentRegion(html);
932
+ return extractPageActionsFromRegion(readHtmlContentRegion(html), pageUrl);
933
+ }
934
+ _chunkS3JO3N4Hcjs.__name.call(void 0, extractFarmPageActions, "extractFarmPageActions");
935
+ function extractPageActionsFromRegion(region, pageUrl) {
865
936
  const labelsFor = /* @__PURE__ */ new Map();
866
937
  for (const match of region.matchAll(/<label\b([^>]*)>([\s\S]*?)<\/label>/gi)) {
867
938
  const target = readDecodedAttribute(match[1], "for");
@@ -874,7 +945,7 @@ function extractFarmPageActions(html, pageUrl) {
874
945
  }
875
946
  return actions;
876
947
  }
877
- _chunkS3JO3N4Hcjs.__name.call(void 0, extractFarmPageActions, "extractFarmPageActions");
948
+ _chunkS3JO3N4Hcjs.__name.call(void 0, extractPageActionsFromRegion, "extractPageActionsFromRegion");
878
949
  function readPageForm(attributes, content, pageUrl, labelsFor) {
879
950
  const method = _optionalChain([readDecodedAttribute, 'call', _48 => _48(attributes, "method"), 'optionalAccess', _49 => _49.trim, 'call', _50 => _50(), 'access', _51 => _51.toLowerCase, 'call', _52 => _52()]);
880
951
  if (method === "dialog") return void 0;
@@ -1109,6 +1180,7 @@ var VOID_TAGS = /* @__PURE__ */ new Set([
1109
1180
  "wbr"
1110
1181
  ]);
1111
1182
  function removeHiddenElements(html) {
1183
+ if (!/hidden/i.test(html)) return html;
1112
1184
  const openingTag = /<([a-zA-Z][\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g;
1113
1185
  let closingTags;
1114
1186
  let result = "";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createFarmMarkdownRouteModule
3
- } from "./chunk-2DLN6HG4.mjs";
3
+ } from "./chunk-BZ3CHOFX.mjs";
4
4
  import {
5
5
  __name
6
6
  } from "./chunk-LPEX4YW6.mjs";
@@ -336,32 +336,49 @@ function assertPluginDependencies(plugins, integrations) {
336
336
  }
337
337
  }
338
338
  const state = /* @__PURE__ */ new Map();
339
- const path2 = [];
339
+ const path3 = [];
340
340
  const visit = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (plugin) => {
341
341
  if (state.get(plugin) === "done") return;
342
342
  if (state.get(plugin) === "visiting") {
343
- const cycle = [...path2.slice(path2.indexOf(plugin)), plugin].map(
343
+ const cycle = [...path3.slice(path3.indexOf(plugin)), plugin].map(
344
344
  (entry) => pluginShortName(entry.name)
345
345
  );
346
346
  throw new Error(`Plugins depend on each other in a cycle: ${cycle.join(" \u2192 ")}.`);
347
347
  }
348
348
  state.set(plugin, "visiting");
349
- path2.push(plugin);
349
+ path3.push(plugin);
350
350
  for (const dependency of _nullishCoalesce(plugin.dependsOn, () => ( []))) {
351
351
  for (const candidate of plugins) {
352
352
  if (candidate !== plugin && matches(candidate, dependency)) visit(candidate);
353
353
  }
354
354
  }
355
- path2.pop();
355
+ path3.pop();
356
356
  state.set(plugin, "done");
357
357
  }, "visit");
358
358
  for (const plugin of plugins) visit(plugin);
359
359
  }
360
360
  _chunkS3JO3N4Hcjs.__name.call(void 0, assertPluginDependencies, "assertPluginDependencies");
361
361
 
362
+ // src/utils/source-dir.ts
363
+ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
364
+ var FARM_PROJECT_SOURCE_DIRS = /* @__PURE__ */ Symbol.for("farm.projectSourceDirs");
365
+ function getProjectSourceDirs() {
366
+ const globalState = globalThis;
367
+ return _nullishCoalesce(globalState[FARM_PROJECT_SOURCE_DIRS], () => ( (globalState[FARM_PROJECT_SOURCE_DIRS] = /* @__PURE__ */ new Map())));
368
+ }
369
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getProjectSourceDirs, "getProjectSourceDirs");
370
+ function setFarmProjectSourceDir(root, srcDir) {
371
+ getProjectSourceDirs().set(_path2.default.resolve(root), srcDir);
372
+ }
373
+ _chunkS3JO3N4Hcjs.__name.call(void 0, setFarmProjectSourceDir, "setFarmProjectSourceDir");
374
+ function getFarmProjectSourceDir(root) {
375
+ return _nullishCoalesce(getProjectSourceDirs().get(_path2.default.resolve(root)), () => ( "src"));
376
+ }
377
+ _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmProjectSourceDir, "getFarmProjectSourceDir");
378
+
362
379
  // src/auth-config.ts
363
380
  var _module = require('module');
364
- var _path = require('path'); var _path2 = _interopRequireDefault(_path);
381
+
365
382
  var _url = require('url');
366
383
  function resolveFarmAuthConfig(input) {
367
384
  const config = input === true ? {} : input && typeof input === "object" ? input : {};
@@ -484,4 +501,6 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, validateFarmAuthConfig, "validateFarmAuthC
484
501
 
485
502
 
486
503
 
487
- exports.resolveFarmDevIndicatorsConfig = resolveFarmDevIndicatorsConfig; exports.generateFarmDevIndicatorsClientRuntime = generateFarmDevIndicatorsClientRuntime; exports.resolveFarmAuthConfig = resolveFarmAuthConfig; exports.resolveFarmAuthIntegration = resolveFarmAuthIntegration; exports.pluginShortName = pluginShortName; exports.assertPluginDependencies = assertPluginDependencies;
504
+
505
+
506
+ exports.setFarmProjectSourceDir = setFarmProjectSourceDir; exports.getFarmProjectSourceDir = getFarmProjectSourceDir; exports.resolveFarmDevIndicatorsConfig = resolveFarmDevIndicatorsConfig; exports.generateFarmDevIndicatorsClientRuntime = generateFarmDevIndicatorsClientRuntime; exports.resolveFarmAuthConfig = resolveFarmAuthConfig; exports.resolveFarmAuthIntegration = resolveFarmAuthIntegration; exports.pluginShortName = pluginShortName; exports.assertPluginDependencies = assertPluginDependencies;
@@ -2,8 +2,9 @@ import {
2
2
  assertPluginDependencies,
3
3
  resolveFarmAuthConfig,
4
4
  resolveFarmAuthIntegration,
5
- resolveFarmDevIndicatorsConfig
6
- } from "./chunk-FZC7EEPM.mjs";
5
+ resolveFarmDevIndicatorsConfig,
6
+ setFarmProjectSourceDir
7
+ } from "./chunk-RSOJ7DRT.mjs";
7
8
  import {
8
9
  resolveFarmDevtoolsConfig
9
10
  } from "./chunk-JBSVKMC5.mjs";
@@ -28,7 +29,7 @@ import {
28
29
  resolveFarmNoindexPreviews,
29
30
  resolveFarmPerformanceConfig,
30
31
  resolveFarmSecurityConfig
31
- } from "./chunk-REGFZJEJ.mjs";
32
+ } from "./chunk-YMUE7L3D.mjs";
32
33
  import {
33
34
  resolveFarmImageConfig
34
35
  } from "./chunk-G2KY33I6.mjs";
@@ -47,7 +48,7 @@ import {
47
48
  } from "./chunk-FA2W42OV.mjs";
48
49
  import {
49
50
  resolveMarkdownConfig
50
- } from "./chunk-K3YEZLSY.mjs";
51
+ } from "./chunk-ATXI6LGT.mjs";
51
52
  import {
52
53
  bundleNodeModule
53
54
  } from "./chunk-SFGWNC43.mjs";
@@ -88,9 +89,6 @@ import {
88
89
  __name
89
90
  } from "./chunk-LPEX4YW6.mjs";
90
91
 
91
- // src/config.ts
92
- import path3 from "path";
93
-
94
92
  // src/mcp-config.ts
95
93
  import { createRequire } from "module";
96
94
  import path from "path";
@@ -128,6 +126,9 @@ async function resolveFarmMCPPlugin(config, options) {
128
126
  }
129
127
  __name(resolveFarmMCPPlugin, "resolveFarmMCPPlugin");
130
128
 
129
+ // src/config.ts
130
+ import path3 from "path";
131
+
131
132
  // src/agent-config.ts
132
133
  var DEFAULT_JSON_LD = { type: "WebSite" };
133
134
  function resolveFarmAgentConfig(input, context = {}) {
@@ -697,6 +698,7 @@ async function resolveConfig(userConfig, mode) {
697
698
  const deploy = resolveDeployConfig(userConfig);
698
699
  const root = userConfig.root || process.cwd();
699
700
  const srcDir = userConfig.srcDir || "src";
701
+ setFarmProjectSourceDir(root, srcDir);
700
702
  const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
701
703
  const md = resolveMarkdownConfig(userConfig.md);
702
704
  const mdx = resolveMdxConfig(userConfig.mdx);
@@ -882,6 +884,8 @@ async function loadConfig(rootDir, configPath, mode = process.env.NODE_ENV === "
882
884
  __name(loadConfig, "loadConfig");
883
885
 
884
886
  export {
887
+ resolveFarmMCPConfig,
888
+ resolveFarmMCPPlugin,
885
889
  hasCustomFarmRouteContext,
886
890
  isResolvedFarmConfig,
887
891
  normalizeDeployTarget,
@@ -4,6 +4,9 @@ import {
4
4
  import {
5
5
  _findFarmMCPEndpointTool
6
6
  } from "./chunk-O6XNAMBV.mjs";
7
+ import {
8
+ _withFarmResponseHeaders
9
+ } from "./chunk-Z3HATSKO.mjs";
7
10
  import {
8
11
  stripFarmBasePath
9
12
  } from "./chunk-4RB44K6Z.mjs";
@@ -14,8 +17,7 @@ import {
14
17
  // src/markdown-view.ts
15
18
  var FENCE = /^\s{0,3}(`{3,}|~{3,})/;
16
19
  var ATX_HEADING = /^\s{0,3}(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/;
17
- function parseFarmMarkdownHeadings(markdown) {
18
- const lines = markdown.split("\n");
20
+ function parseMarkdownHeadingsFromLines(lines) {
19
21
  const headings = [];
20
22
  const used = /* @__PURE__ */ new Map();
21
23
  let index = 0;
@@ -57,7 +59,7 @@ function parseFarmMarkdownHeadings(markdown) {
57
59
  }
58
60
  return headings;
59
61
  }
60
- __name(parseFarmMarkdownHeadings, "parseFarmMarkdownHeadings");
62
+ __name(parseMarkdownHeadingsFromLines, "parseMarkdownHeadingsFromLines");
61
63
  function slugifyHeading(text) {
62
64
  return text.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[`*_~]/g, "").toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu, "").trim().replace(/\s/g, "-");
63
65
  }
@@ -97,7 +99,7 @@ function selectFarmMarkdownView(markdown, searchParams, markdownPath) {
97
99
  ), "withinBudget");
98
100
  if (!wantsOutline && sectionId === null) return withinBudget(markdown);
99
101
  const lines = markdown.split("\n");
100
- const headings = parseFarmMarkdownHeadings(markdown);
102
+ const headings = parseMarkdownHeadingsFromLines(lines);
101
103
  const sectionText = /* @__PURE__ */ __name((heading) => lines.slice(heading.start, heading.end).join("\n").trim(), "sectionText");
102
104
  if (sectionId !== null) {
103
105
  const heading = headings.find((candidate) => candidate.id === sectionId);
@@ -116,10 +118,20 @@ ${available}
116
118
  ` : "This page has no sections.\n")
117
119
  };
118
120
  }
121
+ const offsets = [];
122
+ let offset = 0;
123
+ for (const line of lines) {
124
+ offsets.push(offset);
125
+ offset += line.length + 1;
126
+ }
119
127
  const minLevel = headings.reduce((min, heading) => Math.min(min, heading.level), 6);
120
128
  const entries = headings.map((heading) => {
121
129
  const indent = " ".repeat(heading.level - minLevel);
122
- const tokens = estimateFarmMarkdownTokens(sectionText(heading));
130
+ let last = heading.end - 1;
131
+ while (last > heading.start && lines[last].trim().length === 0) last--;
132
+ const first = lines[heading.start];
133
+ const length = offsets[last] + lines[last].trimEnd().length - offsets[heading.start] - (first.length - first.trimStart().length);
134
+ const tokens = Math.ceil(length / 4);
123
135
  return `${indent}- [${heading.text}](${viewUrl({ section: heading.id })}) ~${tokens} tokens`;
124
136
  });
125
137
  return {
@@ -211,7 +223,9 @@ The page changed after this cursor was issued. Start again at ${partUrl()}.
211
223
  const part = `${head}${lines.slice(start, end).join("\n").replace(/\n+$/, "")}${open ? `
212
224
  ${open.closer}` : ""}`;
213
225
  const next = partUrl(`${end}.${version}`);
214
- const remaining = estimateFarmMarkdownTokens(lines.slice(end).join("\n"));
226
+ let remainingLength = lines.length - end - 1;
227
+ for (let index = end; index < lines.length; index++) remainingLength += lines[index].length;
228
+ const remaining = Math.ceil(remainingLength / 4);
215
229
  return {
216
230
  status: 200,
217
231
  body: `${part}
@@ -423,19 +437,24 @@ async function createMarkdownMirrorResponse(options) {
423
437
  }
424
438
  const html = await pageResponse.text();
425
439
  const markdownPath = target.pathname === "/" ? "/index.md" : `${target.pathname}.md`;
426
- const actions = pageResponse.status >= 400 ? [] : extractFarmPageActions(html, pageUrl);
440
+ const region = pageResponse.status < 400 && /<form\b/i.test(html) ? readHtmlContentRegion(html) : void 0;
441
+ const actions = region === void 0 ? [] : extractPageActionsFromRegion(region, pageUrl);
427
442
  for (const form of actions) {
428
443
  if (!form.action?.startsWith("/")) continue;
429
444
  const pathname = new URL(form.action, pageUrl.origin).pathname;
430
445
  const tool = _findFarmMCPEndpointTool(form.method, pathname, options.apiServerBasePath) ?? _findFarmMCPEndpointTool(form.method, stripFarmBasePath(pathname), options.apiServerBasePath);
431
446
  if (tool) form.tool = tool;
432
447
  }
433
- const markdown = htmlToMarkdown(html, {
434
- title: target.route?.title,
435
- includeMetadata: options.config?.includeMetadata ?? true,
436
- sourcePath: target.pathname,
437
- actionsPath: actions.length > 0 ? `${markdownPath}?actions` : void 0
438
- });
448
+ const markdown = pageResponse.status < 400 && requestUrl.searchParams.has("actions") ? "" : convertHtmlToMarkdown(
449
+ html,
450
+ {
451
+ title: target.route?.title,
452
+ includeMetadata: options.config?.includeMetadata ?? true,
453
+ sourcePath: target.pathname,
454
+ actionsPath: actions.length > 0 ? `${markdownPath}?actions` : void 0
455
+ },
456
+ region
457
+ );
439
458
  const headersOut = new Headers({
440
459
  "Content-Type": "text/markdown; charset=utf-8",
441
460
  "Content-Location": markdownPath,
@@ -537,13 +556,9 @@ function applyMarkdownNegotiationHeaders(response, options) {
537
556
  if (!alternatePath) {
538
557
  return response;
539
558
  }
540
- const headers = new Headers(response.headers);
541
- appendHeaderToken(headers, "Vary", "Accept");
542
- headers.append("Link", `<${alternatePath}>; rel="alternate"; type="text/markdown"`);
543
- return new Response(response.body, {
544
- status: response.status,
545
- statusText: response.statusText,
546
- headers
559
+ return _withFarmResponseHeaders(response, (headers) => {
560
+ appendHeaderToken(headers, "Vary", "Accept");
561
+ headers.append("Link", `<${alternatePath}>; rel="alternate"; type="text/markdown"`);
547
562
  });
548
563
  }
549
564
  __name(applyMarkdownNegotiationHeaders, "applyMarkdownNegotiationHeaders");
@@ -551,9 +566,61 @@ var CODE_BLOCK_MARK = "\0";
551
566
  var CODE_BLOCK_PLACEHOLDER = /\u0000(\d+)\u0000/g;
552
567
  var BLOCK_TAGS = /<\/?(ul|ol|main|section|article|header|footer|nav|aside|div|form|fieldset|legend|figure|figcaption|table|thead|tbody|tfoot|tr|dl|dt|dd|details|summary|address)\b[^>]*>/gi;
553
568
  var BOX_TAGS = /<\/?(label|button|input|select|textarea|option|output|meter|progress|td|th)\b[^>]*>/gi;
569
+ var LAYOUT_ROW = /<(div|nav|section|header|footer|aside|main|article|figure|figcaption|dt|dd)\b([^>]*)>((?:(?!<\/?(?:div|nav|section|header|footer|aside|main|article|figure|figcaption|dt|dd|p|h[1-6]|ul|ol|li|table|pre|blockquote)\b)[\s\S])*?)<\/\1>/gi;
570
+ var HTML_TOKEN = /<\/?([a-zA-Z][\w:-]*)\b[^>]*?(\/?)>|[^<]+/g;
571
+ function separateLayoutRowItems(source) {
572
+ return source.replace(
573
+ LAYOUT_ROW,
574
+ (container, tag, attributes, content) => {
575
+ const boundaries = [];
576
+ const items = [];
577
+ let depth = 0;
578
+ let previousEnd = -1;
579
+ let item = "";
580
+ for (const match of content.matchAll(HTML_TOKEN)) {
581
+ const [token, name, selfClosing] = match;
582
+ const index = match.index ?? 0;
583
+ if (name === void 0) {
584
+ if (depth === 0) {
585
+ if (token.trim()) return container;
586
+ previousEnd = -1;
587
+ } else {
588
+ item += token;
589
+ }
590
+ continue;
591
+ }
592
+ const closing = token.startsWith("</");
593
+ const isVoid = selfClosing === "/" || VOID_TAGS.has(name.toLowerCase());
594
+ if (closing) {
595
+ depth = Math.max(0, depth - 1);
596
+ } else {
597
+ if (depth === 0 && previousEnd === index) boundaries.push(index);
598
+ if (!isVoid) depth += 1;
599
+ }
600
+ if (depth === 0) {
601
+ previousEnd = index + token.length;
602
+ items.push(decodeHtml(item).trim());
603
+ item = "";
604
+ }
605
+ }
606
+ if (boundaries.length === 0) return container;
607
+ if (items.filter(Boolean).every((text) => text.length === 1)) return container;
608
+ let separated = content;
609
+ for (const boundary of boundaries.reverse()) {
610
+ separated = `${separated.slice(0, boundary)} ${separated.slice(boundary)}`;
611
+ }
612
+ return `<${tag}${attributes}>${separated}</${tag}>`;
613
+ }
614
+ );
615
+ }
616
+ __name(separateLayoutRowItems, "separateLayoutRowItems");
554
617
  function htmlToMarkdown(html, options = {}) {
618
+ return convertHtmlToMarkdown(html, options);
619
+ }
620
+ __name(htmlToMarkdown, "htmlToMarkdown");
621
+ function convertHtmlToMarkdown(html, options, region) {
555
622
  const title = options.title ?? extractHtmlTitle(html);
556
- let source = readHtmlContentRegion(html);
623
+ let source = region ?? readHtmlContentRegion(html);
557
624
  const codeBlocks = [];
558
625
  const setAsideCodeBlock = /* @__PURE__ */ __name((code, attributes) => {
559
626
  const content = decodeHtml(stripTags(code)).trim();
@@ -594,6 +661,7 @@ ${CODE_BLOCK_MARK}${codeBlocks.length - 1}${CODE_BLOCK_MARK}
594
661
  `;
595
662
  }
596
663
  );
664
+ source = separateLayoutRowItems(source);
597
665
  source = source.replace(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi, (_, level, content) => {
598
666
  return `
599
667
 
@@ -664,7 +732,7 @@ ${markdown}` : ""}`;
664
732
  return `${markdown}
665
733
  `;
666
734
  }
667
- __name(htmlToMarkdown, "htmlToMarkdown");
735
+ __name(convertHtmlToMarkdown, "convertHtmlToMarkdown");
668
736
  function normalizeMarkdownRouteInput(input) {
669
737
  if (typeof input === "string") {
670
738
  return {
@@ -861,7 +929,10 @@ var FORM_ENCTYPES = /* @__PURE__ */ new Set([
861
929
  ]);
862
930
  function extractFarmPageActions(html, pageUrl) {
863
931
  if (!/<form\b/i.test(html)) return [];
864
- const region = readHtmlContentRegion(html);
932
+ return extractPageActionsFromRegion(readHtmlContentRegion(html), pageUrl);
933
+ }
934
+ __name(extractFarmPageActions, "extractFarmPageActions");
935
+ function extractPageActionsFromRegion(region, pageUrl) {
865
936
  const labelsFor = /* @__PURE__ */ new Map();
866
937
  for (const match of region.matchAll(/<label\b([^>]*)>([\s\S]*?)<\/label>/gi)) {
867
938
  const target = readDecodedAttribute(match[1], "for");
@@ -874,7 +945,7 @@ function extractFarmPageActions(html, pageUrl) {
874
945
  }
875
946
  return actions;
876
947
  }
877
- __name(extractFarmPageActions, "extractFarmPageActions");
948
+ __name(extractPageActionsFromRegion, "extractPageActionsFromRegion");
878
949
  function readPageForm(attributes, content, pageUrl, labelsFor) {
879
950
  const method = readDecodedAttribute(attributes, "method")?.trim().toLowerCase();
880
951
  if (method === "dialog") return void 0;
@@ -1109,6 +1180,7 @@ var VOID_TAGS = /* @__PURE__ */ new Set([
1109
1180
  "wbr"
1110
1181
  ]);
1111
1182
  function removeHiddenElements(html) {
1183
+ if (!/hidden/i.test(html)) return html;
1112
1184
  const openingTag = /<([a-zA-Z][\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g;
1113
1185
  let closingTags;
1114
1186
  let result = "";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createFarmMarkdownViewResponse,
3
3
  requestAcceptsMarkdown
4
- } from "./chunk-K3YEZLSY.mjs";
4
+ } from "./chunk-ATXI6LGT.mjs";
5
5
  import {
6
6
  __name
7
7
  } from "./chunk-LPEX4YW6.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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkTII23GJCcjs = require('./chunk-TII23GJC.cjs');
3
+ var _chunkNXG66MR7cjs = require('./chunk-NXG66MR7.cjs');
4
4
 
5
5
 
6
6
  var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
@@ -11,7 +11,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
11
11
  var _url = require('url');
12
12
  async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
13
13
  const source = await _promises.readFile.call(void 0, filePath, "utf8");
14
- return _chunkTII23GJCcjs.createFarmMarkdownRouteModule.call(void 0, {
14
+ return _chunkNXG66MR7cjs.createFarmMarkdownRouteModule.call(void 0, {
15
15
  source,
16
16
  filePath,
17
17
  components: options.components,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-XAXTTBUT.mjs";
4
4
  import {
5
5
  serializeFarmLlmsTxt
6
- } from "./chunk-REGFZJEJ.mjs";
6
+ } from "./chunk-YMUE7L3D.mjs";
7
7
  import {
8
8
  emitFarmAgentRead
9
9
  } from "./chunk-MVL2RAJW.mjs";