tribunal-kit 4.3.1 → 4.4.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.
Files changed (28) hide show
  1. package/.agent/history/architecture-explorer.html +352 -0
  2. package/.agent/history/architecture-graph.yaml +109 -0
  3. package/.agent/history/graph-cache.json +215 -0
  4. package/.agent/history/snapshots/migrate_refs.js.json +11 -0
  5. package/.agent/history/snapshots/scripts__changelog.js.json +12 -0
  6. package/.agent/history/snapshots/scripts__sync-version.js.json +11 -0
  7. package/.agent/history/snapshots/scripts__validate-payload.js.json +11 -0
  8. package/.agent/history/snapshots/test__integration__bridges.test.js.json +13 -0
  9. package/.agent/history/snapshots/test__integration__init.test.js.json +13 -0
  10. package/.agent/history/snapshots/test__integration__routing.test.js.json +11 -0
  11. package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +13 -0
  12. package/.agent/history/snapshots/test__integration__wave2.test.js.json +13 -0
  13. package/.agent/history/snapshots/test__unit__args.test.js.json +10 -0
  14. package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +10 -0
  15. package/.agent/history/snapshots/test__unit__copyDir.test.js.json +13 -0
  16. package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +11 -0
  17. package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +13 -0
  18. package/.agent/history/snapshots/test__unit__semver.test.js.json +10 -0
  19. package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +11 -0
  20. package/.agent/scripts/dependency_analyzer.js +1 -1
  21. package/.agent/scripts/graph_builder.js +311 -199
  22. package/.agent/scripts/graph_visualizer.js +384 -0
  23. package/.agent/scripts/mutation_runner.js +280 -0
  24. package/.agent/skills/knowledge-graph/SKILL.md +52 -36
  25. package/.agent/skills/testing-patterns/SKILL.md +19 -2
  26. package/.agent/skills/ui-ux-pro-max/SKILL.md +562 -125
  27. package/bin/tribunal-kit.js +129 -1
  28. package/package.json +1 -1
