@wundr.io/cli 1.0.1 → 1.0.3

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 (249) hide show
  1. package/dist/ai/ai-service.d.ts +152 -0
  2. package/dist/ai/ai-service.d.ts.map +1 -0
  3. package/dist/ai/ai-service.js +430 -0
  4. package/dist/ai/ai-service.js.map +1 -0
  5. package/dist/ai/claude-client.d.ts +130 -0
  6. package/dist/ai/claude-client.d.ts.map +1 -0
  7. package/dist/ai/claude-client.js +340 -0
  8. package/dist/ai/claude-client.js.map +1 -0
  9. package/dist/ai/conversation-manager.d.ts +164 -0
  10. package/dist/ai/conversation-manager.d.ts.map +1 -0
  11. package/dist/ai/conversation-manager.js +614 -0
  12. package/dist/ai/conversation-manager.js.map +1 -0
  13. package/dist/ai/index.d.ts +5 -0
  14. package/dist/ai/index.d.ts.map +1 -0
  15. package/dist/ai/index.js +8 -0
  16. package/dist/ai/index.js.map +1 -0
  17. package/dist/cli.d.ts +36 -0
  18. package/dist/cli.d.ts.map +1 -0
  19. package/dist/cli.js +192 -0
  20. package/dist/cli.js.map +1 -0
  21. package/dist/commands/ai.d.ts +89 -0
  22. package/dist/commands/ai.d.ts.map +1 -0
  23. package/dist/commands/ai.js +735 -0
  24. package/dist/commands/ai.js.map +1 -0
  25. package/dist/commands/alignment.d.ts +78 -0
  26. package/dist/commands/alignment.d.ts.map +1 -0
  27. package/dist/commands/alignment.js +817 -0
  28. package/dist/commands/alignment.js.map +1 -0
  29. package/dist/commands/analyze-optimized.d.ts +14 -0
  30. package/dist/commands/analyze-optimized.d.ts.map +1 -0
  31. package/dist/commands/analyze-optimized.js +440 -0
  32. package/dist/commands/analyze-optimized.js.map +1 -0
  33. package/dist/commands/analyze.d.ts +65 -0
  34. package/dist/commands/analyze.d.ts.map +1 -0
  35. package/dist/commands/analyze.js +435 -0
  36. package/dist/commands/analyze.js.map +1 -0
  37. package/dist/commands/batch.d.ts +71 -0
  38. package/dist/commands/batch.d.ts.map +1 -0
  39. package/dist/commands/batch.js +738 -0
  40. package/dist/commands/batch.js.map +1 -0
  41. package/dist/commands/chat.d.ts +71 -0
  42. package/dist/commands/chat.d.ts.map +1 -0
  43. package/dist/commands/chat.js +674 -0
  44. package/dist/commands/chat.js.map +1 -0
  45. package/dist/commands/claude-init.d.ts +28 -0
  46. package/dist/commands/claude-init.d.ts.map +1 -0
  47. package/dist/commands/claude-init.js +591 -0
  48. package/dist/commands/claude-init.js.map +1 -0
  49. package/dist/commands/claude-setup.d.ts +119 -0
  50. package/dist/commands/claude-setup.d.ts.map +1 -0
  51. package/dist/commands/claude-setup.js +1073 -0
  52. package/dist/commands/claude-setup.js.map +1 -0
  53. package/dist/commands/computer-setup-commands.d.ts +53 -0
  54. package/dist/commands/computer-setup-commands.d.ts.map +1 -0
  55. package/dist/commands/computer-setup-commands.js +705 -0
  56. package/dist/commands/computer-setup-commands.js.map +1 -0
  57. package/dist/commands/computer-setup.d.ts +7 -0
  58. package/dist/commands/computer-setup.d.ts.map +1 -0
  59. package/dist/commands/computer-setup.js +849 -0
  60. package/dist/commands/computer-setup.js.map +1 -0
  61. package/dist/commands/create-command.d.ts +7 -0
  62. package/dist/commands/create-command.d.ts.map +1 -0
  63. package/dist/commands/create-command.js +158 -0
  64. package/dist/commands/create-command.js.map +1 -0
  65. package/dist/commands/create.d.ts +74 -0
  66. package/dist/commands/create.d.ts.map +1 -0
  67. package/dist/commands/create.js +556 -0
  68. package/dist/commands/create.js.map +1 -0
  69. package/dist/commands/dashboard.d.ts +91 -0
  70. package/dist/commands/dashboard.d.ts.map +1 -0
  71. package/dist/commands/dashboard.js +538 -0
  72. package/dist/commands/dashboard.js.map +1 -0
  73. package/dist/commands/govern.d.ts +70 -0
  74. package/dist/commands/govern.d.ts.map +1 -0
  75. package/dist/commands/govern.js +481 -0
  76. package/dist/commands/govern.js.map +1 -0
  77. package/dist/commands/governance.d.ts +17 -0
  78. package/dist/commands/governance.d.ts.map +1 -0
  79. package/dist/commands/governance.js +703 -0
  80. package/dist/commands/governance.js.map +1 -0
  81. package/dist/commands/guardian.d.ts +20 -0
  82. package/dist/commands/guardian.d.ts.map +1 -0
  83. package/dist/commands/guardian.js +597 -0
  84. package/dist/commands/guardian.js.map +1 -0
  85. package/dist/commands/init.d.ts +59 -0
  86. package/dist/commands/init.d.ts.map +1 -0
  87. package/dist/commands/init.js +650 -0
  88. package/dist/commands/init.js.map +1 -0
  89. package/dist/commands/performance-optimizer.d.ts +30 -0
  90. package/dist/commands/performance-optimizer.d.ts.map +1 -0
  91. package/dist/commands/performance-optimizer.js +650 -0
  92. package/dist/commands/performance-optimizer.js.map +1 -0
  93. package/dist/commands/plugins.d.ts +87 -0
  94. package/dist/commands/plugins.d.ts.map +1 -0
  95. package/dist/commands/plugins.js +685 -0
  96. package/dist/commands/plugins.js.map +1 -0
  97. package/dist/commands/rag.d.ts +7 -0
  98. package/dist/commands/rag.d.ts.map +1 -0
  99. package/dist/commands/rag.js +748 -0
  100. package/dist/commands/rag.js.map +1 -0
  101. package/dist/commands/session.d.ts +41 -0
  102. package/dist/commands/session.d.ts.map +1 -0
  103. package/dist/commands/session.js +441 -0
  104. package/dist/commands/session.js.map +1 -0
  105. package/dist/commands/setup.d.ts +29 -0
  106. package/dist/commands/setup.d.ts.map +1 -0
  107. package/dist/commands/setup.js +397 -0
  108. package/dist/commands/setup.js.map +1 -0
  109. package/dist/commands/test-init.d.ts +9 -0
  110. package/dist/commands/test-init.d.ts.map +1 -0
  111. package/dist/commands/test-init.js +222 -0
  112. package/dist/commands/test-init.js.map +1 -0
  113. package/dist/commands/test.d.ts +25 -0
  114. package/dist/commands/test.d.ts.map +1 -0
  115. package/dist/commands/test.js +217 -0
  116. package/dist/commands/test.js.map +1 -0
  117. package/dist/commands/vp.d.ts +7 -0
  118. package/dist/commands/vp.d.ts.map +1 -0
  119. package/dist/commands/vp.js +571 -0
  120. package/dist/commands/vp.js.map +1 -0
  121. package/dist/commands/watch.d.ts +76 -0
  122. package/dist/commands/watch.d.ts.map +1 -0
  123. package/dist/commands/watch.js +613 -0
  124. package/dist/commands/watch.js.map +1 -0
  125. package/dist/commands/worktree.d.ts +63 -0
  126. package/dist/commands/worktree.d.ts.map +1 -0
  127. package/dist/commands/worktree.js +774 -0
  128. package/dist/commands/worktree.js.map +1 -0
  129. package/dist/context/context-manager.d.ts +155 -0
  130. package/dist/context/context-manager.d.ts.map +1 -0
  131. package/dist/context/context-manager.js +383 -0
  132. package/dist/context/context-manager.js.map +1 -0
  133. package/dist/context/index.d.ts +3 -0
  134. package/dist/context/index.d.ts.map +1 -0
  135. package/dist/context/index.js +6 -0
  136. package/dist/context/index.js.map +1 -0
  137. package/dist/context/session-manager.d.ts +207 -0
  138. package/dist/context/session-manager.d.ts.map +1 -0
  139. package/dist/context/session-manager.js +686 -0
  140. package/dist/context/session-manager.js.map +1 -0
  141. package/dist/index.d.ts +8 -0
  142. package/dist/index.d.ts.map +1 -0
  143. package/dist/index.js +51 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/interactive/interactive-mode.d.ts +76 -0
  146. package/dist/interactive/interactive-mode.d.ts.map +1 -0
  147. package/dist/interactive/interactive-mode.js +732 -0
  148. package/dist/interactive/interactive-mode.js.map +1 -0
  149. package/dist/nlp/command-mapper.d.ts +174 -0
  150. package/dist/nlp/command-mapper.d.ts.map +1 -0
  151. package/dist/nlp/command-mapper.js +624 -0
  152. package/dist/nlp/command-mapper.js.map +1 -0
  153. package/dist/nlp/command-parser.d.ts +106 -0
  154. package/dist/nlp/command-parser.d.ts.map +1 -0
  155. package/dist/nlp/command-parser.js +417 -0
  156. package/dist/nlp/command-parser.js.map +1 -0
  157. package/dist/nlp/index.d.ts +5 -0
  158. package/dist/nlp/index.d.ts.map +1 -0
  159. package/dist/nlp/index.js +8 -0
  160. package/dist/nlp/index.js.map +1 -0
  161. package/dist/nlp/intent-classifier.d.ts +59 -0
  162. package/dist/nlp/intent-classifier.d.ts.map +1 -0
  163. package/dist/nlp/intent-classifier.js +384 -0
  164. package/dist/nlp/intent-classifier.js.map +1 -0
  165. package/dist/nlp/intent-parser.d.ts +152 -0
  166. package/dist/nlp/intent-parser.d.ts.map +1 -0
  167. package/dist/nlp/intent-parser.js +744 -0
  168. package/dist/nlp/intent-parser.js.map +1 -0
  169. package/dist/plugins/plugin-manager.d.ts +120 -0
  170. package/dist/plugins/plugin-manager.d.ts.map +1 -0
  171. package/dist/plugins/plugin-manager.js +595 -0
  172. package/dist/plugins/plugin-manager.js.map +1 -0
  173. package/dist/types/index.d.ts +224 -0
  174. package/dist/types/index.d.ts.map +1 -0
  175. package/dist/types/index.js +3 -0
  176. package/dist/types/index.js.map +1 -0
  177. package/dist/utils/backup-rollback-manager.d.ts +72 -0
  178. package/dist/utils/backup-rollback-manager.d.ts.map +1 -0
  179. package/dist/utils/backup-rollback-manager.js +289 -0
  180. package/dist/utils/backup-rollback-manager.js.map +1 -0
  181. package/dist/utils/claude-config-installer.d.ts +94 -0
  182. package/dist/utils/claude-config-installer.d.ts.map +1 -0
  183. package/dist/utils/claude-config-installer.js +628 -0
  184. package/dist/utils/claude-config-installer.js.map +1 -0
  185. package/dist/utils/config-manager.d.ts +73 -0
  186. package/dist/utils/config-manager.d.ts.map +1 -0
  187. package/dist/utils/config-manager.js +339 -0
  188. package/dist/utils/config-manager.js.map +1 -0
  189. package/dist/utils/error-handler.d.ts +46 -0
  190. package/dist/utils/error-handler.d.ts.map +1 -0
  191. package/dist/utils/error-handler.js +169 -0
  192. package/dist/utils/error-handler.js.map +1 -0
  193. package/dist/utils/logger.d.ts +25 -0
  194. package/dist/utils/logger.d.ts.map +1 -0
  195. package/dist/utils/logger.js +105 -0
  196. package/dist/utils/logger.js.map +1 -0
  197. package/package.json +23 -4
  198. package/src/ai/ai-service.ts +22 -19
  199. package/src/ai/claude-client.ts +20 -16
  200. package/src/ai/conversation-manager.ts +37 -30
  201. package/src/cli.ts +42 -13
  202. package/src/commands/ai.ts +59 -57
  203. package/src/commands/alignment.ts +1212 -0
  204. package/src/commands/analyze-optimized.ts +70 -62
  205. package/src/commands/analyze.ts +22 -20
  206. package/src/commands/batch.ts +41 -38
  207. package/src/commands/chat.ts +37 -34
  208. package/src/commands/claude-init.ts +38 -30
  209. package/src/commands/claude-setup.ts +692 -97
  210. package/src/commands/computer-setup-commands.ts +45 -39
  211. package/src/commands/computer-setup.ts +474 -4
  212. package/src/commands/create-command.ts +7 -7
  213. package/src/commands/create.ts +36 -33
  214. package/src/commands/dashboard.ts +33 -28
  215. package/src/commands/govern.ts +34 -29
  216. package/src/commands/governance.ts +1005 -0
  217. package/src/commands/guardian.ts +887 -0
  218. package/src/commands/init.ts +112 -22
  219. package/src/commands/performance-optimizer.ts +48 -42
  220. package/src/commands/plugins.ts +35 -32
  221. package/src/commands/project-update.ts +1053 -0
  222. package/src/commands/rag.ts +904 -0
  223. package/src/commands/session.ts +631 -0
  224. package/src/commands/setup.ts +35 -31
  225. package/src/commands/test-init.ts +6 -5
  226. package/src/commands/test.ts +7 -6
  227. package/src/commands/vp.ts +762 -0
  228. package/src/commands/watch.ts +44 -33
  229. package/src/commands/worktree.ts +1057 -0
  230. package/src/context/context-manager.ts +15 -12
  231. package/src/context/session-manager.ts +51 -40
  232. package/src/index.ts +7 -6
  233. package/src/interactive/interactive-mode.ts +25 -18
  234. package/src/lib/conflict-resolution.ts +28 -0
  235. package/src/lib/merge-strategy.ts +28 -0
  236. package/src/lib/safety-mechanisms.ts +47 -0
  237. package/src/lib/state-detection.ts +28 -0
  238. package/src/nlp/command-mapper.ts +35 -30
  239. package/src/nlp/command-parser.ts +20 -17
  240. package/src/nlp/intent-classifier.ts +7 -7
  241. package/src/nlp/intent-parser.ts +61 -49
  242. package/src/plugins/plugin-manager.ts +27 -23
  243. package/src/types/index.ts +1 -1
  244. package/src/types/modules.d.ts +1 -0
  245. package/src/utils/backup-rollback-manager.ts +13 -11
  246. package/src/utils/claude-config-installer.ts +18 -16
  247. package/src/utils/config-manager.ts +12 -9
  248. package/src/utils/error-handler.ts +5 -3
  249. package/src/utils/logger.ts +35 -12
