@vibecheck-ai/mcp 24.6.8 → 24.6.11
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.
- package/README.md +1 -1
- package/dist/APITruthEngine-IZRR3NT5-LPFUOMLD.js +9 -0
- package/dist/CredentialsEngine-B66ANCBB-HY5ZQTSX.js +9 -0
- package/dist/EnvVarEngine-ZFNW2XKP-6HRTZULP.js +9 -0
- package/dist/ErrorHandlingEngine-VAHVDVFG-3GDGRN3U.js +11 -0
- package/dist/FrameworkPackEngine-RRBJW4MC-KH7WRXXS.js +12 -0
- package/dist/GhostRouteEngine-UMYBCOCL-MSZOPVZY.js +9 -0
- package/dist/LogicGapEngine-OK5UKZQ5-YGXZDERB.js +11 -0
- package/dist/PhantomDepEngine-HQEXAS25-TRVEXBMF.js +10 -0
- package/dist/SecurityEngine-MVMRPKLH-BNP7IC46.js +9 -0
- package/dist/VersionHallucinationEngine-673DJ26J-BD4SK6JX.js +9 -0
- package/dist/chokidar-CI5VJY5M.js +2414 -0
- package/dist/chunk-43XAAYST.js +863 -0
- package/dist/chunk-5DADZJ3D.js +650 -0
- package/dist/chunk-DDTUTWRY.js +605 -0
- package/dist/chunk-DGNNNAVK.js +304 -0
- package/dist/chunk-F34MHA6A.js +772 -0
- package/dist/chunk-FGMVY5QW.js +42 -0
- package/dist/chunk-G3FQJC2H.js +1968 -0
- package/dist/chunk-J52EUKKW.js +196 -0
- package/dist/chunk-JZSHXEYP.js +915 -0
- package/dist/chunk-LQSBUKYZ.js +551 -0
- package/dist/chunk-MUP4JXOF.js +219 -0
- package/dist/chunk-NR36RTVO.js +152 -0
- package/dist/chunk-QFDZMUGO.js +213300 -0
- package/dist/chunk-QGPX6H6L.js +3044 -0
- package/dist/chunk-QYXENOVK.js +499 -0
- package/dist/chunk-RNFMO5GH.js +8861 -0
- package/dist/chunk-RR5ETBSV.js +66 -0
- package/dist/chunk-YWUMPN4Z.js +53 -0
- package/dist/dist-HFMJ3GIR.js +1091 -0
- package/dist/dist-JUOVMQEA.js +9 -0
- package/dist/dist-NXITTS32-O3XLWR6T.js +386 -0
- package/dist/dist-OUJKMVTB.js +22 -0
- package/dist/fingerprint-NOJ7TDB6-K6SB7LCZ.js +9 -0
- package/dist/index.js +4735 -3577
- package/dist/semantic-WW6XVII4.js +8544 -0
- package/dist/transformers.node-K4WKH4PR.js +45809 -0
- package/dist/tree-sitter-AGICL65I.js +1412 -0
- package/dist/tree-sitter-H5E7LKR4-MKO3NNLJ.js +9 -0
- package/package.json +7 -6
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
import { readFile } from 'fs/promises';
|
|
5
|
+
|
|
6
|
+
createRequire(import.meta.url);
|
|
7
|
+
const __filename$1 = fileURLToPath(import.meta.url);
|
|
8
|
+
dirname(__filename$1);
|
|
9
|
+
var SymbolKind = /* @__PURE__ */ ((SymbolKind2) => {
|
|
10
|
+
SymbolKind2["Function"] = "function";
|
|
11
|
+
SymbolKind2["Method"] = "method";
|
|
12
|
+
SymbolKind2["Class"] = "class";
|
|
13
|
+
SymbolKind2["Struct"] = "struct";
|
|
14
|
+
SymbolKind2["Enum"] = "enum";
|
|
15
|
+
SymbolKind2["Interface"] = "interface";
|
|
16
|
+
SymbolKind2["Type"] = "type";
|
|
17
|
+
SymbolKind2["Trait"] = "trait";
|
|
18
|
+
SymbolKind2["Const"] = "const";
|
|
19
|
+
SymbolKind2["Variable"] = "variable";
|
|
20
|
+
SymbolKind2["Export"] = "export";
|
|
21
|
+
return SymbolKind2;
|
|
22
|
+
})(SymbolKind || {});
|
|
23
|
+
var GRAMMAR_DIR = join(dirname(fileURLToPath(import.meta.url)), "../../../../node_modules/tree-sitter-wasms/out");
|
|
24
|
+
var EXT_TO_GRAMMAR = {
|
|
25
|
+
".ts": "typescript",
|
|
26
|
+
".tsx": "tsx",
|
|
27
|
+
".js": "javascript",
|
|
28
|
+
".jsx": "javascript",
|
|
29
|
+
".mjs": "javascript",
|
|
30
|
+
".cjs": "javascript",
|
|
31
|
+
".py": "python",
|
|
32
|
+
".rs": "rust",
|
|
33
|
+
".go": "go",
|
|
34
|
+
".java": "java",
|
|
35
|
+
".c": "c",
|
|
36
|
+
".h": "c",
|
|
37
|
+
".cpp": "cpp",
|
|
38
|
+
".hpp": "cpp",
|
|
39
|
+
".cc": "cpp",
|
|
40
|
+
".cs": "c_sharp",
|
|
41
|
+
".rb": "ruby",
|
|
42
|
+
".php": "php",
|
|
43
|
+
".swift": "swift",
|
|
44
|
+
".kt": "kotlin",
|
|
45
|
+
".kts": "kotlin",
|
|
46
|
+
".lua": "lua",
|
|
47
|
+
".dart": "dart",
|
|
48
|
+
".ex": "elixir",
|
|
49
|
+
".exs": "elixir",
|
|
50
|
+
".elm": "elm",
|
|
51
|
+
".ml": "ocaml",
|
|
52
|
+
".scala": "scala",
|
|
53
|
+
".sc": "scala",
|
|
54
|
+
".sol": "solidity",
|
|
55
|
+
".zig": "zig",
|
|
56
|
+
".vue": "vue",
|
|
57
|
+
".sh": "bash",
|
|
58
|
+
".bash": "bash",
|
|
59
|
+
".zsh": "bash",
|
|
60
|
+
".toml": "toml",
|
|
61
|
+
".yaml": "yaml",
|
|
62
|
+
".yml": "yaml",
|
|
63
|
+
".json": "json",
|
|
64
|
+
".html": "html",
|
|
65
|
+
".css": "css",
|
|
66
|
+
".m": "objc",
|
|
67
|
+
".re": "rescript"
|
|
68
|
+
};
|
|
69
|
+
var DEFINITION_TYPES = {
|
|
70
|
+
typescript: {
|
|
71
|
+
function_declaration: "function",
|
|
72
|
+
method_definition: "method",
|
|
73
|
+
class_declaration: "class",
|
|
74
|
+
interface_declaration: "interface",
|
|
75
|
+
enum_declaration: "enum",
|
|
76
|
+
type_alias_declaration: "type",
|
|
77
|
+
lexical_declaration: "const"
|
|
78
|
+
},
|
|
79
|
+
javascript: {
|
|
80
|
+
function_declaration: "function",
|
|
81
|
+
method_definition: "method",
|
|
82
|
+
class_declaration: "class",
|
|
83
|
+
variable_declaration: "const"
|
|
84
|
+
},
|
|
85
|
+
tsx: {
|
|
86
|
+
function_declaration: "function",
|
|
87
|
+
method_definition: "method",
|
|
88
|
+
class_declaration: "class",
|
|
89
|
+
interface_declaration: "interface",
|
|
90
|
+
enum_declaration: "enum",
|
|
91
|
+
type_alias_declaration: "type"
|
|
92
|
+
},
|
|
93
|
+
python: {
|
|
94
|
+
function_definition: "function",
|
|
95
|
+
class_definition: "class"
|
|
96
|
+
},
|
|
97
|
+
rust: {
|
|
98
|
+
function_item: "function",
|
|
99
|
+
struct_item: "struct",
|
|
100
|
+
enum_item: "enum",
|
|
101
|
+
trait_item: "trait",
|
|
102
|
+
impl_item: "class"
|
|
103
|
+
},
|
|
104
|
+
go: {
|
|
105
|
+
function_declaration: "function",
|
|
106
|
+
method_declaration: "method",
|
|
107
|
+
type_spec: "type"
|
|
108
|
+
},
|
|
109
|
+
java: {
|
|
110
|
+
method_declaration: "method",
|
|
111
|
+
class_declaration: "class",
|
|
112
|
+
interface_declaration: "interface",
|
|
113
|
+
enum_declaration: "enum"
|
|
114
|
+
},
|
|
115
|
+
c: {
|
|
116
|
+
function_definition: "function",
|
|
117
|
+
struct_specifier: "struct",
|
|
118
|
+
enum_specifier: "enum"
|
|
119
|
+
},
|
|
120
|
+
cpp: {
|
|
121
|
+
function_definition: "function",
|
|
122
|
+
class_specifier: "class",
|
|
123
|
+
struct_specifier: "struct",
|
|
124
|
+
enum_specifier: "enum"
|
|
125
|
+
},
|
|
126
|
+
c_sharp: {
|
|
127
|
+
method_declaration: "method",
|
|
128
|
+
class_declaration: "class",
|
|
129
|
+
interface_declaration: "interface",
|
|
130
|
+
enum_declaration: "enum",
|
|
131
|
+
struct_declaration: "struct"
|
|
132
|
+
},
|
|
133
|
+
ruby: {},
|
|
134
|
+
lua: {},
|
|
135
|
+
dart: {},
|
|
136
|
+
elixir: {},
|
|
137
|
+
php: {
|
|
138
|
+
function_definition: "function",
|
|
139
|
+
method_declaration: "method",
|
|
140
|
+
class_declaration: "class",
|
|
141
|
+
interface_declaration: "interface",
|
|
142
|
+
enum_declaration: "enum"
|
|
143
|
+
},
|
|
144
|
+
swift: {
|
|
145
|
+
function_declaration: "function",
|
|
146
|
+
class_declaration: "class",
|
|
147
|
+
struct_declaration: "struct",
|
|
148
|
+
enum_declaration: "enum",
|
|
149
|
+
protocol_declaration: "interface"
|
|
150
|
+
},
|
|
151
|
+
kotlin: {
|
|
152
|
+
function_declaration: "function",
|
|
153
|
+
class_declaration: "class",
|
|
154
|
+
object_declaration: "class",
|
|
155
|
+
interface_delegation: "interface"
|
|
156
|
+
},
|
|
157
|
+
scala: {
|
|
158
|
+
function_definition: "function",
|
|
159
|
+
class_definition: "class",
|
|
160
|
+
trait_definition: "trait",
|
|
161
|
+
object_definition: "class"
|
|
162
|
+
},
|
|
163
|
+
solidity: {
|
|
164
|
+
function_definition: "function",
|
|
165
|
+
contract_declaration: "class",
|
|
166
|
+
struct_declaration: "struct",
|
|
167
|
+
enum_declaration: "enum",
|
|
168
|
+
event_definition: "export"
|
|
169
|
+
},
|
|
170
|
+
zig: {
|
|
171
|
+
function_declaration: "function"
|
|
172
|
+
},
|
|
173
|
+
bash: {
|
|
174
|
+
function_definition: "function"
|
|
175
|
+
},
|
|
176
|
+
ocaml: {
|
|
177
|
+
let_binding: "function",
|
|
178
|
+
type_binding: "type"
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
var ParserClass = null;
|
|
182
|
+
var grammarCache = /* @__PURE__ */ new Map();
|
|
183
|
+
async function initParser() {
|
|
184
|
+
if (ParserClass) return ParserClass;
|
|
185
|
+
const mod = await import('./tree-sitter-AGICL65I.js');
|
|
186
|
+
const Parser = mod.default || mod;
|
|
187
|
+
await Parser.init();
|
|
188
|
+
ParserClass = Parser;
|
|
189
|
+
return Parser;
|
|
190
|
+
}
|
|
191
|
+
async function loadGrammar(grammarName) {
|
|
192
|
+
if (grammarCache.has(grammarName)) return grammarCache.get(grammarName);
|
|
193
|
+
try {
|
|
194
|
+
const Parser = await initParser();
|
|
195
|
+
const wasmPath = join(GRAMMAR_DIR, `tree-sitter-${grammarName}.wasm`);
|
|
196
|
+
await readFile(wasmPath);
|
|
197
|
+
const lang = await Parser.Language.load(wasmPath);
|
|
198
|
+
grammarCache.set(grammarName, lang);
|
|
199
|
+
return lang;
|
|
200
|
+
} catch {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function extractName(node, _kind) {
|
|
205
|
+
const nameNode = node.childForFieldName("name") ?? node.childForFieldName("declarator") ?? node.namedChildren?.find(
|
|
206
|
+
(c) => c.type === "identifier" || c.type === "type_identifier" || c.type === "property_identifier" || c.type === "simple_identifier"
|
|
207
|
+
);
|
|
208
|
+
if (nameNode) {
|
|
209
|
+
if (nameNode.type === "function_declarator" || nameNode.type === "pointer_declarator") {
|
|
210
|
+
const inner = nameNode.childForFieldName("declarator") ?? nameNode.namedChildren?.[0];
|
|
211
|
+
if (inner) return inner.text;
|
|
212
|
+
}
|
|
213
|
+
return nameNode.text;
|
|
214
|
+
}
|
|
215
|
+
for (const child of node.namedChildren ?? []) {
|
|
216
|
+
if (child.type === "variable_declarator" || child.type === "const_declaration") {
|
|
217
|
+
const inner = child.childForFieldName("name");
|
|
218
|
+
if (inner) return inner.text;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return node.text.split(/[\s({]/)[0]?.trim() ?? "anonymous";
|
|
222
|
+
}
|
|
223
|
+
function extractSignature(node) {
|
|
224
|
+
const lines = node.text.split("\n");
|
|
225
|
+
const firstLine = lines[0].trim();
|
|
226
|
+
return firstLine.length > 150 ? firstLine.substring(0, 150) + "..." : firstLine;
|
|
227
|
+
}
|
|
228
|
+
function mapKind(typeStr) {
|
|
229
|
+
const kinds = {
|
|
230
|
+
function: "function",
|
|
231
|
+
method: "method",
|
|
232
|
+
class: "class",
|
|
233
|
+
struct: "struct",
|
|
234
|
+
enum: "enum",
|
|
235
|
+
interface: "interface",
|
|
236
|
+
type: "type",
|
|
237
|
+
trait: "trait",
|
|
238
|
+
const: "const",
|
|
239
|
+
variable: "variable",
|
|
240
|
+
export: "export"
|
|
241
|
+
};
|
|
242
|
+
return kinds[typeStr] ?? "function";
|
|
243
|
+
}
|
|
244
|
+
function walkTree(rootNode, defTypes, maxDepth = 3) {
|
|
245
|
+
const symbols = [];
|
|
246
|
+
function visit(node, depth, parent) {
|
|
247
|
+
if (depth > maxDepth) return;
|
|
248
|
+
const kindStr = defTypes[node.type];
|
|
249
|
+
if (kindStr) {
|
|
250
|
+
const sym = {
|
|
251
|
+
name: extractName(node),
|
|
252
|
+
kind: mapKind(kindStr),
|
|
253
|
+
line: node.startPosition.row + 1,
|
|
254
|
+
endLine: node.endPosition.row + 1,
|
|
255
|
+
signature: extractSignature(node),
|
|
256
|
+
children: []
|
|
257
|
+
};
|
|
258
|
+
if (parent && depth > 0) {
|
|
259
|
+
parent.children.push(sym);
|
|
260
|
+
} else {
|
|
261
|
+
symbols.push(sym);
|
|
262
|
+
}
|
|
263
|
+
for (const child of node.namedChildren ?? []) {
|
|
264
|
+
visit(child, depth + 1, sym);
|
|
265
|
+
}
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
for (const child of node.namedChildren ?? []) {
|
|
269
|
+
visit(child, depth, parent);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
visit(rootNode, 0, null);
|
|
273
|
+
return symbols;
|
|
274
|
+
}
|
|
275
|
+
function getGrammarName(ext) {
|
|
276
|
+
return EXT_TO_GRAMMAR[ext.toLowerCase()] ?? null;
|
|
277
|
+
}
|
|
278
|
+
async function parseWithTreeSitter(content, ext) {
|
|
279
|
+
const grammarName = getGrammarName(ext);
|
|
280
|
+
if (!grammarName) return null;
|
|
281
|
+
const defTypes = DEFINITION_TYPES[grammarName];
|
|
282
|
+
if (!defTypes) return null;
|
|
283
|
+
const lang = await loadGrammar(grammarName);
|
|
284
|
+
if (!lang) return null;
|
|
285
|
+
let parser = null;
|
|
286
|
+
let tree = null;
|
|
287
|
+
try {
|
|
288
|
+
const Parser = await initParser();
|
|
289
|
+
parser = new Parser();
|
|
290
|
+
parser.setLanguage(lang);
|
|
291
|
+
tree = parser.parse(content);
|
|
292
|
+
return walkTree(tree.rootNode, defTypes);
|
|
293
|
+
} catch {
|
|
294
|
+
return null;
|
|
295
|
+
} finally {
|
|
296
|
+
tree?.delete?.();
|
|
297
|
+
parser?.delete?.();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function getSupportedExtensions() {
|
|
301
|
+
return Object.keys(EXT_TO_GRAMMAR);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export { SymbolKind, getGrammarName, getSupportedExtensions, parseWithTreeSitter };
|