claude-ex 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/dist/claude/claudemd.d.ts +3 -0
- package/dist/claude/claudemd.js +112 -0
- package/dist/claude/claudemd.js.map +1 -0
- package/dist/claude/installer.d.ts +1 -0
- package/dist/claude/installer.js +193 -0
- package/dist/claude/installer.js.map +1 -0
- package/dist/claude/mcp.d.ts +1 -0
- package/dist/claude/mcp.js +195 -0
- package/dist/claude/mcp.js.map +1 -0
- package/dist/db/schema.d.ts +25 -0
- package/dist/db/schema.js +218 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +339 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer/collector.d.ts +1 -0
- package/dist/indexer/collector.js +133 -0
- package/dist/indexer/collector.js.map +1 -0
- package/dist/indexer/index.d.ts +13 -0
- package/dist/indexer/index.js +326 -0
- package/dist/indexer/index.js.map +1 -0
- package/dist/indexer/parser.d.ts +31 -0
- package/dist/indexer/parser.js +407 -0
- package/dist/indexer/parser.js.map +1 -0
- package/dist/query/engine.d.ts +65 -0
- package/dist/query/engine.js +340 -0
- package/dist/query/engine.js.map +1 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +75 -0
- package/dist/utils.js.map +1 -0
- package/dist/watcher/daemon.d.ts +5 -0
- package/dist/watcher/daemon.js +136 -0
- package/dist/watcher/daemon.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getLanguage = getLanguage;
|
|
37
|
+
exports.isSupportedFile = isSupportedFile;
|
|
38
|
+
exports.hashFile = hashFile;
|
|
39
|
+
exports.parseFile = parseFile;
|
|
40
|
+
const crypto = __importStar(require("crypto"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
// Tree-sitter imports — loaded lazily
|
|
43
|
+
let Parser;
|
|
44
|
+
const grammars = new Map();
|
|
45
|
+
let treeSitterLoaded = false;
|
|
46
|
+
function loadTreeSitter() {
|
|
47
|
+
if (treeSitterLoaded)
|
|
48
|
+
return true;
|
|
49
|
+
try {
|
|
50
|
+
Parser = require('tree-sitter');
|
|
51
|
+
treeSitterLoaded = true;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const EXTENSION_MAP = {
|
|
59
|
+
'.ts': { grammar: 'typescript', module: 'tree-sitter-typescript/typescript' },
|
|
60
|
+
'.tsx': { grammar: 'tsx', module: 'tree-sitter-typescript/tsx' },
|
|
61
|
+
'.js': { grammar: 'javascript', module: 'tree-sitter-javascript' },
|
|
62
|
+
'.jsx': { grammar: 'javascript', module: 'tree-sitter-javascript' },
|
|
63
|
+
'.mjs': { grammar: 'javascript', module: 'tree-sitter-javascript' },
|
|
64
|
+
'.py': { grammar: 'python', module: 'tree-sitter-python' },
|
|
65
|
+
'.rs': { grammar: 'rust', module: 'tree-sitter-rust' },
|
|
66
|
+
'.go': { grammar: 'go', module: 'tree-sitter-go' },
|
|
67
|
+
'.sh': { grammar: 'bash', module: 'tree-sitter-bash' },
|
|
68
|
+
'.bash': { grammar: 'bash', module: 'tree-sitter-bash' },
|
|
69
|
+
'.c': { grammar: 'c', module: 'tree-sitter-c' },
|
|
70
|
+
'.h': { grammar: 'c', module: 'tree-sitter-c' },
|
|
71
|
+
'.cpp': { grammar: 'cpp', module: 'tree-sitter-cpp' },
|
|
72
|
+
'.cc': { grammar: 'cpp', module: 'tree-sitter-cpp' },
|
|
73
|
+
'.hpp': { grammar: 'cpp', module: 'tree-sitter-cpp' },
|
|
74
|
+
'.json': { grammar: 'json', module: 'tree-sitter-json' },
|
|
75
|
+
'.css': { grammar: 'css', module: 'tree-sitter-css' },
|
|
76
|
+
'.html': { grammar: 'html', module: 'tree-sitter-html' },
|
|
77
|
+
'.htm': { grammar: 'html', module: 'tree-sitter-html' },
|
|
78
|
+
};
|
|
79
|
+
function getParser(language) {
|
|
80
|
+
if (!loadTreeSitter())
|
|
81
|
+
return null;
|
|
82
|
+
if (grammars.has(language))
|
|
83
|
+
return grammars.get(language);
|
|
84
|
+
const entry = Object.values(EXTENSION_MAP).find(e => e.grammar === language);
|
|
85
|
+
if (!entry)
|
|
86
|
+
return null;
|
|
87
|
+
try {
|
|
88
|
+
const lang = require(entry.module);
|
|
89
|
+
const parser = new Parser();
|
|
90
|
+
parser.setLanguage(lang);
|
|
91
|
+
grammars.set(language, parser);
|
|
92
|
+
return parser;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
grammars.set(language, null);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function getLanguage(filePath) {
|
|
100
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
101
|
+
return EXTENSION_MAP[ext]?.grammar || null;
|
|
102
|
+
}
|
|
103
|
+
function isSupportedFile(filePath) {
|
|
104
|
+
return getLanguage(filePath) !== null;
|
|
105
|
+
}
|
|
106
|
+
function hashFile(content) {
|
|
107
|
+
return crypto.createHash('sha256').update(content).digest('hex').slice(0, 16);
|
|
108
|
+
}
|
|
109
|
+
const SKIP_CALLS = new Set(['console.log', 'console.error', 'console.warn', 'console.info', 'console.debug', 'print', 'require']);
|
|
110
|
+
function parseFile(filePath, content) {
|
|
111
|
+
const language = getLanguage(filePath);
|
|
112
|
+
if (!language)
|
|
113
|
+
return { symbols: [], imports: [], calls: [], language: null };
|
|
114
|
+
// Skip parsing for JSON/CSS/HTML — no meaningful symbols
|
|
115
|
+
if (['json', 'css', 'html'].includes(language)) {
|
|
116
|
+
return { symbols: [], imports: [], calls: [], language };
|
|
117
|
+
}
|
|
118
|
+
const parser = getParser(language);
|
|
119
|
+
if (!parser)
|
|
120
|
+
return { symbols: [], imports: [], calls: [], language };
|
|
121
|
+
let tree;
|
|
122
|
+
try {
|
|
123
|
+
tree = parser.parse(content);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return { symbols: [], imports: [], calls: [], language };
|
|
127
|
+
}
|
|
128
|
+
const lines = content.split('\n');
|
|
129
|
+
const symbols = [];
|
|
130
|
+
const imports = [];
|
|
131
|
+
const calls = [];
|
|
132
|
+
function getDocstring(node) {
|
|
133
|
+
const prev = node.previousNamedSibling;
|
|
134
|
+
if (prev && prev.type === 'comment') {
|
|
135
|
+
return prev.text.slice(0, 500);
|
|
136
|
+
}
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
function getSignature(node) {
|
|
140
|
+
const startRow = node.startPosition.row;
|
|
141
|
+
return lines[startRow]?.trim().slice(0, 200) || '';
|
|
142
|
+
}
|
|
143
|
+
function getContent(node, maxLen) {
|
|
144
|
+
return node.text.slice(0, maxLen);
|
|
145
|
+
}
|
|
146
|
+
function isExported(node) {
|
|
147
|
+
const parent = node.parent;
|
|
148
|
+
if (!parent)
|
|
149
|
+
return false;
|
|
150
|
+
if (parent.type === 'export_statement' || parent.type === 'export_declaration')
|
|
151
|
+
return true;
|
|
152
|
+
if (parent.type === 'decorated_definition') {
|
|
153
|
+
const pp = parent.parent;
|
|
154
|
+
if (pp && (pp.type === 'export_statement' || pp.type === 'export_declaration'))
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
// Python: top-level definitions without underscore prefix
|
|
158
|
+
if (['python'].includes(language)) {
|
|
159
|
+
if (parent.type === 'module') {
|
|
160
|
+
const nameNode = node.childForFieldName('name');
|
|
161
|
+
if (nameNode && !nameNode.text.startsWith('_'))
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
function findEnclosingSymbol(node) {
|
|
168
|
+
let cur = node.parent;
|
|
169
|
+
while (cur) {
|
|
170
|
+
if (['function_declaration', 'function_definition', 'method_definition',
|
|
171
|
+
'arrow_function', 'class_declaration', 'class_definition'].includes(cur.type)) {
|
|
172
|
+
const nameNode = cur.childForFieldName('name');
|
|
173
|
+
if (nameNode)
|
|
174
|
+
return nameNode.text;
|
|
175
|
+
}
|
|
176
|
+
// Handle variable declarations with arrow functions
|
|
177
|
+
if (cur.type === 'variable_declarator' || cur.type === 'lexical_declaration') {
|
|
178
|
+
const nameNode = cur.childForFieldName('name') ||
|
|
179
|
+
(cur.type === 'lexical_declaration' ? cur.firstNamedChild?.childForFieldName('name') : null);
|
|
180
|
+
if (nameNode)
|
|
181
|
+
return nameNode.text;
|
|
182
|
+
}
|
|
183
|
+
cur = cur.parent;
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
function walkNode(node, className) {
|
|
188
|
+
const type = node.type;
|
|
189
|
+
// Symbols
|
|
190
|
+
if (['function_declaration', 'function_definition'].includes(type)) {
|
|
191
|
+
const nameNode = node.childForFieldName('name');
|
|
192
|
+
if (nameNode) {
|
|
193
|
+
symbols.push({
|
|
194
|
+
name: nameNode.text,
|
|
195
|
+
qualifiedName: className ? `${className}.${nameNode.text}` : undefined,
|
|
196
|
+
kind: 'function',
|
|
197
|
+
lineStart: node.startPosition.row + 1,
|
|
198
|
+
lineEnd: node.endPosition.row + 1,
|
|
199
|
+
signature: getSignature(node),
|
|
200
|
+
docstring: getDocstring(node),
|
|
201
|
+
content: getContent(node, 2048),
|
|
202
|
+
exported: isExported(node),
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else if (type === 'method_definition') {
|
|
207
|
+
const nameNode = node.childForFieldName('name');
|
|
208
|
+
if (nameNode) {
|
|
209
|
+
symbols.push({
|
|
210
|
+
name: nameNode.text,
|
|
211
|
+
qualifiedName: className ? `${className}.${nameNode.text}` : undefined,
|
|
212
|
+
kind: 'method',
|
|
213
|
+
lineStart: node.startPosition.row + 1,
|
|
214
|
+
lineEnd: node.endPosition.row + 1,
|
|
215
|
+
signature: getSignature(node),
|
|
216
|
+
docstring: getDocstring(node),
|
|
217
|
+
content: getContent(node, 2048),
|
|
218
|
+
exported: isExported(node),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else if (['class_declaration', 'class_definition'].includes(type)) {
|
|
223
|
+
const nameNode = node.childForFieldName('name');
|
|
224
|
+
if (nameNode) {
|
|
225
|
+
const name = nameNode.text;
|
|
226
|
+
symbols.push({
|
|
227
|
+
name,
|
|
228
|
+
kind: 'class',
|
|
229
|
+
lineStart: node.startPosition.row + 1,
|
|
230
|
+
lineEnd: node.endPosition.row + 1,
|
|
231
|
+
signature: getSignature(node),
|
|
232
|
+
docstring: getDocstring(node),
|
|
233
|
+
content: getContent(node, 3072),
|
|
234
|
+
exported: isExported(node),
|
|
235
|
+
});
|
|
236
|
+
// Walk children with class context
|
|
237
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
238
|
+
walkNode(node.child(i), name);
|
|
239
|
+
}
|
|
240
|
+
return; // Don't double-walk children
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else if (type === 'interface_declaration') {
|
|
244
|
+
const nameNode = node.childForFieldName('name');
|
|
245
|
+
if (nameNode) {
|
|
246
|
+
symbols.push({
|
|
247
|
+
name: nameNode.text,
|
|
248
|
+
kind: 'interface',
|
|
249
|
+
lineStart: node.startPosition.row + 1,
|
|
250
|
+
lineEnd: node.endPosition.row + 1,
|
|
251
|
+
signature: getSignature(node),
|
|
252
|
+
docstring: getDocstring(node),
|
|
253
|
+
content: getContent(node, 3072),
|
|
254
|
+
exported: isExported(node),
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (type === 'type_alias_declaration') {
|
|
259
|
+
const nameNode = node.childForFieldName('name');
|
|
260
|
+
if (nameNode) {
|
|
261
|
+
symbols.push({
|
|
262
|
+
name: nameNode.text,
|
|
263
|
+
kind: 'type',
|
|
264
|
+
lineStart: node.startPosition.row + 1,
|
|
265
|
+
lineEnd: node.endPosition.row + 1,
|
|
266
|
+
signature: getSignature(node),
|
|
267
|
+
content: getContent(node, 2048),
|
|
268
|
+
exported: isExported(node),
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
else if (type === 'enum_declaration') {
|
|
273
|
+
const nameNode = node.childForFieldName('name');
|
|
274
|
+
if (nameNode) {
|
|
275
|
+
symbols.push({
|
|
276
|
+
name: nameNode.text,
|
|
277
|
+
kind: 'enum',
|
|
278
|
+
lineStart: node.startPosition.row + 1,
|
|
279
|
+
lineEnd: node.endPosition.row + 1,
|
|
280
|
+
signature: getSignature(node),
|
|
281
|
+
content: getContent(node, 2048),
|
|
282
|
+
exported: isExported(node),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
else if (type === 'lexical_declaration' || type === 'variable_declaration') {
|
|
287
|
+
if (isExported(node)) {
|
|
288
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
289
|
+
const decl = node.namedChild(i);
|
|
290
|
+
if (decl && decl.type === 'variable_declarator') {
|
|
291
|
+
const nameNode = decl.childForFieldName('name');
|
|
292
|
+
const value = decl.childForFieldName('value');
|
|
293
|
+
if (nameNode) {
|
|
294
|
+
// Check if it's an arrow function
|
|
295
|
+
if (value && value.type === 'arrow_function') {
|
|
296
|
+
symbols.push({
|
|
297
|
+
name: nameNode.text,
|
|
298
|
+
kind: 'function',
|
|
299
|
+
lineStart: node.startPosition.row + 1,
|
|
300
|
+
lineEnd: node.endPosition.row + 1,
|
|
301
|
+
signature: getSignature(node),
|
|
302
|
+
docstring: getDocstring(node),
|
|
303
|
+
content: getContent(node, 2048),
|
|
304
|
+
exported: true,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
symbols.push({
|
|
309
|
+
name: nameNode.text,
|
|
310
|
+
kind: 'variable',
|
|
311
|
+
lineStart: node.startPosition.row + 1,
|
|
312
|
+
lineEnd: node.endPosition.row + 1,
|
|
313
|
+
signature: getSignature(node),
|
|
314
|
+
content: getContent(node, 1024),
|
|
315
|
+
exported: true,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
// Imports
|
|
324
|
+
if (type === 'import_statement' || type === 'import_declaration') {
|
|
325
|
+
extractImport(node);
|
|
326
|
+
}
|
|
327
|
+
// Calls
|
|
328
|
+
if (type === 'call_expression') {
|
|
329
|
+
const funcNode = node.childForFieldName('function');
|
|
330
|
+
if (funcNode) {
|
|
331
|
+
let calledName = funcNode.text;
|
|
332
|
+
// Simplify member expressions to last two parts
|
|
333
|
+
if (calledName.includes('.')) {
|
|
334
|
+
const parts = calledName.split('.');
|
|
335
|
+
calledName = parts.slice(-2).join('.');
|
|
336
|
+
}
|
|
337
|
+
if (!SKIP_CALLS.has(calledName) && calledName.length < 100) {
|
|
338
|
+
const enclosing = findEnclosingSymbol(node);
|
|
339
|
+
if (enclosing) {
|
|
340
|
+
calls.push({
|
|
341
|
+
callerSymbol: enclosing,
|
|
342
|
+
calledName,
|
|
343
|
+
line: node.startPosition.row + 1,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// Recurse
|
|
350
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
351
|
+
walkNode(node.child(i), className);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function extractImport(node) {
|
|
355
|
+
const sourceNode = node.childForFieldName('source') ||
|
|
356
|
+
node.children?.find((c) => c.type === 'string' || c.type === 'string_literal');
|
|
357
|
+
if (!sourceNode) {
|
|
358
|
+
// Python: import X
|
|
359
|
+
if (language === 'python') {
|
|
360
|
+
const moduleNode = node.childForFieldName('name') ||
|
|
361
|
+
node.children?.find((c) => c.type === 'dotted_name' || c.type === 'aliased_import');
|
|
362
|
+
if (moduleNode) {
|
|
363
|
+
imports.push({
|
|
364
|
+
source: moduleNode.text,
|
|
365
|
+
names: [],
|
|
366
|
+
isDefault: true,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const source = sourceNode.text.replace(/['"]/g, '');
|
|
373
|
+
const names = [];
|
|
374
|
+
let isDefault = false;
|
|
375
|
+
// Look for named imports
|
|
376
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
377
|
+
const child = node.child(i);
|
|
378
|
+
if (child.type === 'import_clause' || child.type === 'named_imports' || child.type === 'import_specifier') {
|
|
379
|
+
walkImportNames(child, names);
|
|
380
|
+
if (child.type === 'import_clause') {
|
|
381
|
+
const firstNamed = child.firstNamedChild;
|
|
382
|
+
if (firstNamed && firstNamed.type === 'identifier') {
|
|
383
|
+
isDefault = true;
|
|
384
|
+
names.push(firstNamed.text);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (names.length === 0)
|
|
390
|
+
isDefault = true;
|
|
391
|
+
imports.push({ source, names, isDefault });
|
|
392
|
+
}
|
|
393
|
+
function walkImportNames(node, names) {
|
|
394
|
+
if (node.type === 'import_specifier') {
|
|
395
|
+
const nameNode = node.childForFieldName('name');
|
|
396
|
+
if (nameNode)
|
|
397
|
+
names.push(nameNode.text);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
401
|
+
walkImportNames(node.child(i), names);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
walkNode(tree.rootNode);
|
|
405
|
+
return { symbols, imports, calls, language };
|
|
406
|
+
}
|
|
407
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/indexer/parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,kCAGC;AAED,0CAEC;AAED,4BAEC;AAmCD,8BA6SC;AAxZD,+CAAiC;AACjC,2CAA6B;AAE7B,sCAAsC;AACtC,IAAI,MAAW,CAAC;AAChB,MAAM,QAAQ,GAAqB,IAAI,GAAG,EAAE,CAA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3
|
+
name: string;
|
|
4
|
+
qualifiedName: string | null;
|
|
5
|
+
kind: string;
|
|
6
|
+
file: string;
|
|
7
|
+
lineStart: number;
|
|
8
|
+
lineEnd: number;
|
|
9
|
+
signature: string | null;
|
|
10
|
+
pagerank: number;
|
|
11
|
+
snippet?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ContextResult {
|
|
14
|
+
symbol: {
|
|
15
|
+
name: string;
|
|
16
|
+
qualifiedName: string | null;
|
|
17
|
+
kind: string;
|
|
18
|
+
file: string;
|
|
19
|
+
lineStart: number;
|
|
20
|
+
lineEnd: number;
|
|
21
|
+
signature: string | null;
|
|
22
|
+
docstring: string | null;
|
|
23
|
+
code: string | null;
|
|
24
|
+
};
|
|
25
|
+
dependencies: SearchResult[];
|
|
26
|
+
dependents: SearchResult[];
|
|
27
|
+
sameFileSymbols: SearchResult[];
|
|
28
|
+
}
|
|
29
|
+
export interface ImpactResult {
|
|
30
|
+
file: string;
|
|
31
|
+
depth: number;
|
|
32
|
+
symbolCount: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ModuleResult {
|
|
35
|
+
name: string;
|
|
36
|
+
fileCount: number;
|
|
37
|
+
symbolCount: number;
|
|
38
|
+
importsFrom: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface Stats {
|
|
41
|
+
files: number;
|
|
42
|
+
symbols: number;
|
|
43
|
+
edges: number;
|
|
44
|
+
fileDeps: number;
|
|
45
|
+
}
|
|
46
|
+
export declare function search(db: Database.Database, query: string, limit?: number): SearchResult[];
|
|
47
|
+
export declare function getCallers(db: Database.Database, symbolName: string): SearchResult[];
|
|
48
|
+
export declare function getContext(db: Database.Database, symbolName: string): ContextResult | null;
|
|
49
|
+
export declare function getImpact(db: Database.Database, filePath: string, maxDepth?: number): ImpactResult[];
|
|
50
|
+
export declare function getDeps(db: Database.Database, symbolName: string): SearchResult[];
|
|
51
|
+
export declare function getRank(db: Database.Database, top?: number): SearchResult[];
|
|
52
|
+
export declare function getModules(db: Database.Database): ModuleResult[];
|
|
53
|
+
export declare function getStats(db: Database.Database): Stats;
|
|
54
|
+
export declare function brief(db: Database.Database): string;
|
|
55
|
+
export declare function preEditContext(db: Database.Database, filePath: string): string;
|
|
56
|
+
export declare function searchFromRoot(rootDir: string, query: string, limit?: number): SearchResult[];
|
|
57
|
+
export declare function getCallersFromRoot(rootDir: string, name: string): SearchResult[];
|
|
58
|
+
export declare function getContextFromRoot(rootDir: string, name: string): ContextResult | null;
|
|
59
|
+
export declare function getImpactFromRoot(rootDir: string, file: string, maxDepth?: number): ImpactResult[];
|
|
60
|
+
export declare function getDepsFromRoot(rootDir: string, name: string): SearchResult[];
|
|
61
|
+
export declare function getRankFromRoot(rootDir: string, top?: number): SearchResult[];
|
|
62
|
+
export declare function getModulesFromRoot(rootDir: string): ModuleResult[];
|
|
63
|
+
export declare function getStatsFromRoot(rootDir: string): Stats;
|
|
64
|
+
export declare function briefFromRoot(rootDir: string): string;
|
|
65
|
+
export declare function preEditContextFromRoot(rootDir: string, filePath: string): string;
|