@@ -3,11 +3,13 @@
3
3
  * Enhanced CLI command for large-scale codebase analysis
4
4
  */
5
5
 
6
- import { Command } from 'commander';
6
+ import * as path from 'path';
7
+
7
8
  import chalk from 'chalk';
8
- import ora from 'ora';
9
+ import { Command } from 'commander';
9
10
  import * as fs from 'fs-extra';
10
- import * as path from 'path';
11
+ import ora from 'ora';
12
+
11
13
 
12
14
  // Use analysis-engine modules for testing
13
15
  // Temporarily using inline implementation for CodeAnalyzer
@@ -158,24 +160,24 @@ export function createOptimizedAnalyzeCommand(): Command {
158
160
  const command = new Command('analyze-optimized')
159
161
  .alias('ao')
160
162
  .description(
161
- 'Run optimized analysis with memory management and high concurrency'
163
+ 'Run optimized analysis with memory management and high concurrency',
162
164
  )
163
165
  .argument('<directory>', 'Directory to analyze')
164
166
  .option(
165
167
  '-o, --output <path>',
166
168
  'Output directory for results',
167
- './wundr-analysis'
169
+ './wundr-analysis',
168
170
  )
169
171
  .option(
170
172
  '-f, --format <format>',
171
173
  'Output format (json, html, markdown, all)',
172
- 'json'
174
+ 'json',
173
175
  )
174
176
  .option('-v, --verbose', 'Verbose output with detailed progress', false)
175
177
  .option(
176
178
  '--max-memory <size>',
177
179
  'Maximum memory usage (e.g., 250MB, 1GB)',
178
- '250MB'
180
+ '250MB',
179
181
  )
180
182
  .option('--max-workers <count>', 'Maximum number of workers', '32')
181
183
  .option('--enable-streaming', 'Enable streaming for large codebases', true)
@@ -185,7 +187,7 @@ export function createOptimizedAnalyzeCommand(): Command {
185
187
  .option(
186
188
  '--cache-enabled',
187
189
  'Enable caching for faster repeated analysis',
188
- true
190
+ true,
189
191
  )
190
192
  .option('--include <patterns...>', 'File patterns to include', [
191
193
  '**/*.{ts,tsx,js,jsx}',
@@ -206,7 +208,7 @@ export function createOptimizedAnalyzeCommand(): Command {
206
208
  */
207
209
  async function runOptimizedAnalysis(
208
210
  directory: string,
209
- options: OptimizedAnalysisOptions
211
+ options: OptimizedAnalysisOptions,
210
212
  ): Promise<void> {
211
213
  const startTime = Date.now();
212
214
  const spinner = ora('Initializing optimized analysis...').start();
@@ -251,8 +253,8 @@ async function runOptimizedAnalysis(
251
253
  if (options.verbose) {
252
254
  spinner.warn(
253
255
  color(
254
- `Memory Alert: ${alert.type} - ${Math.round(alert.current / 1024 / 1024)}MB`
255
- )
256
+ `Memory Alert: ${alert.type} - ${Math.round(alert.current / 1024 / 1024)}MB`,
257
+ ),
256
258
  );
257
259
  }
258
260
  });
@@ -260,8 +262,8 @@ async function runOptimizedAnalysis(
260
262
  memoryMonitor.on('memory-leak-detected', (analysis: any) => {
261
263
  spinner.warn(
262
264
  chalk.red(
263
- `Memory leak detected! Growth rate: ${Math.round(analysis.growthRate / 1024)}KB/s`
264
- )
265
+ `Memory leak detected! Growth rate: ${Math.round(analysis.growthRate / 1024)}KB/s`,
266
+ ),
265
267
  );
266
268
  });
267
269
 
@@ -298,8 +300,8 @@ async function runOptimizedAnalysis(
298
300
  analysisService.on('memory-leak-warning', (warning: any) => {
299
301
  spinner.warn(
300
302
  chalk.yellow(
301
- `Memory Warning: ${warning.severity} - Growth: ${Math.round(warning.growthRate / 1024)}KB/s`
302
- )
303
+ `Memory Warning: ${warning.severity} - Growth: ${Math.round(warning.growthRate / 1024)}KB/s`,
304
+ ),
303
305
  );
304
306
  });
305
307
  }
@@ -327,27 +329,27 @@ async function runOptimizedAnalysis(
327
329
  console.log(chalk.cyan('šŸ“Š Performance Summary:'));
328
330
  console.log(chalk.gray(` Duration: ${formatDuration(duration)}`));
329
331
  console.log(
330
- chalk.gray(` Files analyzed: ${result.data?.summary.totalFiles || 0}`)
332
+ chalk.gray(` Files analyzed: ${result.data?.summary.totalFiles || 0}`),
331
333
  );
332
334
  console.log(
333
335
  chalk.gray(
334
- ` Entities found: ${result.data?.summary.totalEntities || 0}`
335
- )
336
+ ` Entities found: ${result.data?.summary.totalEntities || 0}`,
337
+ ),
336
338
  );
337
339
  console.log(
338
340
  chalk.gray(
339
- ` Peak memory: ${formatFileSize(memoryMetrics.peak.heapUsed)}`
340
- )
341
+ ` Peak memory: ${formatFileSize(memoryMetrics.peak.heapUsed)}`,
342
+ ),
341
343
  );
342
344
  console.log(
343
345
  chalk.gray(
344
- ` Average memory: ${formatFileSize(memoryMetrics.average.heapUsed)}`
345
- )
346
+ ` Average memory: ${formatFileSize(memoryMetrics.average.heapUsed)}`,
347
+ ),
346
348
  );
347
349
  console.log(
348
350
  chalk.gray(
349
- ` Processing rate: ${Math.round((result.data?.summary.totalFiles || 0) / (duration / 1000))} files/sec`
350
- )
351
+ ` Processing rate: ${Math.round((result.data?.summary.totalFiles || 0) / (duration / 1000))} files/sec`,
352
+ ),
351
353
  );
