@backendkit-labs/mcp-server 0.14.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/dist/agent-server.d.ts +88 -0
- package/dist/agent-server.d.ts.map +1 -0
- package/dist/agent-server.js +149 -0
- package/dist/agent-server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer/graph-store.d.ts +48 -0
- package/dist/indexer/graph-store.d.ts.map +1 -0
- package/dist/indexer/graph-store.js +233 -0
- package/dist/indexer/graph-store.js.map +1 -0
- package/dist/indexer/indexer.d.ts +17 -0
- package/dist/indexer/indexer.d.ts.map +1 -0
- package/dist/indexer/indexer.js +180 -0
- package/dist/indexer/indexer.js.map +1 -0
- package/dist/indexer/languages/go.d.ts +2 -0
- package/dist/indexer/languages/go.d.ts.map +1 -0
- package/dist/indexer/languages/go.js +36 -0
- package/dist/indexer/languages/go.js.map +1 -0
- package/dist/indexer/languages/index.d.ts +27 -0
- package/dist/indexer/languages/index.d.ts.map +1 -0
- package/dist/indexer/languages/index.js +25 -0
- package/dist/indexer/languages/index.js.map +1 -0
- package/dist/indexer/languages/java.d.ts +2 -0
- package/dist/indexer/languages/java.d.ts.map +1 -0
- package/dist/indexer/languages/java.js +39 -0
- package/dist/indexer/languages/java.js.map +1 -0
- package/dist/indexer/languages/python.d.ts +2 -0
- package/dist/indexer/languages/python.d.ts.map +1 -0
- package/dist/indexer/languages/python.js +41 -0
- package/dist/indexer/languages/python.js.map +1 -0
- package/dist/indexer/languages/rust.d.ts +2 -0
- package/dist/indexer/languages/rust.d.ts.map +1 -0
- package/dist/indexer/languages/rust.js +49 -0
- package/dist/indexer/languages/rust.js.map +1 -0
- package/dist/indexer/languages/typescript.d.ts +2 -0
- package/dist/indexer/languages/typescript.d.ts.map +1 -0
- package/dist/indexer/languages/typescript.js +47 -0
- package/dist/indexer/languages/typescript.js.map +1 -0
- package/dist/indexer/languages/utils.d.ts +2 -0
- package/dist/indexer/languages/utils.d.ts.map +1 -0
- package/dist/indexer/languages/utils.js +52 -0
- package/dist/indexer/languages/utils.js.map +1 -0
- package/dist/indexer/parser.d.ts +24 -0
- package/dist/indexer/parser.d.ts.map +1 -0
- package/dist/indexer/parser.js +136 -0
- package/dist/indexer/parser.js.map +1 -0
- package/dist/indexer/stack-detector.d.ts +3 -0
- package/dist/indexer/stack-detector.d.ts.map +1 -0
- package/dist/indexer/stack-detector.js +63 -0
- package/dist/indexer/stack-detector.js.map +1 -0
- package/dist/indexer/watcher.d.ts +8 -0
- package/dist/indexer/watcher.d.ts.map +1 -0
- package/dist/indexer/watcher.js +83 -0
- package/dist/indexer/watcher.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +308 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/code/context.d.ts +23 -0
- package/dist/tools/code/context.d.ts.map +1 -0
- package/dist/tools/code/context.js +93 -0
- package/dist/tools/code/context.js.map +1 -0
- package/dist/tools/code/search.d.ts +15 -0
- package/dist/tools/code/search.d.ts.map +1 -0
- package/dist/tools/code/search.js +40 -0
- package/dist/tools/code/search.js.map +1 -0
- package/dist/tools/skills/install.d.ts +11 -0
- package/dist/tools/skills/install.d.ts.map +1 -0
- package/dist/tools/skills/install.js +33 -0
- package/dist/tools/skills/install.js.map +1 -0
- package/dist/tools/skills/list.d.ts +9 -0
- package/dist/tools/skills/list.d.ts.map +1 -0
- package/dist/tools/skills/list.js +34 -0
- package/dist/tools/skills/list.js.map +1 -0
- package/dist/tools/skills/search.d.ts +11 -0
- package/dist/tools/skills/search.d.ts.map +1 -0
- package/dist/tools/skills/search.js +44 -0
- package/dist/tools/skills/search.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,180 @@
|
|
|
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.CodeIndexer = void 0;
|
|
37
|
+
const fs = __importStar(require("fs/promises"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const crypto_1 = require("crypto");
|
|
40
|
+
const index_1 = require("./languages/index");
|
|
41
|
+
const parser_1 = require("./parser");
|
|
42
|
+
const graph_store_1 = require("./graph-store");
|
|
43
|
+
const IGNORE_DIRS = new Set(['node_modules', 'dist', 'build', '.git', 'coverage', '.next', 'out']);
|
|
44
|
+
function contentHash(content) {
|
|
45
|
+
return (0, crypto_1.createHash)('sha1').update(content).digest('hex');
|
|
46
|
+
}
|
|
47
|
+
function qualifiedName(filePath, name, cwd) {
|
|
48
|
+
const rel = path.relative(cwd, filePath).replace(/\\/g, '/');
|
|
49
|
+
return `${rel}::${name}`;
|
|
50
|
+
}
|
|
51
|
+
class CodeIndexer {
|
|
52
|
+
store;
|
|
53
|
+
cwd;
|
|
54
|
+
constructor(store, cwd) {
|
|
55
|
+
this.store = store;
|
|
56
|
+
this.cwd = cwd;
|
|
57
|
+
}
|
|
58
|
+
async indexFile(filePath) {
|
|
59
|
+
const config = (0, index_1.detectLanguage)(filePath);
|
|
60
|
+
if (!config)
|
|
61
|
+
return { indexed: false, symbols: 0 };
|
|
62
|
+
let content;
|
|
63
|
+
try {
|
|
64
|
+
content = await fs.readFile(filePath, 'utf-8');
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return { indexed: false, symbols: 0 };
|
|
68
|
+
}
|
|
69
|
+
const hash = contentHash(content);
|
|
70
|
+
if (this.store.getFileHash(filePath) === hash) {
|
|
71
|
+
return { indexed: false, symbols: 0 };
|
|
72
|
+
}
|
|
73
|
+
const parsed = await (0, parser_1.parseFile)(content, config);
|
|
74
|
+
// Build nodes — symbols + imports (imports stored as kind='import' for stack detection)
|
|
75
|
+
const importNodes = parsed.imports.map(imp => ({
|
|
76
|
+
id: (0, graph_store_1.nodeId)(filePath, imp.source, imp.line),
|
|
77
|
+
name: imp.source,
|
|
78
|
+
qualified_name: imp.source,
|
|
79
|
+
kind: 'import',
|
|
80
|
+
language: config.name,
|
|
81
|
+
file_path: filePath,
|
|
82
|
+
start_line: imp.line,
|
|
83
|
+
end_line: imp.line,
|
|
84
|
+
signature: `import "${imp.source}"`,
|
|
85
|
+
exported: 0,
|
|
86
|
+
}));
|
|
87
|
+
const nodes = parsed.symbols.map(sym => ({
|
|
88
|
+
id: (0, graph_store_1.nodeId)(filePath, sym.name, sym.startLine),
|
|
89
|
+
name: sym.name,
|
|
90
|
+
qualified_name: qualifiedName(filePath, sym.name, this.cwd),
|
|
91
|
+
kind: sym.kind,
|
|
92
|
+
language: config.name,
|
|
93
|
+
file_path: filePath,
|
|
94
|
+
start_line: sym.startLine,
|
|
95
|
+
end_line: sym.endLine,
|
|
96
|
+
signature: sym.signature,
|
|
97
|
+
exported: sym.exported ? 1 : 0,
|
|
98
|
+
}));
|
|
99
|
+
// Build edges: calls
|
|
100
|
+
const edges = [];
|
|
101
|
+
for (const sym of parsed.symbols) {
|
|
102
|
+
const srcId = (0, graph_store_1.nodeId)(filePath, sym.name, sym.startLine);
|
|
103
|
+
for (const call of parsed.calls) {
|
|
104
|
+
if (call.line >= sym.startLine && call.line <= sym.endLine) {
|
|
105
|
+
// self-calls excluded
|
|
106
|
+
if (call.callee === sym.name)
|
|
107
|
+
continue;
|
|
108
|
+
// target node might not be indexed yet — use a placeholder target
|
|
109
|
+
const targetPlaceholder = (0, graph_store_1.nodeId)(filePath, call.callee, 0);
|
|
110
|
+
edges.push({
|
|
111
|
+
source_id: srcId,
|
|
112
|
+
target_id: targetPlaceholder,
|
|
113
|
+
kind: 'calls',
|
|
114
|
+
file_path: filePath,
|
|
115
|
+
line: call.line,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Write atomically: clear old + insert new
|
|
121
|
+
this.store.removeNodesForFile(filePath);
|
|
122
|
+
this.store.removeEdgesForFile(filePath);
|
|
123
|
+
this.store.upsertNodes([...nodes, ...importNodes]);
|
|
124
|
+
this.store.upsertEdges(edges);
|
|
125
|
+
this.store.upsertFile(filePath, config.name, hash, nodes.length);
|
|
126
|
+
return { indexed: true, symbols: nodes.length };
|
|
127
|
+
}
|
|
128
|
+
removeFile(filePath) {
|
|
129
|
+
this.store.removeFile(filePath);
|
|
130
|
+
}
|
|
131
|
+
async indexDirectory(dir) {
|
|
132
|
+
const files = await this.collectFiles(dir);
|
|
133
|
+
let totalSymbols = 0;
|
|
134
|
+
let indexedFiles = 0;
|
|
135
|
+
await Promise.all(files.map(async (f) => {
|
|
136
|
+
const result = await this.indexFile(f);
|
|
137
|
+
if (result.indexed) {
|
|
138
|
+
indexedFiles++;
|
|
139
|
+
totalSymbols += result.symbols;
|
|
140
|
+
}
|
|
141
|
+
}));
|
|
142
|
+
return { files: indexedFiles, symbols: totalSymbols };
|
|
143
|
+
}
|
|
144
|
+
async collectFiles(dir) {
|
|
145
|
+
const extensions = new Set((0, index_1.registeredExtensions)());
|
|
146
|
+
const result = [];
|
|
147
|
+
async function walk(current) {
|
|
148
|
+
let entries;
|
|
149
|
+
try {
|
|
150
|
+
entries = await fs.readdir(current);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
for (const name of entries) {
|
|
156
|
+
const fullPath = path.join(current, name);
|
|
157
|
+
let stat;
|
|
158
|
+
try {
|
|
159
|
+
stat = await fs.stat(fullPath);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (stat.isDirectory()) {
|
|
165
|
+
if (!IGNORE_DIRS.has(name))
|
|
166
|
+
await walk(fullPath);
|
|
167
|
+
}
|
|
168
|
+
else if (stat.isFile()) {
|
|
169
|
+
const ext = name.slice(name.lastIndexOf('.'));
|
|
170
|
+
if (extensions.has(ext))
|
|
171
|
+
result.push(fullPath);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
await walk(dir);
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.CodeIndexer = CodeIndexer;
|
|
180
|
+
//# sourceMappingURL=indexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("./index");
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
(0, index_1.registerLanguage)({
|
|
6
|
+
name: 'go',
|
|
7
|
+
extensions: ['.go'],
|
|
8
|
+
wasmFile: (0, utils_1.resolveWasm)('tree-sitter-go.wasm'),
|
|
9
|
+
queries: {
|
|
10
|
+
symbols: `
|
|
11
|
+
[
|
|
12
|
+
(function_declaration name: (identifier) @name) @node
|
|
13
|
+
(method_declaration name: (field_identifier) @name) @node
|
|
14
|
+
(type_declaration
|
|
15
|
+
(type_spec name: (type_identifier) @name)) @node
|
|
16
|
+
]
|
|
17
|
+
`,
|
|
18
|
+
imports: `
|
|
19
|
+
(import_spec path: (interpreted_string_literal) @source)
|
|
20
|
+
`,
|
|
21
|
+
calls: `
|
|
22
|
+
[
|
|
23
|
+
(call_expression function: (identifier) @name)
|
|
24
|
+
(call_expression
|
|
25
|
+
function: (selector_expression
|
|
26
|
+
field: (field_identifier) @name))
|
|
27
|
+
]
|
|
28
|
+
`,
|
|
29
|
+
},
|
|
30
|
+
kindMap: {
|
|
31
|
+
function_declaration: 'function',
|
|
32
|
+
method_declaration: 'method',
|
|
33
|
+
type_declaration: 'type',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=go.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../../src/indexer/languages/go.ts"],"names":[],"mappings":";;AAAA,mCAA2C;AAC3C,mCAAsC;AAEtC,IAAA,wBAAgB,EAAC;IACb,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,QAAQ,EAAE,IAAA,mBAAW,EAAC,qBAAqB,CAAC;IAC5C,OAAO,EAAE;QACL,OAAO,EAAE;;;;;;;SAOR;QACD,OAAO,EAAE;;SAER;QACD,KAAK,EAAE;;;;;;;SAON;KACJ;IACD,OAAO,EAAE;QACL,oBAAoB,EAAE,UAAU;QAChC,kBAAkB,EAAI,QAAQ;QAC9B,gBAAgB,EAAM,MAAM;KAC/B;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type SymbolKind = 'function' | 'method' | 'class' | 'interface' | 'type' | 'enum' | 'variable' | 'arrow';
|
|
2
|
+
export interface LanguageQueries {
|
|
3
|
+
/** S-expr query — captures @node (container) and @name (identifier) */
|
|
4
|
+
symbols: string;
|
|
5
|
+
/** S-expr query — captures @source (module path string) */
|
|
6
|
+
imports: string;
|
|
7
|
+
/** S-expr query — captures @name (called function/method) */
|
|
8
|
+
calls: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LanguageConfig {
|
|
11
|
+
name: string;
|
|
12
|
+
extensions: string[];
|
|
13
|
+
/** Absolute path to the .wasm grammar file */
|
|
14
|
+
wasmFile: string;
|
|
15
|
+
queries: LanguageQueries;
|
|
16
|
+
/** Maps tree-sitter node types to SymbolKind */
|
|
17
|
+
kindMap: Record<string, SymbolKind>;
|
|
18
|
+
}
|
|
19
|
+
export declare function registerLanguage(config: LanguageConfig): void;
|
|
20
|
+
export declare function detectLanguage(filePath: string): LanguageConfig | undefined;
|
|
21
|
+
export declare function registeredExtensions(): string[];
|
|
22
|
+
import './typescript';
|
|
23
|
+
import './python';
|
|
24
|
+
import './go';
|
|
25
|
+
import './rust';
|
|
26
|
+
import './java';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/indexer/languages/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAChB,UAAU,GACV,QAAQ,GACR,OAAO,GACP,WAAW,GACX,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,CAAC;AAEd,MAAM,WAAW,eAAe;IAC5B,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,eAAe,CAAC;IACzB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACvC;AAID,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAI7D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAG3E;AAED,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAGD,OAAO,cAAc,CAAC;AACtB,OAAO,UAAU,CAAC;AAClB,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,CAAC;AAChB,OAAO,QAAQ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerLanguage = registerLanguage;
|
|
4
|
+
exports.detectLanguage = detectLanguage;
|
|
5
|
+
exports.registeredExtensions = registeredExtensions;
|
|
6
|
+
const REGISTRY = new Map();
|
|
7
|
+
function registerLanguage(config) {
|
|
8
|
+
for (const ext of config.extensions) {
|
|
9
|
+
REGISTRY.set(ext, config);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function detectLanguage(filePath) {
|
|
13
|
+
const ext = filePath.slice(filePath.lastIndexOf('.'));
|
|
14
|
+
return REGISTRY.get(ext);
|
|
15
|
+
}
|
|
16
|
+
function registeredExtensions() {
|
|
17
|
+
return [...REGISTRY.keys()];
|
|
18
|
+
}
|
|
19
|
+
// Eagerly import all language configs so they self-register
|
|
20
|
+
require("./typescript");
|
|
21
|
+
require("./python");
|
|
22
|
+
require("./go");
|
|
23
|
+
require("./rust");
|
|
24
|
+
require("./java");
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/indexer/languages/index.ts"],"names":[],"mappings":";;AA+BA,4CAIC;AAED,wCAGC;AAED,oDAEC;AAfD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEnD,SAAgB,gBAAgB,CAAC,MAAsB;IACnD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAClC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,QAAgB;IAC3C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IACtD,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,SAAgB,oBAAoB;IAChC,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AAChC,CAAC;AAED,4DAA4D;AAC5D,wBAAsB;AACtB,oBAAkB;AAClB,gBAAc;AACd,kBAAgB;AAChB,kBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java.d.ts","sourceRoot":"","sources":["../../../src/indexer/languages/java.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("./index");
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
(0, index_1.registerLanguage)({
|
|
6
|
+
name: 'java',
|
|
7
|
+
extensions: ['.java'],
|
|
8
|
+
wasmFile: (0, utils_1.resolveWasm)('tree-sitter-java.wasm'),
|
|
9
|
+
queries: {
|
|
10
|
+
symbols: `
|
|
11
|
+
[
|
|
12
|
+
(class_declaration name: (identifier) @name) @node
|
|
13
|
+
(interface_declaration name: (identifier) @name) @node
|
|
14
|
+
(enum_declaration name: (identifier) @name) @node
|
|
15
|
+
(method_declaration name: (identifier) @name) @node
|
|
16
|
+
(constructor_declaration name: (identifier) @name) @node
|
|
17
|
+
(record_declaration name: (identifier) @name) @node
|
|
18
|
+
]
|
|
19
|
+
`,
|
|
20
|
+
imports: `
|
|
21
|
+
(import_declaration (scoped_identifier) @source)
|
|
22
|
+
`,
|
|
23
|
+
calls: `
|
|
24
|
+
[
|
|
25
|
+
(method_invocation name: (identifier) @name)
|
|
26
|
+
(object_creation_expression type: (type_identifier) @name)
|
|
27
|
+
]
|
|
28
|
+
`,
|
|
29
|
+
},
|
|
30
|
+
kindMap: {
|
|
31
|
+
class_declaration: 'class',
|
|
32
|
+
interface_declaration: 'interface',
|
|
33
|
+
enum_declaration: 'enum',
|
|
34
|
+
method_declaration: 'method',
|
|
35
|
+
constructor_declaration: 'function',
|
|
36
|
+
record_declaration: 'class',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=java.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java.js","sourceRoot":"","sources":["../../../src/indexer/languages/java.ts"],"names":[],"mappings":";;AAAA,mCAA2C;AAC3C,mCAAsC;AAEtC,IAAA,wBAAgB,EAAC;IACb,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,QAAQ,EAAE,IAAA,mBAAW,EAAC,uBAAuB,CAAC;IAC9C,OAAO,EAAE;QACL,OAAO,EAAE;;;;;;;;;SASR;QACD,OAAO,EAAE;;SAER;QACD,KAAK,EAAE;;;;;SAKN;KACJ;IACD,OAAO,EAAE;QACL,iBAAiB,EAAQ,OAAO;QAChC,qBAAqB,EAAI,WAAW;QACpC,gBAAgB,EAAS,MAAM;QAC/B,kBAAkB,EAAO,QAAQ;QACjC,uBAAuB,EAAE,UAAU;QACnC,kBAAkB,EAAO,OAAO;KACnC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../../src/indexer/languages/python.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("./index");
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
(0, index_1.registerLanguage)({
|
|
6
|
+
name: 'python',
|
|
7
|
+
extensions: ['.py', '.pyi'],
|
|
8
|
+
wasmFile: (0, utils_1.resolveWasm)('tree-sitter-python.wasm'),
|
|
9
|
+
queries: {
|
|
10
|
+
symbols: `
|
|
11
|
+
[
|
|
12
|
+
(function_definition name: (identifier) @name) @node
|
|
13
|
+
(class_definition name: (identifier) @name) @node
|
|
14
|
+
(decorated_definition
|
|
15
|
+
definition: [
|
|
16
|
+
(function_definition name: (identifier) @name)
|
|
17
|
+
(class_definition name: (identifier) @name)
|
|
18
|
+
]) @node
|
|
19
|
+
]
|
|
20
|
+
`,
|
|
21
|
+
imports: `
|
|
22
|
+
[
|
|
23
|
+
(import_statement name: (dotted_name) @source)
|
|
24
|
+
(import_from_statement module_name: (dotted_name) @source)
|
|
25
|
+
(import_from_statement module_name: (relative_import) @source)
|
|
26
|
+
]
|
|
27
|
+
`,
|
|
28
|
+
calls: `
|
|
29
|
+
[
|
|
30
|
+
(call function: (identifier) @name)
|
|
31
|
+
(call function: (attribute attribute: (identifier) @name))
|
|
32
|
+
]
|
|
33
|
+
`,
|
|
34
|
+
},
|
|
35
|
+
kindMap: {
|
|
36
|
+
function_definition: 'function',
|
|
37
|
+
class_definition: 'class',
|
|
38
|
+
decorated_definition: 'function',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=python.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python.js","sourceRoot":"","sources":["../../../src/indexer/languages/python.ts"],"names":[],"mappings":";;AAAA,mCAA2C;AAC3C,mCAAsC;AAEtC,IAAA,wBAAgB,EAAC;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,IAAA,mBAAW,EAAC,yBAAyB,CAAC;IAChD,OAAO,EAAE;QACL,OAAO,EAAE;;;;;;;;;;SAUR;QACD,OAAO,EAAE;;;;;;SAMR;QACD,KAAK,EAAE;;;;;SAKN;KACJ;IACD,OAAO,EAAE;QACL,mBAAmB,EAAG,UAAU;QAChC,gBAAgB,EAAM,OAAO;QAC7B,oBAAoB,EAAE,UAAU;KACnC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust.d.ts","sourceRoot":"","sources":["../../../src/indexer/languages/rust.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("./index");
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
(0, index_1.registerLanguage)({
|
|
6
|
+
name: 'rust',
|
|
7
|
+
extensions: ['.rs'],
|
|
8
|
+
wasmFile: (0, utils_1.resolveWasm)('tree-sitter-rust.wasm'),
|
|
9
|
+
queries: {
|
|
10
|
+
symbols: `
|
|
11
|
+
[
|
|
12
|
+
(function_item name: (identifier) @name) @node
|
|
13
|
+
(struct_item name: (type_identifier) @name) @node
|
|
14
|
+
(enum_item name: (type_identifier) @name) @node
|
|
15
|
+
(trait_item name: (type_identifier) @name) @node
|
|
16
|
+
(impl_item
|
|
17
|
+
type: (type_identifier) @name) @node
|
|
18
|
+
(type_item name: (type_identifier) @name) @node
|
|
19
|
+
]
|
|
20
|
+
`,
|
|
21
|
+
imports: `
|
|
22
|
+
[
|
|
23
|
+
(use_declaration argument: (scoped_identifier path: (identifier) @source))
|
|
24
|
+
(use_declaration argument: (identifier) @source)
|
|
25
|
+
(extern_crate_declaration name: (identifier) @source)
|
|
26
|
+
]
|
|
27
|
+
`,
|
|
28
|
+
calls: `
|
|
29
|
+
[
|
|
30
|
+
(call_expression function: (identifier) @name)
|
|
31
|
+
(call_expression
|
|
32
|
+
function: (field_expression
|
|
33
|
+
field: (field_identifier) @name))
|
|
34
|
+
(call_expression
|
|
35
|
+
function: (scoped_identifier
|
|
36
|
+
name: (identifier) @name))
|
|
37
|
+
]
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
kindMap: {
|
|
41
|
+
function_item: 'function',
|
|
42
|
+
struct_item: 'class',
|
|
43
|
+
enum_item: 'enum',
|
|
44
|
+
trait_item: 'interface',
|
|
45
|
+
impl_item: 'class',
|
|
46
|
+
type_item: 'type',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=rust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust.js","sourceRoot":"","sources":["../../../src/indexer/languages/rust.ts"],"names":[],"mappings":";;AAAA,mCAA2C;AAC3C,mCAAsC;AAEtC,IAAA,wBAAgB,EAAC;IACb,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,QAAQ,EAAE,IAAA,mBAAW,EAAC,uBAAuB,CAAC;IAC9C,OAAO,EAAE;QACL,OAAO,EAAE;;;;;;;;;;SAUR;QACD,OAAO,EAAE;;;;;;SAMR;QACD,KAAK,EAAE;;;;;;;;;;SAUN;KACJ;IACD,OAAO,EAAE;QACL,aAAa,EAAE,UAAU;QACzB,WAAW,EAAI,OAAO;QACtB,SAAS,EAAM,MAAM;QACrB,UAAU,EAAK,WAAW;QAC1B,SAAS,EAAM,OAAO;QACtB,SAAS,EAAM,MAAM;KACxB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../src/indexer/languages/typescript.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("./index");
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
(0, index_1.registerLanguage)({
|
|
6
|
+
name: 'typescript',
|
|
7
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],
|
|
8
|
+
wasmFile: (0, utils_1.resolveWasm)('tree-sitter-typescript.wasm'),
|
|
9
|
+
queries: {
|
|
10
|
+
symbols: `
|
|
11
|
+
[
|
|
12
|
+
(function_declaration name: (identifier) @name) @node
|
|
13
|
+
(method_definition name: (property_identifier) @name) @node
|
|
14
|
+
(class_declaration name: (type_identifier) @name) @node
|
|
15
|
+
(interface_declaration name: (type_identifier) @name) @node
|
|
16
|
+
(type_alias_declaration name: (type_identifier) @name) @node
|
|
17
|
+
(enum_declaration name: (identifier) @name) @node
|
|
18
|
+
(lexical_declaration
|
|
19
|
+
(variable_declarator
|
|
20
|
+
name: (identifier) @name
|
|
21
|
+
value: [(arrow_function) (function_expression)])) @node
|
|
22
|
+
]
|
|
23
|
+
`,
|
|
24
|
+
imports: `
|
|
25
|
+
(import_statement
|
|
26
|
+
source: (string (string_fragment) @source))
|
|
27
|
+
`,
|
|
28
|
+
calls: `
|
|
29
|
+
[
|
|
30
|
+
(call_expression function: (identifier) @name)
|
|
31
|
+
(call_expression
|
|
32
|
+
function: (member_expression
|
|
33
|
+
property: (property_identifier) @name))
|
|
34
|
+
]
|
|
35
|
+
`,
|
|
36
|
+
},
|
|
37
|
+
kindMap: {
|
|
38
|
+
function_declaration: 'function',
|
|
39
|
+
method_definition: 'method',
|
|
40
|
+
class_declaration: 'class',
|
|
41
|
+
interface_declaration: 'interface',
|
|
42
|
+
type_alias_declaration: 'type',
|
|
43
|
+
enum_declaration: 'enum',
|
|
44
|
+
lexical_declaration: 'arrow',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/indexer/languages/typescript.ts"],"names":[],"mappings":";;AAAA,mCAA2C;AAC3C,mCAAsC;AAEtC,IAAA,wBAAgB,EAAC;IACb,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAC1D,QAAQ,EAAE,IAAA,mBAAW,EAAC,6BAA6B,CAAC;IACpD,OAAO,EAAE;QACL,OAAO,EAAE;;;;;;;;;;;;;SAaR;QACD,OAAO,EAAE;;;SAGR;QACD,KAAK,EAAE;;;;;;;SAON;KACJ;IACD,OAAO,EAAE;QACL,oBAAoB,EAAK,UAAU;QACnC,iBAAiB,EAAQ,QAAQ;QACjC,iBAAiB,EAAQ,OAAO;QAChC,qBAAqB,EAAI,WAAW;QACpC,sBAAsB,EAAG,MAAM;QAC/B,gBAAgB,EAAS,MAAM;QAC/B,mBAAmB,EAAM,OAAO;KACnC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/indexer/languages/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUpD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.resolveWasm = resolveWasm;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
function resolveWasm(filename) {
|
|
40
|
+
let dir = __dirname;
|
|
41
|
+
while (true) {
|
|
42
|
+
const candidate = path.join(dir, 'node_modules', 'tree-sitter-wasms', 'out', filename);
|
|
43
|
+
if (fs.existsSync(candidate))
|
|
44
|
+
return candidate;
|
|
45
|
+
const parent = path.dirname(dir);
|
|
46
|
+
if (parent === dir)
|
|
47
|
+
break;
|
|
48
|
+
dir = parent;
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`Cannot find ${filename}. Run: npm install tree-sitter-wasms`);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/indexer/languages/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,kCAUC;AAbD,2CAA6B;AAC7B,uCAAyB;AAEzB,SAAgB,WAAW,CAAC,QAAgB;IACxC,IAAI,GAAG,GAAG,SAAS,CAAC;IACpB,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvF,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACjB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,eAAe,QAAQ,sCAAsC,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LanguageConfig, SymbolKind } from './languages/index';
|
|
2
|
+
export interface ExtractedSymbol {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: SymbolKind;
|
|
5
|
+
startLine: number;
|
|
6
|
+
endLine: number;
|
|
7
|
+
exported: boolean;
|
|
8
|
+
signature: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ExtractedImport {
|
|
11
|
+
source: string;
|
|
12
|
+
line: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ExtractedCall {
|
|
15
|
+
callee: string;
|
|
16
|
+
line: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ParseResult {
|
|
19
|
+
symbols: ExtractedSymbol[];
|
|
20
|
+
imports: ExtractedImport[];
|
|
21
|
+
calls: ExtractedCall[];
|
|
22
|
+
}
|
|
23
|
+
export declare function parseFile(content: string, config: LanguageConfig): Promise<ParseResult>;
|
|
24
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/indexer/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,KAAK,EAAE,aAAa,EAAE,CAAC;CAC1B;AAqCD,wBAAsB,SAAS,CAC3B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC,CA2EtB"}
|