@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
@@ -1,12 +1,15 @@
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';
8
+ import { logger } from '../utils/logger';
9
+
10
+ import type { PluginManager } from '../plugins/plugin-manager';
11
+ import type { ConfigManager } from '../utils/config-manager';
12
+ import type { Command } from 'commander';
10
13
  // import { projectTemplates } from '@wundr/project-templates';
11
14
  // TODO: Fix this import - project-templates package needs to be created
12
15
  const projectTemplates = {
@@ -28,7 +31,7 @@ export class CreateCommands {
28
31
  constructor(
29
32
  private program: Command,
30
33
  private configManager: ConfigManager,
31
- private pluginManager: PluginManager
34
+ private pluginManager: PluginManager,
32
35
  ) {
33
36
  this.registerCommands();
34
37
  }
@@ -37,7 +40,7 @@ export class CreateCommands {
37
40
  const createCmd = this.program
38
41
  .command('create')
39
42
  .description(
40
- 'create new wundr-compliant projects, components, services, and templates'
43
+ 'create new wundr-compliant projects, components, services, and templates',
41
44
  );
42
45
 
43
46
  // Create new project (full wundr-compliant project)
@@ -66,7 +69,7 @@ export class CreateCommands {
66
69
  .option(
67
70
  '-f, --framework <framework>',
68
71
  'framework (next|react|vue)',
69
- 'next'
72
+ 'next',
70
73
  )
71
74
  .action(async (name: string, options: any) => {
72
75
  await projectTemplates.createProject({
@@ -84,7 +87,7 @@ export class CreateCommands {
84
87
  .option(
85
88
  '-f, --framework <framework>',
86
89
  'framework (fastify|express|nestjs)',
87
- 'fastify'
90
+ 'fastify',
88
91
  )
89
92
  .action(async (name: string, options: any) => {
90
93
  await projectTemplates.createProject({
@@ -142,12 +145,12 @@ export class CreateCommands {
142
145
  .option(
143
146
  '--type <type>',
144
147
  'service type (api, worker, microservice)',
145
- 'api'
148
+ 'api',
146
149
  )
147
150
  .option(
148
151
  '--framework <framework>',
149
152
  'framework (express, fastify, nest)',
150
- 'express'
153
+ 'express',
151
154
  )
152
155
  .option('--with-tests', 'generate test files')
153
156
  .option('--with-docs', 'generate API documentation')
@@ -184,7 +187,7 @@ export class CreateCommands {
184
187
  .option(
185
188
  '--platform <platform>',
186
189
  'platform (github, gitlab, jenkins)',
187
- 'github'
190
+ 'github',
188
191
  )
189
192
  .action(async (name, options) => {
190
193
  await this.createWorkflow(name, options);
@@ -196,7 +199,7 @@ export class CreateCommands {
196
199
  .description('create configuration files')
197
200
  .option(
198
201
  '--type <type>',
199
- 'config type (eslint, prettier, jest, typescript)'
202
+ 'config type (eslint, prettier, jest, typescript)',
200
203
  )
201
204
  .option('--preset <preset>', 'configuration preset')
202
205
  .action(async (name, options) => {
@@ -210,7 +213,7 @@ export class CreateCommands {
210
213
  private async createProject(
211
214
  type: string,
212
215
  name: string | undefined,
213
- options: any
216
+ options: any,
214
217
  ): Promise<void> {
215
218
  try {
216
219
  // If no name provided, launch interactive mode
@@ -256,7 +259,7 @@ export class CreateCommands {
256
259
  'WUNDR_CREATE_PROJECT_FAILED',
257
260
  'Failed to create project',
258
261
  { type, name, options },
259
- true
262
+ true,
260
263
  );
261
264
  }
262
265
  }
@@ -277,7 +280,7 @@ export class CreateCommands {
277
280
  await this.generateFromTemplate(
278
281
  'component-test',
279
282
  componentData,
280
- outputPath
283
+ outputPath,
281
284
  );
282
285
  }
283
286
 
@@ -285,7 +288,7 @@ export class CreateCommands {
285
288
  await this.generateFromTemplate(
286
289
  'component-stories',
287
290
  componentData,
288
- outputPath
291
+ outputPath,
289
292
  );
290
293
  }
291
294
 
@@ -295,7 +298,7 @@ export class CreateCommands {
295
298
  'WUNDR_CREATE_COMPONENT_FAILED',
296
299
  'Failed to create component',
297
300
  { name, options },
298
- true
301
+ true,
299
302
  );
300
303
  }
301
304
  }
@@ -316,7 +319,7 @@ export class CreateCommands {
316
319
  await this.generateFromTemplate(
317
320
  'service-test',
318
321
  serviceData,
319
- outputPath
322
+ outputPath,
320
323
  );
321
324
  }
322
325
 
@@ -330,7 +333,7 @@ export class CreateCommands {
330
333
  'WUNDR_CREATE_SERVICE_FAILED',
331
334
  'Failed to create service',
332
335
  { name, options },
333
- true
336
+ true,
334
337
  );
335
338
  }
336
339
  }
@@ -354,7 +357,7 @@ export class CreateCommands {
354
357
  'WUNDR_CREATE_PACKAGE_FAILED',
355
358
  'Failed to create package',
356
359
  { name, options },
357
- true
360
+ true,
358
361
  );
359
362
  }
360
363
  }
@@ -380,7 +383,7 @@ export class CreateCommands {
380
383
  'WUNDR_CREATE_TEMPLATE_FAILED',
381
384
  'Failed to create template',
382
385
  { name, options },
383
- true
386
+ true,
384
387
  );
385
388
  }
386
389
  }
@@ -403,7 +406,7 @@ export class CreateCommands {
403
406
  'WUNDR_CREATE_WORKFLOW_FAILED',
404
407
  'Failed to create workflow',
405
408
  { name, options },
406
- true
409
+ true,
407
410
  );
408
411
  }
409
412
  }
@@ -426,7 +429,7 @@ export class CreateCommands {
426
429
  'WUNDR_CREATE_CONFIG_FAILED',
427
430
  'Failed to create configuration',
428
431
  { name, options },
429
- true
432
+ true,
430
433
  );
431
434
  }
432
435
  }
@@ -501,7 +504,7 @@ export class CreateCommands {
501
504
  private async generateFromTemplate(
502
505
  templateType: string,
503
506
  data: any,
504
- outputPath: string
507
+ outputPath: string,
505
508
  ): Promise<void> {
506
509
  const templatePath = this.getTemplatePath(templateType);
507
510
 
@@ -518,7 +521,7 @@ export class CreateCommands {
518
521
  private async copyTemplateWithReplacements(
519
522
  srcPath: string,
520
523
  destPath: string,
521
- data: any
524
+ data: any,
522
525
  ): Promise<void> {
523
526
  const files = await fs.readdir(srcPath);
524
527
 
@@ -526,7 +529,7 @@ export class CreateCommands {
526
529
  const srcFile = path.join(srcPath, file);
527
530
  const destFile = path.join(
528
531
  destPath,
529
- this.replacePlaceholders(file, data)
532
+ this.replacePlaceholders(file, data),
530
533
  );
531
534
 
532
535
  const stat = await fs.stat(srcFile);
@@ -558,7 +561,7 @@ export class CreateCommands {
558
561
  */
559
562
  private async determineOutputPath(
560
563
  category: string,
561
- name: string
564
+ name: string,
562
565
  ): Promise<string> {
563
566
  const projectRoot = process.cwd();
564
567
  const srcPath = path.join(projectRoot, 'src');
@@ -572,7 +575,7 @@ export class CreateCommands {
572
575
 
573
576
  private async determinePackagePath(
574
577
  name: string,
575
- type: string
578
+ type: string,
576
579
  ): Promise<string> {
577
580
  const projectRoot = process.cwd();
578
581
  const packagesPath = path.join(projectRoot, 'packages');
@@ -629,7 +632,7 @@ export class CreateCommands {
629
632
 
630
633
  private async updateWorkspaceConfig(
631
634
  name: string,
632
- type: string
635
+ type: string,
633
636
  ): Promise<void> {
634
637
  const packageJsonPath = path.join(process.cwd(), 'package.json');
635
638
 
@@ -648,7 +651,7 @@ export class CreateCommands {
648
651
 
649
652
  private async generateApiDocs(
650
653
  serviceData: any,
651
- outputPath: string
654
+ outputPath: string,
652
655
  ): Promise<void> {
653
656
  // Generate API documentation based on service type and framework
654
657
  const docsPath = path.join(outputPath, 'docs');
@@ -714,7 +717,7 @@ Create new ${serviceData.name}
714
717
 
715
718
  private async createTemplateFromSource(
716
719
  name: string,
717
- sourcePath: string
720
+ sourcePath: string,
718
721
  ): Promise<void> {
719
722
  logger.debug(`Creating template ${name} from source: ${sourcePath}`);
720
723
  // Implementation for creating template from existing source
@@ -1,12 +1,15 @@
1
- import { Command } from 'commander';
2
1
  import { spawn } from 'child_process';
3
- import fs from 'fs-extra';
4
2
  import path from 'path';
3
+
5
4
  import chalk from 'chalk';
6
- import { ConfigManager } from '../utils/config-manager';
7
- import { PluginManager } from '../plugins/plugin-manager';
8
- import { logger } from '../utils/logger';
5
+ import fs from 'fs-extra';
6
+
9
7
  import { errorHandler } from '../utils/error-handler';
8
+ import { logger } from '../utils/logger';
9
+
10
+ import type { PluginManager } from '../plugins/plugin-manager';
11
+ import type { ConfigManager } from '../utils/config-manager';
12
+ import type { Command } from 'commander';
10
13
 
11
14
  /**
12
15
  * Dashboard commands for web interface and visualization
@@ -15,7 +18,7 @@ export class DashboardCommands {
15
18
  constructor(
16
19
  private program: Command,
17
20
  private configManager: ConfigManager,
18
- private pluginManager: PluginManager
21
+ private pluginManager: PluginManager,
19
22
  ) {
20
23
  this.registerCommands();
21
24
  }
@@ -63,7 +66,7 @@ export class DashboardCommands {
63
66
  .option(
64
67
  '--period <period>',
65
68
  'report period (daily, weekly, monthly)',
66
- 'weekly'
69
+ 'weekly',
67
70
  )
68
71
  .action(async (type, options) => {
69
72
  await this.generateReport(type, options);
@@ -171,7 +174,7 @@ export class DashboardCommands {
171
174
  await this.saveDashboardProcess(dashboardProcess, options);
172
175
 
173
176
  logger.success(
174
- `Dashboard started at http://${options.host}:${options.port}`
177
+ `Dashboard started at http://${options.host}:${options.port}`,
175
178
  );
176
179
 
177
180
  if (options.open) {
@@ -181,7 +184,7 @@ export class DashboardCommands {
181
184
  // Keep the process alive if not in dev mode
182
185
  if (!options.dev) {
183
186
  logger.info(
184
- 'Dashboard is running in the background. Use "wundr dashboard stop" to stop it.'
187
+ 'Dashboard is running in the background. Use "wundr dashboard stop" to stop it.',
185
188
  );
186
189
  }
187
190
  } catch (error) {
@@ -189,7 +192,7 @@ export class DashboardCommands {
189
192
  'WUNDR_DASHBOARD_START_FAILED',
190
193
  'Failed to start dashboard',
191
194
  { options },
192
- true
195
+ true,
193
196
  );
194
197
  }
195
198
  }
@@ -219,7 +222,7 @@ export class DashboardCommands {
219
222
  'WUNDR_DASHBOARD_STOP_FAILED',
220
223
  'Failed to stop dashboard',
221
224
  {},
222
- true
225
+ true,
223
226
  );
224
227
  }
225
228
  }
@@ -234,11 +237,11 @@ export class DashboardCommands {
234
237
 
235
238
  if (isRunning && processInfo) {
236
239
  logger.success(
237
- `Dashboard is running on http://${processInfo.host}:${processInfo.port}`
240
+ `Dashboard is running on http://${processInfo.host}:${processInfo.port}`,
238
241
  );
239
242
  logger.info(`Process ID: ${processInfo.pid}`);
240
243
  logger.info(
241
- `Started: ${new Date(processInfo.started).toLocaleString()}`
244
+ `Started: ${new Date(processInfo.started).toLocaleString()}`,
242
245
  );
243
246
  } else {
244
247
  logger.info('Dashboard is not running');
@@ -248,7 +251,7 @@ export class DashboardCommands {
248
251
  'WUNDR_DASHBOARD_STATUS_FAILED',
249
252
  'Failed to check dashboard status',
250
253
  {},
251
- true
254
+ true,
252
255
  );
253
256
  }
254
257
  }
@@ -273,7 +276,7 @@ export class DashboardCommands {
273
276
  'WUNDR_DASHBOARD_REPORT_FAILED',
274
277
  'Failed to generate report',
275
278
  { type, options },
276
- true
279
+ true,
277
280
  );
278
281
  }
279
282
  }
@@ -298,7 +301,7 @@ export class DashboardCommands {
298
301
  'WUNDR_DASHBOARD_EXPORT_FAILED',
299
302
  'Failed to export data',
300
303
  { type, options },
301
- true
304
+ true,
302
305
  );
303
306
  }
304
307
  }
@@ -329,7 +332,7 @@ export class DashboardCommands {
329
332
  'WUNDR_DASHBOARD_IMPORT_FAILED',
330
333
  'Failed to import data',
331
334
  { file, options },
332
- true
335
+ true,
333
336
  );
334
337
  }
335
338
  }
@@ -347,7 +350,7 @@ export class DashboardCommands {
347
350
  'WUNDR_DASHBOARD_CONFIG_SET_FAILED',
348
351
  'Failed to set dashboard configuration',
349
352
  { key, value },
350
- true
353
+ true,
351
354
  );
352
355
  }
353
356
  }
@@ -369,7 +372,7 @@ export class DashboardCommands {
369
372
  'WUNDR_DASHBOARD_CONFIG_GET_FAILED',
370
373
  'Failed to get dashboard configuration',
371
374
  { key },
372
- true
375
+ true,
373
376
  );
374
377
  }
375
378
  }
@@ -398,7 +401,7 @@ export class DashboardCommands {
398
401
  'WUNDR_DASHBOARD_ADD_WIDGET_FAILED',
399
402
  'Failed to add widget',
400
403
  { type, options },
401
- true
404
+ true,
402
405
  );
403
406
  }
404
407
  }
@@ -417,7 +420,7 @@ export class DashboardCommands {
417
420
  'WUNDR_DASHBOARD_REMOVE_WIDGET_FAILED',
418
421
  'Failed to remove widget',
419
422
  { id },
420
- true
423
+ true,
421
424
  );
422
425
  }
423
426
  }
@@ -441,14 +444,14 @@ export class DashboardCommands {
441
444
  Type: widget.type,
442
445
  Position: `(${widget.position.x}, ${widget.position.y})`,
443
446
  Created: new Date(widget.created).toLocaleDateString(),
444
- }))
447
+ })),
445
448
  );
446
449
  } catch (error) {
447
450
  throw errorHandler.createError(
448
451
  'WUNDR_DASHBOARD_LIST_WIDGETS_FAILED',
449
452
  'Failed to list widgets',
450
453
  {},
451
- true
454
+ true,
452
455
  );
453
456
  }
454
457
  }
@@ -479,7 +482,7 @@ export class DashboardCommands {
479
482
  'WUNDR_DASHBOARD_THEME_FAILED',
480
483
  'Failed to manage theme',
481
484
  { action, options },
482
- true
485
+ true,
483
486
  );
484
487
  }
485
488
  }
@@ -489,7 +492,9 @@ export class DashboardCommands {
489
492
  */
490
493
  private async isDashboardRunning(): Promise<boolean> {
491
494
  const processInfo = await this.loadDashboardProcess();
492
- if (!processInfo) return false;
495
+ if (!processInfo) {
496
+ return false;
497
+ }
493
498
 
494
499
  try {
495
500
  process.kill(processInfo.pid, 0);
@@ -537,7 +542,7 @@ export class DashboardCommands {
537
542
 
538
543
  private async saveDashboardProcess(
539
544
  processInfo: any,
540
- options: any
545
+ options: any,
541
546
  ): Promise<void> {
542
547
  const processFile = path.join(process.cwd(), '.wundr', 'dashboard.pid');
543
548
  await fs.ensureDir(path.dirname(processFile));
@@ -631,7 +636,7 @@ export class DashboardCommands {
631
636
  process.cwd(),
632
637
  '.wundr',
633
638
  'widgets',
634
- `${widget.id}.json`
639
+ `${widget.id}.json`,
635
640
  );
636
641
  await fs.ensureDir(path.dirname(widgetFile));
637
642
  await fs.writeJson(widgetFile, widget, { spaces: 2 });
@@ -642,7 +647,7 @@ export class DashboardCommands {
642
647
  process.cwd(),
643
648
  '.wundr',
644
649
  'widgets',
645
- `${id}.json`
650
+ `${id}.json`,
646
651
  );
647
652
  if (await fs.pathExists(widgetFile)) {
648
653
  await fs.remove(widgetFile);
@@ -1,11 +1,14 @@
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 { ConfigManager } from '../utils/config-manager';
6
- import { PluginManager } from '../plugins/plugin-manager';
7
- import { logger } from '../utils/logger';
4
+ import fs from 'fs-extra';
5
+
8
6
  import { errorHandler } from '../utils/error-handler';
7
+ import { logger } from '../utils/logger';
8
+
9
+ import type { PluginManager } from '../plugins/plugin-manager';
10
+ import type { ConfigManager } from '../utils/config-manager';
11
+ import type { Command } from 'commander';
9
12
 
10
13
  /**
11
14
  * Governance commands for compliance and quality control
@@ -14,7 +17,7 @@ export class GovernCommands {
14
17
  constructor(
15
18
  private program: Command,
16
19
  private configManager: ConfigManager,
17
- private pluginManager: PluginManager
20
+ private pluginManager: PluginManager,
18
21
  ) {
19
22
  this.registerCommands();
20
23
  }
@@ -81,7 +84,7 @@ export class GovernCommands {
81
84
  .option(
82
85
  '--scope <scope>',
83
86
  'application scope (project, workspace)',
84
- 'project'
87
+ 'project',
85
88
  )
86
89
  .action(async (policy, options) => {
87
90
  await this.applyPolicy(policy, options);
@@ -114,7 +117,7 @@ export class GovernCommands {
114
117
  .option(
115
118
  '--scope <scope>',
116
119
  'audit scope (security, quality, compliance)',
117
- 'all'
120
+ 'all',
118
121
  )
119
122
  .option('--export <path>', 'export audit results')
120
123
  .action(async options => {
@@ -128,12 +131,12 @@ export class GovernCommands {
128
131
  .option(
129
132
  '--type <type>',
130
133
  'report type (compliance, quality, security)',
131
- 'compliance'
134
+ 'compliance',
132
135
  )
133
136
  .option(
134
137
  '--period <period>',
135
138
  'report period (daily, weekly, monthly)',
136
- 'weekly'
139
+ 'weekly',
137
140
  )
138
141
  .option('--output <path>', 'output file path')
139
142
  .action(async options => {
@@ -181,7 +184,7 @@ export class GovernCommands {
181
184
  'WUNDR_GOVERN_CHECK_FAILED',
182
185
  'Failed to run compliance checks',
183
186
  { options },
184
- true
187
+ true,
185
188
  );
186
189
  }
187
190
  }
@@ -209,14 +212,14 @@ export class GovernCommands {
209
212
  Severity: rule.severity,
210
213
  Description: rule.description,
211
214
  Fixable: rule.fixable ? '✓' : '✗',
212
- }))
215
+ })),
213
216
  );
214
217
  } catch (error) {
215
218
  throw errorHandler.createError(
216
219
  'WUNDR_GOVERN_LIST_RULES_FAILED',
217
220
  'Failed to list rules',
218
221
  { options },
219
- true
222
+ true,
220
223
  );
221
224
  }
222
225
  }
@@ -241,7 +244,7 @@ export class GovernCommands {
241
244
  'WUNDR_GOVERN_ADD_RULE_FAILED',
242
245
  'Failed to add rule',
243
246
  { rule, options },
244
- true
247
+ true,
245
248
  );
246
249
  }
247
250
  }
@@ -268,7 +271,7 @@ export class GovernCommands {
268
271
  'WUNDR_GOVERN_REMOVE_RULE_FAILED',
269
272
  'Failed to remove rule',
270
273
  { rule },
271
- true
274
+ true,
272
275
  );
273
276
  }
274
277
  }
@@ -292,7 +295,7 @@ export class GovernCommands {
292
295
  process.cwd(),
293
296
  '.wundr',
294
297
  'policies',
295
- `${name}.json`
298
+ `${name}.json`,
296
299
  );
297
300
  await fs.ensureDir(path.dirname(policyPath));
298
301
  await fs.writeJson(policyPath, policy, { spaces: 2 });
@@ -303,7 +306,7 @@ export class GovernCommands {
303
306
  'WUNDR_GOVERN_CREATE_POLICY_FAILED',
304
307
  'Failed to create policy',
305
308
  { name, options },
306
- true
309
+ true,
307
310
  );
308
311
  }
309
312
  }
@@ -319,7 +322,7 @@ export class GovernCommands {
319
322
  process.cwd(),
320
323
  '.wundr',
321
324
  'policies',
322
- `${policy}.json`
325
+ `${policy}.json`,
323
326
  );
324
327
 
325
328
  if (await fs.pathExists(policyPath)) {
@@ -342,7 +345,7 @@ export class GovernCommands {
342
345
  'WUNDR_GOVERN_APPLY_POLICY_FAILED',
343
346
  'Failed to apply policy',
344
347
  { policy, options },
345
- true
348
+ true,
346
349
  );
347
350
  }
348
351
  }
@@ -389,7 +392,7 @@ export class GovernCommands {
389
392
  'WUNDR_GOVERN_GATE_CHECK_FAILED',
390
393
  'Failed to check quality gate',
391
394
  { options },
392
- true
395
+ true,
393
396
  );
394
397
  }
395
398
  }
@@ -412,7 +415,7 @@ export class GovernCommands {
412
415
  process.cwd(),
413
416
  '.wundr',
414
417
  'gates',
415
- `${name}.json`
418
+ `${name}.json`,
416
419
  );
417
420
  await fs.ensureDir(path.dirname(gatePath));
418
421
  await fs.writeJson(gatePath, gate, { spaces: 2 });
@@ -423,7 +426,7 @@ export class GovernCommands {
423
426
  'WUNDR_GOVERN_CREATE_GATE_FAILED',
424
427
  'Failed to create quality gate',
425
428
  { name, options },
426
- true
429
+ true,
427
430
  );
428
431
  }
429
432
  }
@@ -466,7 +469,7 @@ export class GovernCommands {
466
469
  'WUNDR_GOVERN_AUDIT_FAILED',
467
470
  'Failed to run audit',
468
471
  { options },
469
- true
472
+ true,
470
473
  );
471
474
  }
472
475
  }
@@ -480,7 +483,7 @@ export class GovernCommands {
480
483
 
481
484
  const report = await this.createGovernanceReport(
482
485
  options.type,
483
- options.period
486
+ options.period,
484
487
  );
485
488
 
486
489
  const outputPath =
@@ -493,7 +496,7 @@ export class GovernCommands {
493
496
  'WUNDR_GOVERN_REPORT_FAILED',
494
497
  'Failed to generate report',
495
498
  { options },
496
- true
499
+ true,
497
500
  );
498
501
  }
499
502
  }
@@ -537,7 +540,7 @@ export class GovernCommands {
537
540
  }
538
541
 
539
542
  private async evaluateQualityGate(
540
- gate: any
543
+ gate: any,
541
544
  ): Promise<{ passed: boolean; failures: string[] }> {
542
545
  // Implementation for evaluating quality gates
543
546
  return { passed: true, failures: [] };
@@ -560,7 +563,7 @@ export class GovernCommands {
560
563
 
561
564
  private async createGovernanceReport(
562
565
  type: string,
563
- period: string
566
+ period: string,
564
567
  ): Promise<any> {
565
568
  // Implementation for creating governance reports
566
569
  return {
@@ -573,7 +576,9 @@ export class GovernCommands {
573
576
  }
574
577
 
575
578
  private displayViolations(violations: any[]): void {
576
- if (violations.length === 0) return;
579
+ if (violations.length === 0) {
580
+ return;
581
+ }
577
582
 
578
583
  console.log(chalk.yellow('\nCompliance Violations:'));
579
584
  console.table(
@@ -583,7 +588,7 @@ export class GovernCommands {
583
588
  File: v.file,
584
589
  Line: v.line || 'N/A',
585
590
  Description: v.description,
586
- }))
591
+ })),
587
592
  );
588
593
  }
589
594