352
354
 
353
355
  // Analysis results
@@ -355,49 +357,49 @@ async function runOptimizedAnalysis(
355
357
  console.log(chalk.cyan('\nšŸ” Analysis Results:'));
356
358
  console.log(
357
359
  chalk.gray(
358
- ` Duplicate clusters: ${result.data.summary.duplicateClusters}`
359
- )
360
+ ` Duplicate clusters: ${result.data.summary.duplicateClusters}`,
361
+ ),
360
362
  );
361
363
  console.log(
362
364
  chalk.gray(
363
- ` Circular dependencies: ${result.data.summary.circularDependencies}`
364
- )
365
+ ` Circular dependencies: ${result.data.summary.circularDependencies}`,
366
+ ),
365
367
  );
366
368
  console.log(
367
- chalk.gray(` Code smells: ${result.data.summary.codeSmells}`)
369
+ chalk.gray(` Code smells: ${result.data.summary.codeSmells}`),
368
370
  );
369
371
  console.log(
370
372
  chalk.gray(
371
- ` Technical debt score: ${result.data.summary.technicalDebt}/100`
372
- )
373
+ ` Technical debt score: ${result.data.summary.technicalDebt}/100`,
374
+ ),
373
375
  );
374
376
  }
375
377
 
376
378
  // Memory efficiency
