@wundr.io/cli 1.0.1 → 1.0.2-dev.20260530174250.ef0ec927

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 (69) hide show
  1. package/bin/wundr.js +13 -5
  2. package/package.json +30 -9
  3. package/src/ai/ai-service.ts +6 -4
  4. package/src/ai/claude-client.ts +6 -2
  5. package/src/ai/conversation-manager.ts +12 -5
  6. package/src/cli.ts +42 -13
  7. package/src/commands/ai.ts +340 -64
  8. package/src/commands/alignment.ts +1212 -0
  9. package/src/commands/analyze-optimized.ts +371 -33
  10. package/src/commands/analyze.ts +8 -6
  11. package/src/commands/batch.ts +166 -26
  12. package/src/commands/chat.ts +20 -10
  13. package/src/commands/claude-init.ts +31 -27
  14. package/src/commands/claude-setup.ts +761 -81
  15. package/src/commands/computer-setup.ts +524 -12
  16. package/src/commands/create-command.ts +3 -3
  17. package/src/commands/create.ts +9 -6
  18. package/src/commands/dashboard.ts +11 -6
  19. package/src/commands/govern.ts +11 -6
  20. package/src/commands/governance.ts +1005 -0
  21. package/src/commands/guardian.ts +887 -0
  22. package/src/commands/init.ts +104 -11
  23. package/src/commands/orchestrator.ts +789 -0
  24. package/src/commands/performance-optimizer.ts +15 -10
  25. package/src/commands/plugins.ts +8 -5
  26. package/src/commands/project-update.ts +1156 -0
  27. package/src/commands/rag.ts +1011 -0
  28. package/src/commands/session.ts +631 -0
  29. package/src/commands/setup.ts +42 -344
  30. package/src/commands/test-init.ts +3 -2
  31. package/src/commands/test.ts +3 -2
  32. package/src/commands/watch.ts +21 -11
  33. package/src/commands/worktree.ts +1057 -0
  34. package/src/context/context-manager.ts +5 -2
  35. package/src/context/session-manager.ts +18 -7
  36. package/src/framework/command-interface.ts +520 -0
  37. package/src/framework/command-registry.ts +942 -0
  38. package/src/framework/completion-exporter.ts +383 -0
  39. package/src/framework/debug-logger.ts +519 -0
  40. package/src/framework/error-handler.ts +867 -0
  41. package/src/framework/help-generator.ts +540 -0
  42. package/src/framework/index.ts +169 -0
  43. package/src/framework/interactive-repl.ts +703 -0
  44. package/src/framework/output-formatter.ts +834 -0
  45. package/src/framework/progress-manager.ts +539 -0
  46. package/src/index.ts +3 -2
  47. package/src/interactive/interactive-mode.ts +14 -7
  48. package/src/lib/conflict-resolution.ts +818 -0
  49. package/src/lib/merge-strategy.ts +550 -0
  50. package/src/lib/safety-mechanisms.ts +451 -0
  51. package/src/lib/state-detection.ts +1030 -0
  52. package/src/nlp/command-mapper.ts +8 -3
  53. package/src/nlp/command-parser.ts +5 -2
  54. package/src/nlp/intent-parser.ts +23 -9
  55. package/src/plugins/plugin-manager.ts +50 -24
  56. package/src/tests/computer-setup-integration.test.ts +46 -15
  57. package/src/types/index.ts +1 -1
  58. package/src/types/modules.d.ts +425 -1
  59. package/src/utils/backup-rollback-manager.ts +19 -14
  60. package/src/utils/claude-config-installer.ts +119 -28
  61. package/src/utils/config-manager.ts +9 -6
  62. package/src/utils/error-handler.ts +3 -1
  63. package/src/utils/logger.ts +35 -12
  64. package/templates/batch/ci-cd.yaml +7 -7
  65. package/test-suites/api/health.spec.ts +20 -23
  66. package/test-suites/helpers/test-config.ts +14 -13
  67. package/test-suites/ui/accessibility.spec.ts +27 -22
  68. package/test-suites/ui/smoke.spec.ts +26 -21
  69. package/src/commands/computer-setup-commands.ts +0 -869
@@ -1,12 +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
+
7
+ import { initProjectRag, type RagInitOptions } from '@wundr.io/core';
9
8
  import { errorHandler } from '../utils/error-handler';
9
+ import { logger } from '../utils/logger';
10
+
11
+ import type { PluginManager } from '../plugins/plugin-manager';
12
+ import type { ConfigManager } from '../utils/config-manager';
13
+ import type { Command } from 'commander';
10
14
 
