@wundr.io/cli 1.0.1 → 1.0.4

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 +799 -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 +600 -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 +6 -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 +46 -17
  202. package/src/commands/ai.ts +196 -88
  203. package/src/commands/alignment.ts +1212 -0
  204. package/src/commands/analyze-optimized.ts +394 -89
  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 +490 -20
  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
@@ -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}`);
@@ -1,14 +1,17 @@
1
- import { Command } from 'commander';
2
- import fs from 'fs-extra';
3
1
  import path from 'path';
2
+
4
3
  import chalk from 'chalk';
5
- import YAML from 'yaml';
4
+ import fs from 'fs-extra';
6
5
  import { Listr } from 'listr2';
7
- import { ConfigManager } from '../utils/config-manager';
8
- import { PluginManager } from '../plugins/plugin-manager';
9
- import { logger } from '../utils/logger';
6
+ import YAML from 'yaml';
7
+
10
8
  import { errorHandler } from '../utils/error-handler';
11
- import { BatchJob, BatchCommand } from '../types';
9
+ import { logger } from '../utils/logger';
10
+
11
+ import type { PluginManager } from '../plugins/plugin-manager';
12
+ import type { BatchJob, BatchCommand } from '../types';
13
+ import type { ConfigManager } from '../utils/config-manager';
14
+ import type { Command } from 'commander';
12
15
 
13
16
  /**
14
17
  * Batch commands for YAML automation and batch processing
@@ -19,7 +22,7 @@ export class BatchCommands {
19
22
  constructor(
20
23
  private program: Command,
21
24
  private configManager: ConfigManager,
22
- private pluginManager: PluginManager
25
+ private pluginManager: PluginManager,
23
26
  ) {
24
27
  this.registerCommands();
25
28
  }
@@ -38,7 +41,7 @@ export class BatchCommands {
38
41
  .option('--continue-on-error', 'continue execution on command failures')
39
42
  .option(
40
43
  '--vars <vars>',
41
- 'variables to pass to batch job (JSON or key=value)'
44
+ 'variables to pass to batch job (JSON or key=value)',
42
45
  )
43
46
  .option('--timeout <ms>', 'global timeout for batch job')
44
47
  .action(async (file, options) => {
@@ -108,7 +111,7 @@ export class BatchCommands {
108
111
  .option(
109
112
  '--format <format>',
110
113
  'export format (json, shell, dockerfile)',
111
- 'json'
114
+ 'json',
112
115
  )
113
116
  .option('--output <path>', 'output file path')
114
117
  .action(async (file, options) => {
@@ -121,7 +124,7 @@ export class BatchCommands {
121
124
  .description('import batch job from different formats')
122
125
  .option(
123
126
  '--format <format>',
124
- 'source format (json, shell, package-scripts)'
127
+ 'source format (json, shell, package-scripts)',
125
128
  )
126
129
  .option('--name <name>', 'batch job name')
127
130
  .action(async (file, options) => {
@@ -186,7 +189,7 @@ export class BatchCommands {
186
189
  'WUNDR_BATCH_RUN_FAILED',
187
190
  'Failed to run batch job',
188
191
  { file, options },
189
- true
192
+ true,
190
193
  );
191
194
  }
192
195
  }
@@ -212,7 +215,7 @@ export class BatchCommands {
212
215
  process.cwd(),
213
216
  '.wundr',
214
217
  'batch',
215
- `${name}.yaml`
218
+ `${name}.yaml`,
216
219
  );
217
220
  await fs.ensureDir(path.dirname(jobPath));
218
221
  await fs.writeFile(jobPath, YAML.stringify(job));
@@ -223,7 +226,7 @@ export class BatchCommands {
223
226
  'WUNDR_BATCH_CREATE_FAILED',
224
227
  'Failed to create batch job',
225
228
  { name, options },
226
- true
229
+ true,
227
230
  );
228
231
  }
229
232
  }
@@ -243,7 +246,7 @@ export class BatchCommands {
243
246
 
244
247
  const files = await fs.readdir(batchDir);
245
248
  const yamlFiles = files.filter(
246
- f => f.endsWith('.yaml') || f.endsWith('.yml')
249
+ f => f.endsWith('.yaml') || f.endsWith('.yml'),
247
250
  );
248
251
 
249
252
  if (yamlFiles.length === 0) {
@@ -285,7 +288,7 @@ export class BatchCommands {
285
288
  'WUNDR_BATCH_LIST_FAILED',
286
289
  'Failed to list batch jobs',
287
290
  { options },
288
- true
291
+ true,
289
292
  );
290
293
  }
291
294
  }
@@ -322,7 +325,7 @@ export class BatchCommands {
322
325
  'WUNDR_BATCH_VALIDATE_FAILED',
323
326
  'Failed to validate batch job',
324
327
  { file },
325
- true
328
+ true,
326
329
  );
327
330
  }
328
331
  }
@@ -349,7 +352,7 @@ export class BatchCommands {
349
352
  'WUNDR_BATCH_STOP_FAILED',
350
353
  'Failed to stop batch job',
351
354
  { jobId },
352
- true
355
+ true,
353
356
  );
354
357
  }
355
358
  }
@@ -384,7 +387,7 @@ export class BatchCommands {
384
387
  File: path.basename(job.file),
385
388
  Status: job.status,
386
389
  Duration: `${Date.now() - job.startTime}ms`,
387
- })
390
+ }),
388
391
  );
389
392
 
390
393
  console.table(jobData);
@@ -394,7 +397,7 @@ export class BatchCommands {
394
397
  'WUNDR_BATCH_STATUS_FAILED',
395
398
  'Failed to show job status',
396
399
  { jobId },
397
- true
400
+ true,
398
401
  );
399
402
  }
400
403
  }
@@ -428,7 +431,7 @@ export class BatchCommands {
428
431
  'WUNDR_BATCH_SCHEDULE_FAILED',
429
432
  'Failed to schedule batch job',
430
433
  { file, options },
431
- true
434
+ true,
432
435
  );
433
436
  }
434
437
  }
@@ -468,7 +471,7 @@ export class BatchCommands {
468
471
  'WUNDR_BATCH_EXPORT_FAILED',
469
472
  'Failed to export batch job',
470
473
  { file, options },
471
- true
474
+ true,
472
475
  );
473
476
  }
474
477
  }
@@ -501,7 +504,7 @@ export class BatchCommands {
501
504
  process.cwd(),
502
505
  '.wundr',
503
506
  'batch',
504
- `${jobName}.yaml`
507
+ `${jobName}.yaml`,
505
508
  );
506
509
 
507
510
  await fs.ensureDir(path.dirname(jobPath));
@@ -513,7 +516,7 @@ export class BatchCommands {
513
516
  'WUNDR_BATCH_IMPORT_FAILED',
514
517
  'Failed to import batch job',
515
518
  { file, options },
516
- true
519
+ true,
517
520
  );
518
521
  }
519
522
  }
@@ -539,7 +542,7 @@ export class BatchCommands {
539
542
  }
540
543
 
541
544
  private async validateJobStructure(
542
- job: BatchJob
545
+ job: BatchJob,
543
546
  ): Promise<{ valid: boolean; errors: string[] }> {
544
547
  const errors: string[] = [];
545
548
 
@@ -562,7 +565,7 @@ export class BatchCommands {
562
565
 
563
566
  private async processJobVariables(
564
567
  job: BatchJob,
565
- vars?: string
568
+ vars?: string,
566
569
  ): Promise<BatchJob> {
567
570
  let variables: Record<string, any> = {};
568
571
 
@@ -624,7 +627,7 @@ export class BatchCommands {
624
627
  private async executeBatchJob(
625
628
  job: BatchJob,
626
629
  _jobId: string,
627
- _options: any
630
+ _options: any,
628
631
  ): Promise<void> {
629
632
  const tasks = job.commands.map((cmd, _index) => ({
630
633
  title: cmd.command,
@@ -648,7 +651,7 @@ export class BatchCommands {
648
651
 
649
652
  private async executeCommand(
650
653
  cmd: BatchCommand,
651
- _options: any
654
+ _options: any,
652
655
  ): Promise<void> {
653
656
  // Check condition if specified
654
657
  if (cmd.condition && !(await this.evaluateCondition(cmd.condition))) {
@@ -798,13 +801,13 @@ export class BatchCommands {
798
801
 
799
802
  private async createJobFromTemplate(
800
803
  name: string,
801
- template: string
804
+ template: string,
802
805
  ): Promise<BatchJob> {
803
806
  // Load template and create job
804
807
  const templatePath = path.join(
805
808
  __dirname,
806
809
  '../../templates/batch',
807
- `${template}.yaml`
810
+ `${template}.yaml`,
808
811
  );
809
812
  if (await fs.pathExists(templatePath)) {
810
813
  const templateJob = await this.loadBatchJob(templatePath);
@@ -834,14 +837,14 @@ export class BatchCommands {
834
837
 
835
838
  private convertToDockerfile(job: BatchJob): string {
836
839
  let dockerfile = `# Generated from batch job: ${job.name}\n`;