377
379
  const memoryEfficiency = calculateMemoryEfficiency(
378
380
  result.data?.summary.totalFiles || 0,
379
- memoryMetrics.peak.heapUsed
381
+ memoryMetrics.peak.heapUsed,
380
382
  );
381
383
  console.log(chalk.cyan('\nšŸ’¾ Memory Efficiency:'));
382
384
  console.log(
383
- chalk.gray(` Efficiency score: ${memoryEfficiency.toFixed(1)}%`)
385
+ chalk.gray(` Efficiency score: ${memoryEfficiency.toFixed(1)}%`),
384
386
  );
385
387
  console.log(
386
388
  chalk.gray(
387
- ` Memory per file: ${Math.round(memoryMetrics.average.heapUsed / Math.max(1, result.data?.summary.totalFiles || 1) / 1024)}KB`
388
- )
389
+ ` Memory per file: ${Math.round(memoryMetrics.average.heapUsed / Math.max(1, result.data?.summary.totalFiles || 1) / 1024)}KB`,
390
+ ),
389
391
  );
390
392
 
391
393
  // Leak analysis
392
394
  if (memoryMetrics.leakAnalysis.leakDetected) {
393
395
  console.log(chalk.red('\nāš ļø Memory Leak Detected:'));
394
396
  console.log(
395
- chalk.gray(` Severity: ${memoryMetrics.leakAnalysis.severity}`)
397
+ chalk.gray(` Severity: ${memoryMetrics.leakAnalysis.severity}`),
396
398
  );
397
399
  console.log(
398
400
  chalk.gray(
399
- ` Growth rate: ${Math.round(memoryMetrics.leakAnalysis.growthRate / 1024)}KB/s`
400
- )
401
+ ` Growth rate: ${Math.round(memoryMetrics.leakAnalysis.growthRate / 1024)}KB/s`,
402
+ ),
401
403
  );
