@opentrace/components 0.1.1-rc.47 → 0.1.1-rc.62

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 (111) hide show
  1. package/README.md +306 -0
  2. package/bin/copy-wasm.js +125 -0
  3. package/dist/opentrace-components.cjs +354 -246
  4. package/dist/opentrace-components.cjs.map +1 -1
  5. package/dist/opentrace-components.js +355 -247
  6. package/dist/opentrace-components.js.map +1 -1
  7. package/dist/pipeline-wasm.cjs +58 -0
  8. package/dist/pipeline-wasm.cjs.map +1 -0
  9. package/dist/pipeline-wasm.js +57 -0
  10. package/dist/pipeline-wasm.js.map +1 -0
  11. package/dist/pipeline.cjs +3481 -0
  12. package/dist/pipeline.cjs.map +1 -0
  13. package/dist/pipeline.js +3481 -0
  14. package/dist/pipeline.js.map +1 -0
  15. package/dist/src/GraphCanvas.d.ts +5 -0
  16. package/dist/src/GraphCanvas.d.ts.map +1 -1
  17. package/dist/src/colors/communityColors.d.ts.map +1 -1
  18. package/dist/src/config/graphLayout.d.ts +9 -9
  19. package/dist/src/config/graphLayout.d.ts.map +1 -1
  20. package/dist/src/graph/LayoutPipeline.d.ts +4 -6
  21. package/dist/src/graph/LayoutPipeline.d.ts.map +1 -1
  22. package/dist/src/graph/spacingWorker.d.ts +4 -0
  23. package/dist/src/graph/spacingWorker.d.ts.map +1 -1
  24. package/dist/src/graph/useGraphFilters.d.ts.map +1 -1
  25. package/dist/src/graph/useGraphInstance.d.ts.map +1 -1
  26. package/dist/src/graph/useGraphVisuals.d.ts.map +1 -1
  27. package/dist/src/index.d.ts +1 -1
  28. package/dist/src/index.d.ts.map +1 -1
  29. package/dist/src/pipeline/__tests__/cross-repo.test.d.ts +2 -0
  30. package/dist/src/pipeline/__tests__/cross-repo.test.d.ts.map +1 -0
  31. package/dist/src/pipeline/__tests__/fixture.test.d.ts +2 -0
  32. package/dist/src/pipeline/__tests__/fixture.test.d.ts.map +1 -0
  33. package/dist/src/pipeline/__tests__/github.test.d.ts +2 -0
  34. package/dist/src/pipeline/__tests__/github.test.d.ts.map +1 -0
  35. package/dist/src/pipeline/__tests__/helpers.d.ts +16 -0
  36. package/dist/src/pipeline/__tests__/helpers.d.ts.map +1 -0
  37. package/dist/src/pipeline/__tests__/loading.test.d.ts +2 -0
  38. package/dist/src/pipeline/__tests__/loading.test.d.ts.map +1 -0
  39. package/dist/src/pipeline/__tests__/parsing.test.d.ts +2 -0
  40. package/dist/src/pipeline/__tests__/parsing.test.d.ts.map +1 -0
  41. package/dist/src/pipeline/__tests__/pipeline.test.d.ts +2 -0
  42. package/dist/src/pipeline/__tests__/pipeline.test.d.ts.map +1 -0
  43. package/dist/src/pipeline/index.d.ts +19 -0
  44. package/dist/src/pipeline/index.d.ts.map +1 -0
  45. package/dist/src/pipeline/parser/callResolver.d.ts +52 -0
  46. package/dist/src/pipeline/parser/callResolver.d.ts.map +1 -0
  47. package/dist/src/pipeline/parser/extractors/generic.d.ts +15 -0
  48. package/dist/src/pipeline/parser/extractors/generic.d.ts.map +1 -0
  49. package/dist/src/pipeline/parser/extractors/go.d.ts +8 -0
  50. package/dist/src/pipeline/parser/extractors/go.d.ts.map +1 -0
  51. package/dist/src/pipeline/parser/extractors/python.d.ts +8 -0
  52. package/dist/src/pipeline/parser/extractors/python.d.ts.map +1 -0
  53. package/dist/src/pipeline/parser/extractors/typescript.d.ts +8 -0
  54. package/dist/src/pipeline/parser/extractors/typescript.d.ts.map +1 -0
  55. package/dist/src/pipeline/parser/importAnalyzer.d.ts +25 -0
  56. package/dist/src/pipeline/parser/importAnalyzer.d.ts.map +1 -0
  57. package/dist/src/pipeline/parser/manifestParser.d.ts +42 -0
  58. package/dist/src/pipeline/parser/manifestParser.d.ts.map +1 -0
  59. package/dist/src/pipeline/pipeline.d.ts +10 -0
  60. package/dist/src/pipeline/pipeline.d.ts.map +1 -0
  61. package/dist/src/pipeline/stages/loading.d.ts +6 -0
  62. package/dist/src/pipeline/stages/loading.d.ts.map +1 -0
  63. package/dist/src/pipeline/stages/parsing.d.ts +20 -0
  64. package/dist/src/pipeline/stages/parsing.d.ts.map +1 -0
  65. package/dist/src/pipeline/stages/processing.d.ts +15 -0
  66. package/dist/src/pipeline/stages/processing.d.ts.map +1 -0
  67. package/dist/src/pipeline/stages/resolving.d.ts +11 -0
  68. package/dist/src/pipeline/stages/resolving.d.ts.map +1 -0
  69. package/dist/src/pipeline/stages/saving.d.ts +7 -0
  70. package/dist/src/pipeline/stages/saving.d.ts.map +1 -0
  71. package/dist/src/pipeline/stages/scanning.d.ts +7 -0
  72. package/dist/src/pipeline/stages/scanning.d.ts.map +1 -0
  73. package/dist/src/pipeline/stages/summarizing.d.ts +16 -0
  74. package/dist/src/pipeline/stages/summarizing.d.ts.map +1 -0
  75. package/dist/src/pipeline/store/memory.d.ts +8 -0
  76. package/dist/src/pipeline/store/memory.d.ts.map +1 -0
  77. package/dist/src/pipeline/summarizer/templateSummarizer.d.ts +40 -0
  78. package/dist/src/pipeline/summarizer/templateSummarizer.d.ts.map +1 -0
  79. package/dist/src/pipeline/summarizer/types.d.ts +62 -0
  80. package/dist/src/pipeline/summarizer/types.d.ts.map +1 -0
  81. package/dist/src/pipeline/types.d.ts +119 -0
  82. package/dist/src/pipeline/types.d.ts.map +1 -0
  83. package/dist/src/pipeline/wasm.d.ts +14 -0
  84. package/dist/src/pipeline/wasm.d.ts.map +1 -0
  85. package/dist/src/sigma/useSelectionPulse.d.ts +3 -0
  86. package/dist/src/sigma/useSelectionPulse.d.ts.map +1 -0
  87. package/dist/{useHighlights-DbMfb0-p.js → useHighlights-CmOAWaLE.js} +60 -53
  88. package/dist/{useHighlights-DbMfb0-p.js.map → useHighlights-CmOAWaLE.js.map} +1 -1
  89. package/dist/{useHighlights-fRWg-A_c.cjs → useHighlights-zx7DM4V0.cjs} +60 -53
  90. package/dist/{useHighlights-fRWg-A_c.cjs.map → useHighlights-zx7DM4V0.cjs.map} +1 -1
  91. package/dist/utils.cjs +1 -1
  92. package/dist/utils.js +1 -1
  93. package/package.json +32 -4
  94. package/public/wasm/tree-sitter-bash.wasm +0 -0
  95. package/public/wasm/tree-sitter-c.wasm +0 -0
  96. package/public/wasm/tree-sitter-c_sharp.wasm +0 -0
  97. package/public/wasm/tree-sitter-cpp.wasm +0 -0
  98. package/public/wasm/tree-sitter-go.wasm +0 -0
  99. package/public/wasm/tree-sitter-java.wasm +0 -0
  100. package/public/wasm/tree-sitter-json.wasm +0 -0
  101. package/public/wasm/tree-sitter-kotlin.wasm +0 -0
  102. package/public/wasm/tree-sitter-python.wasm +0 -0
  103. package/public/wasm/tree-sitter-ruby.wasm +0 -0
  104. package/public/wasm/tree-sitter-rust.wasm +0 -0
  105. package/public/wasm/tree-sitter-swift.wasm +0 -0
  106. package/public/wasm/tree-sitter-toml.wasm +0 -0
  107. package/public/wasm/tree-sitter-tsx.wasm +0 -0
  108. package/public/wasm/tree-sitter-typescript.wasm +0 -0
  109. package/public/wasm/web-tree-sitter.wasm +0 -0
  110. package/dist/assets/spacingWorker-hXLGHyRg.js +0 -123
  111. package/dist/assets/spacingWorker-hXLGHyRg.js.map +0 -1
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const node_fs = require("node:fs");
4
+ const node_url = require("node:url");
5
+ const node_path = require("node:path");
6
+ var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
7
+ const __filename$1 = node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("pipeline-wasm.cjs", document.baseURI).href);
8
+ const __dirname$1 = node_path.dirname(__filename$1);
9
+ function findWasmDir() {
10
+ let dir = __dirname$1;
11
+ for (let i = 0; i < 5; i++) {
12
+ const candidate = node_path.join(dir, "public", "wasm");
13
+ if (node_fs.existsSync(candidate)) return candidate;
14
+ dir = node_path.dirname(dir);
15
+ }
16
+ throw new Error(
17
+ "Could not find WASM directory. Ensure @opentrace/components is installed correctly."
18
+ );
19
+ }
20
+ let _wasmDir;
21
+ const WASM_FILES = {
22
+ bash: "tree-sitter-bash.wasm",
23
+ c: "tree-sitter-c.wasm",
24
+ cpp: "tree-sitter-cpp.wasm",
25
+ csharp: "tree-sitter-c_sharp.wasm",
26
+ go: "tree-sitter-go.wasm",
27
+ java: "tree-sitter-java.wasm",
28
+ json: "tree-sitter-json.wasm",
29
+ kotlin: "tree-sitter-kotlin.wasm",
30
+ python: "tree-sitter-python.wasm",
31
+ ruby: "tree-sitter-ruby.wasm",
32
+ rust: "tree-sitter-rust.wasm",
33
+ swift: "tree-sitter-swift.wasm",
34
+ toml: "tree-sitter-toml.wasm",
35
+ tsx: "tree-sitter-tsx.wasm",
36
+ typescript: "tree-sitter-typescript.wasm"
37
+ };
38
+ const SUPPORTED_LANGUAGES = Object.keys(WASM_FILES);
39
+ function getWasmDir() {
40
+ if (!_wasmDir) _wasmDir = findWasmDir();
41
+ return _wasmDir;
42
+ }
43
+ function getWasmPath(key) {
44
+ if (key === "runtime") {
45
+ return node_path.join(getWasmDir(), "web-tree-sitter.wasm");
46
+ }
47
+ const file = WASM_FILES[key];
48
+ if (!file) {
49
+ throw new Error(
50
+ `Unknown language "${key}". Supported: ${SUPPORTED_LANGUAGES.join(", ")}, runtime`
51
+ );
52
+ }
53
+ return node_path.join(getWasmDir(), file);
54
+ }
55
+ exports.SUPPORTED_LANGUAGES = SUPPORTED_LANGUAGES;
56
+ exports.getWasmDir = getWasmDir;
57
+ exports.getWasmPath = getWasmPath;
58
+ //# sourceMappingURL=pipeline-wasm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-wasm.cjs","sources":["../src/pipeline/wasm.ts"],"sourcesContent":["/*\n * Copyright 2026 OpenTrace Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Helpers for locating tree-sitter WASM files shipped with this package.\n *\n * Usage (Node.js — tests, build scripts, CLI tools):\n *\n * import { getWasmDir, getWasmPath } from '@opentrace/components/pipeline';\n *\n * // Directory containing all WASM files\n * const dir = getWasmDir();\n *\n * // Path to a specific grammar\n * const pyWasm = getWasmPath('python');\n * const lang = await Language.load(await readFile(pyWasm));\n *\n * Usage (browser — Vite/webpack/etc.):\n *\n * WASM files must be copied to your app's public directory so they're\n * served as static assets. Use the included CLI:\n *\n * npx opentrace-copy-wasm public/\n *\n * Or in your package.json scripts:\n *\n * \"postinstall\": \"opentrace-copy-wasm public/\"\n */\n\nimport { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { dirname, join } from 'node:path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Resolve the WASM directory. Walks up from this file's location until\n * it finds a `public/wasm` directory. Works from both source and dist:\n *\n * - Source: components/src/pipeline/wasm.ts (2 levels up)\n * - Dist: components/dist/pipeline.js (1 level up)\n * - npm: @opentrace/components/dist/pipeline.js (1 level up)\n */\nfunction findWasmDir(): string {\n let dir = __dirname;\n for (let i = 0; i < 5; i++) {\n const candidate = join(dir, 'public', 'wasm');\n if (existsSync(candidate)) return candidate;\n dir = dirname(dir);\n }\n // Should not happen in a correctly installed package\n throw new Error(\n 'Could not find WASM directory. Ensure @opentrace/components is installed correctly.',\n );\n}\n\nlet _wasmDir: string | undefined;\n\n/** Language key → WASM filename mapping. */\nconst WASM_FILES: Record<string, string> = {\n bash: 'tree-sitter-bash.wasm',\n c: 'tree-sitter-c.wasm',\n cpp: 'tree-sitter-cpp.wasm',\n csharp: 'tree-sitter-c_sharp.wasm',\n go: 'tree-sitter-go.wasm',\n java: 'tree-sitter-java.wasm',\n json: 'tree-sitter-json.wasm',\n kotlin: 'tree-sitter-kotlin.wasm',\n python: 'tree-sitter-python.wasm',\n ruby: 'tree-sitter-ruby.wasm',\n rust: 'tree-sitter-rust.wasm',\n swift: 'tree-sitter-swift.wasm',\n toml: 'tree-sitter-toml.wasm',\n tsx: 'tree-sitter-tsx.wasm',\n typescript: 'tree-sitter-typescript.wasm',\n};\n\n/** All supported language keys. */\nexport const SUPPORTED_LANGUAGES = Object.keys(WASM_FILES);\n\n/** Get the absolute path to the directory containing all WASM files. */\nexport function getWasmDir(): string {\n if (!_wasmDir) _wasmDir = findWasmDir();\n return _wasmDir;\n}\n\n/**\n * Get the absolute path to a specific WASM file.\n *\n * @param key - Language key (e.g. 'python', 'typescript', 'tsx') or\n * 'runtime' for the web-tree-sitter runtime WASM.\n * @returns Absolute path to the .wasm file.\n * @throws If the language key is not recognized.\n */\nexport function getWasmPath(key: string): string {\n if (key === 'runtime') {\n return join(getWasmDir(), 'web-tree-sitter.wasm');\n }\n const file = WASM_FILES[key];\n if (!file) {\n throw new Error(\n `Unknown language \"${key}\". Supported: ${SUPPORTED_LANGUAGES.join(', ')}, runtime`,\n );\n }\n return join(getWasmDir(), file);\n}\n"],"names":["__filename","fileURLToPath","__dirname","dirname","join","existsSync"],"mappings":";;;;;;AA8CA,MAAMA,eAAaC,SAAAA,wQAA6B;AAChD,MAAMC,cAAYC,UAAAA,QAAQH,YAAU;AAUpC,SAAS,cAAsB;AAC7B,MAAI,MAAME;AACV,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,UAAM,YAAYE,UAAAA,KAAK,KAAK,UAAU,MAAM;AAC5C,QAAIC,QAAAA,WAAW,SAAS,EAAG,QAAO;AAClC,UAAMF,UAAAA,QAAQ,GAAG;AAAA,EACnB;AAEA,QAAM,IAAI;AAAA,IACR;AAAA,EAAA;AAEJ;AAEA,IAAI;AAGJ,MAAM,aAAqC;AAAA,EACzC,MAAM;AAAA,EACN,GAAG;AAAA,EACH,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AAAA,EACL,YAAY;AACd;AAGO,MAAM,sBAAsB,OAAO,KAAK,UAAU;AAGlD,SAAS,aAAqB;AACnC,MAAI,CAAC,SAAU,YAAW,YAAA;AAC1B,SAAO;AACT;AAUO,SAAS,YAAY,KAAqB;AAC/C,MAAI,QAAQ,WAAW;AACrB,WAAOC,UAAAA,KAAK,WAAA,GAAc,sBAAsB;AAAA,EAClD;AACA,QAAM,OAAO,WAAW,GAAG;AAC3B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,qBAAqB,GAAG,iBAAiB,oBAAoB,KAAK,IAAI,CAAC;AAAA,IAAA;AAAA,EAE3E;AACA,SAAOA,UAAAA,KAAK,WAAA,GAAc,IAAI;AAChC;;;;"}
@@ -0,0 +1,57 @@
1
+ import { existsSync } from "node:fs";
2
+ import { fileURLToPath } from "node:url";
3
+ import { dirname, join } from "node:path";
4
+ const __filename$1 = fileURLToPath(import.meta.url);
5
+ const __dirname$1 = dirname(__filename$1);
6
+ function findWasmDir() {
7
+ let dir = __dirname$1;
8
+ for (let i = 0; i < 5; i++) {
9
+ const candidate = join(dir, "public", "wasm");
10
+ if (existsSync(candidate)) return candidate;
11
+ dir = dirname(dir);
12
+ }
13
+ throw new Error(
14
+ "Could not find WASM directory. Ensure @opentrace/components is installed correctly."
15
+ );
16
+ }
17
+ let _wasmDir;
18
+ const WASM_FILES = {
19
+ bash: "tree-sitter-bash.wasm",
20
+ c: "tree-sitter-c.wasm",
21
+ cpp: "tree-sitter-cpp.wasm",
22
+ csharp: "tree-sitter-c_sharp.wasm",
23
+ go: "tree-sitter-go.wasm",
24
+ java: "tree-sitter-java.wasm",
25
+ json: "tree-sitter-json.wasm",
26
+ kotlin: "tree-sitter-kotlin.wasm",
27
+ python: "tree-sitter-python.wasm",
28
+ ruby: "tree-sitter-ruby.wasm",
29
+ rust: "tree-sitter-rust.wasm",
30
+ swift: "tree-sitter-swift.wasm",
31
+ toml: "tree-sitter-toml.wasm",
32
+ tsx: "tree-sitter-tsx.wasm",
33
+ typescript: "tree-sitter-typescript.wasm"
34
+ };
35
+ const SUPPORTED_LANGUAGES = Object.keys(WASM_FILES);
36
+ function getWasmDir() {
37
+ if (!_wasmDir) _wasmDir = findWasmDir();
38
+ return _wasmDir;
39
+ }
40
+ function getWasmPath(key) {
41
+ if (key === "runtime") {
42
+ return join(getWasmDir(), "web-tree-sitter.wasm");
43
+ }
44
+ const file = WASM_FILES[key];
45
+ if (!file) {
46
+ throw new Error(
47
+ `Unknown language "${key}". Supported: ${SUPPORTED_LANGUAGES.join(", ")}, runtime`
48
+ );
49
+ }
50
+ return join(getWasmDir(), file);
51
+ }
52
+ export {
53
+ SUPPORTED_LANGUAGES,
54
+ getWasmDir,
55
+ getWasmPath
56
+ };
57
+ //# sourceMappingURL=pipeline-wasm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-wasm.js","sources":["../src/pipeline/wasm.ts"],"sourcesContent":["/*\n * Copyright 2026 OpenTrace Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Helpers for locating tree-sitter WASM files shipped with this package.\n *\n * Usage (Node.js — tests, build scripts, CLI tools):\n *\n * import { getWasmDir, getWasmPath } from '@opentrace/components/pipeline';\n *\n * // Directory containing all WASM files\n * const dir = getWasmDir();\n *\n * // Path to a specific grammar\n * const pyWasm = getWasmPath('python');\n * const lang = await Language.load(await readFile(pyWasm));\n *\n * Usage (browser — Vite/webpack/etc.):\n *\n * WASM files must be copied to your app's public directory so they're\n * served as static assets. Use the included CLI:\n *\n * npx opentrace-copy-wasm public/\n *\n * Or in your package.json scripts:\n *\n * \"postinstall\": \"opentrace-copy-wasm public/\"\n */\n\nimport { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { dirname, join } from 'node:path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Resolve the WASM directory. Walks up from this file's location until\n * it finds a `public/wasm` directory. Works from both source and dist:\n *\n * - Source: components/src/pipeline/wasm.ts (2 levels up)\n * - Dist: components/dist/pipeline.js (1 level up)\n * - npm: @opentrace/components/dist/pipeline.js (1 level up)\n */\nfunction findWasmDir(): string {\n let dir = __dirname;\n for (let i = 0; i < 5; i++) {\n const candidate = join(dir, 'public', 'wasm');\n if (existsSync(candidate)) return candidate;\n dir = dirname(dir);\n }\n // Should not happen in a correctly installed package\n throw new Error(\n 'Could not find WASM directory. Ensure @opentrace/components is installed correctly.',\n );\n}\n\nlet _wasmDir: string | undefined;\n\n/** Language key → WASM filename mapping. */\nconst WASM_FILES: Record<string, string> = {\n bash: 'tree-sitter-bash.wasm',\n c: 'tree-sitter-c.wasm',\n cpp: 'tree-sitter-cpp.wasm',\n csharp: 'tree-sitter-c_sharp.wasm',\n go: 'tree-sitter-go.wasm',\n java: 'tree-sitter-java.wasm',\n json: 'tree-sitter-json.wasm',\n kotlin: 'tree-sitter-kotlin.wasm',\n python: 'tree-sitter-python.wasm',\n ruby: 'tree-sitter-ruby.wasm',\n rust: 'tree-sitter-rust.wasm',\n swift: 'tree-sitter-swift.wasm',\n toml: 'tree-sitter-toml.wasm',\n tsx: 'tree-sitter-tsx.wasm',\n typescript: 'tree-sitter-typescript.wasm',\n};\n\n/** All supported language keys. */\nexport const SUPPORTED_LANGUAGES = Object.keys(WASM_FILES);\n\n/** Get the absolute path to the directory containing all WASM files. */\nexport function getWasmDir(): string {\n if (!_wasmDir) _wasmDir = findWasmDir();\n return _wasmDir;\n}\n\n/**\n * Get the absolute path to a specific WASM file.\n *\n * @param key - Language key (e.g. 'python', 'typescript', 'tsx') or\n * 'runtime' for the web-tree-sitter runtime WASM.\n * @returns Absolute path to the .wasm file.\n * @throws If the language key is not recognized.\n */\nexport function getWasmPath(key: string): string {\n if (key === 'runtime') {\n return join(getWasmDir(), 'web-tree-sitter.wasm');\n }\n const file = WASM_FILES[key];\n if (!file) {\n throw new Error(\n `Unknown language \"${key}\". Supported: ${SUPPORTED_LANGUAGES.join(', ')}, runtime`,\n );\n }\n return join(getWasmDir(), file);\n}\n"],"names":["__filename","__dirname"],"mappings":";;;AA8CA,MAAMA,eAAa,cAAc,YAAY,GAAG;AAChD,MAAMC,cAAY,QAAQD,YAAU;AAUpC,SAAS,cAAsB;AAC7B,MAAI,MAAMC;AACV,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,UAAM,YAAY,KAAK,KAAK,UAAU,MAAM;AAC5C,QAAI,WAAW,SAAS,EAAG,QAAO;AAClC,UAAM,QAAQ,GAAG;AAAA,EACnB;AAEA,QAAM,IAAI;AAAA,IACR;AAAA,EAAA;AAEJ;AAEA,IAAI;AAGJ,MAAM,aAAqC;AAAA,EACzC,MAAM;AAAA,EACN,GAAG;AAAA,EACH,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,KAAK;AAAA,EACL,YAAY;AACd;AAGO,MAAM,sBAAsB,OAAO,KAAK,UAAU;AAGlD,SAAS,aAAqB;AACnC,MAAI,CAAC,SAAU,YAAW,YAAA;AAC1B,SAAO;AACT;AAUO,SAAS,YAAY,KAAqB;AAC/C,MAAI,QAAQ,WAAW;AACrB,WAAO,KAAK,WAAA,GAAc,sBAAsB;AAAA,EAClD;AACA,QAAM,OAAO,WAAW,GAAG;AAC3B,MAAI,CAAC,MAAM;AACT,UAAM,IAAI;AAAA,MACR,qBAAqB,GAAG,iBAAiB,oBAAoB,KAAK,IAAI,CAAC;AAAA,IAAA;AAAA,EAE3E;AACA,SAAO,KAAK,WAAA,GAAc,IAAI;AAChC;"}