memgrid 0.5.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/CHANGELOG.md +80 -0
- package/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/learn/index.d.ts +44 -0
- package/dist/learn/index.d.ts.map +1 -0
- package/dist/learn/index.js +234 -0
- package/dist/learn/index.js.map +1 -0
- package/dist/memgrid.d.ts +50 -0
- package/dist/memgrid.d.ts.map +1 -0
- package/dist/memgrid.js +175 -0
- package/dist/memgrid.js.map +1 -0
- package/dist/retrieve/index.d.ts +27 -0
- package/dist/retrieve/index.d.ts.map +1 -0
- package/dist/retrieve/index.js +209 -0
- package/dist/retrieve/index.js.map +1 -0
- package/dist/retrieve/semantic.d.ts +67 -0
- package/dist/retrieve/semantic.d.ts.map +1 -0
- package/dist/retrieve/semantic.js +240 -0
- package/dist/retrieve/semantic.js.map +1 -0
- package/dist/scanner/composite.d.ts +27 -0
- package/dist/scanner/composite.d.ts.map +1 -0
- package/dist/scanner/composite.js +58 -0
- package/dist/scanner/composite.js.map +1 -0
- package/dist/scanner/config.d.ts +15 -0
- package/dist/scanner/config.d.ts.map +1 -0
- package/dist/scanner/config.js +167 -0
- package/dist/scanner/config.js.map +1 -0
- package/dist/scanner/golang.d.ts +19 -0
- package/dist/scanner/golang.d.ts.map +1 -0
- package/dist/scanner/golang.js +190 -0
- package/dist/scanner/golang.js.map +1 -0
- package/dist/scanner/index.d.ts +11 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +10 -0
- package/dist/scanner/index.js.map +1 -0
- package/dist/scanner/javascript.d.ts +20 -0
- package/dist/scanner/javascript.d.ts.map +1 -0
- package/dist/scanner/javascript.js +167 -0
- package/dist/scanner/javascript.js.map +1 -0
- package/dist/scanner/markdown.d.ts +17 -0
- package/dist/scanner/markdown.d.ts.map +1 -0
- package/dist/scanner/markdown.js +106 -0
- package/dist/scanner/markdown.js.map +1 -0
- package/dist/scanner/python.d.ts +19 -0
- package/dist/scanner/python.d.ts.map +1 -0
- package/dist/scanner/python.js +177 -0
- package/dist/scanner/python.js.map +1 -0
- package/dist/scanner/rules.d.ts +15 -0
- package/dist/scanner/rules.d.ts.map +1 -0
- package/dist/scanner/rules.js +86 -0
- package/dist/scanner/rules.js.map +1 -0
- package/dist/scanner/rust.d.ts +18 -0
- package/dist/scanner/rust.d.ts.map +1 -0
- package/dist/scanner/rust.js +178 -0
- package/dist/scanner/rust.js.map +1 -0
- package/dist/scanner/scanner.d.ts +33 -0
- package/dist/scanner/scanner.d.ts.map +1 -0
- package/dist/scanner/scanner.js +2 -0
- package/dist/scanner/scanner.js.map +1 -0
- package/dist/scanner/typescript.d.ts +28 -0
- package/dist/scanner/typescript.d.ts.map +1 -0
- package/dist/scanner/typescript.js +522 -0
- package/dist/scanner/typescript.js.map +1 -0
- package/dist/serve/cli.d.ts +3 -0
- package/dist/serve/cli.d.ts.map +1 -0
- package/dist/serve/cli.js +145 -0
- package/dist/serve/cli.js.map +1 -0
- package/dist/serve/mcp-server.d.ts +11 -0
- package/dist/serve/mcp-server.d.ts.map +1 -0
- package/dist/serve/mcp-server.js +276 -0
- package/dist/serve/mcp-server.js.map +1 -0
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +2 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/types.d.ts +99 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +3 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/store/file-store.d.ts +62 -0
- package/dist/store/file-store.d.ts.map +1 -0
- package/dist/store/file-store.js +241 -0
- package/dist/store/file-store.js.map +1 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +2 -0
- package/dist/store/index.js.map +1 -0
- package/dist/sync/index.d.ts +56 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +580 -0
- package/dist/sync/index.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { Project } from 'ts-morph';
|
|
4
|
+
export class TypeScriptScanner {
|
|
5
|
+
name = 'typescript';
|
|
6
|
+
store;
|
|
7
|
+
projectRoot;
|
|
8
|
+
constructor(store, projectRoot) {
|
|
9
|
+
this.store = store;
|
|
10
|
+
this.projectRoot = projectRoot;
|
|
11
|
+
}
|
|
12
|
+
detect(projectRoot) {
|
|
13
|
+
return (fs.existsSync(path.join(projectRoot, 'tsconfig.json')) ||
|
|
14
|
+
this.findSourceDirs().length > 0);
|
|
15
|
+
}
|
|
16
|
+
async scan(options) {
|
|
17
|
+
const units = [];
|
|
18
|
+
this.store.ensureDirs();
|
|
19
|
+
// Run all scans in parallel (they are independent)
|
|
20
|
+
const scans = [this.scanTypeScript()];
|
|
21
|
+
if (options.includeRules)
|
|
22
|
+
scans.push(this.scanRules());
|
|
23
|
+
if (options.includeExamples)
|
|
24
|
+
scans.push(this.scanExamples());
|
|
25
|
+
scans.push(this.scanConfig());
|
|
26
|
+
const results = await Promise.all(scans);
|
|
27
|
+
for (const result of results) {
|
|
28
|
+
units.push(...result);
|
|
29
|
+
}
|
|
30
|
+
// 5. Build associations
|
|
31
|
+
this.buildAssociations(units);
|
|
32
|
+
// 6. Save all units
|
|
33
|
+
for (const unit of units) {
|
|
34
|
+
this.store.saveUnit(unit);
|
|
35
|
+
}
|
|
36
|
+
// 7. Update mesh.json
|
|
37
|
+
this.updateGrid(units);
|
|
38
|
+
// Invalidate search index (units changed)
|
|
39
|
+
// (handled by store.load() called before this)
|
|
40
|
+
return units;
|
|
41
|
+
}
|
|
42
|
+
async scanTypeScript() {
|
|
43
|
+
const units = [];
|
|
44
|
+
const tsConfigPath = path.join(this.projectRoot, 'tsconfig.json');
|
|
45
|
+
const appsDir = path.join(this.projectRoot, 'apps');
|
|
46
|
+
if (!fs.existsSync(tsConfigPath) && !fs.existsSync(appsDir)) {
|
|
47
|
+
return units;
|
|
48
|
+
}
|
|
49
|
+
const project = new Project({
|
|
50
|
+
tsConfigFilePath: fs.existsSync(tsConfigPath) ? tsConfigPath : undefined,
|
|
51
|
+
skipAddingFilesFromTsConfig: false,
|
|
52
|
+
});
|
|
53
|
+
// Always add source directories that may not be in tsconfig
|
|
54
|
+
// (e.g., apps/server in monorepos where tsconfig only covers apps/web)
|
|
55
|
+
if (fs.existsSync(tsConfigPath)) {
|
|
56
|
+
const srcDirs = this.findSourceDirs();
|
|
57
|
+
for (const dir of srcDirs) {
|
|
58
|
+
project.addSourceFilesAtPaths(`${dir}/**/*.ts`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (const sourceFile of project.getSourceFiles()) {
|
|
62
|
+
const filePath = path.relative(this.projectRoot, sourceFile.getFilePath());
|
|
63
|
+
// Skip test files, node_modules, dist, .next
|
|
64
|
+
if (filePath.includes('node_modules') || filePath.includes('dist') || filePath.includes('.next'))
|
|
65
|
+
continue;
|
|
66
|
+
if (filePath.endsWith('.spec.ts') || filePath.endsWith('.test.ts'))
|
|
67
|
+
continue;
|
|
68
|
+
// Extract classes with public methods
|
|
69
|
+
for (const cls of sourceFile.getClasses()) {
|
|
70
|
+
const className = cls.getName();
|
|
71
|
+
if (!className || cls.isAbstract())
|
|
72
|
+
continue;
|
|
73
|
+
for (const method of cls.getMethods()) {
|
|
74
|
+
const scope = method.getScope();
|
|
75
|
+
if (scope !== 'public' && scope !== undefined)
|
|
76
|
+
continue; // skip private/protected
|
|
77
|
+
const methodName = method.getName();
|
|
78
|
+
const signature = `${className}.${methodName}`;
|
|
79
|
+
const params = method.getParameters().map((p) => {
|
|
80
|
+
const type = p.getType().getText();
|
|
81
|
+
return `${p.getName()}: ${type}`;
|
|
82
|
+
});
|
|
83
|
+
const returnType = method.getReturnType().getText();
|
|
84
|
+
const unit = {
|
|
85
|
+
id: `method_${signature.toLowerCase().replace(/\./g, '_').replace(/[^a-z0-9_]/g, '_').replace(/_+/g, '_')}`,
|
|
86
|
+
type: 'method',
|
|
87
|
+
summary: `${signature} — ${this.extractJsDoc(method)}`,
|
|
88
|
+
source: {
|
|
89
|
+
file: filePath,
|
|
90
|
+
lines: `${method.getStartLineNumber()}-${method.getEndLineNumber()}`,
|
|
91
|
+
},
|
|
92
|
+
signatures: [signature],
|
|
93
|
+
content: {
|
|
94
|
+
description: this.extractJsDoc(method) || `${signature}()`,
|
|
95
|
+
inputs: params.length > 0 ? params.join(', ') : 'none',
|
|
96
|
+
outputs: returnType,
|
|
97
|
+
dependencies: this.extractDependencies(method),
|
|
98
|
+
code_snippet: method.getText(), // Full text for association analysis
|
|
99
|
+
},
|
|
100
|
+
associations: [],
|
|
101
|
+
meta: {
|
|
102
|
+
created: new Date().toISOString(),
|
|
103
|
+
updated: new Date().toISOString(),
|
|
104
|
+
confidence: 0.8, // AST extraction, high confidence
|
|
105
|
+
usage_count: 0,
|
|
106
|
+
status: 'active',
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
units.push(unit);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Extract exported functions
|
|
113
|
+
for (const func of sourceFile.getFunctions()) {
|
|
114
|
+
if (!func.isExported())
|
|
115
|
+
continue;
|
|
116
|
+
const funcName = func.getName();
|
|
117
|
+
if (!funcName)
|
|
118
|
+
continue;
|
|
119
|
+
const params = func.getParameters().map((p) => {
|
|
120
|
+
const type = p.getType().getText();
|
|
121
|
+
return `${p.getName()}: ${type}`;
|
|
122
|
+
});
|
|
123
|
+
const returnType = func.getReturnType().getText();
|
|
124
|
+
const unit = {
|
|
125
|
+
id: `method_${this.sanitizeId(funcName)}`,
|
|
126
|
+
type: 'method',
|
|
127
|
+
summary: `${funcName}() — ${this.extractJsDoc(func)}`,
|
|
128
|
+
source: {
|
|
129
|
+
file: filePath,
|
|
130
|
+
lines: `${func.getStartLineNumber()}-${func.getEndLineNumber()}`,
|
|
131
|
+
},
|
|
132
|
+
signatures: [funcName],
|
|
133
|
+
content: {
|
|
134
|
+
description: this.extractJsDoc(func) || `${funcName}()`,
|
|
135
|
+
inputs: params.length > 0 ? params.join(', ') : 'none',
|
|
136
|
+
outputs: returnType,
|
|
137
|
+
code_snippet: func.getText().split('\n').slice(0, 10).join('\n'),
|
|
138
|
+
},
|
|
139
|
+
associations: [],
|
|
140
|
+
meta: {
|
|
141
|
+
created: new Date().toISOString(),
|
|
142
|
+
updated: new Date().toISOString(),
|
|
143
|
+
confidence: 0.8,
|
|
144
|
+
usage_count: 0,
|
|
145
|
+
status: 'active',
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
units.push(unit);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return units;
|
|
152
|
+
}
|
|
153
|
+
async scanRules() {
|
|
154
|
+
const units = [];
|
|
155
|
+
const rulesDir = path.join(this.projectRoot, '.claude', 'rules');
|
|
156
|
+
if (!fs.existsSync(rulesDir))
|
|
157
|
+
return units;
|
|
158
|
+
for (const file of fs.readdirSync(rulesDir)) {
|
|
159
|
+
if (!file.endsWith('.md'))
|
|
160
|
+
continue;
|
|
161
|
+
const filePath = path.join(rulesDir, file);
|
|
162
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
163
|
+
const relativePath = path.relative(this.projectRoot, filePath);
|
|
164
|
+
// Extract sections from markdown
|
|
165
|
+
const sections = content.split(/^## /m).filter(Boolean);
|
|
166
|
+
for (const section of sections) {
|
|
167
|
+
const title = section.split('\n')[0].trim();
|
|
168
|
+
const body = section.split('\n').slice(1).join('\n').trim();
|
|
169
|
+
if (!title || body.length < 50)
|
|
170
|
+
continue;
|
|
171
|
+
const safeTitle = title.replace(/[^a-zA-Z0-9_\-]/g, '_').replace(/_+/g, '_').slice(0, 50).toLowerCase();
|
|
172
|
+
if (!safeTitle || safeTitle === '_')
|
|
173
|
+
continue;
|
|
174
|
+
const safeFile = file.replace('.md', '').replace(/[^a-zA-Z0-9_\-]/g, '_').replace(/_+/g, '_').slice(0, 30).toLowerCase();
|
|
175
|
+
const unit = {
|
|
176
|
+
id: `rule_${safeFile}_${safeTitle}`,
|
|
177
|
+
type: 'pattern',
|
|
178
|
+
summary: `${file.replace('.md', '')}: ${title}`,
|
|
179
|
+
source: { file: relativePath },
|
|
180
|
+
signatures: [title, file.replace('.md', '').replace(/-/g, ' ')],
|
|
181
|
+
content: {
|
|
182
|
+
description: body.slice(0, 500),
|
|
183
|
+
},
|
|
184
|
+
associations: [],
|
|
185
|
+
meta: {
|
|
186
|
+
created: new Date().toISOString(),
|
|
187
|
+
updated: new Date().toISOString(),
|
|
188
|
+
confidence: 0.9,
|
|
189
|
+
usage_count: 0,
|
|
190
|
+
status: 'active',
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
units.push(unit);
|
|
194
|
+
}
|
|
195
|
+
// Also create a rule_trigger unit
|
|
196
|
+
const safeFile = file.replace('.md', '').replace(/[^a-zA-Z0-9_\-]/g, '_').replace(/_+/g, '_').slice(0, 30).toLowerCase();
|
|
197
|
+
const triggerUnit = {
|
|
198
|
+
id: `trigger_rule_${safeFile}`,
|
|
199
|
+
type: 'rule_trigger',
|
|
200
|
+
summary: `When working on ${file.replace('.md', '').replace(/-/g, ' ')} → load ${file}`,
|
|
201
|
+
source: { file: relativePath },
|
|
202
|
+
signatures: [file.replace('.md', '').replace(/-/g, ' ')],
|
|
203
|
+
content: {
|
|
204
|
+
description: `Load ${relativePath} when working on relevant code`,
|
|
205
|
+
trigger: `Working on ${file.replace('.md', '').replace(/-/g, ' ')} related code`,
|
|
206
|
+
action: `Load ${relativePath}`,
|
|
207
|
+
},
|
|
208
|
+
associations: [],
|
|
209
|
+
meta: {
|
|
210
|
+
created: new Date().toISOString(),
|
|
211
|
+
updated: new Date().toISOString(),
|
|
212
|
+
confidence: 0.8,
|
|
213
|
+
usage_count: 0,
|
|
214
|
+
status: 'active',
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
units.push(triggerUnit);
|
|
218
|
+
}
|
|
219
|
+
return units;
|
|
220
|
+
}
|
|
221
|
+
async scanExamples() {
|
|
222
|
+
const units = [];
|
|
223
|
+
const examplesDir = path.join(this.projectRoot, '.claude', 'examples');
|
|
224
|
+
if (!fs.existsSync(examplesDir))
|
|
225
|
+
return units;
|
|
226
|
+
const scanDir = (dir, isBad) => {
|
|
227
|
+
if (!fs.existsSync(dir))
|
|
228
|
+
return;
|
|
229
|
+
for (const file of fs.readdirSync(dir)) {
|
|
230
|
+
if (!file.endsWith('.ts'))
|
|
231
|
+
continue;
|
|
232
|
+
if (file.startsWith("_TEMPLATE"))
|
|
233
|
+
continue;
|
|
234
|
+
const filePath = path.join(dir, file);
|
|
235
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
236
|
+
const relativePath = path.relative(this.projectRoot, filePath);
|
|
237
|
+
const unit = {
|
|
238
|
+
id: `example_${isBad ? 'bad' : 'good'}_${file.replace('.ts', '')}`,
|
|
239
|
+
type: isBad ? 'error_solution' : 'pattern',
|
|
240
|
+
summary: `${isBad ? '❌ Bad' : '✅ Good'} example: ${file.replace('.ts', '').replace(/-/g, ' ')}`,
|
|
241
|
+
source: { file: relativePath },
|
|
242
|
+
signatures: [file.replace('.ts', '').replace(/-/g, ' ')],
|
|
243
|
+
content: {
|
|
244
|
+
description: `${isBad ? 'Anti-pattern to avoid' : 'Recommended pattern'}: ${file}`,
|
|
245
|
+
code_snippet: content.slice(0, 800),
|
|
246
|
+
},
|
|
247
|
+
associations: [],
|
|
248
|
+
meta: {
|
|
249
|
+
created: new Date().toISOString(),
|
|
250
|
+
updated: new Date().toISOString(),
|
|
251
|
+
confidence: 0.9,
|
|
252
|
+
usage_count: 0,
|
|
253
|
+
status: 'active',
|
|
254
|
+
},
|
|
255
|
+
};
|
|
256
|
+
units.push(unit);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
scanDir(path.join(examplesDir, 'server', 'good'), false);
|
|
260
|
+
scanDir(path.join(examplesDir, 'server', 'bad'), true);
|
|
261
|
+
scanDir(path.join(examplesDir, 'web', 'good'), false);
|
|
262
|
+
scanDir(path.join(examplesDir, 'web', 'bad'), true);
|
|
263
|
+
return units;
|
|
264
|
+
}
|
|
265
|
+
async scanConfig() {
|
|
266
|
+
const units = [];
|
|
267
|
+
// package.json
|
|
268
|
+
const pkgPath = path.join(this.projectRoot, 'package.json');
|
|
269
|
+
if (fs.existsSync(pkgPath)) {
|
|
270
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
271
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
272
|
+
const keyDeps = Object.entries(deps)
|
|
273
|
+
.filter(([name]) => ['next', 'react', 'nestjs', 'typeorm', 'chakra', 'zustand', 'swr', 'pnpm', 'typescript'].some((k) => name.includes(k)))
|
|
274
|
+
.map(([name, ver]) => `${name}@${ver}`);
|
|
275
|
+
if (keyDeps.length > 0) {
|
|
276
|
+
units.push({
|
|
277
|
+
id: 'config_tech_stack',
|
|
278
|
+
type: 'config',
|
|
279
|
+
summary: `Tech stack: ${keyDeps.slice(0, 8).join(', ')}`,
|
|
280
|
+
source: { file: 'package.json' },
|
|
281
|
+
signatures: ['tech stack', 'dependencies', '技术栈'],
|
|
282
|
+
content: { description: `Key dependencies: ${keyDeps.join(', ')}` },
|
|
283
|
+
associations: [],
|
|
284
|
+
meta: {
|
|
285
|
+
created: new Date().toISOString(),
|
|
286
|
+
updated: new Date().toISOString(),
|
|
287
|
+
confidence: 0.95,
|
|
288
|
+
usage_count: 0,
|
|
289
|
+
status: 'active',
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// docker-compose.yml
|
|
295
|
+
const composePath = path.join(this.projectRoot, 'docker-compose.yml');
|
|
296
|
+
if (fs.existsSync(composePath)) {
|
|
297
|
+
const compose = fs.readFileSync(composePath, 'utf-8');
|
|
298
|
+
const serviceMatches = compose.match(/container_name:\s*(\S+)/g) || [];
|
|
299
|
+
const services = serviceMatches.map((m) => m.replace('container_name:', '').trim());
|
|
300
|
+
units.push({
|
|
301
|
+
id: 'config_docker_services',
|
|
302
|
+
type: 'config',
|
|
303
|
+
summary: `Docker services: ${services.join(', ')}`,
|
|
304
|
+
source: { file: 'docker-compose.yml' },
|
|
305
|
+
signatures: ['docker', 'services', 'containers'],
|
|
306
|
+
content: { description: `Running containers: ${services.join(', ')}` },
|
|
307
|
+
associations: [],
|
|
308
|
+
meta: {
|
|
309
|
+
created: new Date().toISOString(),
|
|
310
|
+
updated: new Date().toISOString(),
|
|
311
|
+
confidence: 0.95,
|
|
312
|
+
usage_count: 0,
|
|
313
|
+
status: 'active',
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
return units;
|
|
318
|
+
}
|
|
319
|
+
sanitizeId(text) {
|
|
320
|
+
return text.replace(/[^a-zA-Z0-9_\-]/g, "_").replace(/_+/g, "_").toLowerCase();
|
|
321
|
+
}
|
|
322
|
+
buildAssociations(units) {
|
|
323
|
+
const methodUnits = units.filter((u) => u.type === 'method');
|
|
324
|
+
const patternUnits = units.filter((u) => u.type === 'pattern');
|
|
325
|
+
const configUnits = units.filter((u) => u.type === 'config');
|
|
326
|
+
// Build a signature → unit index for fast lookup
|
|
327
|
+
const sigIndex = new Map(); // signature → unit id
|
|
328
|
+
for (const u of methodUnits) {
|
|
329
|
+
for (const sig of u.signatures) {
|
|
330
|
+
sigIndex.set(sig.toLowerCase(), u.id);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
for (const unit of methodUnits) {
|
|
334
|
+
if (!unit.source?.file)
|
|
335
|
+
continue;
|
|
336
|
+
// 1. Extract called names from code_snippet
|
|
337
|
+
const snippet = unit.content.code_snippet || '';
|
|
338
|
+
const calledNames = this.extractCalledNames(snippet);
|
|
339
|
+
for (const name of calledNames) {
|
|
340
|
+
// Exact match in sigIndex
|
|
341
|
+
let matchedId = sigIndex.get(name.toLowerCase());
|
|
342
|
+
// Partial match: "this.verifyOwnership" → matches "verifyOwnership"
|
|
343
|
+
if (!matchedId) {
|
|
344
|
+
for (const [sig, id] of sigIndex) {
|
|
345
|
+
if (sig.includes(name.toLowerCase()) || name.toLowerCase().includes(sig)) {
|
|
346
|
+
matchedId = id;
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (matchedId && matchedId !== unit.id) {
|
|
352
|
+
unit.associations.push({
|
|
353
|
+
to: matchedId,
|
|
354
|
+
relation: 'calls',
|
|
355
|
+
weight: 0.8,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// 2. Match patterns used in this method
|
|
360
|
+
for (const p of patternUnits) {
|
|
361
|
+
for (const sig of p.signatures) {
|
|
362
|
+
if (snippet.toLowerCase().includes(sig.toLowerCase()) && sig.length > 5) {
|
|
363
|
+
unit.associations.push({
|
|
364
|
+
to: p.id,
|
|
365
|
+
relation: 'follows_rule',
|
|
366
|
+
weight: 0.6,
|
|
367
|
+
});
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
// 3. Module-level association: same source subdirectory
|
|
373
|
+
const unitDir = path.dirname(unit.source.file);
|
|
374
|
+
const siblings = methodUnits.filter((m) => m.source?.file && path.dirname(m.source.file) === unitDir && m.id !== unit.id);
|
|
375
|
+
for (const sib of siblings.slice(0, 3)) {
|
|
376
|
+
unit.associations.push({
|
|
377
|
+
to: sib.id,
|
|
378
|
+
relation: 'belongs_to_module',
|
|
379
|
+
weight: 0.3,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// 4. Config → method associations (methods using config values)
|
|
384
|
+
for (const config of configUnits) {
|
|
385
|
+
const configKeywords = config.signatures;
|
|
386
|
+
for (const method of methodUnits) {
|
|
387
|
+
const snippet = (method.content.code_snippet || '') + (method.content.description || '');
|
|
388
|
+
if (configKeywords.some((k) => snippet.toLowerCase().includes(k.toLowerCase()) && k.length > 3)) {
|
|
389
|
+
method.associations.push({
|
|
390
|
+
to: config.id,
|
|
391
|
+
relation: 'calls',
|
|
392
|
+
weight: 0.4,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// Deduplicate associations
|
|
398
|
+
for (const unit of methodUnits) {
|
|
399
|
+
const seen = new Set();
|
|
400
|
+
unit.associations = unit.associations.filter((a) => {
|
|
401
|
+
const key = `${a.to}:${a.relation}`;
|
|
402
|
+
if (seen.has(key))
|
|
403
|
+
return false;
|
|
404
|
+
seen.add(key);
|
|
405
|
+
return true;
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
updateGrid(units) {
|
|
410
|
+
const edgeIndex = {};
|
|
411
|
+
let totalAssociations = 0;
|
|
412
|
+
for (const unit of units) {
|
|
413
|
+
if (unit.meta.status === 'archived')
|
|
414
|
+
continue;
|
|
415
|
+
if (unit.associations.length > 0) {
|
|
416
|
+
edgeIndex[unit.id] = unit.associations;
|
|
417
|
+
totalAssociations += unit.associations.length;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const grid = {
|
|
421
|
+
version: '0.1.0',
|
|
422
|
+
project: path.basename(this.projectRoot),
|
|
423
|
+
lastScanAt: new Date().toISOString(),
|
|
424
|
+
stats: {
|
|
425
|
+
totalUnits: units.length,
|
|
426
|
+
activeUnits: units.filter((u) => u.meta.status === 'active').length,
|
|
427
|
+
archivedUnits: units.filter((u) => u.meta.status === 'archived').length,
|
|
428
|
+
totalAssociations,
|
|
429
|
+
},
|
|
430
|
+
edgeIndex,
|
|
431
|
+
};
|
|
432
|
+
this.store.saveGrid(grid);
|
|
433
|
+
}
|
|
434
|
+
extractJsDoc(node) {
|
|
435
|
+
const jsDocs = node.getJsDocs?.();
|
|
436
|
+
if (jsDocs && jsDocs.length > 0) {
|
|
437
|
+
const text = jsDocs[0].getDescription().trim();
|
|
438
|
+
return text || '';
|
|
439
|
+
}
|
|
440
|
+
return '';
|
|
441
|
+
}
|
|
442
|
+
extractDependencies(method) {
|
|
443
|
+
const body = method.getBodyText?.() || '';
|
|
444
|
+
const deps = [];
|
|
445
|
+
// Match this.xxxService.yyy() or this.repo.yyy()
|
|
446
|
+
const serviceCalls = body.match(/this\.(\w+(?:Service|Repo|Query|Builder))\b/g) || [];
|
|
447
|
+
for (const call of serviceCalls) {
|
|
448
|
+
const name = call.replace('this.', '');
|
|
449
|
+
if (!deps.includes(name))
|
|
450
|
+
deps.push(name);
|
|
451
|
+
}
|
|
452
|
+
return deps;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Extract function/method names called in a code snippet.
|
|
456
|
+
* Matches patterns like: foo(), await foo(), this.foo(), obj.foo()
|
|
457
|
+
*/
|
|
458
|
+
extractCalledNames(code) {
|
|
459
|
+
const names = new Set();
|
|
460
|
+
// Match function calls: foo(...), await foo(...), this.foo(...), obj.foo(...)
|
|
461
|
+
const callPatterns = [
|
|
462
|
+
/\b(\w+)\s*\(/g, // direct calls: foo()
|
|
463
|
+
/this\.(\w+)\s*\(/g, // this.foo()
|
|
464
|
+
/(\w+)\.(\w+)\s*\(/g, // obj.method() — captures both obj and method
|
|
465
|
+
];
|
|
466
|
+
for (const pattern of callPatterns) {
|
|
467
|
+
let match;
|
|
468
|
+
while ((match = pattern.exec(code)) !== null) {
|
|
469
|
+
// Take the last capture group (the actual called function name)
|
|
470
|
+
const name = match[match.length - 1];
|
|
471
|
+
if (name && name.length > 2 && !this.isCommonKeyword(name)) {
|
|
472
|
+
names.add(name);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
// Match import statements
|
|
477
|
+
const importPattern = /import\s*\{[^}]*\}\s*from\s*['"]([^'"]+)['"]/g;
|
|
478
|
+
let match;
|
|
479
|
+
while ((match = importPattern.exec(code)) !== null) {
|
|
480
|
+
// Extract individual imported names
|
|
481
|
+
const namesStr = match[0].match(/\{([^}]*)\}/)?.[1] || '';
|
|
482
|
+
for (const n of namesStr.split(',')) {
|
|
483
|
+
const clean = n.trim().split(/\s+as\s+/)[0].trim();
|
|
484
|
+
if (clean && clean.length > 2)
|
|
485
|
+
names.add(clean);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return [...names];
|
|
489
|
+
}
|
|
490
|
+
isCommonKeyword(name) {
|
|
491
|
+
const keywords = new Set([
|
|
492
|
+
'if', 'for', 'let', 'var', 'new', 'try', 'const', 'typeof', 'instanceof',
|
|
493
|
+
'return', 'throw', 'await', 'async', 'while', 'switch', 'catch', 'finally',
|
|
494
|
+
'export', 'import', 'from', 'require', 'default', 'function', 'class',
|
|
495
|
+
'true', 'false', 'null', 'undefined', 'this', 'super', 'void', 'delete',
|
|
496
|
+
'map', 'filter', 'reduce', 'find', 'forEach', 'push', 'pop', 'slice',
|
|
497
|
+
'split', 'join', 'concat', 'sort', 'some', 'every', 'includes',
|
|
498
|
+
]);
|
|
499
|
+
return keywords.has(name);
|
|
500
|
+
}
|
|
501
|
+
findSourceDirs() {
|
|
502
|
+
const dirs = [];
|
|
503
|
+
const appsDir = path.join(this.projectRoot, 'apps');
|
|
504
|
+
if (fs.existsSync(appsDir)) {
|
|
505
|
+
for (const app of fs.readdirSync(appsDir)) {
|
|
506
|
+
const srcDir = path.join(appsDir, app, 'src');
|
|
507
|
+
if (fs.existsSync(srcDir))
|
|
508
|
+
dirs.push(srcDir);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
const packagesDir = path.join(this.projectRoot, 'packages');
|
|
512
|
+
if (fs.existsSync(packagesDir)) {
|
|
513
|
+
for (const pkg of fs.readdirSync(packagesDir)) {
|
|
514
|
+
const srcDir = path.join(packagesDir, pkg, 'src');
|
|
515
|
+
if (fs.existsSync(srcDir))
|
|
516
|
+
dirs.push(srcDir);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return dirs;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/scanner/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAK/C,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAG,YAAY,CAAC;IACrB,KAAK,CAAY;IACjB,WAAW,CAAS;IAE5B,YAAY,KAAgB,EAAE,WAAmB;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,WAAmB;QACxB,OAAO,CACL,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;YACtD,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC,CACjC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,MAAM,KAAK,GAAiB,EAAE,CAAC;QAE/B,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QAExB,mDAAmD;QACnD,MAAM,KAAK,GAA4B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QAE/D,IAAI,OAAO,CAAC,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QACvD,IAAI,OAAO,CAAC,eAAe;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,IAA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