@nahisaho/musubix-codegraph 3.6.0 → 3.8.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/integration/codemap-bridge.d.ts +16 -0
- package/dist/integration/codemap-bridge.d.ts.map +1 -0
- package/dist/integration/codemap-bridge.js +597 -0
- package/dist/integration/codemap-bridge.js.map +1 -0
- package/dist/integration/codemap-types.d.ts +259 -0
- package/dist/integration/codemap-types.d.ts.map +1 -0
- package/dist/integration/codemap-types.js +16 -0
- package/dist/integration/codemap-types.js.map +1 -0
- package/dist/integration/index.d.ts +8 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +8 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/knowledge-adapter.d.ts +69 -0
- package/dist/storage/knowledge-adapter.d.ts.map +1 -0
- package/dist/storage/knowledge-adapter.js +312 -0
- package/dist/storage/knowledge-adapter.js.map +1 -0
- package/package.json +10 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Codemap Bridge Implementation for Agent Skills Integration
|
|
3
|
+
* @traceability REQ-CM-001, REQ-CM-002, REQ-CM-003, REQ-CM-004
|
|
4
|
+
*/
|
|
5
|
+
import type { CodemapBridge, CodemapBridgeConfig, Codemap } from './codemap-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Create a Codemap Bridge for Agent Skills integration
|
|
8
|
+
* @param config Bridge configuration
|
|
9
|
+
* @returns CodemapBridge instance
|
|
10
|
+
*/
|
|
11
|
+
export declare function createCodemapBridge(config?: Partial<CodemapBridgeConfig>): CodemapBridge;
|
|
12
|
+
/**
|
|
13
|
+
* Format codemap structure as Mermaid diagram
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatCodemapAsMermaid(codemap: Codemap): string;
|
|
16
|
+
//# sourceMappingURL=codemap-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemap-bridge.d.ts","sourceRoot":"","sources":["../../src/integration/codemap-bridge.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EAQnB,OAAO,EAGR,MAAM,oBAAoB,CAAC;AAO5B;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM,GACxC,aAAa,CAsNf;AAyaD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAuB/D"}
|
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Codemap Bridge Implementation for Agent Skills Integration
|
|
3
|
+
* @traceability REQ-CM-001, REQ-CM-002, REQ-CM-003, REQ-CM-004
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'fs/promises';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
import { createHash } from 'crypto';
|
|
8
|
+
import { DEFAULT_CODEMAP_BRIDGE_CONFIG, } from './codemap-types.js';
|
|
9
|
+
import { LANGUAGE_EXTENSIONS } from '../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create a Codemap Bridge for Agent Skills integration
|
|
12
|
+
* @param config Bridge configuration
|
|
13
|
+
* @returns CodemapBridge instance
|
|
14
|
+
*/
|
|
15
|
+
export function createCodemapBridge(config = {}) {
|
|
16
|
+
let currentConfig = {
|
|
17
|
+
...DEFAULT_CODEMAP_BRIDGE_CONFIG,
|
|
18
|
+
...config,
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
async analyzeStructure(rootPath) {
|
|
22
|
+
const packages = await analyzePackages(rootPath);
|
|
23
|
+
const structure = await buildDirectoryTree(rootPath, currentConfig.maxDepth, currentConfig);
|
|
24
|
+
const entryPoints = await detectEntryPoints(rootPath, packages);
|
|
25
|
+
const frameworks = await detectFrameworks(rootPath);
|
|
26
|
+
return { packages, structure, entryPoints, frameworks };
|
|
27
|
+
},
|
|
28
|
+
async analyzeModule(modulePath) {
|
|
29
|
+
const content = await fs.readFile(modulePath, 'utf-8');
|
|
30
|
+
const lines = content.split('\n');
|
|
31
|
+
const exports = extractExports(content, modulePath);
|
|
32
|
+
const imports = extractImports(content);
|
|
33
|
+
const entityCounts = countEntities(content);
|
|
34
|
+
return {
|
|
35
|
+
path: modulePath,
|
|
36
|
+
name: path.basename(modulePath, path.extname(modulePath)),
|
|
37
|
+
exports,
|
|
38
|
+
imports,
|
|
39
|
+
entityCounts,
|
|
40
|
+
linesOfCode: lines.length,
|
|
41
|
+
complexity: calculateComplexity(content),
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
async generateCodemap(rootPath) {
|
|
45
|
+
const { packages, structure, entryPoints, frameworks } = await this.analyzeStructure(rootPath);
|
|
46
|
+
// Read project info
|
|
47
|
+
const packageJsonPath = path.join(rootPath, 'package.json');
|
|
48
|
+
let projectName = path.basename(rootPath);
|
|
49
|
+
let projectVersion;
|
|
50
|
+
try {
|
|
51
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
52
|
+
projectName = packageJson.name || projectName;
|
|
53
|
+
projectVersion = packageJson.version;
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// No package.json, use directory name
|
|
57
|
+
}
|
|
58
|
+
const documents = await generateDocuments(rootPath, packages, entryPoints, frameworks, structure);
|
|
59
|
+
return {
|
|
60
|
+
projectName,
|
|
61
|
+
projectVersion,
|
|
62
|
+
generatedAt: new Date().toISOString(),
|
|
63
|
+
documents,
|
|
64
|
+
packages,
|
|
65
|
+
entryPoints,
|
|
66
|
+
frameworks,
|
|
67
|
+
structure,
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
compareCodemaps(previous, current) {
|
|
71
|
+
const prevHash = hashCodemap(previous);
|
|
72
|
+
const currHash = hashCodemap(current);
|
|
73
|
+
const prevPackageNames = new Set(previous.packages.map(p => p.name));
|
|
74
|
+
const currPackageNames = new Set(current.packages.map(p => p.name));
|
|
75
|
+
const addedPackages = [...currPackageNames].filter(n => !prevPackageNames.has(n));
|
|
76
|
+
const removedPackages = [...prevPackageNames].filter(n => !currPackageNames.has(n));
|
|
77
|
+
const modifiedPackages = [...currPackageNames].filter(n => {
|
|
78
|
+
if (!prevPackageNames.has(n))
|
|
79
|
+
return false;
|
|
80
|
+
const prev = previous.packages.find(p => p.name === n);
|
|
81
|
+
const curr = current.packages.find(p => p.name === n);
|
|
82
|
+
return prev && curr && JSON.stringify(prev) !== JSON.stringify(curr);
|
|
83
|
+
});
|
|
84
|
+
const prevEntryPoints = new Set(previous.entryPoints.map(e => e.path));
|
|
85
|
+
const currEntryPoints = new Set(current.entryPoints.map(e => e.path));
|
|
86
|
+
const addedEntryPoints = [...currEntryPoints].filter(p => !prevEntryPoints.has(p));
|
|
87
|
+
const removedEntryPoints = [...prevEntryPoints].filter(p => !currEntryPoints.has(p));
|
|
88
|
+
const totalChanges = addedPackages.length + removedPackages.length + modifiedPackages.length +
|
|
89
|
+
addedEntryPoints.length + removedEntryPoints.length;
|
|
90
|
+
const totalItems = Math.max(previous.packages.length + previous.entryPoints.length, current.packages.length + current.entryPoints.length);
|
|
91
|
+
const diffPercentage = totalItems > 0 ? (totalChanges / totalItems) * 100 : 0;
|
|
92
|
+
const majorChanges = [];
|
|
93
|
+
if (addedPackages.length > 0)
|
|
94
|
+
majorChanges.push(`Added ${addedPackages.length} package(s)`);
|
|
95
|
+
if (removedPackages.length > 0)
|
|
96
|
+
majorChanges.push(`Removed ${removedPackages.length} package(s)`);
|
|
97
|
+
if (modifiedPackages.length > 0)
|
|
98
|
+
majorChanges.push(`Modified ${modifiedPackages.length} package(s)`);
|
|
99
|
+
return {
|
|
100
|
+
previousHash: prevHash,
|
|
101
|
+
currentHash: currHash,
|
|
102
|
+
diffPercentage: Math.round(diffPercentage * 10) / 10,
|
|
103
|
+
addedPackages,
|
|
104
|
+
removedPackages,
|
|
105
|
+
modifiedPackages,
|
|
106
|
+
addedEntryPoints,
|
|
107
|
+
removedEntryPoints,
|
|
108
|
+
majorChanges,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
async writeCodemap(codemap, outputDir) {
|
|
112
|
+
const dir = outputDir || currentConfig.outputDir;
|
|
113
|
+
await fs.mkdir(dir, { recursive: true });
|
|
114
|
+
for (const doc of codemap.documents) {
|
|
115
|
+
const fileName = `${doc.type === 'index' ? 'INDEX' : doc.type}.md`;
|
|
116
|
+
const filePath = path.join(dir, fileName);
|
|
117
|
+
await fs.writeFile(filePath, doc.content, 'utf-8');
|
|
118
|
+
}
|
|
119
|
+
// Also write metadata
|
|
120
|
+
const metadataPath = path.join(dir, '.codemap-metadata.json');
|
|
121
|
+
await fs.writeFile(metadataPath, JSON.stringify({
|
|
122
|
+
projectName: codemap.projectName,
|
|
123
|
+
projectVersion: codemap.projectVersion,
|
|
124
|
+
generatedAt: codemap.generatedAt,
|
|
125
|
+
packageCount: codemap.packages.length,
|
|
126
|
+
entryPointCount: codemap.entryPoints.length,
|
|
127
|
+
frameworkCount: codemap.frameworks.length,
|
|
128
|
+
}, null, 2), 'utf-8');
|
|
129
|
+
},
|
|
130
|
+
formatAsMarkdown(codemap) {
|
|
131
|
+
const lines = [];
|
|
132
|
+
lines.push(`# Code Map: ${codemap.projectName}`);
|
|
133
|
+
lines.push('');
|
|
134
|
+
lines.push(`**Generated**: ${codemap.generatedAt}`);
|
|
135
|
+
if (codemap.projectVersion) {
|
|
136
|
+
lines.push(`**Version**: ${codemap.projectVersion}`);
|
|
137
|
+
}
|
|
138
|
+
lines.push('');
|
|
139
|
+
// Package Structure
|
|
140
|
+
lines.push('## Package Structure');
|
|
141
|
+
lines.push('');
|
|
142
|
+
lines.push('| Package | Description | Dependencies |');
|
|
143
|
+
lines.push('|---------|-------------|--------------|');
|
|
144
|
+
for (const pkg of codemap.packages) {
|
|
145
|
+
const deps = pkg.dependencies.slice(0, 3).join(', ') +
|
|
146
|
+
(pkg.dependencies.length > 3 ? ', ...' : '');
|
|
147
|
+
lines.push(`| ${pkg.name} | ${pkg.description || '-'} | ${deps || '-'} |`);
|
|
148
|
+
}
|
|
149
|
+
lines.push('');
|
|
150
|
+
// Entry Points
|
|
151
|
+
lines.push('## Entry Points');
|
|
152
|
+
lines.push('');
|
|
153
|
+
for (const entry of codemap.entryPoints) {
|
|
154
|
+
lines.push(`- **${entry.type}**: \`${entry.path}\`${entry.description ? ` - ${entry.description}` : ''}`);
|
|
155
|
+
}
|
|
156
|
+
lines.push('');
|
|
157
|
+
// Frameworks
|
|
158
|
+
if (codemap.frameworks.length > 0) {
|
|
159
|
+
lines.push('## Detected Frameworks');
|
|
160
|
+
lines.push('');
|
|
161
|
+
for (const fw of codemap.frameworks) {
|
|
162
|
+
lines.push(`- **${fw.name}**${fw.version ? ` (${fw.version})` : ''} - ${fw.type}`);
|
|
163
|
+
}
|
|
164
|
+
lines.push('');
|
|
165
|
+
}
|
|
166
|
+
return lines.join('\n');
|
|
167
|
+
},
|
|
168
|
+
formatDiffReport(diff) {
|
|
169
|
+
const lines = [];
|
|
170
|
+
lines.push('Codemap Diff Report');
|
|
171
|
+
lines.push('===================');
|
|
172
|
+
lines.push(`Date: ${new Date().toISOString()}`);
|
|
173
|
+
lines.push(`Previous Hash: ${diff.previousHash.substring(0, 8)}`);
|
|
174
|
+
lines.push(`Current Hash: ${diff.currentHash.substring(0, 8)}`);
|
|
175
|
+
lines.push('');
|
|
176
|
+
lines.push('Summary:');
|
|
177
|
+
lines.push(`- Packages added: ${diff.addedPackages.length}`);
|
|
178
|
+
lines.push(`- Packages removed: ${diff.removedPackages.length}`);
|
|
179
|
+
lines.push(`- Packages modified: ${diff.modifiedPackages.length}`);
|
|
180
|
+
lines.push(`- Entry points added: ${diff.addedEntryPoints.length}`);
|
|
181
|
+
lines.push(`- Entry points removed: ${diff.removedEntryPoints.length}`);
|
|
182
|
+
lines.push(`- Diff percentage: ${diff.diffPercentage}%`);
|
|
183
|
+
lines.push('');
|
|
184
|
+
if (diff.majorChanges.length > 0) {
|
|
185
|
+
lines.push('Major Changes:');
|
|
186
|
+
for (const change of diff.majorChanges) {
|
|
187
|
+
lines.push(`- ${change}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return lines.join('\n');
|
|
191
|
+
},
|
|
192
|
+
getConfig() {
|
|
193
|
+
return { ...currentConfig };
|
|
194
|
+
},
|
|
195
|
+
updateConfig(config) {
|
|
196
|
+
currentConfig = { ...currentConfig, ...config };
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// ============================================================================
|
|
201
|
+
// Helper Functions
|
|
202
|
+
// ============================================================================
|
|
203
|
+
async function analyzePackages(rootPath) {
|
|
204
|
+
const packages = [];
|
|
205
|
+
// Check for monorepo
|
|
206
|
+
const rootPackageJsonPath = path.join(rootPath, 'package.json');
|
|
207
|
+
try {
|
|
208
|
+
const rootPackageJson = JSON.parse(await fs.readFile(rootPackageJsonPath, 'utf-8'));
|
|
209
|
+
// Check workspaces
|
|
210
|
+
const workspaces = rootPackageJson.workspaces || [];
|
|
211
|
+
const workspacePaths = [];
|
|
212
|
+
for (const ws of workspaces) {
|
|
213
|
+
// Handle glob patterns like "packages/*"
|
|
214
|
+
if (ws.includes('*')) {
|
|
215
|
+
const base = ws.replace('/*', '');
|
|
216
|
+
const basePath = path.join(rootPath, base);
|
|
217
|
+
try {
|
|
218
|
+
const dirs = await fs.readdir(basePath, { withFileTypes: true });
|
|
219
|
+
for (const dir of dirs) {
|
|
220
|
+
if (dir.isDirectory()) {
|
|
221
|
+
workspacePaths.push(path.join(base, dir.name));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
// Directory doesn't exist
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
workspacePaths.push(ws);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Analyze each workspace package
|
|
234
|
+
for (const wsPath of workspacePaths) {
|
|
235
|
+
const pkgJsonPath = path.join(rootPath, wsPath, 'package.json');
|
|
236
|
+
try {
|
|
237
|
+
const pkgJson = JSON.parse(await fs.readFile(pkgJsonPath, 'utf-8'));
|
|
238
|
+
packages.push({
|
|
239
|
+
name: pkgJson.name || path.basename(wsPath),
|
|
240
|
+
version: pkgJson.version,
|
|
241
|
+
path: wsPath,
|
|
242
|
+
description: pkgJson.description,
|
|
243
|
+
main: pkgJson.main,
|
|
244
|
+
exports: pkgJson.exports,
|
|
245
|
+
dependencies: Object.keys(pkgJson.dependencies || {}),
|
|
246
|
+
devDependencies: Object.keys(pkgJson.devDependencies || {}),
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
// No package.json
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// If no workspaces, add root as single package
|
|
254
|
+
if (packages.length === 0) {
|
|
255
|
+
packages.push({
|
|
256
|
+
name: rootPackageJson.name || path.basename(rootPath),
|
|
257
|
+
version: rootPackageJson.version,
|
|
258
|
+
path: '.',
|
|
259
|
+
description: rootPackageJson.description,
|
|
260
|
+
main: rootPackageJson.main,
|
|
261
|
+
exports: rootPackageJson.exports,
|
|
262
|
+
dependencies: Object.keys(rootPackageJson.dependencies || {}),
|
|
263
|
+
devDependencies: Object.keys(rootPackageJson.devDependencies || {}),
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
// No package.json at root
|
|
269
|
+
}
|
|
270
|
+
return packages;
|
|
271
|
+
}
|
|
272
|
+
async function buildDirectoryTree(dirPath, maxDepth, config, currentDepth = 0) {
|
|
273
|
+
const name = path.basename(dirPath);
|
|
274
|
+
const node = {
|
|
275
|
+
name,
|
|
276
|
+
path: dirPath,
|
|
277
|
+
isDirectory: true,
|
|
278
|
+
children: [],
|
|
279
|
+
};
|
|
280
|
+
if (currentDepth >= maxDepth) {
|
|
281
|
+
return node;
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
285
|
+
for (const entry of entries) {
|
|
286
|
+
// Skip common excludes
|
|
287
|
+
if (entry.name.startsWith('.') && entry.name !== '.github')
|
|
288
|
+
continue;
|
|
289
|
+
if (entry.name === 'node_modules' && !config.includeNodeModules)
|
|
290
|
+
continue;
|
|
291
|
+
if (entry.name === 'dist' || entry.name === 'build')
|
|
292
|
+
continue;
|
|
293
|
+
if (!config.includeTests && (entry.name === '__tests__' || entry.name === 'tests'))
|
|
294
|
+
continue;
|
|
295
|
+
const entryPath = path.join(dirPath, entry.name);
|
|
296
|
+
if (entry.isDirectory()) {
|
|
297
|
+
const child = await buildDirectoryTree(entryPath, maxDepth, config, currentDepth + 1);
|
|
298
|
+
node.children?.push(child);
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
const ext = path.extname(entry.name);
|
|
302
|
+
const language = LANGUAGE_EXTENSIONS[ext];
|
|
303
|
+
node.children?.push({
|
|
304
|
+
name: entry.name,
|
|
305
|
+
path: entryPath,
|
|
306
|
+
isDirectory: false,
|
|
307
|
+
language,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
// Directory read error
|
|
314
|
+
}
|
|
315
|
+
return node;
|
|
316
|
+
}
|
|
317
|
+
async function detectEntryPoints(rootPath, packages) {
|
|
318
|
+
const entryPoints = [];
|
|
319
|
+
// Check bin directory
|
|
320
|
+
const binPath = path.join(rootPath, 'bin');
|
|
321
|
+
try {
|
|
322
|
+
const binFiles = await fs.readdir(binPath);
|
|
323
|
+
for (const file of binFiles) {
|
|
324
|
+
entryPoints.push({
|
|
325
|
+
type: 'cli',
|
|
326
|
+
path: `bin/${file}`,
|
|
327
|
+
description: 'CLI entry point',
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
// No bin directory
|
|
333
|
+
}
|
|
334
|
+
// Check package main/exports
|
|
335
|
+
for (const pkg of packages) {
|
|
336
|
+
if (pkg.main) {
|
|
337
|
+
entryPoints.push({
|
|
338
|
+
type: 'library',
|
|
339
|
+
path: path.join(pkg.path, pkg.main),
|
|
340
|
+
description: `Main entry for ${pkg.name}`,
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// Check common patterns
|
|
345
|
+
const commonPatterns = [
|
|
346
|
+
{ pattern: 'src/index.ts', type: 'library' },
|
|
347
|
+
{ pattern: 'src/main.ts', type: 'library' },
|
|
348
|
+
{ pattern: 'src/server.ts', type: 'api' },
|
|
349
|
+
{ pattern: 'src/app.ts', type: 'api' },
|
|
350
|
+
{ pattern: 'src/worker.ts', type: 'worker' },
|
|
351
|
+
{ pattern: 'pages/api', type: 'api' },
|
|
352
|
+
{ pattern: 'app/api', type: 'api' },
|
|
353
|
+
];
|
|
354
|
+
for (const { pattern, type } of commonPatterns) {
|
|
355
|
+
const fullPath = path.join(rootPath, pattern);
|
|
356
|
+
try {
|
|
357
|
+
await fs.access(fullPath);
|
|
358
|
+
// Avoid duplicates
|
|
359
|
+
if (!entryPoints.some(e => e.path === pattern)) {
|
|
360
|
+
entryPoints.push({ type, path: pattern });
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
// File doesn't exist
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return entryPoints;
|
|
368
|
+
}
|
|
369
|
+
async function detectFrameworks(rootPath) {
|
|
370
|
+
const frameworks = [];
|
|
371
|
+
const packageJsonPath = path.join(rootPath, 'package.json');
|
|
372
|
+
try {
|
|
373
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
374
|
+
const allDeps = {
|
|
375
|
+
...packageJson.dependencies,
|
|
376
|
+
...packageJson.devDependencies,
|
|
377
|
+
};
|
|
378
|
+
const frameworkPatterns = [
|
|
379
|
+
{ dep: 'next', name: 'Next.js', type: 'fullstack', indicators: ['next.config.js', 'next.config.mjs'] },
|
|
380
|
+
{ dep: 'react', name: 'React', type: 'frontend', indicators: ['src/App.tsx', 'src/App.jsx'] },
|
|
381
|
+
{ dep: 'vue', name: 'Vue.js', type: 'frontend', indicators: ['vue.config.js'] },
|
|
382
|
+
{ dep: 'express', name: 'Express', type: 'backend', indicators: ['src/app.ts', 'src/server.ts'] },
|
|
383
|
+
{ dep: 'fastify', name: 'Fastify', type: 'backend', indicators: ['src/server.ts'] },
|
|
384
|
+
{ dep: 'vitest', name: 'Vitest', type: 'test', indicators: ['vitest.config.ts'] },
|
|
385
|
+
{ dep: 'jest', name: 'Jest', type: 'test', indicators: ['jest.config.js'] },
|
|
386
|
+
{ dep: 'playwright', name: 'Playwright', type: 'test', indicators: ['playwright.config.ts'] },
|
|
387
|
+
{ dep: 'vite', name: 'Vite', type: 'build', indicators: ['vite.config.ts'] },
|
|
388
|
+
{ dep: 'webpack', name: 'Webpack', type: 'build', indicators: ['webpack.config.js'] },
|
|
389
|
+
];
|
|
390
|
+
for (const { dep, name, type, indicators } of frameworkPatterns) {
|
|
391
|
+
if (allDeps[dep]) {
|
|
392
|
+
frameworks.push({
|
|
393
|
+
name,
|
|
394
|
+
version: allDeps[dep],
|
|
395
|
+
type,
|
|
396
|
+
indicators,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
catch {
|
|
402
|
+
// No package.json
|
|
403
|
+
}
|
|
404
|
+
return frameworks;
|
|
405
|
+
}
|
|
406
|
+
function extractExports(content, filePath) {
|
|
407
|
+
const exports = [];
|
|
408
|
+
const lines = content.split('\n');
|
|
409
|
+
const exportPatterns = [
|
|
410
|
+
{ regex: /export\s+default\s+/, type: 'default' },
|
|
411
|
+
{ regex: /export\s+function\s+(\w+)/, type: 'function' },
|
|
412
|
+
{ regex: /export\s+class\s+(\w+)/, type: 'class' },
|
|
413
|
+
{ regex: /export\s+interface\s+(\w+)/, type: 'interface' },
|
|
414
|
+
{ regex: /export\s+type\s+(\w+)/, type: 'type' },
|
|
415
|
+
{ regex: /export\s+const\s+(\w+)/, type: 'const' },
|
|
416
|
+
{ regex: /export\s+enum\s+(\w+)/, type: 'enum' },
|
|
417
|
+
{ regex: /export\s+\{\s*([^}]+)\s*\}/, type: 'const' },
|
|
418
|
+
];
|
|
419
|
+
lines.forEach((line, index) => {
|
|
420
|
+
for (const { regex, type } of exportPatterns) {
|
|
421
|
+
const match = line.match(regex);
|
|
422
|
+
if (match) {
|
|
423
|
+
if (type === 'default') {
|
|
424
|
+
exports.push({
|
|
425
|
+
name: 'default',
|
|
426
|
+
type: 'default',
|
|
427
|
+
isReExport: line.includes('from'),
|
|
428
|
+
sourceFile: filePath,
|
|
429
|
+
line: index + 1,
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
else if (match[1]) {
|
|
433
|
+
// Handle multiple exports in braces
|
|
434
|
+
const names = match[1].split(',').map(n => n.trim().split(' ')[0]);
|
|
435
|
+
for (const name of names) {
|
|
436
|
+
if (name) {
|
|
437
|
+
exports.push({
|
|
438
|
+
name,
|
|
439
|
+
type,
|
|
440
|
+
isReExport: line.includes('from'),
|
|
441
|
+
sourceFile: filePath,
|
|
442
|
+
line: index + 1,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
return exports;
|
|
451
|
+
}
|
|
452
|
+
function extractImports(content) {
|
|
453
|
+
const imports = [];
|
|
454
|
+
const importRegex = /import\s+(?:type\s+)?(?:\{([^}]+)\}|(\w+))\s+from\s+['"]([^'"]+)['"]/g;
|
|
455
|
+
let match;
|
|
456
|
+
while ((match = importRegex.exec(content)) !== null) {
|
|
457
|
+
const items = match[1]
|
|
458
|
+
? match[1].split(',').map(i => i.trim().split(' ')[0]).filter(Boolean)
|
|
459
|
+
: match[2] ? [match[2]] : [];
|
|
460
|
+
const source = match[3];
|
|
461
|
+
imports.push({
|
|
462
|
+
source,
|
|
463
|
+
isExternal: !source.startsWith('.') && !source.startsWith('/'),
|
|
464
|
+
items,
|
|
465
|
+
isTypeOnly: match[0].includes('import type'),
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
return imports;
|
|
469
|
+
}
|
|
470
|
+
function countEntities(content) {
|
|
471
|
+
const counts = {};
|
|
472
|
+
const patterns = [
|
|
473
|
+
{ name: 'function', regex: /function\s+\w+/g },
|
|
474
|
+
{ name: 'class', regex: /class\s+\w+/g },
|
|
475
|
+
{ name: 'interface', regex: /interface\s+\w+/g },
|
|
476
|
+
{ name: 'type', regex: /type\s+\w+\s*=/g },
|
|
477
|
+
{ name: 'const', regex: /const\s+\w+/g },
|
|
478
|
+
{ name: 'let', regex: /let\s+\w+/g },
|
|
479
|
+
];
|
|
480
|
+
for (const { name, regex } of patterns) {
|
|
481
|
+
const matches = content.match(regex);
|
|
482
|
+
if (matches) {
|
|
483
|
+
counts[name] = matches.length;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return counts;
|
|
487
|
+
}
|
|
488
|
+
function calculateComplexity(content) {
|
|
489
|
+
let complexity = 1; // Base complexity
|
|
490
|
+
// Count control flow statements
|
|
491
|
+
const controlPatterns = [
|
|
492
|
+
/\bif\s*\(/g,
|
|
493
|
+
/\belse\s+if\s*\(/g,
|
|
494
|
+
/\bwhile\s*\(/g,
|
|
495
|
+
/\bfor\s*\(/g,
|
|
496
|
+
/\bswitch\s*\(/g,
|
|
497
|
+
/\bcase\s+/g,
|
|
498
|
+
/\bcatch\s*\(/g,
|
|
499
|
+
/\?\s*[^:]+\s*:/g, // Ternary
|
|
500
|
+
/&&/g,
|
|
501
|
+
/\|\|/g,
|
|
502
|
+
];
|
|
503
|
+
for (const pattern of controlPatterns) {
|
|
504
|
+
const matches = content.match(pattern);
|
|
505
|
+
if (matches) {
|
|
506
|
+
complexity += matches.length;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return complexity;
|
|
510
|
+
}
|
|
511
|
+
async function generateDocuments(_rootPath, packages, entryPoints, frameworks, _structure) {
|
|
512
|
+
const documents = [];
|
|
513
|
+
const timestamp = new Date().toISOString();
|
|
514
|
+
// INDEX.md
|
|
515
|
+
let indexContent = '# Code Map\n\n';
|
|
516
|
+
indexContent += `**Generated**: ${timestamp}\n\n`;
|
|
517
|
+
indexContent += '## Packages\n\n';
|
|
518
|
+
indexContent += '| Package | Version | Dependencies |\n';
|
|
519
|
+
indexContent += '|---------|---------|-------------|\n';
|
|
520
|
+
for (const pkg of packages) {
|
|
521
|
+
indexContent += `| ${pkg.name} | ${pkg.version || '-'} | ${pkg.dependencies.length} |\n`;
|
|
522
|
+
}
|
|
523
|
+
indexContent += '\n## Entry Points\n\n';
|
|
524
|
+
for (const ep of entryPoints) {
|
|
525
|
+
indexContent += `- **${ep.type}**: \`${ep.path}\`\n`;
|
|
526
|
+
}
|
|
527
|
+
if (frameworks.length > 0) {
|
|
528
|
+
indexContent += '\n## Frameworks\n\n';
|
|
529
|
+
for (const fw of frameworks) {
|
|
530
|
+
indexContent += `- ${fw.name} (${fw.type})\n`;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
documents.push({
|
|
534
|
+
type: 'index',
|
|
535
|
+
title: 'Code Map Index',
|
|
536
|
+
content: indexContent,
|
|
537
|
+
updatedAt: timestamp,
|
|
538
|
+
});
|
|
539
|
+
// packages.md
|
|
540
|
+
let packagesContent = '# Packages\n\n';
|
|
541
|
+
for (const pkg of packages) {
|
|
542
|
+
packagesContent += `## ${pkg.name}\n\n`;
|
|
543
|
+
packagesContent += `**Path**: \`${pkg.path}\`\n\n`;
|
|
544
|
+
if (pkg.description)
|
|
545
|
+
packagesContent += `${pkg.description}\n\n`;
|
|
546
|
+
if (pkg.dependencies.length > 0) {
|
|
547
|
+
packagesContent += '### Dependencies\n\n';
|
|
548
|
+
for (const dep of pkg.dependencies.slice(0, 20)) {
|
|
549
|
+
packagesContent += `- ${dep}\n`;
|
|
550
|
+
}
|
|
551
|
+
if (pkg.dependencies.length > 20) {
|
|
552
|
+
packagesContent += `- ... and ${pkg.dependencies.length - 20} more\n`;
|
|
553
|
+
}
|
|
554
|
+
packagesContent += '\n';
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
documents.push({
|
|
558
|
+
type: 'packages',
|
|
559
|
+
title: 'Package Details',
|
|
560
|
+
content: packagesContent,
|
|
561
|
+
packages: packages.map(p => p.name),
|
|
562
|
+
updatedAt: timestamp,
|
|
563
|
+
});
|
|
564
|
+
return documents;
|
|
565
|
+
}
|
|
566
|
+
function hashCodemap(codemap) {
|
|
567
|
+
const data = JSON.stringify({
|
|
568
|
+
packages: codemap.packages.map(p => ({ name: p.name, deps: p.dependencies })),
|
|
569
|
+
entryPoints: codemap.entryPoints.map(e => e.path),
|
|
570
|
+
});
|
|
571
|
+
return createHash('sha256').update(data).digest('hex');
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Format codemap structure as Mermaid diagram
|
|
575
|
+
*/
|
|
576
|
+
export function formatCodemapAsMermaid(codemap) {
|
|
577
|
+
const lines = ['graph TD'];
|
|
578
|
+
// Add packages
|
|
579
|
+
for (const pkg of codemap.packages) {
|
|
580
|
+
const safeId = pkg.name.replace(/[@/\-]/g, '_');
|
|
581
|
+
lines.push(` ${safeId}["${pkg.name}"]`);
|
|
582
|
+
}
|
|
583
|
+
// Add dependencies
|
|
584
|
+
for (const pkg of codemap.packages) {
|
|
585
|
+
const sourceId = pkg.name.replace(/[@/\-]/g, '_');
|
|
586
|
+
for (const dep of pkg.dependencies) {
|
|
587
|
+
// Only include internal dependencies
|
|
588
|
+
const depPkg = codemap.packages.find(p => p.name === dep);
|
|
589
|
+
if (depPkg) {
|
|
590
|
+
const targetId = dep.replace(/[@/\-]/g, '_');
|
|
591
|
+
lines.push(` ${sourceId} --> ${targetId}`);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return lines.join('\n');
|
|
596
|
+
}
|
|
597
|
+
//# sourceMappingURL=codemap-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemap-bridge.js","sourceRoot":"","sources":["../../src/integration/codemap-bridge.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAepC,OAAO,EACL,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAuC,EAAE;IAEzC,IAAI,aAAa,GAAwB;QACvC,GAAG,6BAA6B;QAChC,GAAG,MAAM;KACV,CAAC;IAEF,OAAO;QACL,KAAK,CAAC,gBAAgB,CAAC,QAAgB;YACrC,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;YACjD,MAAM,SAAS,GAAG,MAAM,kBAAkB,CAAC,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YAC5F,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAChE,MAAM,UAAU,GAAG,MAAM,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAEpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;QAC1D,CAAC;QAED,KAAK,CAAC,aAAa,CAAC,UAAkB;YACpC,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CA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