@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
@@ -0,0 +1,28 @@
1
+ /**
2
+ * State Detection - Stub implementation
3
+ * TODO: Implement full state detection system
4
+ */
5
+
6
+ export interface ProjectState {
7
+ type: string;
8
+ customizations: CustomizationInfo[];
9
+ dependencies: Record<string, string>;
10
+ healthScore?: number;
11
+ isWundrOutdated?: boolean;
12
+ recommendations?: string[];
13
+ wundrVersion?: string;
14
+ }
15
+
16
+ export interface CustomizationInfo {
17
+ file: string;
18
+ type: string;
19
+ description: string;
20
+ }
21
+
22
+ export async function detectProjectState(): Promise<ProjectState> {
23
+ throw new Error('State detection not yet implemented');
24
+ }
25
+
26
+ export function getStateSummary(_state: ProjectState): string {
27
+ return 'State detection not yet implemented';
28
+ }
@@ -1,7 +1,10 @@
1
+ import { spawn } from 'child_process';
1
2
  import { EventEmitter } from 'events';
2
- import { spawn, ChildProcess } from 'child_process';
3
+
3
4
  import { logger } from '../utils/logger';
4
- import { IntentResult } from './intent-parser';
5
+
6
+ import type { IntentResult } from './intent-parser';
7
+ import type { ChildProcess } from 'child_process';
5
8
 
6
9
  /**
7
10
  * Command execution result
@@ -135,7 +138,7 @@ export class CommandMapper extends EventEmitter {
135
138
  */