11
15
  /**
12
16
  * Init commands for project setup and configuration
@@ -33,10 +37,25 @@ export class InitCommands {
33
37
  .option('--skip-git', 'skip git initialization')
34
38
  .option('--skip-install', 'skip dependency installation')
35
39
  .option('--monorepo', 'initialize as monorepo')
40
+ .option(
41
+ '--with-rag',
42
+ 'initialize RAG (Retrieval-Augmented Generation) support'
43
+ )
36
44
  .action(async (name, options) => {
37
45
  await this.initProject(name, options);
38
46
  });
39
47
 
48
+ // Initialize RAG for existing project
49
+ initCmd
50
+ .command('rag')
51
+ .description('initialize RAG support for an existing project')
52
+ .option('--force', 'force re-initialization even if config exists')
53
+ .option('--skip-indexing', 'skip initial file indexing')
54
+ .option('--project-name <name>', 'override project name')
55
+ .action(async options => {
56
+ await this.initRag(options);
57
+ });
58
+
40
59
  // Initialize configuration
41
60
  initCmd
42
61
  .command('config')
@@ -107,10 +126,36 @@ export class InitCommands {
107
126
  await this.installDependencies(projectPath);
108
127
  }
109
128
 
129
+ // Initialize RAG if --with-rag flag is provided
130
+ if (options.withRag) {
131
+ logger.info('Initializing RAG support...');
132
+ const ragResult = await initProjectRag(projectPath, {
133
+ projectName,
134
+ });
135
+
136
+ if (ragResult.success) {
137
+ logger.success(
138
+ `RAG initialized: ${ragResult.filesIndexed} files indexed`
139
+ );
140
+ logger.info(
141
+ ` Framework detected: ${chalk.cyan(ragResult.framework.name)}`
142
+ );
143
+ } else {
144
+ logger.warn('RAG initialization had issues:');
145
+ for (const error of ragResult.errors) {
146
+ logger.warn(` - ${error}`);
147
+ }
148
+ }
149
+
150
+ for (const warning of ragResult.warnings) {
151
+ logger.warn(` Warning: ${warning}`);
152
+ }
153
+ }
154
+
110
155
  logger.success(`Project ${projectName} initialized successfully!`);
111
- logger.info(`Next steps:`);
156
+ logger.info('Next steps:');
112
157
  logger.info(` cd ${projectName}`);
113
- logger.info(` wundr analyze`);
158
+ logger.info(' wundr analyze');
114
159
  } catch (error) {
115
160
  throw errorHandler.createError(
116
161
  'WUNDR_INIT_PROJECT_FAILED',
@@ -121,6 +166,54 @@ export class InitCommands {
121
166
  }
122
167
  }
123
168
 
169
+ /**
170
+ * Initialize RAG support for existing project
171
+ */
172
+ private async initRag(options: {
173
+ force?: boolean;
174
+ skipIndexing?: boolean;
175
+ projectName?: string;
176
+ }): Promise<void> {
177
+ try {
178
+ const projectPath = process.cwd();
179
+ logger.info(`Initializing RAG support in: ${chalk.cyan(projectPath)}`);
180
+
181
+ const ragOptions: RagInitOptions = {
182
+ force: options.force,
183
+ skipIndexing: options.skipIndexing,
184
+ projectName: options.projectName,
185
+ };
186
+
187
+ const result = await initProjectRag(projectPath, ragOptions);
188
+
189
+ if (result.success) {
190
+ logger.success('RAG initialization complete!');
191
+ logger.info(` Config: ${chalk.cyan(result.configPath)}`);
192
+ logger.info(` Exclusions: ${chalk.cyan(result.excludePath)}`);
193
+ logger.info(` Files indexed: ${chalk.cyan(result.filesIndexed)}`);
194
+ logger.info(
195
+ ` Framework: ${chalk.cyan(result.framework.name)} (${result.framework.projectType})`
196
+ );
197
+ } else {
198
+ logger.error('RAG initialization failed:');
199
+ for (const error of result.errors) {
200
+ logger.error(` - ${error}`);
201
+ }
202
+ }
203
+
204
+ for (const warning of result.warnings) {
205
+ logger.warn(` Warning: ${warning}`);
206
+ }
207
+ } catch (error) {
208
+ throw errorHandler.createError(
209
+ 'WUNDR_INIT_RAG_FAILED',
210
+ 'Failed to initialize RAG',
211
+ { options },
212
+ true
213
+ );
214
+ }
215
+ }
216
+
124
217
  /**
125
218
  * Initialize Wundr configuration
126
219
  */
@@ -254,8 +347,8 @@ export class InitCommands {
254
347
  options: any
255
348
  ): Promise<void> {
256
349
  const directories = options.monorepo
257
- ? ['packages', 'apps', 'tools', 'docs', 'scripts', '.claude-flow']
258
- : ['src', 'tests', 'docs', 'scripts', '.claude-flow'];
350
+ ? ['packages', 'apps', 'tools', 'docs', 'scripts', '.ruflo']
351
+ : ['src', 'tests', 'docs', 'scripts', '.ruflo'];
259
352
 
260
353
  for (const dir of directories) {
261
354
  await fs.ensureDir(path.join(projectPath, dir));
@@ -626,7 +719,7 @@ _(None yet - will be populated when failures are resolved)_
626
719
  };
627
720
 
628
721
  await fs.writeJson(
629
- path.join(projectPath, '.claude-flow', 'verification-hooks.json'),
722
+ path.join(projectPath, '.ruflo', 'verification-hooks.json'),
630
723
  verificationHooks,
631
724
  { spaces: 2 }
632
725
  );