402
404
  }
403
405
 
@@ -438,18 +440,18 @@ async function runOptimizedAnalysis(
438
440
  console.log(chalk.cyan('⚔ Benchmark Results:'));
439
441
  console.log(
440
442
  chalk.gray(
441
- ` Speedup: ${mainResult.results.improvement.speedup.toFixed(1)}x`
442
- )
443
+ ` Speedup: ${mainResult.results.improvement.speedup.toFixed(1)}x`,
444
+ ),
443
445
  );
444
446
  console.log(
445
447
  chalk.gray(
446
- ` Memory reduction: ${mainResult.results.improvement.memoryReduction.toFixed(1)}%`
447
- )
448
+ ` Memory reduction: ${mainResult.results.improvement.memoryReduction.toFixed(1)}%`,
449
+ ),
448
450
  );
449
451
  console.log(
450
452
  chalk.gray(
451
- ` Throughput increase: ${mainResult.results.improvement.throughputIncrease.toFixed(1)}%`
452
- )
453
+ ` Throughput increase: ${mainResult.results.improvement.throughputIncrease.toFixed(1)}%`,
454
+ ),
453
455
  );
454
456
  }
455
457
 
@@ -461,7 +463,7 @@ async function runOptimizedAnalysis(
461
463
  spinner.fail('Analysis failed');
462
464
  console.error(
463
465
  chalk.red('\nāŒ Error:'),
464
- error instanceof Error ? error.message : String(error)
466
+ error instanceof Error ? error.message : String(error),
465
467
  );
466
468
 
467
469
  if (options.verbose && error instanceof Error) {
@@ -502,9 +504,15 @@ function parseMemoryLimit(memoryStr: string): number {
502
504
  * Format duration in milliseconds to human-readable string
503
505
  */
504
506
  function formatDuration(ms: number): string {
505
- if (ms < 1000) return `${ms}ms`;
506
- if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
507
- if (ms < 3600000) return `${(ms / 60000).toFixed(1)}m`;
507
+ if (ms < 1000) {
508
+ return `${ms}ms`;
509
+ }
510
+ if (ms < 60000) {
511
+ return `${(ms / 1000).toFixed(1)}s`;
512
+ }
513
+ if (ms < 3600000) {
514
+ return `${(ms / 60000).toFixed(1)}m`;
515
+ }
508
516
  return `${(ms / 3600000).toFixed(1)}h`;
509
517
  }
510
518
 
@@ -529,12 +537,12 @@ function formatFileSize(bytes: number): string {
529
537
  */
530
538
  function calculateMemoryEfficiency(
531
539
  fileCount: number,
532
- memoryUsed: number
540
+ memoryUsed: number,
533
541
  ): number {
534
542
  const expectedMemory = fileCount * 50 * 1024; // 50KB per file baseline
535
543
  const efficiency = Math.max(
536
544
  0,
537
- 100 - ((memoryUsed - expectedMemory) / expectedMemory) * 100
545
+ 100 - ((memoryUsed - expectedMemory) / expectedMemory) * 100,
538
546
  );
539
547
  return Math.min(100, efficiency);
540
548
  }
@@ -546,12 +554,12 @@ export function createBenchmarkCommand(): Command {
546
554
  const command = new Command('benchmark')
547
555
  .alias('bench')
548
556
  .description(
549
- 'Run performance benchmarks for memory and concurrency optimizations'
557
+ 'Run performance benchmarks for memory and concurrency optimizations',
550
558
  )
551
559
  .option(
552
560
  '-o, --output <path>',
553
561
  'Output directory for benchmark results',
554
- './benchmark-results'
562
+ './benchmark-results',
555
563
  )
556
564
  .option('--iterations <count>', 'Number of benchmark iterations', '3')
557
565
  .option('--memory-limit <size>', 'Memory limit for testing', '500MB')
@@ -600,41 +608,41 @@ async function runBenchmarks(options: any): Promise<void> {
600
608
  const avgSpeedup =
601
609
  results.reduce(
602
610
  (sum: any, r: any) => sum + r.results.improvement.speedup,
603
- 0
611
+ 0,
604
612
  ) / results.length;
605
613
  const avgMemoryReduction =
606
614
  results.reduce(
607
615
  (sum: any, r: any) => sum + r.results.improvement.memoryReduction,
608
- 0
616
+ 0,
609
617
  ) / results.length;
610
618
  const avgThroughputIncrease =
611
619
  results.reduce(
612
620
  (sum: any, r: any) => sum + r.results.improvement.throughputIncrease,
613
- 0
621
+ 0,
614
622
  ) / results.length;
615
623
 
616
624
  console.log(chalk.cyan(`šŸš€ Average Speedup: ${avgSpeedup.toFixed(1)}x`));
617
625
  console.log(
618
626
  chalk.cyan(
619
- `šŸ’¾ Average Memory Reduction: ${avgMemoryReduction.toFixed(1)}%`
620
- )
627
+ `šŸ’¾ Average Memory Reduction: ${avgMemoryReduction.toFixed(1)}%`,
628
+ ),
621
629
  );
622
630
  console.log(
623
631
  chalk.cyan(
624
- `šŸ“Š Average Throughput Increase: ${avgThroughputIncrease.toFixed(1)}%`
625
- )
632
+ `šŸ“Š Average Throughput Increase: ${avgThroughputIncrease.toFixed(1)}%`,
633
+ ),
626
634
  );
627
635
 
628
636
  console.log(
629
637
  chalk.green(
630
- `\nšŸ“ Results saved to: ${options.output || './benchmark-results'}\n`
631
- )
638
+ `\nšŸ“ Results saved to: ${options.output || './benchmark-results'}\n`,
639
+ ),
632
640
  );
633
641
  } catch (error) {
634
642
  spinner.fail('Benchmarks failed');
635
643
  console.error(
636
644
  chalk.red('\nāŒ Error:'),
637
- error instanceof Error ? error.message : String(error)
645
+ error instanceof Error ? error.message : String(error),
638
646
  );
639
647
  process.exit(1);
640
648
  }
@@ -1,12 +1,14 @@
1
- import { Command } from 'commander';
1
+ import chalk from 'chalk';
2
2
  import fs from 'fs-extra';
3
+
3
4
  // import path from 'path'; // Unused import
4
- import chalk from 'chalk';
5
- import { ConfigManager } from '../utils/config-manager';
6
- import { PluginManager } from '../plugins/plugin-manager';
7
- import { logger } from '../utils/logger';
8
5
  import { errorHandler } from '../utils/error-handler';
9
- import { AnalysisResult, Finding } from '../types';
6
+ import { logger } from '../utils/logger';
7
+
8
+ import type { PluginManager } from '../plugins/plugin-manager';
9
+ import type { AnalysisResult, Finding } from '../types';
10
+ import type { ConfigManager } from '../utils/config-manager';
11
+ import type { Command } from 'commander';
10
12
 
11
13
  /**
12
14
  * Analyze commands for code analysis and dependency management
@@ -15,7 +17,7 @@ export class AnalyzeCommands {
15
17
  constructor(
16
18
  private program: Command,
17
19
  private _configManager: ConfigManager,
18
- private _pluginManager: PluginManager
20
+ private _pluginManager: PluginManager,
19
21
  ) {
20
22
  this.registerCommands();
21
23
  }
@@ -37,7 +39,7 @@ export class AnalyzeCommands {
37
39
  .option(
38
40
  '--format <format>',
39
41
  'output format (json, table, graph)',
40
- 'table'
42
+ 'table',
41
43
  )
42
44
  .action(async options => {
43
45
  await this.analyzeDependencies(options);
@@ -148,7 +150,7 @@ export class AnalyzeCommands {
148
150
  'WUNDR_ANALYZE_DEPS_FAILED',
149
151
  'Failed to analyze dependencies',
150
152
  { options },
151
- true
153
+ true,
152
154
  );
153
155
  }
154
156
  }
@@ -198,7 +200,7 @@ export class AnalyzeCommands {
198
200
  'WUNDR_ANALYZE_QUALITY_FAILED',
199
201
  'Failed to analyze code quality',
200
202
  { options },
201
- true
203
+ true,
202
204
  );
203
205
  }
204
206
  }
@@ -243,7 +245,7 @@ export class AnalyzeCommands {
243
245
  'WUNDR_ANALYZE_PERF_FAILED',
244
246
  'Failed to analyze performance',
245
247
  { options },
246
- true
248
+ true,
247
249
  );
248
250
  }
249
251
  }
@@ -287,7 +289,7 @@ export class AnalyzeCommands {
287
289
  'WUNDR_ANALYZE_ARCH_FAILED',
288
290
  'Failed to analyze architecture',
289
291
  { options },
290
- true
292
+ true,
291
293
  );
292
294
  }
293
295
  }
@@ -329,7 +331,7 @@ export class AnalyzeCommands {
329
331
  'WUNDR_ANALYZE_ALL_FAILED',
330
332
  'Failed to run comprehensive analysis',
331
333
  { options },
332
- true
334
+ true,
333
335
  );
334
336
  }
335
337
  }
@@ -363,7 +365,7 @@ export class AnalyzeCommands {
363
365
  'WUNDR_SCAN_FAILED',
364
366
  'Failed to scan for issues',
365
367
  { scanPath, options },
366
- true
368
+ true,
367
369
  );
368
370
  }
369
371
  }
@@ -483,7 +485,7 @@ export class AnalyzeCommands {
483
485
 
484
486
  private async performDirectoryScan(
485
487
  scanPath: string,
486
- options: any
488
+ options: any,
487
489
  ): Promise<Finding[]> {
488
490
  // Implementation for directory scanning
489
491
  return [];
@@ -508,7 +510,7 @@ export class AnalyzeCommands {
508
510
  */
509
511
  private async outputResults(
510
512
  results: AnalysisResult,
511
- format: string
513
+ format: string,
512
514
  ): Promise<void> {
513
515
  switch (format) {
514
516
  case 'json':
@@ -535,7 +537,7 @@ export class AnalyzeCommands {
535
537
  Line: f.line || 'N/A',
536
538
  Description: f.description,
537
539
  Fixable: f.fixable ? 'āœ“' : 'āœ—',
538
- }))
540
+ })),
539
541
  );
