@wundr.io/cli 1.0.11 → 1.0.12

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 (269) hide show
  1. package/bin/wundr.js +8 -4
  2. package/package.json +23 -23
  3. package/src/ai/ai-service.ts +16 -17
  4. package/src/ai/claude-client.ts +16 -16
  5. package/src/ai/conversation-manager.ts +29 -29
  6. package/src/cli.ts +4 -4
  7. package/src/commands/ai.ts +246 -78
  8. package/src/commands/alignment.ts +74 -74
  9. package/src/commands/analyze-optimized.ts +111 -78
  10. package/src/commands/analyze.ts +14 -14
  11. package/src/commands/batch.ts +179 -42
  12. package/src/commands/chat.ts +37 -30
  13. package/src/commands/claude-init.ts +41 -45
  14. package/src/commands/claude-setup.ts +204 -119
  15. package/src/commands/computer-setup.ts +85 -43
  16. package/src/commands/create-command.ts +4 -4
  17. package/src/commands/create.ts +27 -27
  18. package/src/commands/dashboard.ts +24 -24
  19. package/src/commands/govern.ts +25 -25
  20. package/src/commands/governance.ts +34 -34
  21. package/src/commands/guardian.ts +56 -56
  22. package/src/commands/init.ts +25 -22
  23. package/src/commands/orchestrator.ts +68 -41
  24. package/src/commands/performance-optimizer.ts +34 -35
  25. package/src/commands/plugins.ts +27 -27
  26. package/src/commands/project-update.ts +175 -72
  27. package/src/commands/rag.ts +185 -78
  28. package/src/commands/session.ts +35 -35
  29. package/src/commands/setup.ts +40 -344
  30. package/src/commands/test-init.ts +3 -3
  31. package/src/commands/test.ts +4 -4
  32. package/src/commands/watch.ts +28 -29
  33. package/src/commands/worktree.ts +49 -49
  34. package/src/context/context-manager.ts +10 -10
  35. package/src/context/session-manager.ts +41 -41
  36. package/src/framework/command-interface.ts +520 -0
  37. package/src/framework/command-registry.ts +942 -0
  38. package/src/framework/completion-exporter.ts +383 -0
  39. package/src/framework/debug-logger.ts +519 -0
  40. package/src/framework/error-handler.ts +867 -0
  41. package/src/framework/help-generator.ts +540 -0
  42. package/src/framework/index.ts +169 -0
  43. package/src/framework/interactive-repl.ts +703 -0
  44. package/src/framework/output-formatter.ts +834 -0
  45. package/src/framework/progress-manager.ts +539 -0
  46. package/src/index.ts +4 -4
  47. package/src/interactive/interactive-mode.ts +16 -16
  48. package/src/lib/conflict-resolution.ts +799 -9
  49. package/src/lib/merge-strategy.ts +529 -7
  50. package/src/lib/safety-mechanisms.ts +422 -18
  51. package/src/lib/state-detection.ts +1015 -13
  52. package/src/nlp/command-mapper.ts +29 -29
  53. package/src/nlp/command-parser.ts +17 -17
  54. package/src/nlp/intent-classifier.ts +7 -7
  55. package/src/nlp/intent-parser.ts +54 -52
  56. package/src/plugins/plugin-manager.ts +61 -39
  57. package/src/tests/computer-setup-integration.test.ts +46 -15
  58. package/src/types/modules.d.ts +424 -1
  59. package/src/utils/backup-rollback-manager.ts +11 -8
  60. package/src/utils/config-manager.ts +3 -3
  61. package/src/utils/error-handler.ts +2 -2
  62. package/src/utils/logger.ts +22 -22
  63. package/templates/batch/ci-cd.yaml +7 -7
  64. package/test-suites/api/health.spec.ts +20 -23
  65. package/test-suites/helpers/test-config.ts +14 -13
  66. package/test-suites/ui/accessibility.spec.ts +27 -22
  67. package/test-suites/ui/smoke.spec.ts +26 -21
  68. package/LICENSE +0 -21
  69. package/dist/ai/ai-service.d.ts +0 -152
  70. package/dist/ai/ai-service.d.ts.map +0 -1
  71. package/dist/ai/ai-service.js +0 -430
  72. package/dist/ai/ai-service.js.map +0 -1
  73. package/dist/ai/claude-client.d.ts +0 -130
  74. package/dist/ai/claude-client.d.ts.map +0 -1
  75. package/dist/ai/claude-client.js +0 -340
  76. package/dist/ai/claude-client.js.map +0 -1
  77. package/dist/ai/conversation-manager.d.ts +0 -164
  78. package/dist/ai/conversation-manager.d.ts.map +0 -1
  79. package/dist/ai/conversation-manager.js +0 -614
  80. package/dist/ai/conversation-manager.js.map +0 -1
  81. package/dist/ai/index.d.ts +0 -5
  82. package/dist/ai/index.d.ts.map +0 -1
  83. package/dist/ai/index.js +0 -8
  84. package/dist/ai/index.js.map +0 -1
  85. package/dist/cli.d.ts +0 -36
  86. package/dist/cli.d.ts.map +0 -1
  87. package/dist/cli.js +0 -192
  88. package/dist/cli.js.map +0 -1
  89. package/dist/commands/ai.d.ts +0 -89
  90. package/dist/commands/ai.d.ts.map +0 -1
  91. package/dist/commands/ai.js +0 -799
  92. package/dist/commands/ai.js.map +0 -1
  93. package/dist/commands/alignment.d.ts +0 -78
  94. package/dist/commands/alignment.d.ts.map +0 -1
  95. package/dist/commands/alignment.js +0 -817
  96. package/dist/commands/alignment.js.map +0 -1
  97. package/dist/commands/analyze-optimized.d.ts +0 -14
  98. package/dist/commands/analyze-optimized.d.ts.map +0 -1
  99. package/dist/commands/analyze-optimized.js +0 -600
  100. package/dist/commands/analyze-optimized.js.map +0 -1
  101. package/dist/commands/analyze.d.ts +0 -65
  102. package/dist/commands/analyze.d.ts.map +0 -1
  103. package/dist/commands/analyze.js +0 -435
  104. package/dist/commands/analyze.js.map +0 -1
  105. package/dist/commands/batch.d.ts +0 -71
  106. package/dist/commands/batch.d.ts.map +0 -1
  107. package/dist/commands/batch.js +0 -738
  108. package/dist/commands/batch.js.map +0 -1
  109. package/dist/commands/chat.d.ts +0 -71
  110. package/dist/commands/chat.d.ts.map +0 -1
  111. package/dist/commands/chat.js +0 -674
  112. package/dist/commands/chat.js.map +0 -1
  113. package/dist/commands/claude-init.d.ts +0 -28
  114. package/dist/commands/claude-init.d.ts.map +0 -1
  115. package/dist/commands/claude-init.js +0 -591
  116. package/dist/commands/claude-init.js.map +0 -1
  117. package/dist/commands/claude-setup.d.ts +0 -119
  118. package/dist/commands/claude-setup.d.ts.map +0 -1
  119. package/dist/commands/claude-setup.js +0 -1073
  120. package/dist/commands/claude-setup.js.map +0 -1
  121. package/dist/commands/computer-setup-commands.d.ts +0 -53
  122. package/dist/commands/computer-setup-commands.d.ts.map +0 -1
  123. package/dist/commands/computer-setup-commands.js +0 -705
  124. package/dist/commands/computer-setup-commands.js.map +0 -1
  125. package/dist/commands/computer-setup.d.ts +0 -7
  126. package/dist/commands/computer-setup.d.ts.map +0 -1
  127. package/dist/commands/computer-setup.js +0 -849
  128. package/dist/commands/computer-setup.js.map +0 -1
  129. package/dist/commands/create-command.d.ts +0 -7
  130. package/dist/commands/create-command.d.ts.map +0 -1
  131. package/dist/commands/create-command.js +0 -158
  132. package/dist/commands/create-command.js.map +0 -1
  133. package/dist/commands/create.d.ts +0 -74
  134. package/dist/commands/create.d.ts.map +0 -1
  135. package/dist/commands/create.js +0 -556
  136. package/dist/commands/create.js.map +0 -1
  137. package/dist/commands/dashboard.d.ts +0 -91
  138. package/dist/commands/dashboard.d.ts.map +0 -1
  139. package/dist/commands/dashboard.js +0 -538
  140. package/dist/commands/dashboard.js.map +0 -1
  141. package/dist/commands/govern.d.ts +0 -70
  142. package/dist/commands/govern.d.ts.map +0 -1
  143. package/dist/commands/govern.js +0 -481
  144. package/dist/commands/govern.js.map +0 -1
  145. package/dist/commands/governance.d.ts +0 -17
  146. package/dist/commands/governance.d.ts.map +0 -1
  147. package/dist/commands/governance.js +0 -703
  148. package/dist/commands/governance.js.map +0 -1
  149. package/dist/commands/guardian.d.ts +0 -20
  150. package/dist/commands/guardian.d.ts.map +0 -1
  151. package/dist/commands/guardian.js +0 -597
  152. package/dist/commands/guardian.js.map +0 -1
  153. package/dist/commands/init.d.ts +0 -59
  154. package/dist/commands/init.d.ts.map +0 -1
  155. package/dist/commands/init.js +0 -650
  156. package/dist/commands/init.js.map +0 -1
  157. package/dist/commands/orchestrator.d.ts +0 -7
  158. package/dist/commands/orchestrator.d.ts.map +0 -1
  159. package/dist/commands/orchestrator.js +0 -571
  160. package/dist/commands/orchestrator.js.map +0 -1
  161. package/dist/commands/performance-optimizer.d.ts +0 -30
  162. package/dist/commands/performance-optimizer.d.ts.map +0 -1
  163. package/dist/commands/performance-optimizer.js +0 -650
  164. package/dist/commands/performance-optimizer.js.map +0 -1
  165. package/dist/commands/plugins.d.ts +0 -87
  166. package/dist/commands/plugins.d.ts.map +0 -1
  167. package/dist/commands/plugins.js +0 -685
  168. package/dist/commands/plugins.js.map +0 -1
  169. package/dist/commands/rag.d.ts +0 -7
  170. package/dist/commands/rag.d.ts.map +0 -1
  171. package/dist/commands/rag.js +0 -748
  172. package/dist/commands/rag.js.map +0 -1
  173. package/dist/commands/session.d.ts +0 -41
  174. package/dist/commands/session.d.ts.map +0 -1
  175. package/dist/commands/session.js +0 -441
  176. package/dist/commands/session.js.map +0 -1
  177. package/dist/commands/setup.d.ts +0 -29
  178. package/dist/commands/setup.d.ts.map +0 -1
  179. package/dist/commands/setup.js +0 -397
  180. package/dist/commands/setup.js.map +0 -1
  181. package/dist/commands/test-init.d.ts +0 -9
  182. package/dist/commands/test-init.d.ts.map +0 -1
  183. package/dist/commands/test-init.js +0 -222
  184. package/dist/commands/test-init.js.map +0 -1
  185. package/dist/commands/test.d.ts +0 -25
  186. package/dist/commands/test.d.ts.map +0 -1
  187. package/dist/commands/test.js +0 -217
  188. package/dist/commands/test.js.map +0 -1
  189. package/dist/commands/vp.d.ts +0 -7
  190. package/dist/commands/vp.d.ts.map +0 -1
  191. package/dist/commands/vp.js +0 -571
  192. package/dist/commands/vp.js.map +0 -1
  193. package/dist/commands/watch.d.ts +0 -76
  194. package/dist/commands/watch.d.ts.map +0 -1
  195. package/dist/commands/watch.js +0 -613
  196. package/dist/commands/watch.js.map +0 -1
  197. package/dist/commands/worktree.d.ts +0 -63
  198. package/dist/commands/worktree.d.ts.map +0 -1
  199. package/dist/commands/worktree.js +0 -774
  200. package/dist/commands/worktree.js.map +0 -1
  201. package/dist/context/context-manager.d.ts +0 -155
  202. package/dist/context/context-manager.d.ts.map +0 -1
  203. package/dist/context/context-manager.js +0 -383
  204. package/dist/context/context-manager.js.map +0 -1
  205. package/dist/context/index.d.ts +0 -3
  206. package/dist/context/index.d.ts.map +0 -1
  207. package/dist/context/index.js +0 -6
  208. package/dist/context/index.js.map +0 -1
  209. package/dist/context/session-manager.d.ts +0 -207
  210. package/dist/context/session-manager.d.ts.map +0 -1
  211. package/dist/context/session-manager.js +0 -686
  212. package/dist/context/session-manager.js.map +0 -1
  213. package/dist/index.d.ts +0 -8
  214. package/dist/index.d.ts.map +0 -1
  215. package/dist/index.js +0 -51
  216. package/dist/index.js.map +0 -1
  217. package/dist/interactive/interactive-mode.d.ts +0 -76
  218. package/dist/interactive/interactive-mode.d.ts.map +0 -1
  219. package/dist/interactive/interactive-mode.js +0 -732
  220. package/dist/interactive/interactive-mode.js.map +0 -1
  221. package/dist/nlp/command-mapper.d.ts +0 -174
  222. package/dist/nlp/command-mapper.d.ts.map +0 -1
  223. package/dist/nlp/command-mapper.js +0 -624
  224. package/dist/nlp/command-mapper.js.map +0 -1
  225. package/dist/nlp/command-parser.d.ts +0 -106
  226. package/dist/nlp/command-parser.d.ts.map +0 -1
  227. package/dist/nlp/command-parser.js +0 -417
  228. package/dist/nlp/command-parser.js.map +0 -1
  229. package/dist/nlp/index.d.ts +0 -5
  230. package/dist/nlp/index.d.ts.map +0 -1
  231. package/dist/nlp/index.js +0 -8
  232. package/dist/nlp/index.js.map +0 -1
  233. package/dist/nlp/intent-classifier.d.ts +0 -59
  234. package/dist/nlp/intent-classifier.d.ts.map +0 -1
  235. package/dist/nlp/intent-classifier.js +0 -384
  236. package/dist/nlp/intent-classifier.js.map +0 -1
  237. package/dist/nlp/intent-parser.d.ts +0 -152
  238. package/dist/nlp/intent-parser.d.ts.map +0 -1
  239. package/dist/nlp/intent-parser.js +0 -744
  240. package/dist/nlp/intent-parser.js.map +0 -1
  241. package/dist/plugins/plugin-manager.d.ts +0 -120
  242. package/dist/plugins/plugin-manager.d.ts.map +0 -1
  243. package/dist/plugins/plugin-manager.js +0 -595
  244. package/dist/plugins/plugin-manager.js.map +0 -1
  245. package/dist/types/index.d.ts +0 -224
  246. package/dist/types/index.d.ts.map +0 -1
  247. package/dist/types/index.js +0 -3
  248. package/dist/types/index.js.map +0 -1
  249. package/dist/utils/backup-rollback-manager.d.ts +0 -72
  250. package/dist/utils/backup-rollback-manager.d.ts.map +0 -1
  251. package/dist/utils/backup-rollback-manager.js +0 -289
  252. package/dist/utils/backup-rollback-manager.js.map +0 -1
  253. package/dist/utils/claude-config-installer.d.ts +0 -98
  254. package/dist/utils/claude-config-installer.d.ts.map +0 -1
  255. package/dist/utils/claude-config-installer.js +0 -678
  256. package/dist/utils/claude-config-installer.js.map +0 -1
  257. package/dist/utils/config-manager.d.ts +0 -73
  258. package/dist/utils/config-manager.d.ts.map +0 -1
  259. package/dist/utils/config-manager.js +0 -339
  260. package/dist/utils/config-manager.js.map +0 -1
  261. package/dist/utils/error-handler.d.ts +0 -46
  262. package/dist/utils/error-handler.d.ts.map +0 -1
  263. package/dist/utils/error-handler.js +0 -169
  264. package/dist/utils/error-handler.js.map +0 -1
  265. package/dist/utils/logger.d.ts +0 -25
  266. package/dist/utils/logger.d.ts.map +0 -1
  267. package/dist/utils/logger.js +0 -105
  268. package/dist/utils/logger.js.map +0 -1
  269. package/src/commands/computer-setup-commands.ts +0 -872
