@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,10 +1,12 @@
1
- import { Command } from 'commander';
2
- import * as fs from 'fs-extra';
3
- import * as path from 'path';
4
1
  import { execSync } from 'child_process';
2
+ import * as path from 'path';
3
+
5
4
  import chalk from 'chalk';
6
- import ora from 'ora';
5
+ import * as fs from 'fs-extra';
7
6
  import inquirer from 'inquirer';
7
+ import ora from 'ora';
8
+
9
+ import type { Command } from 'commander';
8
10
 
9
11
  interface ProjectInfo {
10
12
  name: string;
@@ -30,7 +32,7 @@ export class ClaudeInitCommand {
30
32
  .command('claude-init')
31
33
  .alias('ci')
32
34
  .description(
33
- 'Initialize Claude Code and Claude Flow in current repository'
35
+ 'Initialize Claude Code and Claude Flow in current repository',
34
36
  )
35
37
  .option('-i, --interactive', 'Interactive mode with prompts')
36
38
  .option('-a, --audit', 'Run repository audit first')
@@ -38,11 +40,11 @@ export class ClaudeInitCommand {
38
40
  .option('--agents <agents>', 'Comma-separated list of agents to enable')
39
41
  .option(
40
42
  '--mcp-tools <tools>',
41
- 'Comma-separated list of MCP tools to enable'
43
+ 'Comma-separated list of MCP tools to enable',
42
44
  )
43
45
  .option(
44
46
  '--profile <profile>',
45
- 'Developer profile (fullstack, frontend, backend, devops)'
47
+ 'Developer profile (fullstack, frontend, backend, devops)',
46
48
  )
47
49
  .action(async options => {
48
50
  await this.execute(options);
@@ -56,8 +58,8 @@ export class ClaudeInitCommand {
56
58
  if (!this.isGitRepo()) {
57
59
  console.error(
58
60
  chalk.red(
59
- '❌ Not in a git repository. Please run this command in a git repository.'
60
- )
61
+ '❌ Not in a git repository. Please run this command in a git repository.',
62
+ ),
61
63
  );
62
64
  process.exit(1);
63
65
  }
@@ -87,7 +89,7 @@ export class ClaudeInitCommand {
87
89
 
88
90
  // Setup agents
89
91
  await this.setupAgents(
90
- options.agents || this.getDefaultAgents(projectInfo)
92
+ options.agents || this.getDefaultAgents(projectInfo),
91
93
  );
92
94
 
93
95
  // Setup quality hooks
@@ -161,7 +163,7 @@ export class ClaudeInitCommand {
161
163
  }
162
164
 
163
165
  this.spinner.succeed(
164
- `Project analyzed: ${projectInfo.name} (${projectInfo.type})`
166
+ `Project analyzed: ${projectInfo.name} (${projectInfo.type})`,
165
167
  );
166
168
  return projectInfo;
167
169
  }
@@ -183,10 +185,12 @@ export class ClaudeInitCommand {
183
185
  };
184
186
 
185
187
  // Structure checks
186
- if (await fs.pathExists('src'))
187
- auditResults.categories.structure.score += 10;
188
- if (await fs.pathExists('.gitignore'))
189
- auditResults.categories.structure.score += 5;
188
+ if (await fs.pathExists('src')) {
189
+ auditResults.categories.structure.score += 10;
190
+ }
191
+ if (await fs.pathExists('.gitignore')) {
192
+ auditResults.categories.structure.score += 5;
193
+ }
190
194
  if (projectInfo.isMonorepo && (await fs.pathExists('packages'))) {
191
195
  auditResults.categories.structure.score += 5;
192
196
  }
@@ -245,7 +249,7 @@ export class ClaudeInitCommand {
245
249
  auditResults.categories.security.score += 10;
246
250
  } else if (await fs.pathExists('.env')) {
247
251
  auditResults.recommendations.push(
248
- 'Add .env.example for environment variables'
252
+ 'Add .env.example for environment variables',
249
253
  );
250
254
  }
251
255
 
@@ -260,8 +264,8 @@ export class ClaudeInitCommand {
260
264
  console.log(chalk.cyan('\n📊 Audit Results:'));
261
265
  console.log(
262
266
  chalk.white(
263
- `Overall Score: ${auditResults.score}/${auditResults.maxScore}`
264
- )
267
+ `Overall Score: ${auditResults.score}/${auditResults.maxScore}`,
268
+ ),
265
269
  );
266
270
 
267
271
  for (const [name, category] of Object.entries(auditResults.categories)) {
@@ -274,8 +278,8 @@ export class ClaudeInitCommand {
274
278
  : chalk.red;
275
279
  console.log(
276
280
  color(
277
- ` ${name}: ${category.score}/${category.maxScore} (${percentage.toFixed(0)}%)`
278
- )
281
+ ` ${name}: ${category.score}/${category.maxScore} (${percentage.toFixed(0)}%)`,
282
+ ),
279
283
  );
280
284
  }
281
285
 
@@ -411,7 +415,7 @@ export class ClaudeInitCommand {
411
415
 
412
416
  private async generateClaudeMd(
413
417
  projectInfo: ProjectInfo,
414
- options: any
418
+ options: any,
415
419
  ): Promise<void> {
416
420
  this.spinner.start('Generating CLAUDE.md...');
417
421
 
@@ -529,7 +533,7 @@ By: Wundr Claude Init
529
533
 
530
534
  private getWorkflowPatterns(
531
535
  projectInfo: ProjectInfo,
532
- agents: string[]
536
+ agents: string[],
533
537
  ): string {
534
538
  const patterns: string[] = [];
535
539
 
@@ -562,9 +566,11 @@ By: Wundr Claude Init
562
566
 
563
567
  private async setupClaudeFlow(
564
568
  projectInfo: ProjectInfo,
565
- options: any
569
+ options: any,
566
570
  ): Promise<void> {
567
- if (!options.setupClaudeFlow) return;
571
+ if (!options.setupClaudeFlow) {
572
+ return;
573
+ }
568
574
 
569
575
  this.spinner.start('Setting up Claude Flow...');
570
576
 
@@ -598,7 +604,9 @@ By: Wundr Claude Init
598
604
  }
599
605
 
600
606
  private async setupMcpTools(mcpTools: string | string[]): Promise<void> {
601
- if (!mcpTools) return;
607
+ if (!mcpTools) {
608
+ return;
609
+ }
602
610
 
603
611
  const tools = Array.isArray(mcpTools) ? mcpTools : mcpTools.split(',');
604
612
 
@@ -620,7 +628,7 @@ By: Wundr Claude Init
620
628
  case 'playwright':
621
629
  execSync(
622
630
  'npx claude mcp add playwright npx @playwright/mcp-server',
623
- { stdio: 'ignore' }
631
+ { stdio: 'ignore' },
624
632
  );
625
633
  break;
626
634
  case 'browser':
@@ -631,7 +639,7 @@ By: Wundr Claude Init
631
639
  case 'sequentialthinking':
632
640
  execSync(
633
641
  'npm install -g @modelcontextprotocol/server-sequentialthinking',
634
- { stdio: 'ignore' }
642
+ { stdio: 'ignore' },
635
643
  );
636
644
  break;
637
645
  }
@@ -699,12 +707,12 @@ echo "✅ All quality checks passed!"
699
707
  console.log(chalk.white('1. Review and customize CLAUDE.md'));
700
708
  console.log(chalk.white('2. Configure API keys for MCP tools (if needed)'));
701
709
  console.log(
702
- chalk.white('3. Restart Claude Desktop to load new configurations')
710
+ chalk.white('3. Restart Claude Desktop to load new configurations'),
703
711
  );
704
712
  console.log(
705
713
  chalk.white(
706
- '4. Run: npx claude-flow@alpha sparc tdd "your first feature"'
707
- )
714
+ '4. Run: npx claude-flow@alpha sparc tdd "your first feature"',
715
+ ),
708
716
  );
709
717
  console.log(chalk.cyan('\n🚀 Happy coding with Claude!\n'));
710
718
  }