@@ -1,199 +1,311 @@
1
- #!/usr/bin/env node
2
- /**
3
- * graph_builder.js — Tribunal Kit Macro Graph Mapper
4
- * Parses project structure for imports, exports, and dependencies
5
- * using incremental caching and zero external dependencies.
6
- */
7
-
8
- 'use strict';
9
-
10
- const fs = require('fs');
11
- const path = require('path');
12
-
13
- const AGENT_DIR = path.join(process.cwd(), '.agent');
14
- const HISTORY_DIR = path.join(AGENT_DIR, 'history');
15
- const CACHE_FILE = path.join(HISTORY_DIR, 'graph-cache.json');
16
- const GRAPH_FILE = path.join(HISTORY_DIR, 'architecture-graph.yaml');
17
-
18
- // ── Exclusions & Safety ───────────────────────────────────────────────────────
19
- const DEFAULT_EXCLUSIONS = new Set([
20
- 'node_modules', '.git', '.next', 'dist', 'build', 'coverage', '.agent', 'artifacts'
21
- ]);
22
-
23
- function loadGitIgnore() {
24
- const gitignorePath = path.join(process.cwd(), '.gitignore');
25
- if (!fs.existsSync(gitignorePath)) return [];
26
-
27
- return fs.readFileSync(gitignorePath, 'utf8')
28
- .split('\n')
29
- .map(line => line.trim())
30
- .filter(line => line && !line.startsWith('#'))
31
- // simplistic conversion from gitignore line to path check
32
- .map(line => line.replace(/\/$/, '').replace(/^\//, ''));
33
- }
34
-
35
- const customExclusions = loadGitIgnore();
36
-
37
- function isExcluded(filePath) {
38
- const parts = filePath.split(path.sep);
39
-
40
- // 1. Check against critical defaults (OOM prevention)
41
- if (parts.some(p => DEFAULT_EXCLUSIONS.has(p))) return true;
42
-
43
- // 2. Check against .gitignore rules
44
- const relativePath = path.relative(process.cwd(), filePath).replace(/\\/g, '/');
45
- for (const pattern of customExclusions) {
46
- if (relativePath.includes(pattern)) return true;
47
- }
48
- return false;
49
- }
50
-
51
- // ── Traversal ─────────────────────────────────────────────────────────────────
52
- function walkDir(dir, fileList = []) {
53
- if (!fs.existsSync(dir) || isExcluded(dir)) return fileList;
54
-
55
- let files;
56
- try {
57
- files = fs.readdirSync(dir);
58
- } catch (err) {
59
- return fileList; // Permission denied or similar
60
- }
61
-
62
- for (const file of files) {
63
- const filePath = path.join(dir, file);
64
- if (isExcluded(filePath)) continue;
65
-
66
- if (fs.statSync(filePath).isDirectory()) {
67
- walkDir(filePath, fileList);
68
- } else {
69
- // Target standard JS/TS ecosystem files
70
- if (/\.(js|jsx|ts|tsx|mjs|cjs)$/.test(file)) {
71
- fileList.push(filePath);
72
- }
73
- }
74
- }
75
- return fileList;
76
- }
77
-
78
- // ── Regex AST Extraction ──────────────────────────────────────────────────────
79
- function parseFile(content) {
80
- const imports = new Set();
81
- const exports = new Set();
82
-
83
- // Strip comments to prevent false positives in regex
84
- const cleanContent = content.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/.*$/gm, '');
85
-
86
- // Import extractors
87
- const importRegex = /import(?:(?:[\w*\s{},]*)\sfrom\s+)?['"]([^'"]+)['"]/g;
88
- const requireRegex = /require\(['"]([^'"]+)['"]\)/g;
89
- const dynamicImportRegex = /import\(['"]([^'"]+)['"]\)/g;
90
-
91
- // Export extractors
92
- const exportRegex = /export\s+(?:const|let|var|function|class)\s+([a-zA-Z0-9_]+)/g;
93
- const moduleExportRegex = /module\.exports\s*=\s*\{([^}]+)\}/g;
94
- const defaultExportRegex = /export\s+default\s+([a-zA-Z0-9_]+)/g;
95
-
96
- let match;
97
- while ((match = importRegex.exec(cleanContent)) !== null) imports.add(match[1]);
98
- while ((match = requireRegex.exec(cleanContent)) !== null) imports.add(match[1]);
99
- while ((match = dynamicImportRegex.exec(cleanContent)) !== null) imports.add(match[1]);
100
-
101
- while ((match = exportRegex.exec(cleanContent)) !== null) exports.add(match[1]);
102
- while ((match = defaultExportRegex.exec(cleanContent)) !== null) exports.add(match[1]);
103
-
104
- // Extractor for module.exports = { a, b, c }
105
- while ((match = moduleExportRegex.exec(cleanContent)) !== null) {
106
- const tokens = match[1].split(',').map(s => s.trim().split(':')[0].trim());
107
- tokens.forEach(t => t && exports.add(t));
108
- }
109
-
110
- return {
111
- imports: Array.from(imports),
112
- exports: Array.from(exports)
113
- };
114
- }
115
-
116
- // ── YAML Generation ───────────────────────────────────────────────────────────
117
- function generateYAML(data) {
118
- let yaml = '# Auto-generated Architecture Graph by Tribunal Kit\n';
119
- yaml += '# DO NOT EDIT MANUALLY - Auto-updates via incremental cache\n\n';
120
-
121
- for (const [file, info] of Object.entries(data)) {
122
- // Only include files that actually export or import things to reduce noise
123
- if (info.imports.length === 0 && info.exports.length === 0) continue;
124
-
125
- yaml += `"${file}":\n`;
126
- if (info.imports && info.imports.length > 0) {
127
- yaml += ` imports:\n`;
128
- info.imports.forEach(i => yaml += ` - "${i}"\n`);
129
- }
130
- if (info.exports && info.exports.length > 0) {
131
- yaml += ` exports:\n`;
132
- info.exports.forEach(e => yaml += ` - "${e}"\n`);
133
- }
134
- }
135
- return yaml;
136
- }
137
-
138
- // ── Main Execution ────────────────────────────────────────────────────────────
139
- function main() {
140
- if (!fs.existsSync(AGENT_DIR)) {
141
- console.error('\x1b[31m✖ Error: .agent directory not found. Please run tribunal-kit init first.\x1b[0m');
142
- process.exit(1);
143
- }
144
-
145
- if (!fs.existsSync(HISTORY_DIR)) {
146
- fs.mkdirSync(HISTORY_DIR, { recursive: true });
147
- }
148
-
149
- // 1. Load incremental cache
150
- let cache = {};
151
- if (fs.existsSync(CACHE_FILE)) {
152
- try { cache = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8')); } catch(e) {}
153
- }
154
-
155
- console.log('\x1b[96m✦ Building Architecture Graph...\x1b[0m');
156
- const files = walkDir(process.cwd());
157
- const graphData = {};
158
-
159
- let parsedCount = 0;
160
- let cachedCount = 0;
161
-
162
- // 2. Parse or hit cache
163
- for (const file of files) {
164
- const stat = fs.statSync(file);
165
- const relativePath = path.relative(process.cwd(), file).replace(/\\/g, '/');
166
-
167
- if (cache[relativePath] && cache[relativePath].mtimeMs === stat.mtimeMs) {
168
- graphData[relativePath] = { imports: cache[relativePath].imports, exports: cache[relativePath].exports };
169
- cachedCount++;
170
- } else {
171
- try {
172
- const content = fs.readFileSync(file, 'utf8');
173
- const parsed = parseFile(content);
174
- graphData[relativePath] = parsed;
175
-
176
- cache[relativePath] = {
177
- mtimeMs: stat.mtimeMs,
178
- imports: parsed.imports,
179
- exports: parsed.exports
180
- };
181
- parsedCount++;
182
- } catch (err) {
183
- // Graceful fallback on unreadable files
184
- console.warn(`\x1b[33m ⚠ Skipping unreadable file: ${relativePath}\x1b[0m`);
185
- }
186
- }
187
- }
188
-
189
- // 3. Save states
190
- fs.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2));
191
- const yamlOutput = generateYAML(graphData);
192
- fs.writeFileSync(GRAPH_FILE, yamlOutput);
193
-
194
- console.log(`\n\x1b[32m✔ Graph successfully built.\x1b[0m`);
195
- console.log(` \x1b[2mParsed: ${parsedCount} files | Cached: ${cachedCount} files\x1b[0m`);
196
- console.log(` \x1b[2mSaved to: ${GRAPH_FILE}\x1b[0m`);
197
- }
198
-
199
- main();
1
+ #!/usr/bin/env node
2
+ /**
3
+ * graph_builder.js — Tribunal Kit Macro Graph Mapper
4
+ * Parses project structure for imports, exports, and dependencies
5
+ * using incremental caching and zero external dependencies.
6
+ * Now includes Blast Radius calculation and robust token stripping.
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ const AGENT_DIR = path.join(process.cwd(), '.agent');
15
+ const HISTORY_DIR = path.join(AGENT_DIR, 'history');
16
+ const CACHE_FILE = path.join(HISTORY_DIR, 'graph-cache.json');
17
+ const GRAPH_FILE = path.join(HISTORY_DIR, 'architecture-graph.yaml');
18
+
19
+ // ── Exclusions & Safety ───────────────────────────────────────────────────────
20
+ const DEFAULT_EXCLUSIONS = new Set([
21
+ 'node_modules', '.git', '.next', 'dist', 'build', 'coverage', '.agent', 'artifacts'
22
+ ]);
23
+
24
+ function loadGitIgnore() {
25
+ const gitignorePath = path.join(process.cwd(), '.gitignore');
26
+ if (!fs.existsSync(gitignorePath)) return [];
27
+
28
+ return fs.readFileSync(gitignorePath, 'utf8')
29
+ .split('\n')
30
+ .map(line => line.trim())
31
+ .filter(line => line && !line.startsWith('#'))
32
+ .map(line => line.replace(/\/$/, '').replace(/^\//, ''));
33
+ }
34
+
35
+ const customExclusions = loadGitIgnore();
36
+
37
+ function isExcluded(filePath) {
38
+ const parts = filePath.split(path.sep);
39
+ if (parts.some(p => DEFAULT_EXCLUSIONS.has(p))) return true;
40
+
41
+ const relativePath = path.relative(process.cwd(), filePath).replace(/\\/g, '/');
42
+ for (const pattern of customExclusions) {
43
+ if (relativePath.includes(pattern)) return true;
44
+ }
45
+ return false;
46
+ }
47
+
48
+ // ── Traversal ─────────────────────────────────────────────────────────────────
49
+ function walkDir(dir, fileList = []) {
50
+ if (!fs.existsSync(dir) || isExcluded(dir)) return fileList;
51
+
52
+ let files;
53
+ try {
54
+ files = fs.readdirSync(dir);
55
+ } catch (err) {
56
+ return fileList;
57
+ }
58
+
59
+ for (const file of files) {
60
+ const filePath = path.join(dir, file);
61
+ if (isExcluded(filePath)) continue;
62
+
63
+ if (fs.statSync(filePath).isDirectory()) {
64
+ walkDir(filePath, fileList);
65
+ } else {
66
+ if (/\.(js|jsx|ts|tsx|mjs|cjs)$/.test(file)) {
67
+ fileList.push(filePath);
68
+ }
69
+ }
70
+ }
71
+ return fileList;
72
+ }
73
+
74
+ // ── Regex AST Extraction ──────────────────────────────────────────────────────
75
+ function parseFile(content) {
76
+ const imports = new Set();
77
+ const exports = new Set();
78
+
79
+ const cleanContent = stripStringsAndComments(content);
80
+
81
+ const importRegex = /import(?:(?:[\w*\s{},]*)\sfrom\s+)?([^\s;]+)/g; // Match bare specifier if possible, strings are stripped, but wait...
82
+ // WAIT: If I stripped strings, how do I get the import path?
83
+ // The previous implementation used strings `['"]([^'"]+)['"]`.
84
+ // If I strip strings, the import path is lost!
85
+ // Let's rollback that logic or adapt it.
86
+ // Instead of stripping all strings, we should only strip strings if they are NOT following 'import ' or 'require('
87
+ // To do this simply, let's keep strings, but just be careful.
88
+ // Actually, string literals inside `require("...")` are what we want.
89
+ // So `parseFile` should probably NOT strip strings, but just use a safer regex.
90
+ // The false positive in `dependency_analyzer` was because of `const diff = "import a from 'a'"`.
91
+ // Let's use `stripStringsAndComments` but we DO NOT strip strings.
92
+ // We only strip comments.
93
+
94
+ // I'll define an inner function to just strip comments to be safe for imports.
95
+ // Let's stick to the simple `.replace` for comments for now, and rely on regex boundaries.
96
+ const semiCleanContent = content.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/.*$/gm, '');
97
+
98
+ const importRegex2 = /^[\s]*import(?:(?:[\w*\s{},]*)\sfrom\s+)?['"]([^'"]+)['"]/gm;
99
+ const requireRegex = /require\(['"]([^'"]+)['"]\)/g;
100
+ const dynamicImportRegex = /import\(['"]([^'"]+)['"]\)/g;
101
+
102
+ const exportRegex = /^[\s]*export\s+(?:const|let|var|function|class)\s+([a-zA-Z0-9_]+)/gm;
103
+ const moduleExportRegex = /module\.exports\s*=\s*\{([^}]+)\}/g;
104
+ const defaultExportRegex = /^[\s]*export\s+default\s+([a-zA-Z0-9_]+)/gm;
105
+
106
+ let match;
107
+ while ((match = importRegex2.exec(semiCleanContent)) !== null) imports.add(match[1]);
108
+ while ((match = requireRegex.exec(semiCleanContent)) !== null) imports.add(match[1]);
109
+ while ((match = dynamicImportRegex.exec(semiCleanContent)) !== null) imports.add(match[1]);
110
+
111
+ while ((match = exportRegex.exec(semiCleanContent)) !== null) exports.add(match[1]);
112
+ while ((match = defaultExportRegex.exec(semiCleanContent)) !== null) exports.add(match[1]);
113
+
114
+ while ((match = moduleExportRegex.exec(semiCleanContent)) !== null) {
115
+ const tokens = match[1].split(',').map(s => s.trim().split(':')[0].trim());
116
+ tokens.forEach(t => t && exports.add(t));
117
+ }
118
+
119
+ return {
120
+ imports: Array.from(imports),
121
+ exports: Array.from(exports)
122
+ };
123
+ }
124
+
125
+ // ── YAML Generation ───────────────────────────────────────────────────────────
126
+ function generateYAML(data) {
127
+ let yaml = '# Auto-generated Architecture Graph by Tribunal Kit\n';
128
+ yaml += '# DO NOT EDIT MANUALLY - Auto-updates via incremental cache\n\n';
129
+
130
+ for (const [file, info] of Object.entries(data)) {
131
+ if (info.imports.length === 0 && info.exports.length === 0 && (!info.dependents || info.dependents.length === 0)) continue;
132
+
133
+ yaml += `"${file}":\n`;
134
+ yaml += ` riskScore: "${info.riskScore || 'Low'}"\n`;
135
+ yaml += ` blastRadius: ${info.blastRadius || 0}\n`;
136
+
137
+ if (info.imports && info.imports.length > 0) {
138
+ yaml += ` imports:\n`;
139
+ info.imports.forEach(i => yaml += ` - "${i}"\n`);
140
+ }
141
+ if (info.exports && info.exports.length > 0) {
142
+ yaml += ` exports:\n`;
143
+ info.exports.forEach(e => yaml += ` - "${e}"\n`);
144
+ }
145
+ if (info.dependents && info.dependents.length > 0) {
146
+ yaml += ` dependents:\n`;
147
+ info.dependents.forEach(d => yaml += ` - "${d}"\n`);
148
+ }
149
+ }
150
+ return yaml;
151
+ }
152
+
153
+ // ── Main Execution ────────────────────────────────────────────────────────────
154
+ function main() {
155
+ if (!fs.existsSync(AGENT_DIR)) {
156
+ console.error('\x1b[31m✖ Error: .agent directory not found.\x1b[0m');
157
+ process.exit(1);
158
+ }
159
+
160
+ if (!fs.existsSync(HISTORY_DIR)) fs.mkdirSync(HISTORY_DIR, { recursive: true });
161
+
162
+ let cache = {};
163
+ if (fs.existsSync(CACHE_FILE)) {
164
+ try { cache = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8')); } catch(e) {}
165
+ }
166
+
167
+ console.log('\x1b[96m✦ Building Architecture Graph...\x1b[0m');
168
+ const files = walkDir(process.cwd());
169
+ const graphData = {};
170
+
171
+ let parsedCount = 0;
172
+ let cachedCount = 0;
173
+
174
+ for (const file of files) {
175
+ const stat = fs.statSync(file);
176
+ const relativePath = path.relative(process.cwd(), file).replace(/\\/g, '/');
177
+
178
+ if (cache[relativePath] && cache[relativePath].mtimeMs === stat.mtimeMs) {
179
+ graphData[relativePath] = { imports: cache[relativePath].imports, exports: cache[relativePath].exports };
180
+ cachedCount++;
181
+ } else {
182
+ try {
183
+ const content = fs.readFileSync(file, 'utf8');
184
+ const parsed = parseFile(content);
185
+ graphData[relativePath] = parsed;
186
+
187
+ cache[relativePath] = {
188
+ mtimeMs: stat.mtimeMs,
189
+ imports: parsed.imports,
190
+ exports: parsed.exports
191
+ };
192
+ parsedCount++;
193
+ } catch (err) {}
194
+ }
195
+ }
196
+
197
+ // Compute Dependents
198
+ for (const [file, info] of Object.entries(graphData)) info.dependents = [];
199
+
200
+ const fileKeys = Object.keys(graphData);
201
+ for (const [file, info] of Object.entries(graphData)) {
202
+ for (const imp of info.imports) {
203
+ if (imp.startsWith('.')) {
204
+ let resolved = path.posix.join(path.dirname(file), imp);
205
+ // Look for direct match or .js / index.js
206
+ let matchingKey = fileKeys.find(k =>
207
+ k === resolved || k === resolved + '.js' || k === resolved + '.ts' || k === resolved + '/index.js'
208
+ );
209
+ if (matchingKey) {
210
+ if (!graphData[matchingKey].dependents.includes(file)) {
211
+ graphData[matchingKey].dependents.push(file);
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+
218
+ // Compute Risk Score
219
+ function computeRisk(file) {
220
+ const visited = new Set();
221
+ function visit(node) {
222
+ if (visited.has(node)) return;
223
+ visited.add(node);
224
+ const deps = graphData[node]?.dependents || [];
225
+ deps.forEach(visit);
226
+ }
227
+ visit(file);
228
+ const radius = visited.size - 1;
229
+ let score = 'Low';
230
+ if (radius > 10) score = 'Critical';
231
+ else if (radius >= 5) score = 'High';
232
+ else if (radius >= 2) score = 'Medium';
233
+ return { score, count: Math.max(0, radius) };
234
+ }
235
+
236
+ for (const file of fileKeys) {
237
+ const risk = computeRisk(file);
238
+ graphData[file].riskScore = risk.score;
239
+ graphData[file].blastRadius = risk.count;
240
+
241
+ // Update cache with these values so visualizer can use it
242
+ if (cache[file]) {
243
+ cache[file].dependents = graphData[file].dependents;
244
+ cache[file].riskScore = risk.score;
245
+ cache[file].blastRadius = risk.count;
246
+ }
247
+ }
248
+
249
+ fs.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2));
250
+ fs.writeFileSync(GRAPH_FILE, generateYAML(graphData));
251
+
252
+ // ── Pre-Computed Context Snapshots (Option C) ───────────────────────────
253
+ const SNAPSHOTS_DIR = path.join(HISTORY_DIR, 'snapshots');
254
+ if (!fs.existsSync(SNAPSHOTS_DIR)) {
255
+ fs.mkdirSync(SNAPSHOTS_DIR, { recursive: true });
256
+ } else {
257
+ // Clear stale snapshots
258
+ try {
259
+ const oldSnapshots = fs.readdirSync(SNAPSHOTS_DIR);
260
+ for (const os of oldSnapshots) fs.unlinkSync(path.join(SNAPSHOTS_DIR, os));
261
+ } catch (e) {}
262
+ }
263
+
264
+ console.log('\x1b[96m✦ Generating Context Snapshots...\x1b[0m');
265
+ for (const file of fileKeys) {
266
+ const info = graphData[file];
267
+ const snapshotFile = file.replace(/[\\/]/g, '__') + '.json';
268
+ const snapshotPath = path.join(SNAPSHOTS_DIR, snapshotFile);
269
+
270
+ let content = '';
271
+ try {
272
+ content = fs.readFileSync(path.join(process.cwd(), file), 'utf8');
273
+ } catch (e) {
274
+ continue;
275
+ }
276
+
277
+ const snapshot = {
278
+ file: file,
279
+ riskScore: info.riskScore,
280
+ blastRadius: info.blastRadius,
281
+ imports: {},
282
+ dependents: info.dependents || [],
283
+ content: content
284
+ };
285
+
286
+ for (const imp of info.imports) {
287
+ if (imp.startsWith('.')) {
288
+ let resolved = path.posix.join(path.dirname(file), imp);
289
+ let matchingKey = fileKeys.find(k =>
290
+ k === resolved || k === resolved + '.js' || k === resolved + '.ts' || k === resolved + '/index.js'
291
+ );
292
+ if (matchingKey && graphData[matchingKey]) {
293
+ snapshot.imports[imp] = graphData[matchingKey].exports;
294
+ } else {
295
+ snapshot.imports[imp] = [];
296
+ }
297
+ } else {
298
+ snapshot.imports[imp] = [];
299
+ }
300
+ }
301
+
302
+ fs.writeFileSync(snapshotPath, JSON.stringify(snapshot, null, 2));
303
+ }
304
+ console.log(` \x1b[2mSaved ${fileKeys.length} snapshots to: ${SNAPSHOTS_DIR}\x1b[0m`);
305
+
306
+ console.log(`\n\x1b[32m✔ Graph successfully built.\x1b[0m`);
307
+ console.log(` \x1b[2mParsed: ${parsedCount} files | Cached: ${cachedCount} files\x1b[0m`);
308
+ console.log(` \x1b[2mSaved to: ${GRAPH_FILE}\x1b[0m`);
309
+ }
310
+
311
+ main();