token-goat 2.9.18 → 2.9.20

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 (55) hide show
  1. package/README.md +5 -1
  2. package/dist/token-goat-chunk-2CLWWRFR.mjs +26 -0
  3. package/dist/{token-goat-chunk-LTYWLKAG.mjs → token-goat-chunk-2Q3N5KUQ.mjs} +1283 -1012
  4. package/dist/{token-goat-chunk-6LGVCCMY.mjs → token-goat-chunk-3OGZOFLS.mjs} +26 -16
  5. package/dist/{token-goat-chunk-QML7ITHJ.mjs → token-goat-chunk-3VTJC7KU.mjs} +693 -438
  6. package/dist/{token-goat-chunk-QIDLJGXZ.mjs → token-goat-chunk-6LJNM4ZZ.mjs} +29 -5
  7. package/dist/{token-goat-chunk-CA6V36KW.mjs → token-goat-chunk-74ADIZZX.mjs} +68 -50
  8. package/dist/{token-goat-chunk-52IMXJ2L.mjs → token-goat-chunk-ASTBLE2R.mjs} +4 -4
  9. package/dist/token-goat-chunk-AU2K2QHR.mjs +20 -0
  10. package/dist/token-goat-chunk-BQIC3AVL.mjs +292 -0
  11. package/dist/token-goat-chunk-CBXLE54Q.mjs +30 -0
  12. package/dist/{token-goat-chunk-LMFO66YD.mjs → token-goat-chunk-DA43OE7L.mjs} +1 -1
  13. package/dist/{token-goat-chunk-ARNRFR6M.mjs → token-goat-chunk-DNAF26L4.mjs} +1 -1
  14. package/dist/{token-goat-chunk-BFEWOMA3.mjs → token-goat-chunk-DPHJU3P7.mjs} +1186 -4573
  15. package/dist/{token-goat-chunk-OWSJJY5R.mjs → token-goat-chunk-DW4VKU7D.mjs} +5 -5
  16. package/dist/token-goat-chunk-DYUBZZNP.mjs +198 -0
  17. package/dist/{token-goat-chunk-W3E65QOW.mjs → token-goat-chunk-ERGHDBC6.mjs} +310 -47
  18. package/dist/token-goat-chunk-EUZKG7ZO.mjs +304 -0
  19. package/dist/{token-goat-chunk-5MMJAJF3.mjs → token-goat-chunk-FWYZVS3E.mjs} +324 -31
  20. package/dist/token-goat-chunk-G6SYQQO7.mjs +41 -0
  21. package/dist/{token-goat-chunk-YQZE5NS6.mjs → token-goat-chunk-GIPMOGOI.mjs} +6 -6
  22. package/dist/{token-goat-chunk-BWCRC23L.mjs → token-goat-chunk-H4VC5TR6.mjs} +29 -20
  23. package/dist/{token-goat-chunk-V3ZWBEHM.mjs → token-goat-chunk-I5PQRHFE.mjs} +103 -24
  24. package/dist/token-goat-chunk-ITWYDOKP.mjs +341 -0
  25. package/dist/{token-goat-chunk-I67CPTDD.mjs → token-goat-chunk-K3ZNBN4U.mjs} +19 -14
  26. package/dist/{token-goat-chunk-HPOFR6QX.mjs → token-goat-chunk-K5XPIUVB.mjs} +222 -61
  27. package/dist/token-goat-chunk-KT75DZK4.mjs +1989 -0
  28. package/dist/{token-goat-chunk-H3FONFBO.mjs → token-goat-chunk-MNJWG2ZO.mjs} +3 -3
  29. package/dist/{token-goat-chunk-GRI6HWX3.mjs → token-goat-chunk-MUJV7BR3.mjs} +1 -1
  30. package/dist/{token-goat-chunk-ERTXEKB6.mjs → token-goat-chunk-NMTKNYGF.mjs} +2 -0
  31. package/dist/{token-goat-chunk-LA3O4JGD.mjs → token-goat-chunk-ODF7H7WS.mjs} +3 -3
  32. package/dist/{token-goat-chunk-K4DG6EEF.mjs → token-goat-chunk-ONMU7BON.mjs} +7 -8
  33. package/dist/{token-goat-chunk-4EXFN2AW.mjs → token-goat-chunk-OZRSREKR.mjs} +2 -2
  34. package/dist/{token-goat-chunk-EPXNOKIV.mjs → token-goat-chunk-P4XBHZXU.mjs} +2 -2
  35. package/dist/{token-goat-chunk-CTOYJ232.mjs → token-goat-chunk-PAVWB4L4.mjs} +173 -1840
  36. package/dist/{token-goat-chunk-UENEL6KX.mjs → token-goat-chunk-PTW22MRC.mjs} +2 -2
  37. package/dist/token-goat-chunk-SL454EN5.mjs +1816 -0
  38. package/dist/token-goat-chunk-SP5QR2HN.mjs +1379 -0
  39. package/dist/{token-goat-chunk-7VLWNQDQ.mjs → token-goat-chunk-T46UKRFM.mjs} +1 -1
  40. package/dist/{token-goat-chunk-L7VCX33I.mjs → token-goat-chunk-T63VHOL3.mjs} +40 -10
  41. package/dist/token-goat-chunk-VSJGPEBB.mjs +248 -0
  42. package/dist/{token-goat-chunk-HIZXQVNU.mjs → token-goat-chunk-VYXGHGUY.mjs} +4 -4
  43. package/dist/token-goat-chunk-W6QYCWAT.mjs +128 -0
  44. package/dist/{token-goat-chunk-WFX2V3OF.mjs → token-goat-chunk-Z4ALQADF.mjs} +579 -422
  45. package/dist/token-goat-chunk-ZHFM4DHJ.mjs +324 -0
  46. package/dist/token-goat-hook.mjs +18 -12
  47. package/dist/token-goat.core.mjs +29 -20
  48. package/docs/C4_RUNTIME_ARCHITECTURE.md +1 -1
  49. package/docs/cli.md +15 -13
  50. package/docs/install.md +1 -1
  51. package/docs/security.md +2 -2
  52. package/package.json +3 -2
  53. package/dist/token-goat-chunk-2KTZ6J7T.mjs +0 -173
  54. package/dist/token-goat-chunk-34OUJ2IE.mjs +0 -35
  55. package/dist/token-goat-chunk-RHHFEXKF.mjs +0 -93
