@wundr.io/cli 1.0.0 ā 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.
- package/README.md +696 -280
- package/dist/ai/ai-service.d.ts +2 -2
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js +1 -1
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/claude-client.d.ts.map +1 -1
- package/dist/ai/claude-client.js +2 -1
- package/dist/ai/claude-client.js.map +1 -1
- package/dist/ai/conversation-manager.d.ts +2 -2
- package/dist/ai/conversation-manager.d.ts.map +1 -1
- package/dist/ai/conversation-manager.js +5 -3
- package/dist/ai/conversation-manager.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +32 -13
- package/dist/cli.js.map +1 -1
- package/dist/commands/ai.d.ts +3 -3
- package/dist/commands/ai.d.ts.map +1 -1
- package/dist/commands/ai.js +2 -2
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/alignment.d.ts +78 -0
- package/dist/commands/alignment.d.ts.map +1 -0
- package/dist/commands/alignment.js +817 -0
- package/dist/commands/alignment.js.map +1 -0
- package/dist/commands/analyze-optimized.d.ts.map +1 -1
- package/dist/commands/analyze-optimized.js +9 -6
- package/dist/commands/analyze-optimized.js.map +1 -1
- package/dist/commands/analyze.d.ts +3 -3
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +2 -2
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/batch.d.ts +3 -3
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +7 -7
- package/dist/commands/batch.js.map +1 -1
- package/dist/commands/chat.d.ts +3 -3
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +3 -3
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/claude-init.d.ts +1 -1
- package/dist/commands/claude-init.d.ts.map +1 -1
- package/dist/commands/claude-init.js +11 -7
- package/dist/commands/claude-init.js.map +1 -1
- package/dist/commands/claude-setup.d.ts +88 -1
- package/dist/commands/claude-setup.d.ts.map +1 -1
- package/dist/commands/claude-setup.js +549 -46
- package/dist/commands/claude-setup.js.map +1 -1
- package/dist/commands/computer-setup-commands.d.ts +17 -3
- package/dist/commands/computer-setup-commands.d.ts.map +1 -1
- package/dist/commands/computer-setup-commands.js +145 -3
- package/dist/commands/computer-setup-commands.js.map +1 -1
- package/dist/commands/computer-setup.d.ts.map +1 -1
- package/dist/commands/computer-setup.js +372 -4
- package/dist/commands/computer-setup.js.map +1 -1
- package/dist/commands/create-command.d.ts.map +1 -1
- package/dist/commands/create-command.js +3 -3
- package/dist/commands/create-command.js.map +1 -1
- package/dist/commands/create.d.ts +3 -3
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +3 -3
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dashboard.d.ts +3 -3
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +4 -3
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/govern.d.ts +3 -3
- package/dist/commands/govern.d.ts.map +1 -1
- package/dist/commands/govern.js +4 -3
- package/dist/commands/govern.js.map +1 -1
- package/dist/commands/governance.d.ts +17 -0
- package/dist/commands/governance.d.ts.map +1 -0
- package/dist/commands/governance.js +703 -0
- package/dist/commands/governance.js.map +1 -0
- package/dist/commands/guardian.d.ts +20 -0
- package/dist/commands/guardian.d.ts.map +1 -0
- package/dist/commands/guardian.js +597 -0
- package/dist/commands/guardian.js.map +1 -0
- package/dist/commands/init.d.ts +7 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +71 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/performance-optimizer.d.ts +2 -2
- package/dist/commands/performance-optimizer.d.ts.map +1 -1
- package/dist/commands/performance-optimizer.js +8 -7
- package/dist/commands/performance-optimizer.js.map +1 -1
- package/dist/commands/plugins.d.ts +3 -3
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +2 -2
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/rag.d.ts +7 -0
- package/dist/commands/rag.d.ts.map +1 -0
- package/dist/commands/rag.js +748 -0
- package/dist/commands/rag.js.map +1 -0
- package/dist/commands/session.d.ts +41 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +441 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +3 -3
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +1 -3
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/test-init.d.ts.map +1 -1
- package/dist/commands/test-init.js +2 -2
- package/dist/commands/test-init.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +2 -2
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/vp.d.ts +7 -0
- package/dist/commands/vp.d.ts.map +1 -0
- package/dist/commands/vp.js +571 -0
- package/dist/commands/vp.js.map +1 -0
- package/dist/commands/watch.d.ts +3 -3
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +10 -7
- package/dist/commands/watch.js.map +1 -1
- package/dist/commands/worktree.d.ts +63 -0
- package/dist/commands/worktree.d.ts.map +1 -0
- package/dist/commands/worktree.js +774 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/context/context-manager.d.ts +1 -1
- package/dist/context/context-manager.d.ts.map +1 -1
- package/dist/context/context-manager.js +1 -1
- package/dist/context/context-manager.js.map +1 -1
- package/dist/context/session-manager.d.ts +2 -2
- package/dist/context/session-manager.d.ts.map +1 -1
- package/dist/context/session-manager.js +9 -5
- package/dist/context/session-manager.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive/interactive-mode.d.ts +2 -2
- package/dist/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/interactive/interactive-mode.js +6 -4
- package/dist/interactive/interactive-mode.js.map +1 -1
- package/dist/nlp/command-mapper.d.ts +1 -1
- package/dist/nlp/command-mapper.d.ts.map +1 -1
- package/dist/nlp/command-mapper.js +3 -2
- package/dist/nlp/command-mapper.js.map +1 -1
- package/dist/nlp/command-parser.d.ts +1 -1
- package/dist/nlp/command-parser.d.ts.map +1 -1
- package/dist/nlp/command-parser.js +2 -1
- package/dist/nlp/command-parser.js.map +1 -1
- package/dist/nlp/intent-parser.d.ts +1 -1
- package/dist/nlp/intent-parser.d.ts.map +1 -1
- package/dist/nlp/intent-parser.js +14 -9
- package/dist/nlp/intent-parser.js.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +2 -2
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +3 -3
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/backup-rollback-manager.d.ts +72 -0
- package/dist/utils/backup-rollback-manager.d.ts.map +1 -0
- package/dist/utils/backup-rollback-manager.js +289 -0
- package/dist/utils/backup-rollback-manager.js.map +1 -0
- package/dist/utils/claude-config-installer.d.ts +94 -0
- package/dist/utils/claude-config-installer.d.ts.map +1 -0
- package/dist/utils/claude-config-installer.js +628 -0
- package/dist/utils/claude-config-installer.js.map +1 -0
- package/dist/utils/config-manager.d.ts +1 -1
- package/dist/utils/config-manager.d.ts.map +1 -1
- package/dist/utils/config-manager.js +5 -5
- package/dist/utils/config-manager.js.map +1 -1
- package/dist/utils/error-handler.d.ts +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +22 -11
- package/dist/utils/logger.js.map +1 -1
- package/package.json +26 -7
- package/src/ai/ai-service.ts +22 -19
- package/src/ai/claude-client.ts +20 -16
- package/src/ai/conversation-manager.ts +37 -30
- package/src/cli.ts +42 -13
- package/src/commands/ai.ts +59 -57
- package/src/commands/alignment.ts +1212 -0
- package/src/commands/analyze-optimized.ts +70 -62
- package/src/commands/analyze.ts +22 -20
- package/src/commands/batch.ts +41 -38
- package/src/commands/chat.ts +37 -34
- package/src/commands/claude-init.ts +38 -30
- package/src/commands/claude-setup.ts +692 -97
- package/src/commands/computer-setup-commands.ts +203 -37
- package/src/commands/computer-setup.ts +474 -4
- package/src/commands/create-command.ts +7 -7
- package/src/commands/create.ts +36 -33
- package/src/commands/dashboard.ts +33 -28
- package/src/commands/govern.ts +34 -29
- package/src/commands/governance.ts +1005 -0
- package/src/commands/guardian.ts +887 -0
- package/src/commands/init.ts +112 -22
- package/src/commands/performance-optimizer.ts +48 -42
- package/src/commands/plugins.ts +35 -32
- package/src/commands/project-update.ts +1053 -0
- package/src/commands/rag.ts +904 -0
- package/src/commands/session.ts +631 -0
- package/src/commands/setup.ts +35 -31
- package/src/commands/test-init.ts +6 -5
- package/src/commands/test.ts +7 -6
- package/src/commands/vp.ts +762 -0
- package/src/commands/watch.ts +44 -33
- package/src/commands/worktree.ts +1057 -0
- package/src/context/context-manager.ts +15 -12
- package/src/context/session-manager.ts +51 -40
- package/src/index.ts +7 -6
- package/src/interactive/interactive-mode.ts +25 -18
- package/src/lib/conflict-resolution.ts +28 -0
- package/src/lib/merge-strategy.ts +28 -0
- package/src/lib/safety-mechanisms.ts +47 -0
- package/src/lib/state-detection.ts +28 -0
- package/src/nlp/command-mapper.ts +35 -30
- package/src/nlp/command-parser.ts +20 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +61 -49
- package/src/plugins/plugin-manager.ts +27 -23
- package/src/tests/computer-setup-integration.test.ts +439 -0
- package/src/types/index.ts +1 -1
- package/src/types/modules.d.ts +1 -0
- package/src/utils/backup-rollback-manager.ts +363 -0
- package/src/utils/claude-config-installer.ts +734 -0
- package/src/utils/config-manager.ts +12 -9
- package/src/utils/error-handler.ts +5 -3
- package/src/utils/logger.ts +35 -12
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import fs from 'fs-extra';
|
|
2
|
-
import path from 'path';
|
|
3
1
|
import os from 'os';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
import fs from 'fs-extra';
|
|
4
5
|
import { z } from 'zod';
|
|
5
|
-
|
|
6
|
-
import { logger } from './logger';
|
|
6
|
+
|
|
7
7
|
import { errorHandler } from './error-handler';
|
|
8
|
+
import { logger } from './logger';
|
|
9
|
+
|
|
10
|
+
import type { WundrConfig } from '../types';
|
|
8
11
|
|
|
9
12
|
// Zod schema for configuration validation
|
|
10
13
|
const WundrConfigSchema = z.object({
|
|
@@ -101,7 +104,7 @@ export class ConfigManager {
|
|
|
101
104
|
'WUNDR_CONFIG_INVALID',
|
|
102
105
|
'Failed to load or parse configuration file',
|
|
103
106
|
{ configPath: configFile },
|
|
104
|
-
true
|
|
107
|
+
true,
|
|
105
108
|
);
|
|
106
109
|
}
|
|
107
110
|
}
|
|
@@ -126,7 +129,7 @@ export class ConfigManager {
|
|
|
126
129
|
'WUNDR_CONFIG_INVALID',
|
|
127
130
|
'Failed to save configuration file',
|
|
128
131
|
{ configPath: configFile },
|
|
129
|
-
false
|
|
132
|
+
false,
|
|
130
133
|
);
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -166,7 +169,7 @@ export class ConfigManager {
|
|
|
166
169
|
return {
|
|
167
170
|
valid: false,
|
|
168
171
|
errors: error.issues.map(
|
|
169
|
-
issue => `${issue.path.join('.')}: ${issue.message}
|
|
172
|
+
issue => `${issue.path.join('.')}: ${issue.message}`,
|
|
170
173
|
),
|
|
171
174
|
};
|
|
172
175
|
}
|
|
@@ -213,7 +216,7 @@ export class ConfigManager {
|
|
|
213
216
|
throw new Error(`Invalid path: empty key at position ${i}`);
|
|
214
217
|
}
|
|
215
218
|
if (!current || typeof current !== 'object') {
|
|
216
|
-
throw new Error(
|
|
219
|
+
throw new Error('Invalid path: cannot set property on non-object');
|
|
217
220
|
}
|
|
218
221
|
if (!current[key] || typeof current[key] !== 'object') {
|
|
219
222
|
current[key] = {};
|
|
@@ -226,7 +229,7 @@ export class ConfigManager {
|
|
|
226
229
|
throw new Error('Invalid path: empty final key');
|
|
227
230
|
}
|
|
228
231
|
if (!finalKey || !current || typeof current !== 'object') {
|
|
229
|
-
throw new Error(
|
|
232
|
+
throw new Error('Invalid path: cannot set property');
|
|
230
233
|
}
|
|
231
234
|
current[finalKey] = value;
|
|
232
235
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { logger } from './logger';
|
|
4
4
|
|
|
5
|
+
import type { WundrError } from '../types';
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Centralized error handling system
|
|
7
9
|
*/
|
|
@@ -114,7 +116,7 @@ class ErrorHandler {
|
|
|
114
116
|
|
|
115
117
|
console.error(chalk.yellow('\nš” This appears to be an unexpected error.'));
|
|
116
118
|
console.error(
|
|
117
|
-
chalk.yellow(' Please report this issue with the above details.')
|
|
119
|
+
chalk.yellow(' Please report this issue with the above details.'),
|
|
118
120
|
);
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -165,7 +167,7 @@ class ErrorHandler {
|
|
|
165
167
|
code: string,
|
|
166
168
|
message: string,
|
|
167
169
|
context?: Record<string, any>,
|
|
168
|
-
recoverable = false
|
|
170
|
+
recoverable = false,
|
|
169
171
|
): WundrError {
|
|
170
172
|
const error = new Error(message) as WundrError;
|
|
171
173
|
error.code = code;
|
package/src/utils/logger.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { Logger } from '../types';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Enhanced logger with multiple levels and colored output
|
|
@@ -17,7 +18,9 @@ class WundrLogger implements Logger {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
private shouldLog(level: string): boolean {
|
|
20
|
-
if (this.silent)
|
|
21
|
+
if (this.silent) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
21
24
|
|
|
22
25
|
const levels = { debug: 0, info: 1, warn: 2, error: 3 };
|
|
23
26
|
return levels[level as keyof typeof levels] >= levels[this.level];
|
|
@@ -36,54 +39,74 @@ class WundrLogger implements Logger {
|
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
debug(message: string, ...args: any[]): void {
|
|
39
|
-
if (!this.shouldLog('debug'))
|
|
42
|
+
if (!this.shouldLog('debug')) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
40
45
|
console.log(chalk.gray(this.formatMessage('debug', message, ...args)));
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
info(message: string, ...args: any[]): void {
|
|
44
|
-
if (!this.shouldLog('info'))
|
|
49
|
+
if (!this.shouldLog('info')) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
45
52
|
console.log(chalk.blue(this.formatMessage('info', message, ...args)));
|
|
46
53
|
}
|
|
47
54
|
|
|
48
55
|
warn(message: string, ...args: any[]): void {
|
|
49
|
-
if (!this.shouldLog('warn'))
|
|
56
|
+
if (!this.shouldLog('warn')) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
50
59
|
console.warn(chalk.yellow(this.formatMessage('warn', message, ...args)));
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
error(message: string, ...args: any[]): void {
|
|
54
|
-
if (!this.shouldLog('error'))
|
|
63
|
+
if (!this.shouldLog('error')) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
55
66
|
console.error(chalk.red(this.formatMessage('error', message, ...args)));
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
success(message: string, ...args: any[]): void {
|
|
59
|
-
if (!this.shouldLog('info'))
|
|
70
|
+
if (!this.shouldLog('info')) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
60
73
|
console.log(chalk.green(this.formatMessage('success', message, ...args)));
|
|
61
74
|
}
|
|
62
75
|
|
|
63
76
|
// Utility methods for structured logging
|
|
64
77
|
table(data: any[]): void {
|
|
65
|
-
if (this.silent)
|
|
78
|
+
if (this.silent) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
66
81
|
console.table(data);
|
|
67
82
|
}
|
|
68
83
|
|
|
69
84
|
json(data: any): void {
|
|
70
|
-
if (this.silent)
|
|
85
|
+
if (this.silent) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
71
88
|
console.log(JSON.stringify(data, null, 2));
|
|
72
89
|
}
|
|
73
90
|
|
|
74
91
|
group(label: string): void {
|
|
75
|
-
if (this.silent)
|
|
92
|
+
if (this.silent) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
76
95
|
console.group(chalk.cyan(label));
|
|
77
96
|
}
|
|
78
97
|
|
|
79
98
|
groupEnd(): void {
|
|
80
|
-
if (this.silent)
|
|
99
|
+
if (this.silent) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
81
102
|
console.groupEnd();
|
|
82
103
|
}
|
|
83
104
|
|
|
84
105
|
// Progress logging
|
|
85
106
|
progress(current: number, total: number, message?: string): void {
|
|
86
|
-
if (this.silent)
|
|
107
|
+
if (this.silent) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
87
110
|
const percentage = Math.round((current / total) * 100);
|
|
88
111
|
const bar = 'ā'.repeat(Math.round(percentage / 2));
|
|
89
112
|
const empty = 'ā'.repeat(50 - Math.round(percentage / 2));
|