@@ -10,7 +10,6 @@ import { Command } from 'commander';
10
10
  import * as fs from 'fs-extra';
11
11
  import ora from 'ora';
12
12
 
13
-
14
13
  // Use analysis-engine modules for testing
15
14
  // Temporarily using inline implementation for CodeAnalyzer
16
15
 
@@ -90,7 +89,10 @@ interface BenchmarkSuiteConfig {
90
89
  // Functional implementations for testing
91
90
  class MemoryMonitor {
92
91
  private config: MemoryMonitorConfig;
93
- private eventHandlers: Map<string, EventCallback<MemoryAlert | MemoryLeakAnalysis>[]> = new Map();
92
+ private eventHandlers: Map<
93
+ string,
94
+ EventCallback<MemoryAlert | MemoryLeakAnalysis>[]
95
+ > = new Map();
94
96
  private monitoringInterval: NodeJS.Timeout | null = null;
95
97
  private samples: number[] = [];
96
98
 
@@ -102,7 +104,10 @@ class MemoryMonitor {
102
104
  };
103
105
  }
104
106
 
105
- on(event: string, callback: EventCallback<MemoryAlert | MemoryLeakAnalysis>): void {
107
+ on(
108
+ event: string,
109
+ callback: EventCallback<MemoryAlert | MemoryLeakAnalysis>
110
+ ): void {
106
111
  if (!this.eventHandlers.has(event)) {
107
112
  this.eventHandlers.set(event, []);
108
113
  }
@@ -123,10 +128,16 @@ class MemoryMonitor {
123
128
  this.samples.push(currentMemory);
124
129
 
125
130
  // Check for memory threshold alerts
126
- if (currentMemory > this.config.maxMemoryUsage! * this.config.alertThreshold!) {
131
+ if (
132
+ currentMemory >
133
+ this.config.maxMemoryUsage! * this.config.alertThreshold!
134
+ ) {
127
135
  this.emit('memory-alert', {
128
136
  type: 'threshold',
129
- severity: currentMemory > this.config.maxMemoryUsage! ? 'critical' : 'warning',
137
+ severity:
138
+ currentMemory > this.config.maxMemoryUsage!
139
+ ? 'critical'
140
+ : 'warning',
130
141
  current: currentMemory,
131
142
  threshold: this.config.maxMemoryUsage!,
132
143
  });
@@ -139,7 +150,8 @@ class MemoryMonitor {
139
150
  const lastSample = recentSamples[9];
140
151
  if (firstSample !== undefined && lastSample !== undefined) {
141
152
  const growthRate = (lastSample - firstSample) / 10;
142
- if (growthRate > 1024 * 1024) { // Growing more than 1MB per sample
153
+ if (growthRate > 1024 * 1024) {
154
+ // Growing more than 1MB per sample
143
155
  this.emit('memory-leak-detected', {
144
156
  detected: true,
145
157
  growthRate,
@@ -161,10 +173,14 @@ class MemoryMonitor {
161
173
 
162
174
  getMetrics() {
163
175
  const currentMemory = process.memoryUsage();
164
- const peakHeapUsed = this.samples.length > 0 ? Math.max(...this.samples) : currentMemory.heapUsed * 1.2;
165
- const averageHeapUsed = this.samples.length > 0
166
- ? this.samples.reduce((a, b) => a + b, 0) / this.samples.length
167
- : currentMemory.heapUsed;
176
+ const peakHeapUsed =
177
+ this.samples.length > 0
178
+ ? Math.max(...this.samples)
179
+ : currentMemory.heapUsed * 1.2;
180
+ const averageHeapUsed =
181
+ this.samples.length > 0
182
+ ? this.samples.reduce((a, b) => a + b, 0) / this.samples.length
183
+ : currentMemory.heapUsed;
168
184
 
169
185
  return {
170
186
  data: {
@@ -249,14 +265,20 @@ class SimpleAnalyzer {
249
265
  class OptimizedBaseAnalysisService {
250
266
  private analyzer: SimpleAnalyzer;
251
267
  private config: AnalysisServiceConfig;
252
- private eventHandlers: Map<string, EventCallback<ProgressEvent | MemoryLeakWarning>[]> = new Map();
268
+ private eventHandlers: Map<
269
+ string,
270
+ EventCallback<ProgressEvent | MemoryLeakWarning>[]
271
+ > = new Map();
253
272
 
254
273
  constructor(config: AnalysisServiceConfig) {
255
274
  this.config = config;
256
275
  this.analyzer = new SimpleAnalyzer();
257
276
  }
258
277
 
259
- on(event: string, callback: EventCallback<ProgressEvent | MemoryLeakWarning>): void {
278
+ on(
279
+ event: string,
280
+ callback: EventCallback<ProgressEvent | MemoryLeakWarning>
281
+ ): void {
260
282
  if (!this.eventHandlers.has(event)) {
261
283
  this.eventHandlers.set(event, []);
262
284
  }
@@ -271,7 +293,10 @@ class OptimizedBaseAnalysisService {
271
293
  }
272
294
 
273
295
  async initialize(): Promise<void> {
274
- this.emit('progress', { type: 'phase', message: 'Initializing analysis service...' });
296
+ this.emit('progress', {
297
+ type: 'phase',
298
+ message: 'Initializing analysis service...',
299
+ });
275
300
 
276
301
  // Ensure output directory exists
277
302
  await fs.ensureDir(this.config.outputDir);
@@ -389,7 +414,7 @@ class PerformanceBenchmarkSuite {
389
414
  metrics: {
390
415
  avgExecutionTime: executionTime,
391
416
  peakMemory: memoryAfter,
392
- filesPerSecond: 1000 / executionTime * 100,
417
+ filesPerSecond: (1000 / executionTime) * 100,
393
418
  },
394
419
  },
395
420
  });
@@ -397,7 +422,10 @@ class PerformanceBenchmarkSuite {
397
422
 
398
423
  // Save results if profiling is enabled
399
424
  if (this.config.enableProfiling) {
400
- const outputPath = path.join(this.config.outputDir!, 'benchmark-results.json');
425
+ const outputPath = path.join(
426
+ this.config.outputDir!,
427
+ 'benchmark-results.json'
428
+ );
401
429
  await fs.writeJson(outputPath, results, { spaces: 2 });
402
430
  }
403
431
 
@@ -423,7 +451,12 @@ class PerformanceBenchmarkSuite {
423
451
  const recoveryTime = Date.now() - this.startTime;
424
452
 
425
453
  return {
426
- stabilityScore: Math.min(100, Math.round(100 - ((peakMemory - memoryBefore) / this.config.memoryLimit!) * 100)),
454
+ stabilityScore: Math.min(
455
+ 100,
456
+ Math.round(
457
+ 100 - ((peakMemory - memoryBefore) / this.config.memoryLimit!) * 100
458
+ )
459
+ ),
427
460
  peakMemory,
428
461
  recoveryTime,
429
462
  };
@@ -457,24 +490,24 @@ export function createOptimizedAnalyzeCommand(): Command {
457
490
  const command = new Command('analyze-optimized')
458
491
  .alias('ao')
459
492
  .description(
460
- 'Run optimized analysis with memory management and high concurrency',
493
+ 'Run optimized analysis with memory management and high concurrency'
461
494
  )
462
495
  .argument('<directory>', 'Directory to analyze')
463
496
  .option(
464
497
  '-o, --output <path>',
465
498
  'Output directory for results',
466
- './wundr-analysis',
499
+ './wundr-analysis'
467
500
  )
468
501
  .option(
469
502
  '-f, --format <format>',
470
503
  'Output format (json, html, markdown, all)',
471
- 'json',
504
+ 'json'
472
505
  )
473
506
  .option('-v, --verbose', 'Verbose output with detailed progress', false)
474
507
  .option(
475
508
  '--max-memory <size>',
476
509
  'Maximum memory usage (e.g., 250MB, 1GB)',
477
- '250MB',
510
+ '250MB'
478
511
  )
479
512
  .option('--max-workers <count>', 'Maximum number of workers', '32')
480
513
  .option('--enable-streaming', 'Enable streaming for large codebases', true)
@@ -484,7 +517,7 @@ export function createOptimizedAnalyzeCommand(): Command {
484
517
  .option(
485
518
  '--cache-enabled',
486
519
  'Enable caching for faster repeated analysis',
487
- true,
520
+ true
488
521
  )
489
522
  .option('--include <patterns...>', 'File patterns to include', [
490
523
  '**/*.{ts,tsx,js,jsx}',
@@ -505,7 +538,7 @@ export function createOptimizedAnalyzeCommand(): Command {
505
538
  */
506
539
  async function runOptimizedAnalysis(
507
540
  directory: string,
508
- options: OptimizedAnalysisOptions,
541
+ options: OptimizedAnalysisOptions
509
542
  ): Promise<void> {
510
543
  const startTime = Date.now();
511
544
  const spinner = ora('Initializing optimized analysis...').start();
@@ -550,8 +583,8 @@ async function runOptimizedAnalysis(
550
583
  if (options.verbose) {
551
584
  spinner.warn(
552
585
  color(
553
- `Memory Alert: ${alert.type} - ${Math.round(alert.current / 1024 / 1024)}MB`,
554
- ),
586
+ `Memory Alert: ${alert.type} - ${Math.round(alert.current / 1024 / 1024)}MB`
587
+ )
555
588
  );
556
589
  }
557
590
  });
@@ -559,8 +592,8 @@ async function runOptimizedAnalysis(
559
592
  memoryMonitor.on('memory-leak-detected', (analysis: any) => {
560
593
  spinner.warn(
561
594
  chalk.red(
562
- `Memory leak detected! Growth rate: ${Math.round(analysis.growthRate / 1024)}KB/s`,
563
- ),
595
+ `Memory leak detected! Growth rate: ${Math.round(analysis.growthRate / 1024)}KB/s`
596
+ )
564
597
  );
565
598
  });
566
599
 
@@ -597,8 +630,8 @@ async function runOptimizedAnalysis(
597
630
  analysisService.on('memory-leak-warning', (warning: any) => {
598
631
  spinner.warn(
599
632
  chalk.yellow(
600
- `Memory Warning: ${warning.severity} - Growth: ${Math.round(warning.growthRate / 1024)}KB/s`,
601
- ),
633
+ `Memory Warning: ${warning.severity} - Growth: ${Math.round(warning.growthRate / 1024)}KB/s`
634
+ )
602
635
  );
603
636
  });
604
637
  }
@@ -626,27 +659,27 @@ async function runOptimizedAnalysis(
626
659
  console.log(chalk.cyan('šŸ“Š Performance Summary:'));
627
660
  console.log(chalk.gray(` Duration: ${formatDuration(duration)}`));
628
661
  console.log(
629
- chalk.gray(` Files analyzed: ${result.data?.summary.totalFiles || 0}`),
662
+ chalk.gray(` Files analyzed: ${result.data?.summary.totalFiles || 0}`)
630
663
  );
631
664
  console.log(
632
665
  chalk.gray(
633
- ` Entities found: ${result.data?.summary.totalEntities || 0}`,
634
- ),
666
+ ` Entities found: ${result.data?.summary.totalEntities || 0}`
667
+ )
635
668
  );
636
669
  console.log(
637
670
  chalk.gray(
638
- ` Peak memory: ${formatFileSize(memoryMetrics.peak.heapUsed)}`,
639
- ),
671
+ ` Peak memory: ${formatFileSize(memoryMetrics.peak.heapUsed)}`
672
+ )
640
673
  );
641
674
  console.log(
642
675
  chalk.gray(
643
- ` Average memory: ${formatFileSize(memoryMetrics.average.heapUsed)}`,
644
- ),
676
+ ` Average memory: ${formatFileSize(memoryMetrics.average.heapUsed)}`
677
+ )
645
678
  );
646
679
  console.log(
647
680
  chalk.gray(
648
- ` Processing rate: ${Math.round((result.data?.summary.totalFiles || 0) / (duration / 1000))} files/sec`,
649
- ),
681
+ ` Processing rate: ${Math.round((result.data?.summary.totalFiles || 0) / (duration / 1000))} files/sec`
682
+ )
650
683
  );
651
684
 
652
685
  // Analysis results
@@ -654,49 +687,49 @@ async function runOptimizedAnalysis(
654
687
  console.log(chalk.cyan('\nšŸ” Analysis Results:'));
655
688
  console.log(
656
689
  chalk.gray(
657
- ` Duplicate clusters: ${result.data.summary.duplicateClusters}`,
658
- ),
690
+ ` Duplicate clusters: ${result.data.summary.duplicateClusters}`
691
+ )
659
692
  );
660
693
  console.log(
661
694
  chalk.gray(
662
- ` Circular dependencies: ${result.data.summary.circularDependencies}`,
663
- ),
695
+ ` Circular dependencies: ${result.data.summary.circularDependencies}`
696
+ )
664
697
  );
665
698
  console.log(
666
- chalk.gray(` Code smells: ${result.data.summary.codeSmells}`),
699
+ chalk.gray(` Code smells: ${result.data.summary.codeSmells}`)
667
700
  );
668
701
  console.log(
669
702
  chalk.gray(
670
- ` Technical debt score: ${result.data.summary.technicalDebt}/100`,
671
- ),
703
+ ` Technical debt score: ${result.data.summary.technicalDebt}/100`
704
+ )
672
705
  );
673
706
  }
674
707
 
675
708
  // Memory efficiency
676
709
  const memoryEfficiency = calculateMemoryEfficiency(
677
710
  result.data?.summary.totalFiles || 0,
678
- memoryMetrics.peak.heapUsed,
711
+ memoryMetrics.peak.heapUsed
679
712
  );
680
713
  console.log(chalk.cyan('\nšŸ’¾ Memory Efficiency:'));
681
714
  console.log(
682
- chalk.gray(` Efficiency score: ${memoryEfficiency.toFixed(1)}%`),
715
+ chalk.gray(` Efficiency score: ${memoryEfficiency.toFixed(1)}%`)
683
716
  );
684
717
  console.log(
685
718
  chalk.gray(
686
- ` Memory per file: ${Math.round(memoryMetrics.average.heapUsed / Math.max(1, result.data?.summary.totalFiles || 1) / 1024)}KB`,
687
- ),
719
+ ` Memory per file: ${Math.round(memoryMetrics.average.heapUsed / Math.max(1, result.data?.summary.totalFiles || 1) / 1024)}KB`
720
+ )
688
721
  );
689
722
 
690
723
  // Leak analysis
691
724
  if (memoryMetrics.leakAnalysis.leakDetected) {
692
725
  console.log(chalk.red('\nāš ļø Memory Leak Detected:'));
693
726
  console.log(
694
- chalk.gray(` Severity: ${memoryMetrics.leakAnalysis.severity}`),
727
+ chalk.gray(` Severity: ${memoryMetrics.leakAnalysis.severity}`)
695
728
  );
696
729
  console.log(
697
730
  chalk.gray(
698
- ` Growth rate: ${Math.round(memoryMetrics.leakAnalysis.growthRate / 1024)}KB/s`,
699
- ),
731
+ ` Growth rate: ${Math.round(memoryMetrics.leakAnalysis.growthRate / 1024)}KB/s`
732
+ )
700
733
  );
701
734
  }
702
735
 
@@ -737,18 +770,18 @@ async function runOptimizedAnalysis(
737
770
  console.log(chalk.cyan('⚔ Benchmark Results:'));
738
771
  console.log(
739
772
  chalk.gray(
740
- ` Speedup: ${mainResult.results.improvement.speedup.toFixed(1)}x`,
741
- ),
773
+ ` Speedup: ${mainResult.results.improvement.speedup.toFixed(1)}x`
774
+ )
742
775
  );
743
776
  console.log(
744
777
  chalk.gray(
745
- ` Memory reduction: ${mainResult.results.improvement.memoryReduction.toFixed(1)}%`,
746
- ),
778
+ ` Memory reduction: ${mainResult.results.improvement.memoryReduction.toFixed(1)}%`
779
+ )
747
780
  );
748
781
  console.log(
749
782
  chalk.gray(
750
- ` Throughput increase: ${mainResult.results.improvement.throughputIncrease.toFixed(1)}%`,
751
- ),
783
+ ` Throughput increase: ${mainResult.results.improvement.throughputIncrease.toFixed(1)}%`
784
+ )
752
785
  );
753
786
  }
754
787
 
@@ -760,7 +793,7 @@ async function runOptimizedAnalysis(
760
793
  spinner.fail('Analysis failed');
761
794
  console.error(
762
795
  chalk.red('\nāŒ Error:'),
763
- error instanceof Error ? error.message : String(error),
796
+ error instanceof Error ? error.message : String(error)
764
797
  );
765
798
 
766
799
  if (options.verbose && error instanceof Error) {
@@ -802,14 +835,14 @@ function parseMemoryLimit(memoryStr: string): number {
802
835
  */
803
836
  function formatDuration(ms: number): string {
804
837
  if (ms < 1000) {
805
- return `${ms}ms`;
806
- }
838
+ return `${ms}ms`;
839
+ }
807
840
  if (ms < 60000) {
808
- return `${(ms / 1000).toFixed(1)}s`;
809
- }
841
+ return `${(ms / 1000).toFixed(1)}s`;
842
+ }
810
843
  if (ms < 3600000) {
811
- return `${(ms / 60000).toFixed(1)}m`;
812
- }
844
+ return `${(ms / 60000).toFixed(1)}m`;
845
+ }
813
846
  return `${(ms / 3600000).toFixed(1)}h`;
814
847
  }
815
848
 
@@ -834,12 +867,12 @@ function formatFileSize(bytes: number): string {
834
867
  */
835
868
  function calculateMemoryEfficiency(
836
869
  fileCount: number,
837
- memoryUsed: number,
870
+ memoryUsed: number
838
871
  ): number {
839
872
  const expectedMemory = fileCount * 50 * 1024; // 50KB per file baseline
840
873
  const efficiency = Math.max(
841
874
  0,
842
- 100 - ((memoryUsed - expectedMemory) / expectedMemory) * 100,
875
+ 100 - ((memoryUsed - expectedMemory) / expectedMemory) * 100
843
876
  );
844
877
  return Math.min(100, efficiency);
845
878
  }
@@ -851,12 +884,12 @@ export function createBenchmarkCommand(): Command {
851
884
  const command = new Command('benchmark')
852
885
  .alias('bench')
853
886
  .description(
854
- 'Run performance benchmarks for memory and concurrency optimizations',
887
+ 'Run performance benchmarks for memory and concurrency optimizations'
855
888
  )
856
889
  .option(
857
890
  '-o, --output <path>',
858
891
  'Output directory for benchmark results',
859
- './benchmark-results',
892
+ './benchmark-results'
860
893
  )
861
894
  .option('--iterations <count>', 'Number of benchmark iterations', '3')
862
895
  .option('--memory-limit <size>', 'Memory limit for testing', '500MB')
@@ -905,41 +938,41 @@ async function runBenchmarks(options: any): Promise<void> {
905
938
  const avgSpeedup =
906
939
  results.reduce(
907
940
  (sum: any, r: any) => sum + r.results.improvement.speedup,
908
- 0,
941
+ 0
909
942
  ) / results.length;
910
943
  const avgMemoryReduction =
911
944
  results.reduce(
912
945
  (sum: any, r: any) => sum + r.results.improvement.memoryReduction,
913
- 0,
946
+ 0
914
947
  ) / results.length;
915
948
  const avgThroughputIncrease =
916
949
  results.reduce(
917
950
  (sum: any, r: any) => sum + r.results.improvement.throughputIncrease,
918
- 0,
951
+ 0
919
952
  ) / results.length;
920
953
 
921
954
  console.log(chalk.cyan(`šŸš€ Average Speedup: ${avgSpeedup.toFixed(1)}x`));
922
955
  console.log(
923
956
  chalk.cyan(
924
- `šŸ’¾ Average Memory Reduction: ${avgMemoryReduction.toFixed(1)}%`,
925
- ),
957
+ `šŸ’¾ Average Memory Reduction: ${avgMemoryReduction.toFixed(1)}%`
958
+ )
926
959
  );
927
960
  console.log(
928
961
  chalk.cyan(
929
- `šŸ“Š Average Throughput Increase: ${avgThroughputIncrease.toFixed(1)}%`,
930
- ),
962
+ `šŸ“Š Average Throughput Increase: ${avgThroughputIncrease.toFixed(1)}%`
963
+ )
931
964
  );
932
965
 
933
966
  console.log(
934
967
  chalk.green(
935
- `\nšŸ“ Results saved to: ${options.output || './benchmark-results'}\n`,
936
- ),
968
+ `\nšŸ“ Results saved to: ${options.output || './benchmark-results'}\n`
969
+ )
937
970
  );
938
971
  } catch (error) {
939
972
  spinner.fail('Benchmarks failed');
940
973
  console.error(
941
974
  chalk.red('\nāŒ Error:'),
942
- error instanceof Error ? error.message : String(error),
975
+ error instanceof Error ? error.message : String(error)
943
976
  );
944
977
  process.exit(1);
945
978
  }
@@ -17,7 +17,7 @@ export class AnalyzeCommands {
17
17
  constructor(
18
18
  private program: Command,
19
19
  private _configManager: ConfigManager,
20
- private _pluginManager: PluginManager,
20
+ private _pluginManager: PluginManager
21
21
  ) {
22
22
  this.registerCommands();
23
23
  }
@@ -39,7 +39,7 @@ export class AnalyzeCommands {
39
39
  .option(
40
40
  '--format <format>',
41
41
  'output format (json, table, graph)',
42
- 'table',
42
+ 'table'
43
43
  )
44
44
  .action(async options => {
45
45
  await this.analyzeDependencies(options);
@@ -150,7 +150,7 @@ export class AnalyzeCommands {
150
150
  'WUNDR_ANALYZE_DEPS_FAILED',
151
151
  'Failed to analyze dependencies',
152
152
  { options },
153
- true,
153
+ true
154
154
  );
155
155
  }
156
156
  }
@@ -200,7 +200,7 @@ export class AnalyzeCommands {
200
200
  'WUNDR_ANALYZE_QUALITY_FAILED',
201
201
  'Failed to analyze code quality',
202
202
  { options },
203
- true,
203
+ true
204
204
  );
205
205
  }
206
206
  }
@@ -245,7 +245,7 @@ export class AnalyzeCommands {
245
245
  'WUNDR_ANALYZE_PERF_FAILED',
246
246
  'Failed to analyze performance',
247
247
  { options },
248
- true,
248
+ true
249
249
  );
250
250
  }
251
251
  }
@@ -289,7 +289,7 @@ export class AnalyzeCommands {
289
289
  'WUNDR_ANALYZE_ARCH_FAILED',
290
290
  'Failed to analyze architecture',
291
291
  { options },
292
- true,
292
+ true
293
293
  );
294
294
  }
295
295
  }
@@ -331,7 +331,7 @@ export class AnalyzeCommands {
331
331
  'WUNDR_ANALYZE_ALL_FAILED',
332
332
  'Failed to run comprehensive analysis',
333
333
  { options },
334
- true,
334
+ true
335
335
  );
336
336
  }
337
337
  }
@@ -365,7 +365,7 @@ export class AnalyzeCommands {
365
365
  'WUNDR_SCAN_FAILED',
366
366
  'Failed to scan for issues',
367
367
  { scanPath, options },
368
- true,
368
+ true
369
369
  );
370
370
  }
371
371
  }
@@ -485,7 +485,7 @@ export class AnalyzeCommands {
485
485
 
486
486
  private async performDirectoryScan(
487
487
  scanPath: string,
488
- options: any,
488
+ options: any
489
489
  ): Promise<Finding[]> {
490
490
  // Implementation for directory scanning
491
491
  return [];
@@ -510,7 +510,7 @@ export class AnalyzeCommands {
510
510
  */
511
511
  private async outputResults(
512
512
  results: AnalysisResult,
513
- format: string,
513
+ format: string
514
514
  ): Promise<void> {
515
515
  switch (format) {
516
516
  case 'json':
@@ -537,7 +537,7 @@ export class AnalyzeCommands {
537
537
  Line: f.line || 'N/A',
538
538
  Description: f.description,
539
539
  Fixable: f.fixable ? 'āœ“' : 'āœ—',
540
- })),
540
+ }))
541
541
  );
542
542
  }
543
543
 
@@ -550,7 +550,7 @@ export class AnalyzeCommands {
550
550
  console.log(chalk.green('\nRecommendations:'));
551
551
  results.recommendations.forEach((rec, i) => {
552
552
  console.log(
553
- `${i + 1}. ${rec.title} (${rec.impact} impact, ${rec.effort} effort)`,
553
+ `${i + 1}. ${rec.title} (${rec.impact} impact, ${rec.effort} effort)`
554
554
  );
555
555
  });
556
556
  }
@@ -562,7 +562,7 @@ export class AnalyzeCommands {
562
562
  }
563
563
 
564
564
  private async generateComprehensiveReport(
565
- results: AnalysisResult[],
565
+ results: AnalysisResult[]
566
566
  ): Promise<void> {
567
567
  // Implementation for comprehensive report generation
568
568
  logger.info('Generating comprehensive report...');
@@ -570,7 +570,7 @@ export class AnalyzeCommands {
570
570
 
571
571
  private async exportResults(
572
572
  results: AnalysisResult[],
573
- exportPath: string,
573
+ exportPath: string
574
574
  ): Promise<void> {
575
575
  await fs.writeJson(exportPath, results, { spaces: 2 });
576
576
  logger.success(`Results exported to ${exportPath}`);