540
542
  }
541
543
 
@@ -548,7 +550,7 @@ export class AnalyzeCommands {
548
550
  console.log(chalk.green('\nRecommendations:'));
549
551
  results.recommendations.forEach((rec, i) => {
550
552
  console.log(
551
- `${i + 1}. ${rec.title} (${rec.impact} impact, ${rec.effort} effort)`
553
+ `${i + 1}. ${rec.title} (${rec.impact} impact, ${rec.effort} effort)`,
552
554
  );
553
555
  });
554
556
  }
@@ -560,7 +562,7 @@ export class AnalyzeCommands {
560
562
  }
561
563
 
562
564
  private async generateComprehensiveReport(
563
- results: AnalysisResult[]
565
+ results: AnalysisResult[],
564
566
  ): Promise<void> {
565
567
  // Implementation for comprehensive report generation
566
568
  logger.info('Generating comprehensive report...');
@@ -568,7 +570,7 @@ export class AnalyzeCommands {
568
570
 
569
571
  private async exportResults(
570
572
  results: AnalysisResult[],
571
- exportPath: string
573
+ exportPath: string,
572
574
  ): Promise<void> {
573
575
  await fs.writeJson(exportPath, results, { spaces: 2 });
574
576
  logger.success(`Results exported to ${exportPath}`);