@@ -25,11 +25,11 @@ import {
25
25
  extractSwift,
26
26
  extractThrift,
27
27
  extractWgsl
28
- } from "./token-goat-chunk-GRI6HWX3.mjs";
28
+ } from "./token-goat-chunk-MUJV7BR3.mjs";
29
29
  import {
30
30
  extractShellBannerHeading
31
- } from "./token-goat-chunk-W3E65QOW.mjs";
32
- import "./token-goat-chunk-I67CPTDD.mjs";
31
+ } from "./token-goat-chunk-ERGHDBC6.mjs";
32
+ import "./token-goat-chunk-K3ZNBN4U.mjs";
33
33
  import {
34
34
  GENERIC_CLAUSE,
35
35
  assignBraceBlockSpans,
@@ -58,16 +58,16 @@ import {
58
58
  stripMultilineStringSpan,
59
59
  stripStringLiterals,
60
60
  stripXmlComments
61
- } from "./token-goat-chunk-L7VCX33I.mjs";
62
- import "./token-goat-chunk-CA6V36KW.mjs";
61
+ } from "./token-goat-chunk-T63VHOL3.mjs";
62
+ import "./token-goat-chunk-74ADIZZX.mjs";
63
63
  import "./token-goat-chunk-EEIDFMEM.mjs";
64
64
  import "./token-goat-chunk-OSUFN2FV.mjs";
65
65
  import {
66
66
  countContentLines,
67
67
  escapeRegExp,
68
68
  pushAll
69
- } from "./token-goat-chunk-QIDLJGXZ.mjs";
70
- import "./token-goat-chunk-ERTXEKB6.mjs";
69
+ } from "./token-goat-chunk-6LJNM4ZZ.mjs";
70
+ import "./token-goat-chunk-NMTKNYGF.mjs";
71
71
  import "./token-goat-chunk-Y4AFKTHK.mjs";
72
72
  import "./token-goat-chunk-GMOUBOX4.mjs";