136
139
  async mapIntentToCommand(
137
140
  intentResult: IntentResult,
138
- context: ExecutionContext
141
+ context: ExecutionContext,
139
142
  ): Promise<{
140
143
  command: string;
141
144
  args: string[];
@@ -147,7 +150,7 @@ export class CommandMapper extends EventEmitter {
147
150
 
148
151
  if (!template) {
149
152
  throw new Error(
150
- `No command template found for intent: ${intentResult.intent}`
153
+ `No command template found for intent: ${intentResult.intent}`,
151
154
  );
152
155
  }
153
156
 
@@ -155,14 +158,14 @@ export class CommandMapper extends EventEmitter {
155
158
  const { command, args } = await this.buildCommand(
156
159
  template,
157
160
  intentResult.parameters || {},
158
- context
161
+ context,
159
162
  );
160
163
 
161
164
  // Validate command
162
165
  const validation = await this.validateCommand(
163
166
  template,
164
167
  intentResult.parameters || {},
165
- context
168
+ context,
166
169
  );
167
170
 
168
171
  this.emit('command_mapped', {
@@ -193,7 +196,7 @@ export class CommandMapper extends EventEmitter {
193
196
  streaming?: boolean;
194
197
  onOutput?: (output: string) => void;
195
198
  onError?: (error: string) => void;
196
- } = {}
199
+ } = {},
197
200
  ): Promise<CommandResult> {
198
201
  const startTime = Date.now();
199
202
  const executionId = `cmd_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
@@ -330,7 +333,7 @@ export class CommandMapper extends EventEmitter {
330
333
  if (this.runningCommands.has(executionId)) {
331
334
  childProcess.kill('SIGTERM');
332
335
  logger.warn(
333
- `Command timed out after ${this.config.timeout}ms: ${command}`
336
+ `Command timed out after ${this.config.timeout}ms: ${command}`,
334
337
  );
335
338
  }
336
339
  }, this.config.timeout);
@@ -349,7 +352,7 @@ export class CommandMapper extends EventEmitter {
349
352
  streaming?: boolean;
350
353
  onOutput?: (output: string) => void;
351
354
  onError?: (error: string) => void;
352
- } = {}
355
+ } = {},
353
356
  ): Promise<CommandResult> {
354
357
  // Map intent to command
355
358
  const mappedCommand = await this.mapIntentToCommand(intentResult, context);
@@ -357,7 +360,7 @@ export class CommandMapper extends EventEmitter {
357
360
  // Check validation
358
361
  if (!mappedCommand.validation.valid) {
359
362
  throw new Error(
360
- `Command validation failed: ${mappedCommand.validation.errors.join(', ')}`
363
+ `Command validation failed: ${mappedCommand.validation.errors.join(', ')}`,
361
364
  );
362
365
  }
363
366
 
@@ -370,7 +373,7 @@ export class CommandMapper extends EventEmitter {
370
373
  ) {
371
374
  const confirmed = await this.confirmExecution(
372
375
  mappedCommand,
373
- intentResult
376
+ intentResult,
374
377
  );
375
378
  if (!confirmed) {
376
379
  throw new Error('Command execution cancelled by user');
@@ -382,7 +385,7 @@ export class CommandMapper extends EventEmitter {
382
385
  mappedCommand.command,
383
386
  mappedCommand.args,
384
387
  context,
385
- options
388
+ options,
386
389
  );
387
390
  }
388
391
 
@@ -401,7 +404,7 @@ export class CommandMapper extends EventEmitter {
401
404
  async validateCommand(
402
405
  template: CommandTemplate,
403
406
  parameters: Record<string, any>,
404
- context: ExecutionContext
407
+ context: ExecutionContext,
405
408
  ): Promise<ValidationResult> {
406
409
  const result: ValidationResult = {
407
410
  valid: true,
@@ -421,7 +424,7 @@ export class CommandMapper extends EventEmitter {
421
424
  const isValid = await this.executeValidationRule(
422
425
  rule,
423
426
  parameters,
424
- context
427
+ context,
425
428
  );
426
429
 
427
430
  if (!isValid) {
@@ -434,7 +437,7 @@ export class CommandMapper extends EventEmitter {
434
437
  }
435
438
  } catch (error) {
436
439
  result.errors.push(
437
- `Validation error: ${error instanceof Error ? error.message : 'Unknown error'}`
440
+ `Validation error: ${error instanceof Error ? error.message : 'Unknown error'}`,
438
441
  );
439
442
  result.valid = false;
440
443
  }
@@ -444,7 +447,7 @@ export class CommandMapper extends EventEmitter {
444
447
  for (const mapping of template.parameterMapping) {
445
448
  if (mapping.required && !parameters[mapping.intentParam]) {
446
449
  result.errors.push(
447
- `Required parameter missing: ${mapping.intentParam}`
450
+ `Required parameter missing: ${mapping.intentParam}`,
448
451
  );
449
452
  result.valid = false;
450
453
  }
@@ -452,7 +455,7 @@ export class CommandMapper extends EventEmitter {
452
455
  if (parameters[mapping.intentParam] && mapping.validation) {
453
456
  if (!mapping.validation(parameters[mapping.intentParam])) {
454
457
  result.errors.push(
455
- `Invalid value for parameter: ${mapping.intentParam}`
458
+ `Invalid value for parameter: ${mapping.intentParam}`,
456
459
  );
457
460
  result.valid = false;
458
461
  }
@@ -482,7 +485,7 @@ export class CommandMapper extends EventEmitter {
482
485
  successOnly?: boolean;
483
486
  intent?: string;
484
487
  since?: Date;
485
- } = {}
488
+ } = {},
486
489
  ): CommandResult[] {
487
490
  let history = [...this.commandHistory];
488
491
 
@@ -490,7 +493,7 @@ export class CommandMapper extends EventEmitter {
490
493
  history = history.filter(
491
494
  cmd =>
492
495
  cmd.metadata?.['startTime'] &&
493
- new Date(cmd.metadata['startTime']) >= filters.since!
496
+ new Date(cmd.metadata['startTime']) >= filters.since!,
494
497
  );
495
498
  }
496
499
 
@@ -500,7 +503,7 @@ export class CommandMapper extends EventEmitter {
500
503
 
501
504
  if (filters.intent) {
502
505
  history = history.filter(
503
- cmd => cmd.metadata?.['intent'] === filters.intent
506
+ cmd => cmd.metadata?.['intent'] === filters.intent,
504
507
  );
505
508
  }
506
509
 
@@ -557,7 +560,7 @@ export class CommandMapper extends EventEmitter {
557
560
  */
558
561
  async previewCommand(
559
562
  intentResult: IntentResult,
560
- context: ExecutionContext
563
+ context: ExecutionContext,
561
564
  ): Promise<{
562
565
  command: string;
563
566
  explanation: string;
@@ -569,7 +572,7 @@ export class CommandMapper extends EventEmitter {
569
572
  const explanation = this.generateCommandExplanation(
570
573
  mappedCommand.command,
571
574
  mappedCommand.args,
572
- intentResult
575
+ intentResult,
573
576
  );
574
577
 
575
578
  return {
@@ -599,7 +602,7 @@ export class CommandMapper extends EventEmitter {
599
602
  commandFlag: '--focus',
600
603
  validation: (value: string) =>
601
604
  ['dependencies', 'quality', 'security', 'performance'].includes(
602
- value
605
+ value,
603
606
  ),
604
607
  },
605
608
  {
@@ -742,14 +745,14 @@ export class CommandMapper extends EventEmitter {
742
745
  ];
743
746
 
744
747
  defaultTemplates.forEach(template =>
745
- this.registerCommandTemplate(template)
748
+ this.registerCommandTemplate(template),
746
749
  );
747
750
  }
748
751
 
749
752
  private async buildCommand(
750
753
  template: CommandTemplate,
751
754
  parameters: Record<string, any>,
752
- context: ExecutionContext
755
+ context: ExecutionContext,
753
756
  ): Promise<{ command: string; args: string[] }> {
754
757
  const commandParts = template.commandTemplate.split(' ');
755
758
  const baseCommand = commandParts[0] || '';
@@ -793,7 +796,7 @@ export class CommandMapper extends EventEmitter {
793
796
  private async executeValidationRule(
794
797
  rule: ValidationRule,
795
798
  parameters: Record<string, any>,
796
- context: ExecutionContext
799
+ context: ExecutionContext,
797
800
  ): Promise<boolean> {
798
801
  switch (rule.type) {
799
802
  case 'parameter':
@@ -807,7 +810,9 @@ export class CommandMapper extends EventEmitter {
807
810
  case 'directory_exists':
808
811
  const fsDir = await import('fs-extra');
809
812
  const dirPath = parameters[rule.rule as string];
810
- if (!dirPath) return false;
813
+ if (!dirPath) {
814
+ return false;
815
+ }
811
816
  const stats = await fsDir.stat(dirPath).catch(() => null);
812
817
  return stats ? stats.isDirectory() : false;
813
818
 
@@ -835,14 +840,14 @@ export class CommandMapper extends EventEmitter {
835
840
 
836
841
  private async confirmExecution(
837
842
  mappedCommand: any,
838
- intentResult: IntentResult
843
+ intentResult: IntentResult,
839
844
  ): Promise<boolean> {
840
845
  // In a real implementation, this would show a confirmation dialog
841
846
  // For now, we'll assume confirmation based on safety level
842
847
 
843
848
  if (mappedCommand.safetyLevel === 'dangerous') {
844
849
  logger.warn(
845
- `Dangerous command requires confirmation: ${mappedCommand.command} ${mappedCommand.args.join(' ')}`
850
+ `Dangerous command requires confirmation: ${mappedCommand.command} ${mappedCommand.args.join(' ')}`,
846
851
  );
847
852
  // In a real CLI, this would prompt the user
848
853
  return false; // Default to not confirmed for dangerous commands
@@ -854,7 +859,7 @@ export class CommandMapper extends EventEmitter {
854
859
  private generateCommandExplanation(
855
860
  command: string,
856
861
  args: string[],
857
- intentResult: IntentResult
862
+ intentResult: IntentResult,
858
863
  ): string {
859
864
  const fullCommand = `${command} ${args.join(' ')}`;
860
865
 
@@ -1,5 +1,6 @@
1
1
  import { logger } from '../utils/logger';
2
- import { AIService, ConversationContext } from '../ai/ai-service';
2
+
3
+ import type { AIService, ConversationContext } from '../ai/ai-service';
3
4
 
4
5
  /**
5
6
  * Natural language command parsing result
@@ -57,7 +58,7 @@ export class CommandParser {
57
58
  */
58
59
  async parseCommand(
59
60
  input: string,
60
- context?: ConversationContext
61
+ context?: ConversationContext,
61
62
  ): Promise<ParsedCommand> {
62
63
  try {
63
64
  // First, try template-based parsing for common patterns
@@ -79,7 +80,7 @@ export class CommandParser {
79
80
  // Fall back to AI-powered parsing
80
81
  const aiResult = await this.aiService.parseNaturalLanguageCommand(
81
82
  input,
82
- context
83
+ context,
83
84
  );
84
85
 
85
86
  // Parse the command string into components
@@ -118,7 +119,7 @@ export class CommandParser {
118
119
  */
119
120
  async parseComplexCommand(
120
121
  input: string,
121
- context?: ConversationContext
122
+ context?: ConversationContext,
122
123
  ): Promise<ParsedCommand> {
123
124
  try {
124
125
  // Check if this is a complex command (contains "and", "then", "after")
@@ -141,7 +142,9 @@ export class CommandParser {
141
142
 
142
143
  for (let i = 0; i < steps.length; i++) {
143
144
  const step = steps[i];
144
- if (!step) continue;
145
+ if (!step) {
146
+ continue;
147
+ }
145
148
 
146
149
  const stepResult = await this.parseCommand(step, context);
147
150
 
@@ -186,7 +189,7 @@ export class CommandParser {
186
189
  if (!parsedCommand.command || parsedCommand.command.trim() === '') {
187
190
  issues.push('No valid command identified');
188
191
  recommendations.push(
189
- 'Try rephrasing with a specific action like "analyze", "create", or "init"'
192
+ 'Try rephrasing with a specific action like "analyze", "create", or "init"',
190
193
  );
191
194
  }
192
195
 
@@ -204,7 +207,7 @@ export class CommandParser {
204
207
  if (parsedCommand.confidence < 0.6) {
205
208
  issues.push('Low confidence in command interpretation');
206
209
  recommendations.push(
207
- 'Consider providing more specific details about what you want to accomplish'
210
+ 'Consider providing more specific details about what you want to accomplish',
208
211
  );
209
212
  }
210
213
 
@@ -223,7 +226,7 @@ export class CommandParser {
223
226
  */
224
227
  async generateSuggestions(
225
228
  input: string,
226
- context?: ConversationContext
229
+ context?: ConversationContext,
227
230
  ): Promise<string[]> {
228
231
  try {
229
232
  const suggestions = await this.aiService.suggestCommands(input, context);
@@ -442,8 +445,8 @@ export class CommandParser {
442
445
  step =>
443
446
  step.length > 0 &&
444
447
  !['and', 'then', 'after', 'next', 'followed by'].includes(
445
- step.toLowerCase()
446
- )
448
+ step.toLowerCase(),
449
+ ),
447
450
  );
448
451
  }
449
452
 
@@ -474,7 +477,7 @@ export class CommandParser {
474
477
  private async validateCommandSpecifics(
475
478
  parsedCommand: ParsedCommand,
476
479
  issues: string[],
477
- recommendations: string[]
480
+ recommendations: string[],
478
481
  ): Promise<void> {
479
482
  const commandParts = parsedCommand.command.split(' ');
480
483
  const baseCommand = commandParts[1]; // Skip "wundr"
@@ -483,10 +486,10 @@ export class CommandParser {
483
486
  case 'create':
484
487
  if (parsedCommand.args.length === 0) {
485
488
  issues.push(
486
- 'Create command requires a type (service, component, etc.)'
489
+ 'Create command requires a type (service, component, etc.)',
487
490
  );
488
491
  recommendations.push(
489
- 'Specify what you want to create: "wundr create service MyService"'
492
+ 'Specify what you want to create: "wundr create service MyService"',
490
493
  );
491
494
  }
492
495
  break;
@@ -495,7 +498,7 @@ export class CommandParser {
495
498
  // Analyze command is flexible, but we can suggest focus areas
496
499
  if (!parsedCommand.options['focus']) {
497
500
  recommendations.push(
498
- 'Consider using --focus to target specific areas (dependencies, duplicates, quality)'
501
+ 'Consider using --focus to target specific areas (dependencies, duplicates, quality)',
499
502
  );
500
503
  }
501
504
  break;
@@ -506,7 +509,7 @@ export class CommandParser {
506
509
  parsedCommand.args.length === 0
507
510
  ) {
508
511
  recommendations.push(
509
- 'Specify file patterns to watch: "wundr watch --pattern "**/*.ts""'
512
+ 'Specify file patterns to watch: "wundr watch --pattern "**/*.ts""',
510
513
  );
511
514
  }
512
515
  break;
@@ -517,10 +520,10 @@ export class CommandParser {
517
520
  !parsedCommand.options['interactive']
518
521
  ) {
519
522
  issues.push(
520
- 'Batch command requires either a batch file or interactive mode'
523
+ 'Batch command requires either a batch file or interactive mode',
521
524
  );
522
525
  recommendations.push(
523
- 'Use --file <batch-file> or --interactive for step-by-step execution'
526
+ 'Use --file <batch-file> or --interactive for step-by-step execution',
524
527
  );
525
528
  }
526
529
  break;
@@ -44,7 +44,7 @@ export class IntentClassifier {
44
44
 
45
45
  // Extract entities using pattern extractors
46
46
  for (const [entityName, extractor] of Object.entries(
47
- pattern.entityExtractors
47
+ pattern.entityExtractors,
48
48
  )) {
49
49
  try {
50
50
  entities[entityName] = extractor(match);
@@ -56,7 +56,7 @@ export class IntentClassifier {
56
56
  const confidence = this.calculateConfidence(
57
57
  match,
58
58
  pattern,
59
- normalizedInput
59
+ normalizedInput,
60
60
  );
61
61
 
62
62
  results.push({
@@ -98,7 +98,7 @@ export class IntentClassifier {
98
98
  matchesIntent(
99
99
  input: string,
100
100
  intentName: string,
101
- minConfidence = 0.7
101
+ minConfidence = 0.7,
102
102
  ): boolean {
103
103
  const intents = this.classifyIntent(input);
104
104
  const matchedIntent = intents.find(intent => intent.name === intentName);
@@ -351,7 +351,7 @@ export class IntentClassifier {
351
351
  private calculateConfidence(
352
352
  match: RegExpMatchArray,
353
353
  pattern: IntentPattern,
354
- normalizedInput: string
354
+ normalizedInput: string,
355
355
  ): number {
356
356
  let confidence = 0.7; // Base confidence
357
357
 
@@ -376,14 +376,14 @@ export class IntentClassifier {
376
376
  // Entity extraction helper methods
377
377
  private extractServiceName(input: string): string | undefined {
378
378
  const match = input.match(
379
- /(?:service\s+)?(?:called\s+|named\s+)?([A-Z][a-zA-Z]*)/
379
+ /(?:service\s+)?(?:called\s+|named\s+)?([A-Z][a-zA-Z]*)/,
380
380
  );
381
381
  return match?.[1];
382
382
  }
383
383
 
384
384
  private extractComponentName(input: string): string | undefined {
385
385
  const match = input.match(
386
- /(?:component\s+)?(?:called\s+|named\s+)?([A-Z][a-zA-Z]*)/
386
+ /(?:component\s+)?(?:called\s+|named\s+)?([A-Z][a-zA-Z]*)/,
387
387
  );
388
388
  return match?.[1];
389
389
  }
@@ -425,7 +425,7 @@ export class IntentClassifier {
425
425
 
426
426
  private extractBatchFile(input: string): string | undefined {
427
427
  const match = input.match(
428
- /batch\s+(?:file\s+)?([^\s]+\.(?:json|yaml|yml))/
428
+ /batch\s+(?:file\s+)?([^\s]+\.(?:json|yaml|yml))/,
429
429
  );
430
430
  return match?.[1];
431
431
  }