837
- dockerfile += `FROM node:18-alpine\n\n`;
840
+ dockerfile += 'FROM node:18-alpine\n\n';
838
841
 
839
842
  if (job.description) {
840
843
  dockerfile += `# ${job.description}\n`;
841
844
  }
842
845
 
843
- dockerfile += `WORKDIR /app\n`;
844
- dockerfile += `COPY . .\n\n`;
846
+ dockerfile += 'WORKDIR /app\n';
847
+ dockerfile += 'COPY . .\n\n';
845
848
 
846
849
  job.commands.forEach(cmd => {
847
850
  dockerfile += `RUN ${cmd.command}\n`;
@@ -857,7 +860,7 @@ export class BatchCommands {
857
860
 
858
861
  private async importFromShell(
859
862
  file: string,
860
- name?: string
863
+ name?: string,
861
864
  ): Promise<BatchJob> {
862
865
  const content = await fs.readFile(file, 'utf8');
863
866
  const commands = content
@@ -874,7 +877,7 @@ export class BatchCommands {
874
877
 
875
878
  private async importFromPackageScripts(
876
879
  file: string,
877
- name?: string
880
+ name?: string,
878
881
  ): Promise<BatchJob> {
879
882
  const packageJson = await fs.readJson(file);
880
883
  const scripts = packageJson.scripts || {};
@@ -887,7 +890,7 @@ export class BatchCommands {
887
890
 
888
891
  return {
889
892
  name: name || 'package-scripts',
890
- description: `Imported from package.json scripts`,
893
+ description: 'Imported from package.json scripts',
891
894
  commands,
892
895
  };
893
896
  }
@@ -897,7 +900,7 @@ export class BatchCommands {
897
900
  if (await fs.pathExists(templatesDir)) {
898
901
  const templates = await fs.readdir(templatesDir);
899
902
  const yamlTemplates = templates.filter(
900
- t => t.endsWith('.yaml') || t.endsWith('.yml')
903
+ t => t.endsWith('.yaml') || t.endsWith('.yml'),
901
904
  );
902
905
 
903
906
  if (yamlTemplates.length > 0) {
@@ -921,7 +924,7 @@ export class BatchCommands {
921
924
  const templatePath = path.join(
922
925
  __dirname,
923
926
  '../../templates/batch',
924
- `${name}.yaml`
927
+ `${name}.yaml`,
925
928
  );
926
929
 
927
930
  await fs.ensureDir(path.dirname(templatePath));
@@ -1,13 +1,16 @@
1
- import { Command } from 'commander';
2
- import inquirer from 'inquirer';
3
- import fs from 'fs-extra';
4
1
  import path from 'path';
2
+
5
3
  import chalk from 'chalk';
6
- import { ConfigManager } from '../utils/config-manager';
7
- import { PluginManager } from '../plugins/plugin-manager';
8
- import { logger } from '../utils/logger';
4
+ import fs from 'fs-extra';
5
+ import inquirer from 'inquirer';
6
+
9
7
  import { errorHandler } from '../utils/error-handler';
10
- import { ChatSession, ChatMessage } from '../types';
8
+ import { logger } from '../utils/logger';
9
+
10
+ import type { PluginManager } from '../plugins/plugin-manager';
11
+ import type { ChatSession, ChatMessage } from '../types';
12
+ import type { ConfigManager } from '../utils/config-manager';
13
+ import type { Command } from 'commander';
11
14
 
12
15
  /**
13
16
  * Chat commands for natural language interface
@@ -18,7 +21,7 @@ export class ChatCommands {
18
21
  constructor(
19
22
  private program: Command,
20
23
  private configManager: ConfigManager,
21
- private pluginManager: PluginManager
24
+ private pluginManager: PluginManager,
22
25
  ) {
23
26
  this.registerCommands();
24
27
  }
@@ -38,7 +41,7 @@ export class ChatCommands {
38
41
  .option(
39
42
  '--persona <persona>',
40
43
  'AI persona (developer, architect, reviewer)',
41
- 'developer'
44
+ 'developer',
42
45
  )
43
46
  .option('--session-name <name>', 'custom session name')
44
47
  .action(async options => {
@@ -81,7 +84,7 @@ export class ChatCommands {
81
84
  .option(
82
85
  '--format <format>',
83
86
  'export format (json, markdown, txt)',
84
- 'markdown'
87
+ 'markdown',
85
88
  )
86
89
  .option('--output <path>', 'output file path')
87
90
  .action(async (sessionId, options) => {
@@ -130,7 +133,7 @@ export class ChatCommands {
130
133
  .option(
131
134
  '--action <action>',
132
135
  'action to perform (explain, review, improve)',
133
- 'explain'
136
+ 'explain',
134
137
  )
135
138
  .option('--model <model>', 'AI model to use')
136
139
  .action(async (file, options) => {
@@ -145,7 +148,7 @@ export class ChatCommands {
145
148
  .option(
146
149
  '--action <action>',
147
150
  'action to perform (explain, review, improve)',
148
- 'explain'
151
+ 'explain',
149
152
  )
150
153
  .action(async options => {
151
154
  await this.chatWithCode(options);
@@ -186,7 +189,7 @@ export class ChatCommands {
186
189
  console.log(chalk.gray(`Context: ${session.context}`));
187
190
  }
188
191
  console.log(
189
- chalk.gray('Type "exit" to end the session, "help" for commands\n')
192
+ chalk.gray('Type "exit" to end the session, "help" for commands\n'),
190
193
  );
191
194
 
192
195
  await this.runChatLoop(session);
@@ -195,7 +198,7 @@ export class ChatCommands {
195
198
  'WUNDR_CHAT_START_FAILED',
196
199
  'Failed to start chat session',
197
200
  { options },
198
- true
201
+ true,
199
202
  );
200
203
  }
201
204
  }
@@ -218,7 +221,7 @@ export class ChatCommands {
218
221
  console.log(chalk.gray(`Session ID: ${session.id}`));
219
222
  console.log(chalk.gray(`Messages: ${session.history.length}`));
220
223
  console.log(
221
- chalk.gray(`Last updated: ${session.updated.toLocaleString()}\n`)
224
+ chalk.gray(`Last updated: ${session.updated.toLocaleString()}\n`),
222
225
  );
223
226
 
224
227
  // Show recent messages
@@ -241,7 +244,7 @@ export class ChatCommands {
241
244
  'WUNDR_CHAT_RESUME_FAILED',
242
245
  'Failed to resume chat session',
243
246
  { sessionId },
244
- true
247
+ true,
245
248
  );
246
249
  }
247
250
  }
@@ -278,7 +281,7 @@ export class ChatCommands {
278
281
  'WUNDR_CHAT_LIST_FAILED',
279
282
  'Failed to list chat sessions',
280
283
  { options },
281
- true
284
+ true,
282
285
  );
283
286
  }
284
287
  }
@@ -288,7 +291,7 @@ export class ChatCommands {
288
291
  */
289
292
  private async askSingleQuestion(
290
293
  message: string,
291
- options: any
294
+ options: any,
292
295
  ): Promise<void> {
293
296
  try {
294
297
  logger.debug('Processing single question...');
@@ -323,7 +326,7 @@ export class ChatCommands {
323
326
  'WUNDR_CHAT_ASK_FAILED',
324
327
  'Failed to process question',
325
328
  { message, options },
326
- true
329
+ true,
327
330
  );
328
331
  }
329
332
  }
@@ -333,7 +336,7 @@ export class ChatCommands {
333
336
  */
334
337
  private async exportChatSession(
335
338
  sessionId: string,
336
- options: any
339
+ options: any,
337
340
  ): Promise<void> {
338
341
  try {
339
342
  logger.info(`Exporting chat session: ${sessionId}`);
@@ -369,7 +372,7 @@ export class ChatCommands {
369
372
  'WUNDR_CHAT_EXPORT_FAILED',
370
373
  'Failed to export chat session',
371
374
  { sessionId, options },
372
- true
375
+ true,
373
376
  );
374
377
  }
375
378
  }
@@ -410,7 +413,7 @@ export class ChatCommands {
410
413
  'WUNDR_CHAT_IMPORT_FAILED',
411
414
  'Failed to import chat session',
412
415
  { file, options },
413
- true
416
+ true,
414
417
  );
415
418
  }
416
419
  }
@@ -420,7 +423,7 @@ export class ChatCommands {
420
423
  */
421
424
  private async deleteChatSession(
422
425
  sessionId: string,
423
- options: any
426
+ options: any,
424
427
  ): Promise<void> {
425
428
  try {
426
429
  const session = await this.loadChatSession(sessionId);
@@ -453,7 +456,7 @@ export class ChatCommands {
453
456
  'WUNDR_CHAT_DELETE_FAILED',
454
457
  'Failed to delete chat session',
455
458
  { sessionId, options },
456
- true
459
+ true,
457
460
  );
458
461
  }
459
462
  }
@@ -487,7 +490,7 @@ export class ChatCommands {
487
490
  'WUNDR_CHAT_FILE_FAILED',
488
491
  'Failed to chat with file',
489
492
  { file, options },
490
- true
493
+ true,
491
494
  );
492
495
  }
493
496
  }
@@ -530,7 +533,7 @@ export class ChatCommands {
530
533
  'WUNDR_CHAT_CODE_FAILED',
531
534
  'Failed to chat with code',
532
535
  { options },
533
- true
536
+ true,
534
537
  );
535
538
  }
536
539
  }
@@ -582,7 +585,7 @@ export class ChatCommands {
582
585
  } catch (error) {
583
586
  logger.error('Chat error:', error);
584
587
  console.log(
585
- chalk.red('Sorry, there was an error processing your message.\n')
588
+ chalk.red('Sorry, there was an error processing your message.\n'),
586
589
  );
587
590
  }
588
591
  }
@@ -595,7 +598,7 @@ export class ChatCommands {
595
598
 
596
599
  private async sendMessage(
597
600
  session: ChatSession,
598
- message: string
601
+ message: string,
599
602
  ): Promise<string> {
600
603
  // Add user message to history
601
604
  const userMessage: ChatMessage = {
@@ -641,7 +644,7 @@ export class ChatCommands {
641
644
 
642
645
  private async handleChatCommand(
643
646
  session: ChatSession,
644
- command: string
647
+ command: string,
645
648
  ): Promise<void> {
646
649
  const [cmd, ...args] = command.slice(1).split(' ');
647
650
 
@@ -690,20 +693,20 @@ export class ChatCommands {
690
693
  process.cwd(),
691
694
  '.wundr',
692
695
  'chat',
693
- `${session.id}.json`
696
+ `${session.id}.json`,
694
697
  );
695
698
  await fs.ensureDir(path.dirname(sessionPath));
696
699
  await fs.writeJson(sessionPath, session, { spaces: 2 });
697
700
  }
698
701
 
699
702
  private async loadChatSession(
700
- sessionId: string
703
+ sessionId: string,
701
704
  ): Promise<ChatSession | null> {
702
705
  const sessionPath = path.join(
703
706
  process.cwd(),
704
707
  '.wundr',
705
708
  'chat',
706
- `${sessionId}.json`
709
+ `${sessionId}.json`,
707
710
  );
708
711
  if (await fs.pathExists(sessionPath)) {
709
712
  const data = await fs.readJson(sessionPath);
@@ -748,7 +751,7 @@ export class ChatCommands {
748
751
  process.cwd(),
749
752
  '.wundr',
750
753
  'chat',
751
- `${sessionId}.json`
754
+ `${sessionId}.json`,
752
755
  );
753
756
  if (await fs.pathExists(sessionPath)) {
754
757
  await fs.remove(sessionPath);
@@ -866,7 +869,7 @@ export class ChatCommands {
866
869
  Object.entries(variables).forEach(([key, value]) => {
867
870
  processedTemplate = processedTemplate.replace(
868
871
  `{{${key}}}`,
869
- String(value)
872
+ String(value),
870
873
  );
871
874
  });
872
875
  }