73
73
  import {
@@ -525,6 +525,54 @@ function isNoise(name) {
525
525
  return NOISE_IDS_CLASSES.has(name.toLowerCase());
526
526
  }
527
527
  var MAX_SYMBOLS = 1e4;
528
+ var VOID_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
529
+ var TAG_RE = /<(\/?)([a-zA-Z][a-zA-Z0-9:-]*)(?:\s(?:"[^"]*"|'[^']*'|[^'">])*)?>/g;
530
+ var ELEMENT_SPAN_SCAN_CAP = 2e6;
531
+ function buildElementSpans(code) {
532
+ const spans = /* @__PURE__ */ new Map();
533
+ const openTagRanges = [];
534
+ const stack = [];
535
+ TAG_RE.lastIndex = 0;
536
+ let m;
537
+ while ((m = TAG_RE.exec(code)) !== null) {
538
+ if (m.index > ELEMENT_SPAN_SCAN_CAP) break;
539
+ const isClose = m[1] === "/";
540
+ const name = (m[2] ?? "").toLowerCase();
541
+ const selfClosing = m[0][m[0].length - 2] === "/";
542
+ const tagEnd = m.index + m[0].length;
543
+ if (isClose) {
544
+ for (let i = stack.length - 1; i >= 0; i--) {
545
+ if (stack[i].name === name) {
546
+ spans.set(stack[i].start, tagEnd);
547
+ stack.length = i;
548
+ break;
549
+ }
550
+ }
551
+ continue;
552
+ }
553
+ openTagRanges.push({ start: m.index, end: tagEnd });
554
+ if (selfClosing || VOID_ELEMENTS.has(name)) continue;
555
+ if (name === "style") {
556
+ const closeMatch = /<\/style\s*>/gi.exec(code.slice(tagEnd));
557
+ if (closeMatch !== null) TAG_RE.lastIndex = tagEnd + closeMatch.index + closeMatch[0].length;
558
+ continue;
559
+ }
560
+ stack.push({ name, start: m.index });
561
+ }
562
+ return { spans, openTagRanges };
563
+ }
564
+ function findEnclosingTagStart(openTagRanges, offset) {
565
+ let lo = 0;
566
+ let hi = openTagRanges.length - 1;
567
+ while (lo <= hi) {
568
+ const mid = lo + hi >> 1;
569
+ const range = openTagRanges[mid];
570
+ if (offset < range.start) hi = mid - 1;
571
+ else if (offset >= range.end) lo = mid + 1;
572
+ else return range.start;
573
+ }
574
+ return null;
575
+ }
528
576
  function extractHtml(content, filePath) {
529
577
  const symbols = [];
530
578
  const imports = [];
@@ -550,6 +598,7 @@ function extractHtml(content, filePath) {
550
598
  assignFlatEndLines(sections, totalLines);
551
599
  const seenId = /* @__PURE__ */ new Set();
552
600
  const seenClass = /* @__PURE__ */ new Set();
601
+ const { spans: elementSpans, openTagRanges } = buildElementSpans(code);
553
602
  for (const m of code.matchAll(ID_RE)) {
554
603
  if (symbols.length >= MAX_SYMBOLS) break;
555
604
  const idVal = m[2] ?? "";
@@ -558,7 +607,10 @@ function extractHtml(content, filePath) {
558
607
  const key = `${idVal}\0${line}`;
559
608
  if (!seenId.has(key)) {
560
609
  seenId.add(key);
561
- symbols.push({ filePath, name: idVal, kind: "html_id", lineStart: line, lineEnd: line, body: "", docstring: "", parent: "" });
610
+ const tagStart = findEnclosingTagStart(openTagRanges, m.index ?? 0);
611
+ const elementEnd = tagStart !== null ? elementSpans.get(tagStart) : void 0;
612
+ const lineEnd = elementEnd !== void 0 ? offsetToLine(lineIndex, elementEnd - 1) : line;
613
+ symbols.push({ filePath, name: idVal, kind: "html_id", lineStart: line, lineEnd, body: "", docstring: "", parent: "" });
562
614
  }
563
615
  }
564
616
  }
@@ -2407,6 +2459,18 @@ var TYPE_BODY_RE = makeCreateRe("TYPE\\s+BODY", `(?:OR\\s+REPLACE\\s+)?${EDITION
2407
2459
  var PACKAGE_RE = makeCreateRe("PACKAGE(?!\\s+BODY\\b)", `(?:OR\\s+REPLACE\\s+)?${EDITIONING}`);
2408
2460
  var PACKAGE_BODY_RE = makeCreateRe("PACKAGE\\s+BODY", `(?:OR\\s+REPLACE\\s+)?${EDITIONING}`);
2409
2461
  var SCHEMA_RE3 = makeCreateRe("SCHEMA");
2462
+ var MACRO_RE = makeCreateRe("MACRO", `${OR_REPLACE}(?:TEMP(?:ORARY)?\\s+)?`);
2463
+ var SECRET_RE = makeCreateRe("SECRET", `${OR_REPLACE}(?:PERSISTENT\\s+)?`);
2464
+ var EXTENSION_RE2 = makeCreateRe("EXTENSION");
2465
+ var DOMAIN_RE = makeCreateRe("DOMAIN");
2466
+ var AGGREGATE_RE = makeCreateRe("AGGREGATE", OR_REPLACE);
2467
+ var POLICY_RE = makeCreateRe("POLICY");
2468
+ var RULE_RE = makeCreateRe("RULE", OR_REPLACE);
2469
+ var OPERATOR_RE2 = makeCreateRe("OPERATOR(?!\\s+(?:CLASS|FAMILY)\\b)", OR_REPLACE);
2470
+ var SYNONYM_RE = makeCreateRe("SYNONYM", `${OR_REPLACE}(?:PUBLIC\\s+)?`);
2471
+ var DATABASE_LINK_RE = makeCreateRe("DATABASE\\s+LINK", "(?:PUBLIC\\s+)?");
2472
+ var CLUSTER_RE = makeCreateRe("CLUSTER");
2473
+ var CONTEXT_RE = makeCreateRe("CONTEXT", `${OR_REPLACE}`);
2410
2474
  var PATTERNS = [
2411
2475
  [TABLE_RE, "sql_table"],
2412
2476
  [VIEW_RE, "sql_view"],
@@ -2420,7 +2484,19 @@ var PATTERNS = [
2420
2484
  [PACKAGE_RE, "sql_package"],
2421
2485
  [PACKAGE_BODY_RE, "sql_package_body"],
2422
2486
  [SCHEMA_RE3, "sql_schema"],
2423
- [SEQUENCE_RE, "sql_sequence"]
2487
+ [SEQUENCE_RE, "sql_sequence"],
2488
+ [MACRO_RE, "sql_macro"],
2489
+ [SECRET_RE, "sql_secret"],
2490
+ [EXTENSION_RE2, "sql_extension"],
2491
+ [DOMAIN_RE, "sql_domain"],
2492
+ [AGGREGATE_RE, "sql_aggregate"],
2493
+ [POLICY_RE, "sql_policy"],
2494
+ [RULE_RE, "sql_rule"],
2495
+ [OPERATOR_RE2, "sql_operator"],
2496
+ [SYNONYM_RE, "sql_synonym"],
2497
+ [DATABASE_LINK_RE, "sql_database_link"],
2498
+ [CLUSTER_RE, "sql_cluster"],
2499
+ [CONTEXT_RE, "sql_context"]
2424
2500
  ];
2425
2501
  var PLSQL_UNIT_KINDS = /* @__PURE__ */ new Set(["sql_package", "sql_package_body", "sql_type_body", "sql_procedure", "sql_function", "sql_trigger"]);
2426
2502
  var PLSQL_CONTAINER_KINDS = /* @__PURE__ */ new Set(["sql_package", "sql_package_body", "sql_type_body"]);
@@ -2753,6 +2829,221 @@ function extractSql(content, filePath) {
2753
2829
  return [...pinned, ...plsql.children].sort((a, b) => a.lineStart - b.lineStart);
2754
2830
  }
2755
2831
 
2832
+ // src/languages/nginx.ts
2833
+ init_define_import_meta_env();
2834
+ var NGINX_BLOCK_START_RE = /^(?:([a-zA-Z0-9_]+)[ \t]+)?(http|events|stream|server|upstream|location)(?:[ \t]+([^{;\s](?:[^{};]*[^{};\s])?))?[ \t]*\{/;
2835
+ var SERVER_NAME_RE = /^\s*server_name[ \t]+([^\s;][^;]*);/;
2836
+ var LISTEN_RE = /^\s*listen[ \t]+([^\s;][^;]*);/;
2837
+ function extractNginx(content, filePath) {
2838
+ const lines = content.split("\n");
2839
+ const symbols = [];
2840
+ let braceDepth = 0;
2841
+ const blockStack = [];
2842
+ for (let i = 0; i < lines.length; i++) {
2843
+ const rawLine = lines[i] ?? "";
2844
+ const commentIdx = rawLine.indexOf("#");
2845
+ const lineWithoutComment = commentIdx >= 0 ? rawLine.slice(0, commentIdx) : rawLine;
2846
+ const trimmed = lineWithoutComment.trim();
2847
+ if (!trimmed) {
2848
+ continue;
2849
+ }
2850
+ const match = NGINX_BLOCK_START_RE.exec(trimmed);
2851
+ if (match) {
2852
+ const keyword = match[2] ?? "";
2853
+ const arg = match[3]?.trim() ?? "";
2854
+ let symbolName = keyword;
2855
+ const symbolKind = `nginx_${keyword}`;
2856
+ if (keyword === "upstream" && arg) {
2857
+ symbolName = `upstream ${arg}`;
2858
+ } else if (keyword === "location" && arg) {
2859
+ symbolName = `location ${arg}`;
2860
+ } else if (keyword === "server") {
2861
+ let label = "";
2862
+ let lookaheadBraces = 0;
2863
+ for (let j = i; j < Math.min(i + 40, lines.length); j++) {
2864
+ const lRaw = lines[j] ?? "";
2865
+ const lClean = (lRaw.indexOf("#") >= 0 ? lRaw.slice(0, lRaw.indexOf("#")) : lRaw).trim();
2866
+ for (const char of lClean) {
2867
+ if (char === "{") lookaheadBraces++;
2868
+ if (char === "}") lookaheadBraces--;
2869
+ }
2870
+ if (lookaheadBraces === 1) {
2871
+ const snMatch = SERVER_NAME_RE.exec(lRaw);
2872
+ if (snMatch && snMatch[1]) {
2873
+ const first = snMatch[1].trim().split(/\s+/)[0];
2874
+ if (first) {
2875
+ label = first;
2876
+ break;
2877
+ }
2878
+ }
2879
+ if (!label) {
2880
+ const listenMatch = LISTEN_RE.exec(lRaw);
2881
+ if (listenMatch && listenMatch[1]) {
2882
+ label = listenMatch[1].trim();
2883
+ }
2884
+ }
2885
+ }
2886
+ if (lookaheadBraces <= 0 && j > i) break;
2887
+ }
2888
+ symbolName = label ? `server (${label})` : "server";
2889
+ }
2890
+ blockStack.push({
2891
+ name: symbolName,
2892
+ kind: symbolKind,
2893
+ line: i + 1,
2894
+ openBraceDepth: braceDepth
2895
+ });
2896
+ }
2897
+ for (const char of lineWithoutComment) {
2898
+ if (char === "{") {
2899
+ braceDepth++;
2900
+ } else if (char === "}") {
2901
+ braceDepth--;
2902
+ if (blockStack.length > 0) {
2903
+ const top = blockStack[blockStack.length - 1];
2904
+ if (top && braceDepth === top.openBraceDepth) {
2905
+ blockStack.pop();
2906
+ const symbol2 = {
2907
+ filePath,
2908
+ name: top.name,
2909
+ kind: top.kind,
2910
+ lineStart: top.line,
2911
+ lineEnd: i + 1,
2912
+ body: lines.slice(top.line - 1, i + 1).join("\n"),
2913
+ docstring: "",
2914
+ parent: ""
2915
+ };
2916
+ symbols.push(symbol2);
2917
+ }
2918
+ }
2919
+ }
2920
+ }
2921
+ }
2922
+ symbols.sort((a, b) => a.lineStart - b.lineStart);
2923
+ return symbols;
2924
+ }
2925
+
2926
+ // src/languages/caddy.ts
2927
+ init_define_import_meta_env();
2928
+ function symbol(filePath, lines, block, lineEnd) {
2929
+ return {
2930
+ filePath,
2931
+ name: block.name,
2932
+ kind: block.kind,
2933
+ lineStart: block.lineStart,
2934
+ lineEnd,
2935
+ body: lines.slice(block.lineStart - 1, lineEnd).join("\n"),
2936
+ docstring: "",
2937
+ parent: ""
2938
+ };
2939
+ }
2940
+ function extractCaddy(content, filePath) {
2941
+ const lines = content.split("\n");
2942
+ const symbols = [];
2943
+ const stack = [];
2944
+ let braceDepth = 0;
2945
+ let sawContent = false;
2946
+ for (let i = 0; i < lines.length; i++) {
2947
+ const rawLine = lines[i] ?? "";
2948
+ const commentIndex = rawLine.indexOf("#");
2949
+ const codeLine = commentIndex >= 0 ? rawLine.slice(0, commentIndex) : rawLine;
2950
+ const trimmed = codeLine.trim();
2951
+ const depthAtLineStart = braceDepth;
2952
+ const contentBeforeLine = sawContent;
2953
+ let opensSeen = 0;
2954
+ for (let c = 0; c < codeLine.length; c++) {
2955
+ const char = codeLine[c];
2956
+ if (char === "{") {
2957
+ const header = opensSeen === 0 ? codeLine.slice(0, c).trim() : "";
2958
+ if (opensSeen === 0 && depthAtLineStart === 0 && !contentBeforeLine && header === "") {
2959
+ stack.push({ name: "global", kind: "caddy_global", lineStart: i + 1, site: false });
2960
+ } else if (opensSeen === 0 && depthAtLineStart === 0 && header) {
2961
+ const snippet = /^\(([^)]+)\)$/.exec(header);
2962
+ stack.push({
2963
+ name: snippet ? `(${snippet[1]})` : header,
2964
+ kind: snippet ? "caddy_snippet" : "caddy_site",
2965
+ lineStart: i + 1,
2966
+ site: !snippet
2967
+ });
2968
+ } else if (header && /^(?:route|handle|handle_path)\b/.test(header) && stack.some((block) => block.site)) {
2969
+ stack.push({ name: header, kind: "caddy_block", lineStart: i + 1, site: false });
2970
+ } else {
2971
+ stack.push({ name: "", kind: "", lineStart: i + 1, site: false });
2972
+ }
2973
+ opensSeen++;
2974
+ braceDepth++;
2975
+ } else if (char === "}") {
2976
+ braceDepth--;
2977
+ const block = stack[stack.length - 1];
2978
+ if (block && block.kind && braceDepth >= 0) {
2979
+ stack.pop();
2980
+ symbols.push(symbol(filePath, lines, block, i + 1));
2981
+ } else if (block) {
2982
+ stack.pop();
2983
+ }
2984
+ }
2985
+ }
2986
+ if (trimmed) sawContent = true;
2987
+ }
2988
+ return symbols.sort((a, b) => a.lineStart - b.lineStart);
2989
+ }
2990
+
2991
+ // src/languages/apache.ts
2992
+ init_define_import_meta_env();
2993
+ function makeSymbol(filePath, lines, name, kind, lineStart, lineEnd) {
2994
+ return {
2995
+ filePath,
2996
+ name,
2997
+ kind,
2998
+ lineStart,
2999
+ lineEnd,
3000
+ body: lines.slice(lineStart - 1, lineEnd).join("\n"),
3001
+ docstring: "",
3002
+ parent: ""
3003
+ };
3004
+ }
3005
+ function extractApache(content, filePath) {
3006
+ const lines = content.split("\n");
3007
+ const symbols = [];
3008
+ const sections = [];
3009
+ for (let i = 0; i < lines.length; i++) {
3010
+ const lineNumber = i + 1;
3011
+ const rawLine = lines[i] ?? "";
3012
+ const code = rawLine.replace(/^\s*#.*$/, "").trim();
3013
+ if (!code) continue;
3014
+ const closing = /^<\/\s*([A-Za-z][\w-]*)\s*>/i.exec(code);
3015
+ if (closing) {
3016
+ const tag = closing[1]?.toLowerCase();
3017
+ const index = sections.map((section) => section.tag).lastIndexOf(tag ?? "");
3018
+ if (index >= 0) {
3019
+ const section = sections[index];
3020
+ if (section) {
3021
+ sections.splice(index, 1);
3022
+ symbols.push(makeSymbol(filePath, lines, section.name, "apache_section", section.lineStart, lineNumber));
3023
+ }
3024
+ }
3025
+ continue;
3026
+ }
3027
+ const opening = /^<\s*([A-Za-z][\w-]*)(?:\s+([^>\s](?:[^>]*[^>\s])?))?\s*>/i.exec(code);
3028
+ if (opening) {
3029
+ const tag = opening[1] ?? "";
3030
+ const args = opening[2]?.trim() ?? "";
3031
+ sections.push({
3032
+ tag: tag.toLowerCase(),
3033
+ name: args ? `${tag} ${args}` : tag,
3034
+ lineStart: lineNumber
3035
+ });
3036
+ continue;
3037
+ }
3038
+ const directive = /^(ServerName|DocumentRoot|Listen)\b(?:[ \t]+(\S(?:[^\r\n]*\S)?))?$/i.exec(code);
3039
+ if (directive) {
3040
+ const name = directive[2] ? `${directive[1]} ${directive[2]}` : directive[1] ?? "";
3041
+ symbols.push(makeSymbol(filePath, lines, name, "apache_directive", lineNumber, lineNumber));
3042
+ }
3043
+ }
3044
+ return symbols.sort((a, b) => a.lineStart - b.lineStart || a.lineEnd - b.lineEnd);
3045
+ }
3046
+
2756
3047
  // src/languages/bash_idx.ts
2757
3048
  init_define_import_meta_env();
2758
3049
  var MAX_SYMBOLS5 = 1e4;
@@ -3698,10 +3989,10 @@ function extractApex(content, filePath) {
3698
3989
  const key = `${name}\0${kind}\0${span.startLine}`;
3699
3990
  if (seen.has(key)) return;
3700
3991
  seen.add(key);
3701
- const symbol = makeSpanSymbol(filePath, name, kind, span, parent, rawLines, "c");
3702
- symbols.push(symbol);
3992
+ const symbol2 = makeSpanSymbol(filePath, name, kind, span, parent, rawLines, "c");
3993
+ symbols.push(symbol2);
3703
3994
  if (CONTAINER_KINDS.has(kind)) return;
3704
- for (let line = Math.max(0, symbol.lineStart); line <= symbol.lineEnd && line < covered.length; line++) covered[line] = 1;
3995
+ for (let line = Math.max(0, symbol2.lineStart); line <= symbol2.lineEnd && line < covered.length; line++) covered[line] = 1;
3705
3996
  };
3706
3997
  for (const match of code.matchAll(TRIGGER_RE2)) {
3707
3998
  const name = match[1] ?? "";
@@ -3884,11 +4175,11 @@ function propertyElements(content) {
3884
4175
  }
3885
4176
  return out;
3886
4177
  }
3887
- function makeRef(content, filePath, name, offset) {
3888
- const before = content.slice(0, offset);
3889
- const line = before.split(/\r?\n/).length;
3890
- const lineStart = Math.max(before.lastIndexOf("\n"), before.lastIndexOf("\r")) + 1;
3891
- const sourceLine = content.slice(lineStart).split(/\r?\n/, 1)[0] ?? "";
4178
+ function makeRef(content, lineIndex, filePath, name, offset) {
4179
+ const line = offsetToLine(lineIndex, offset);
4180
+ const lineStart = lineIndex[line - 1] ?? 0;
4181
+ const nextStart = lineIndex[line] ?? content.length + 1;
4182
+ const sourceLine = content.slice(lineStart, nextStart - 1);
3892
4183
  return { filePath, name, line, col: offset - lineStart, context: sourceLine.trim() };
3893
4184
  }
3894
4185
  function emitRef(refs, seen, ref) {
@@ -3898,11 +4189,11 @@ function emitRef(refs, seen, ref) {
3898
4189
  seen.add(key);
3899
4190
  refs.push(ref);
3900
4191
  }
3901
- function addTagRefs(refs, seen, content, filePath, tags) {
4192
+ function addTagRefs(refs, seen, content, lineIndex, filePath, tags) {
3902
4193
  for (const tag of tags) {
3903
4194
  for (const block of elementBlocks(content, tag)) {
3904
4195
  const name = decodeXml(block.inner.trim());
3905
- if (name !== "") emitRef(refs, seen, makeRef(content, filePath, name, block.offset));
4196
+ if (name !== "") emitRef(refs, seen, makeRef(content, lineIndex, filePath, name, block.offset));
3906
4197
  }
3907
4198
  }
3908
4199
  }
@@ -3926,12 +4217,12 @@ function addFlowElements(symbols, seen, content, filePath, flowName) {
3926
4217
  emit(symbols, seen, makeSpanSymbol(filePath, name, kind, span, flowName));
3927
4218
  }
3928
4219
  }
3929
- function emit(symbols, seen, symbol) {
3930
- if (!symbol.name || symbols.length >= MAX_SYMBOLS11) return;
3931
- const key = `${symbol.name}\0${symbol.kind}\0${symbol.lineStart}`;
4220
+ function emit(symbols, seen, symbol2) {
4221
+ if (!symbol2.name || symbols.length >= MAX_SYMBOLS11) return;
4222
+ const key = `${symbol2.name}\0${symbol2.kind}\0${symbol2.lineStart}`;
3932
4223
  if (seen.has(key)) return;
3933
4224
  seen.add(key);
3934
- symbols.push(symbol);
4225
+ symbols.push(symbol2);
3935
4226
  }
3936
4227
  function emitObjectScopedMetadata(symbols, seen, filePath, content, whole, metadataSuffix, kind) {
3937
4228
  const name = metadataName(filePath, content, metadataSuffix);
@@ -3943,6 +4234,7 @@ function emitObjectScopedMetadata(symbols, seen, filePath, content, whole, metad
3943
4234
  }
3944
4235
  function extractSalesforceMetadata(rawContent, filePath) {
3945
4236
  const content = stripXmlComments(rawContent);
4237
+ const lineIndex = buildLineIndex(content);
3946
4238
  const symbols = [];
3947
4239
  const seen = /* @__PURE__ */ new Set();
3948
4240
  const refs = [];
@@ -3969,7 +4261,7 @@ function extractSalesforceMetadata(rawContent, filePath) {
3969
4261
  const name2 = basenameWithout(filePath, ".flow-meta.xml");
3970
4262
  emit(symbols, seen, makeSpanSymbol(filePath, name2, "sf_flow", whole));
3971
4263
  addFlowElements(symbols, seen, content, filePath, name2);
3972
- addTagRefs(refs, seenRefs, content, filePath, ["actionName", "flowName"]);
4264
+ addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["actionName", "flowName"]);
3973
4265
  for (const tag of ["recordLookups", "recordCreates", "recordUpdates", "recordDeletes"]) {
3974
4266
  for (const block of elementBlocks(content, tag)) {
3975
4267
  const objectBlock = elementBlocks(block.text, "object")[0];
@@ -3977,7 +4269,7 @@ function extractSalesforceMetadata(rawContent, filePath) {
3977
4269
  const objectName = decodeXml(objectBlock.inner.trim());
3978
4270
  if (objectName === "") continue;
3979
4271
  const objectOffset = block.offset + objectBlock.offset;
3980
- emitRef(refs, seenRefs, makeRef(content, filePath, objectName, objectOffset));
4272
+ emitRef(refs, seenRefs, makeRef(content, lineIndex, filePath, objectName, objectOffset));
3981
4273
  let fieldSearchFrom = 0;
3982
4274
  for (const field of elementBlocks(block.inner, "field")) {
3983
4275
  const fieldName = decodeXml(field.inner.trim());
@@ -3985,7 +4277,7 @@ function extractSalesforceMetadata(rawContent, filePath) {
3985
4277
  const idx = block.text.indexOf(field.text, fieldSearchFrom);
3986
4278
  const offset = block.offset + (idx >= 0 ? idx : 0);
3987
4279
  if (idx >= 0) fieldSearchFrom = idx + field.text.length;
3988
- emitRef(refs, seenRefs, makeRef(content, filePath, `${objectName}.${fieldName}`, offset));
4280
+ emitRef(refs, seenRefs, makeRef(content, lineIndex, filePath, `${objectName}.${fieldName}`, offset));
3989
4281
  }
3990
4282
  }
3991
4283
  }
@@ -4026,7 +4318,6 @@ function extractSalesforceMetadata(rawContent, filePath) {
4026
4318
  const name = companion ?? (base.endsWith(".labels-meta.xml") ? null : xmlText(content, "fullName")) ?? metadataArtifactName(filePath);
4027
4319
  emit(symbols, seen, makeSpanSymbol(filePath, name, `sf_${snakeCase(root)}`, whole));
4028
4320
  if (base.endsWith(".labels-meta.xml")) {
4029
- const lineIndex = buildLineIndex(content);
4030
4321
  for (const block of elementBlocks(content, "labels")) {
4031
4322
  const labelName = xmlText(block.inner, "fullName");
4032
4323
  if (labelName === null) continue;
@@ -4043,7 +4334,6 @@ function extractSalesforceMetadata(rawContent, filePath) {
4043
4334
  }
4044
4335
  }
4045
4336
  if (base.endsWith(".js-meta.xml")) {
4046
- const lineIndex = buildLineIndex(content);
4047
4337
  const lwcSeen = /* @__PURE__ */ new Set();
4048
4338
  for (const target of elementBlocks(content, "target")) {
4049
4339
  const targetName = decodeXml(target.inner.trim());
@@ -4081,11 +4371,11 @@ function extractSalesforceMetadata(rawContent, filePath) {
4081
4371
  }
4082
4372
  }
4083
4373
  if (base.endsWith(".flexipage-meta.xml")) {
4084
- addTagRefs(refs, seenRefs, content, filePath, ["sobjectType", "componentName"]);
4374
+ addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["sobjectType", "componentName"]);
4085
4375
  } else if (base.endsWith(".quickaction-meta.xml")) {
4086
- addTagRefs(refs, seenRefs, content, filePath, ["targetObject", "lightningComponent"]);
4376
+ addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["targetObject", "lightningComponent"]);
4087
4377
  } else if (base.endsWith(".messagechannel-meta.xml")) {
4088
- addTagRefs(refs, seenRefs, content, filePath, ["fieldName"]);
4378
+ addTagRefs(refs, seenRefs, content, lineIndex, filePath, ["fieldName"]);
4089
4379
  }
4090
4380
  return { symbols, refs };
4091
4381
  }
@@ -6041,6 +6331,9 @@ var ADAPTER_EXTRACTORS = {
6041
6331
  graphql: (content, filePath) => extractGraphql(content, filePath).symbols,
6042
6332
  sql: extractSql,
6043
6333
  ini: extractIni,
6334
+ nginx: extractNginx,
6335
+ caddy: extractCaddy,
6336
+ apache: extractApache,
6044
6337
  makefile: extractMakefile,
6045
6338
  proto: (content, filePath) => extractProto(content, filePath).symbols,
6046
6339
  terraform: extractTerraform,
@@ -0,0 +1,41 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ buildEvent,
5
+ relay,
6
+ relayInProcess
7
+ } from "./token-goat-chunk-Z4ALQADF.mjs";
8
+ import "./token-goat-chunk-ITWYDOKP.mjs";
9
+ import {
10
+ MAX_STDIN_BYTES,
11
+ readStdinJson
12
+ } from "./token-goat-chunk-I5PQRHFE.mjs";
13
+ import "./token-goat-chunk-BQIC3AVL.mjs";
14
+ import "./token-goat-chunk-VSJGPEBB.mjs";
15
+ import "./token-goat-chunk-DPHJU3P7.mjs";
16
+ import "./token-goat-chunk-PAVWB4L4.mjs";
17
+ import "./token-goat-chunk-SP5QR2HN.mjs";
18
+ import "./token-goat-chunk-KT75DZK4.mjs";
19
+ import "./token-goat-chunk-ZHFM4DHJ.mjs";
20
+ import "./token-goat-chunk-SL454EN5.mjs";
21
+ import "./token-goat-chunk-K5XPIUVB.mjs";
22
+ import "./token-goat-chunk-3BTK54F3.mjs";
23
+ import "./token-goat-chunk-ERGHDBC6.mjs";
24
+ import "./token-goat-chunk-K3ZNBN4U.mjs";
25
+ import "./token-goat-chunk-T63VHOL3.mjs";
26
+ import "./token-goat-chunk-74ADIZZX.mjs";
27
+ import "./token-goat-chunk-EEIDFMEM.mjs";
28
+ import "./token-goat-chunk-OSUFN2FV.mjs";
29
+ import "./token-goat-chunk-6LJNM4ZZ.mjs";
30
+ import "./token-goat-chunk-NMTKNYGF.mjs";
31
+ import "./token-goat-chunk-Y4AFKTHK.mjs";
32
+ import "./token-goat-chunk-GMOUBOX4.mjs";
33
+ import "./token-goat-chunk-RRNZMM3A.mjs";
34
+ import "./token-goat-chunk-A37V4PBF.mjs";
35
+ export {
36
+ MAX_STDIN_BYTES,
37
+ buildEvent,
38
+ readStdinJson,
39
+ relay,
40
+ relayInProcess
41
+ };
@@ -20,18 +20,18 @@ import {
20
20
  setOcrTimeoutForTesting,
21
21
  setTesseractEntryForTesting,
22
22
  verifyOcrLangCache
23
- } from "./token-goat-chunk-H3FONFBO.mjs";
24
- import "./token-goat-chunk-HPOFR6QX.mjs";
25
- import "./token-goat-chunk-L7VCX33I.mjs";
23
+ } from "./token-goat-chunk-MNJWG2ZO.mjs";
24
+ import "./token-goat-chunk-K5XPIUVB.mjs";
25
+ import "./token-goat-chunk-T63VHOL3.mjs";
26
26
  import {
27
27
  DEFAULT_OCR_LANG,
28
28
  isSupportedOcrLang,
29
29
  resolveOcrLangs
30
- } from "./token-goat-chunk-CA6V36KW.mjs";
30
+ } from "./token-goat-chunk-74ADIZZX.mjs";
31
31
  import "./token-goat-chunk-EEIDFMEM.mjs";
32
32
  import "./token-goat-chunk-OSUFN2FV.mjs";
33
- import "./token-goat-chunk-QIDLJGXZ.mjs";
34
- import "./token-goat-chunk-ERTXEKB6.mjs";
33
+ import "./token-goat-chunk-6LJNM4ZZ.mjs";
34
+ import "./token-goat-chunk-NMTKNYGF.mjs";
35
35
  import "./token-goat-chunk-GMOUBOX4.mjs";
36
36
  import "./token-goat-chunk-A37V4PBF.mjs";
37
37
  export {
@@ -70,35 +70,44 @@ import {
70
70
  requirePositiveInt,
71
71
  run,
72
72
  visualStudioManualSteps
73
- } from "./token-goat-chunk-LTYWLKAG.mjs";
74
- import "./token-goat-chunk-QML7ITHJ.mjs";
75
- import "./token-goat-chunk-H3FONFBO.mjs";
76
- import "./token-goat-chunk-LMFO66YD.mjs";
73
+ } from "./token-goat-chunk-2Q3N5KUQ.mjs";
74
+ import "./token-goat-chunk-ONMU7BON.mjs";
75
+ import "./token-goat-chunk-EUZKG7ZO.mjs";
76
+ import "./token-goat-chunk-W6QYCWAT.mjs";
77
+ import "./token-goat-chunk-3VTJC7KU.mjs";
78
+ import "./token-goat-chunk-MNJWG2ZO.mjs";
79
+ import "./token-goat-chunk-DA43OE7L.mjs";
77
80
  import {
78
81
  cmdDescribe,
79
82
  cmdSessionSchema
80
- } from "./token-goat-chunk-V3ZWBEHM.mjs";
81
- import "./token-goat-chunk-BFEWOMA3.mjs";
82
- import "./token-goat-chunk-CTOYJ232.mjs";
83
- import "./token-goat-chunk-HPOFR6QX.mjs";
83
+ } from "./token-goat-chunk-I5PQRHFE.mjs";
84
+ import "./token-goat-chunk-BQIC3AVL.mjs";
85
+ import "./token-goat-chunk-VSJGPEBB.mjs";
86
+ import "./token-goat-chunk-DPHJU3P7.mjs";
87
+ import "./token-goat-chunk-PAVWB4L4.mjs";
88
+ import "./token-goat-chunk-SP5QR2HN.mjs";
89
+ import "./token-goat-chunk-KT75DZK4.mjs";
90
+ import "./token-goat-chunk-ZHFM4DHJ.mjs";
91
+ import "./token-goat-chunk-SL454EN5.mjs";
92
+ import "./token-goat-chunk-K5XPIUVB.mjs";
84
93
  import "./token-goat-chunk-LKSXAMJB.mjs";
85
- import "./token-goat-chunk-UENEL6KX.mjs";
86
- import "./token-goat-chunk-ARNRFR6M.mjs";
87
- import "./token-goat-chunk-LA3O4JGD.mjs";
88
- import "./token-goat-chunk-EPXNOKIV.mjs";
94
+ import "./token-goat-chunk-PTW22MRC.mjs";
95
+ import "./token-goat-chunk-DNAF26L4.mjs";
96
+ import "./token-goat-chunk-ODF7H7WS.mjs";
97
+ import "./token-goat-chunk-P4XBHZXU.mjs";
89
98
  import "./token-goat-chunk-3BTK54F3.mjs";
90
- import "./token-goat-chunk-7VLWNQDQ.mjs";
99
+ import "./token-goat-chunk-T46UKRFM.mjs";
91
100
  import "./token-goat-chunk-XTQAOTSO.mjs";
92
101
  import "./token-goat-chunk-AH6QILZM.mjs";
93
- import "./token-goat-chunk-GRI6HWX3.mjs";
94
- import "./token-goat-chunk-W3E65QOW.mjs";
95
- import "./token-goat-chunk-I67CPTDD.mjs";
96
- import "./token-goat-chunk-L7VCX33I.mjs";
97
- import "./token-goat-chunk-CA6V36KW.mjs";
102
+ import "./token-goat-chunk-MUJV7BR3.mjs";
103
+ import "./token-goat-chunk-ERGHDBC6.mjs";
104
+ import "./token-goat-chunk-K3ZNBN4U.mjs";
105
+ import "./token-goat-chunk-T63VHOL3.mjs";
106
+ import "./token-goat-chunk-74ADIZZX.mjs";
98
107
  import "./token-goat-chunk-EEIDFMEM.mjs";
99
108
  import "./token-goat-chunk-OSUFN2FV.mjs";
100
- import "./token-goat-chunk-QIDLJGXZ.mjs";
101
- import "./token-goat-chunk-ERTXEKB6.mjs";
109
+ import "./token-goat-chunk-6LJNM4ZZ.mjs";
110
+ import "./token-goat-chunk-NMTKNYGF.mjs";
102
111
  import "./token-goat-chunk-Y4AFKTHK.mjs";
103
112
  import "./token-goat-chunk-GMOUBOX4.mjs";
104
113
  import "./token-goat-chunk-RRNZMM3A.mjs";