@wundr.io/cli 1.0.11 → 1.0.13
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/bin/wundr.js +8 -4
- package/dist/ai/ai-service.d.ts.map +1 -1
- package/dist/ai/ai-service.js.map +1 -1
- package/dist/ai/claude-client.js.map +1 -1
- package/dist/ai/conversation-manager.js.map +1 -1
- package/dist/commands/ai.d.ts.map +1 -1
- package/dist/commands/ai.js +179 -24
- package/dist/commands/ai.js.map +1 -1
- package/dist/commands/analyze-optimized.d.ts.map +1 -1
- package/dist/commands/analyze-optimized.js +15 -6
- package/dist/commands/analyze-optimized.js.map +1 -1
- package/dist/commands/batch.d.ts +22 -0
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +130 -14
- package/dist/commands/batch.js.map +1 -1
- package/dist/commands/chat.d.ts +1 -0
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +7 -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 +16 -16
- package/dist/commands/claude-init.js.map +1 -1
- package/dist/commands/claude-setup.d.ts +5 -5
- package/dist/commands/claude-setup.d.ts.map +1 -1
- package/dist/commands/claude-setup.js +65 -59
- package/dist/commands/claude-setup.js.map +1 -1
- package/dist/commands/computer-setup.d.ts +1 -0
- package/dist/commands/computer-setup.d.ts.map +1 -1
- package/dist/commands/computer-setup.js +35 -7
- package/dist/commands/computer-setup.js.map +1 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/govern.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/orchestrator.d.ts.map +1 -1
- package/dist/commands/orchestrator.js +11 -4
- package/dist/commands/orchestrator.js.map +1 -1
- package/dist/commands/performance-optimizer.d.ts.map +1 -1
- package/dist/commands/performance-optimizer.js.map +1 -1
- package/dist/commands/rag.d.ts.map +1 -1
- package/dist/commands/rag.js +9 -6
- package/dist/commands/rag.js.map +1 -1
- package/dist/commands/setup.d.ts +5 -10
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +35 -260
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js.map +1 -1
- package/dist/context/session-manager.js.map +1 -1
- package/dist/framework/command-interface.d.ts +349 -0
- package/dist/framework/command-interface.d.ts.map +1 -0
- package/dist/framework/command-interface.js +101 -0
- package/dist/framework/command-interface.js.map +1 -0
- package/dist/framework/command-registry.d.ts +173 -0
- package/dist/framework/command-registry.d.ts.map +1 -0
- package/dist/framework/command-registry.js +734 -0
- package/dist/framework/command-registry.js.map +1 -0
- package/dist/framework/completion-exporter.d.ts +79 -0
- package/dist/framework/completion-exporter.d.ts.map +1 -0
- package/dist/framework/completion-exporter.js +259 -0
- package/dist/framework/completion-exporter.js.map +1 -0
- package/dist/framework/debug-logger.d.ts +163 -0
- package/dist/framework/debug-logger.d.ts.map +1 -0
- package/dist/framework/debug-logger.js +373 -0
- package/dist/framework/debug-logger.js.map +1 -0
- package/dist/framework/error-handler.d.ts +196 -0
- package/dist/framework/error-handler.d.ts.map +1 -0
- package/dist/framework/error-handler.js +613 -0
- package/dist/framework/error-handler.js.map +1 -0
- package/dist/framework/help-generator.d.ts +78 -0
- package/dist/framework/help-generator.d.ts.map +1 -0
- package/dist/framework/help-generator.js +414 -0
- package/dist/framework/help-generator.js.map +1 -0
- package/dist/framework/index.d.ts +62 -0
- package/dist/framework/index.d.ts.map +1 -0
- package/dist/framework/index.js +95 -0
- package/dist/framework/index.js.map +1 -0
- package/dist/framework/interactive-repl.d.ts +138 -0
- package/dist/framework/interactive-repl.d.ts.map +1 -0
- package/dist/framework/interactive-repl.js +567 -0
- package/dist/framework/interactive-repl.js.map +1 -0
- package/dist/framework/output-formatter.d.ts +274 -0
- package/dist/framework/output-formatter.d.ts.map +1 -0
- package/dist/framework/output-formatter.js +545 -0
- package/dist/framework/output-formatter.js.map +1 -0
- package/dist/framework/progress-manager.d.ts +192 -0
- package/dist/framework/progress-manager.d.ts.map +1 -0
- package/dist/framework/progress-manager.js +408 -0
- package/dist/framework/progress-manager.js.map +1 -0
- package/dist/interactive/interactive-mode.js.map +1 -1
- package/dist/nlp/command-mapper.js.map +1 -1
- package/dist/nlp/command-parser.js.map +1 -1
- package/dist/nlp/intent-parser.d.ts.map +1 -1
- package/dist/nlp/intent-parser.js +4 -2
- package/dist/nlp/intent-parser.js.map +1 -1
- package/dist/plugins/plugin-manager.d.ts +2 -1
- package/dist/plugins/plugin-manager.d.ts.map +1 -1
- package/dist/plugins/plugin-manager.js +30 -19
- package/dist/plugins/plugin-manager.js.map +1 -1
- package/dist/utils/backup-rollback-manager.d.ts.map +1 -1
- package/dist/utils/backup-rollback-manager.js +1 -2
- package/dist/utils/backup-rollback-manager.js.map +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +6 -6
- package/src/ai/ai-service.ts +16 -17
- package/src/ai/claude-client.ts +16 -16
- package/src/ai/conversation-manager.ts +29 -29
- package/src/cli.ts +4 -4
- package/src/commands/ai.ts +246 -78
- package/src/commands/alignment.ts +74 -74
- package/src/commands/analyze-optimized.ts +111 -78
- package/src/commands/analyze.ts +14 -14
- package/src/commands/batch.ts +179 -42
- package/src/commands/chat.ts +37 -30
- package/src/commands/claude-init.ts +41 -45
- package/src/commands/claude-setup.ts +204 -119
- package/src/commands/computer-setup.ts +85 -43
- package/src/commands/create-command.ts +4 -4
- package/src/commands/create.ts +27 -27
- package/src/commands/dashboard.ts +24 -24
- package/src/commands/govern.ts +25 -25
- package/src/commands/governance.ts +34 -34
- package/src/commands/guardian.ts +56 -56
- package/src/commands/init.ts +25 -22
- package/src/commands/orchestrator.ts +68 -41
- package/src/commands/performance-optimizer.ts +34 -35
- package/src/commands/plugins.ts +27 -27
- package/src/commands/project-update.ts +175 -72
- package/src/commands/rag.ts +185 -78
- package/src/commands/session.ts +35 -35
- package/src/commands/setup.ts +40 -344
- package/src/commands/test-init.ts +3 -3
- package/src/commands/test.ts +4 -4
- package/src/commands/watch.ts +28 -29
- package/src/commands/worktree.ts +49 -49
- package/src/context/context-manager.ts +10 -10
- package/src/context/session-manager.ts +41 -41
- package/src/framework/command-interface.ts +520 -0
- package/src/framework/command-registry.ts +942 -0
- package/src/framework/completion-exporter.ts +383 -0
- package/src/framework/debug-logger.ts +519 -0
- package/src/framework/error-handler.ts +867 -0
- package/src/framework/help-generator.ts +540 -0
- package/src/framework/index.ts +169 -0
- package/src/framework/interactive-repl.ts +703 -0
- package/src/framework/output-formatter.ts +834 -0
- package/src/framework/progress-manager.ts +539 -0
- package/src/index.ts +4 -4
- package/src/interactive/interactive-mode.ts +16 -16
- package/src/lib/conflict-resolution.ts +799 -9
- package/src/lib/merge-strategy.ts +529 -7
- package/src/lib/safety-mechanisms.ts +422 -18
- package/src/lib/state-detection.ts +1015 -13
- package/src/nlp/command-mapper.ts +29 -29
- package/src/nlp/command-parser.ts +17 -17
- package/src/nlp/intent-classifier.ts +7 -7
- package/src/nlp/intent-parser.ts +54 -52
- package/src/plugins/plugin-manager.ts +61 -39
- package/src/tests/computer-setup-integration.test.ts +46 -15
- package/src/types/modules.d.ts +424 -1
- package/src/utils/backup-rollback-manager.ts +11 -8
- package/src/utils/config-manager.ts +3 -3
- package/src/utils/error-handler.ts +2 -2
- package/src/utils/logger.ts +22 -22
- package/templates/batch/ci-cd.yaml +7 -7
- package/test-suites/api/health.spec.ts +20 -23
- package/test-suites/helpers/test-config.ts +14 -13
- package/test-suites/ui/accessibility.spec.ts +27 -22
- package/test-suites/ui/smoke.spec.ts +26 -21
- package/dist/commands/computer-setup-commands.d.ts +0 -53
- package/dist/commands/computer-setup-commands.d.ts.map +0 -1
- package/dist/commands/computer-setup-commands.js +0 -705
- package/dist/commands/computer-setup-commands.js.map +0 -1
- package/dist/commands/vp.d.ts +0 -7
- package/dist/commands/vp.d.ts.map +0 -1
- package/dist/commands/vp.js +0 -571
- package/dist/commands/vp.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
* Integration tests for computer-setup with Claude Code configuration
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
describe,
|
|
7
|
+
it,
|
|
8
|
+
expect,
|
|
9
|
+
beforeEach,
|
|
10
|
+
afterEach,
|
|
11
|
+
jest,
|
|
12
|
+
} from '@jest/globals';
|
|
6
13
|
import * as fs from 'fs/promises';
|
|
7
14
|
import * as path from 'path';
|
|
8
15
|
import { existsSync } from 'fs';
|
|
@@ -79,7 +86,10 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
79
86
|
await fs.writeFile(testFile, 'original content');
|
|
80
87
|
|
|
81
88
|
// Create backup
|
|
82
|
-
const metadata = await backupManager.createBackup(
|
|
89
|
+
const metadata = await backupManager.createBackup(
|
|
90
|
+
[testFile],
|
|
91
|
+
'Test backup'
|
|
92
|
+
);
|
|
83
93
|
|
|
84
94
|
// Modify file
|
|
85
95
|
await fs.writeFile(testFile, 'modified content');
|
|
@@ -102,7 +112,10 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
102
112
|
const testFile = path.join(testDir, 'test.txt');
|
|
103
113
|
await fs.writeFile(testFile, 'content');
|
|
104
114
|
|
|
105
|
-
const metadata = await backupManager.createBackup(
|
|
115
|
+
const metadata = await backupManager.createBackup(
|
|
116
|
+
[testFile],
|
|
117
|
+
'Test backup'
|
|
118
|
+
);
|
|
106
119
|
|
|
107
120
|
const isValid = await backupManager.verifyBackup(metadata.backupId);
|
|
108
121
|
expect(isValid).toBe(true);
|
|
@@ -206,7 +219,9 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
206
219
|
const conventionsPath = path.join(claudeDir, 'conventions.json');
|
|
207
220
|
expect(existsSync(conventionsPath)).toBe(true);
|
|
208
221
|
|
|
209
|
-
const conventions = JSON.parse(
|
|
222
|
+
const conventions = JSON.parse(
|
|
223
|
+
await fs.readFile(conventionsPath, 'utf-8')
|
|
224
|
+
);
|
|
210
225
|
expect(conventions).toHaveProperty('fileNaming');
|
|
211
226
|
expect(conventions).toHaveProperty('codeStyle');
|
|
212
227
|
});
|
|
@@ -220,9 +235,15 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
220
235
|
expect(result.success).toBe(true);
|
|
221
236
|
|
|
222
237
|
const agentsDir = path.join(claudeDir, 'agents');
|
|
223
|
-
expect(existsSync(path.join(agentsDir, 'backend-developer.json'))).toBe(
|
|
224
|
-
|
|
225
|
-
|
|
238
|
+
expect(existsSync(path.join(agentsDir, 'backend-developer.json'))).toBe(
|
|
239
|
+
true
|
|
240
|
+
);
|
|
241
|
+
expect(existsSync(path.join(agentsDir, 'frontend-developer.json'))).toBe(
|
|
242
|
+
true
|
|
243
|
+
);
|
|
244
|
+
expect(existsSync(path.join(agentsDir, 'fullstack-developer.json'))).toBe(
|
|
245
|
+
true
|
|
246
|
+
);
|
|
226
247
|
});
|
|
227
248
|
|
|
228
249
|
it('should install git-worktree workflows', async () => {
|
|
@@ -279,7 +300,10 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
279
300
|
expect(result.skipped).toContain('CLAUDE.md');
|
|
280
301
|
|
|
281
302
|
// Content should remain unchanged
|
|
282
|
-
const content = await fs.readFile(
|
|
303
|
+
const content = await fs.readFile(
|
|
304
|
+
path.join(claudeDir, 'CLAUDE.md'),
|
|
305
|
+
'utf-8'
|
|
306
|
+
);
|
|
283
307
|
expect(content).toBe('existing content');
|
|
284
308
|
});
|
|
285
309
|
|
|
@@ -296,7 +320,10 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
296
320
|
expect(result.installed).toContain('CLAUDE.md');
|
|
297
321
|
|
|
298
322
|
// Content should be updated
|
|
299
|
-
const content = await fs.readFile(
|
|
323
|
+
const content = await fs.readFile(
|
|
324
|
+
path.join(claudeDir, 'CLAUDE.md'),
|
|
325
|
+
'utf-8'
|
|
326
|
+
);
|
|
300
327
|
expect(content).toContain('Test content');
|
|
301
328
|
});
|
|
302
329
|
|
|
@@ -347,16 +374,20 @@ describe('Computer Setup Integration Tests', () => {
|
|
|
347
374
|
// Verify all components installed
|
|
348
375
|
expect(existsSync(path.join(claudeDir, 'CLAUDE.md'))).toBe(true);
|
|
349
376
|
expect(existsSync(path.join(claudeDir, 'conventions.json'))).toBe(true);
|
|
350
|
-
expect(existsSync(path.join(claudeDir, 'hooks', 'pre-commit'))).toBe(
|
|
351
|
-
expect(existsSync(path.join(claudeDir, 'agents', 'backend-developer.json'))).toBe(
|
|
377
|
+
expect(existsSync(path.join(claudeDir, 'hooks', 'pre-commit'))).toBe(
|
|
352
378
|
true
|
|
353
379
|
);
|
|
354
380
|
expect(
|
|
355
|
-
existsSync(path.join(claudeDir, '
|
|
381
|
+
existsSync(path.join(claudeDir, 'agents', 'backend-developer.json'))
|
|
382
|
+
).toBe(true);
|
|
383
|
+
expect(
|
|
384
|
+
existsSync(
|
|
385
|
+
path.join(claudeDir, 'workflows', 'feature-development.json')
|
|
386
|
+
)
|
|
387
|
+
).toBe(true);
|
|
388
|
+
expect(
|
|
389
|
+
existsSync(path.join(claudeDir, 'scripts', 'validate-setup.sh'))
|
|
356
390
|
).toBe(true);
|
|
357
|
-
expect(existsSync(path.join(claudeDir, 'scripts', 'validate-setup.sh'))).toBe(
|
|
358
|
-
true
|
|
359
|
-
);
|
|
360
391
|
});
|
|
361
392
|
|
|
362
393
|
it('should support complete backup and rollback cycle', async () => {
|
package/src/types/modules.d.ts
CHANGED
|
@@ -1,5 +1,416 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Ambient module declarations for workspace packages that may not be built.
|
|
4
|
+
*
|
|
5
|
+
* These declarations provide type stubs so the CLI package compiles
|
|
6
|
+
* independently of whether sibling workspace packages have been built.
|
|
7
|
+
* When the real packages are built and resolvable, TypeScript will prefer
|
|
8
|
+
* their actual declarations over these ambient ones.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// @wundr.io/computer-setup
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
declare module '@wundr.io/computer-setup' {
|
|
16
|
+
import { EventEmitter } from 'events';
|
|
17
|
+
|
|
18
|
+
export interface DeveloperProfile {
|
|
19
|
+
name: string;
|
|
20
|
+
email?: string;
|
|
21
|
+
role: string;
|
|
22
|
+
team?: string;
|
|
23
|
+
company?: string;
|
|
24
|
+
preferences?: ProfilePreferences;
|
|
25
|
+
languages?: Record<string, boolean>;
|
|
26
|
+
frameworks?: Record<string, boolean>;
|
|
27
|
+
tools: {
|
|
28
|
+
packageManagers?: Record<string, boolean>;
|
|
29
|
+
containers?: Record<string, boolean>;
|
|
30
|
+
editors?: Record<string, boolean>;
|
|
31
|
+
databases?: Record<string, boolean>;
|
|
32
|
+
cloud?: Record<string, boolean>;
|
|
33
|
+
ci?: Record<string, boolean>;
|
|
34
|
+
languages?: Record<string, boolean>;
|
|
35
|
+
cloudCLIs?: Record<string, boolean>;
|
|
36
|
+
monitoring?: Record<string, boolean>;
|
|
37
|
+
communication?: Record<string, boolean>;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ProfilePreferences {
|
|
42
|
+
shell: 'bash' | 'zsh' | 'fish';
|
|
43
|
+
editor: 'vscode' | 'vim' | 'neovim' | 'sublime' | 'intellij';
|
|
44
|
+
theme: 'dark' | 'light' | 'auto';
|
|
45
|
+
gitConfig: {
|
|
46
|
+
userName: string;
|
|
47
|
+
userEmail: string;
|
|
48
|
+
signCommits: boolean;
|
|
49
|
+
gpgKey?: string;
|
|
50
|
+
sshKey?: string;
|
|
51
|
+
defaultBranch: string;
|
|
52
|
+
aliases: Record<string, string>;
|
|
53
|
+
};
|
|
54
|
+
aiTools: {
|
|
55
|
+
claudeCode: boolean;
|
|
56
|
+
ruflo: boolean;
|
|
57
|
+
mcpTools: string[];
|
|
58
|
+
swarmAgents: string[];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SetupPlatform {
|
|
63
|
+
os: 'darwin' | 'linux' | 'win32';
|
|
64
|
+
arch: 'x64' | 'arm64';
|
|
65
|
+
distro?: string;
|
|
66
|
+
version?: string;
|
|
67
|
+
node?: string;
|
|
68
|
+
shell?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface SetupResult {
|
|
72
|
+
success: boolean;
|
|
73
|
+
completedSteps: string[];
|
|
74
|
+
failedSteps: string[];
|
|
75
|
+
skippedSteps: string[];
|
|
76
|
+
warnings: string[];
|
|
77
|
+
errors: Error[];
|
|
78
|
+
duration: number;
|
|
79
|
+
report?: any;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface SetupProgress {
|
|
83
|
+
totalSteps: number;
|
|
84
|
+
completedSteps: number;
|
|
85
|
+
currentStep: string;
|
|
86
|
+
percentage: number;
|
|
87
|
+
estimatedTimeRemaining: number;
|
|
88
|
+
logs: string[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface SetupProfile {
|
|
92
|
+
name: string;
|
|
93
|
+
description: string;
|
|
94
|
+
estimatedTimeMinutes: number;
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ComputerSetupManager is the single setup orchestrator. (RealSetupOrchestrator
|
|
99
|
+
// and SetupOrchestrator were retired during the orchestrator consolidation.)
|
|
100
|
+
export class ComputerSetupManager extends EventEmitter {
|
|
101
|
+
static getInstance(): ComputerSetupManager;
|
|
102
|
+
initialize(): Promise<void>;
|
|
103
|
+
validateSetup(profile?: any): Promise<boolean>;
|
|
104
|
+
cleanup(): Promise<void>;
|
|
105
|
+
getProfile(name: string): Promise<DeveloperProfile>;
|
|
106
|
+
getDefaultProfile(): Promise<DeveloperProfile>;
|
|
107
|
+
getAvailableProfiles(): Promise<DeveloperProfile[]>;
|
|
108
|
+
setup(options: any): Promise<SetupResult>;
|
|
109
|
+
on(event: string, callback: Function): this;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// @wundr.io/core (supplement missing RAG exports)
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
|
|
117
|
+
declare module '@wundr.io/core' {
|
|
118
|
+
// Core exports that exist in built dist
|
|
119
|
+
export interface WundrError extends Error {
|
|
120
|
+
code?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface EventBusEvent {
|
|
123
|
+
type: string;
|
|
124
|
+
payload?: unknown;
|
|
125
|
+
}
|
|
126
|
+
export type EventHandler = (event: EventBusEvent) => void | Promise<void>;
|
|
127
|
+
export interface EventBus {
|
|
128
|
+
emit(event: EventBusEvent): void;
|
|
129
|
+
on(type: string, handler: EventHandler): void;
|
|
130
|
+
off(type: string, handler: EventHandler): void;
|
|
131
|
+
}
|
|
132
|
+
export interface ValidationResult {
|
|
133
|
+
valid: boolean;
|
|
134
|
+
errors: string[];
|
|
135
|
+
}
|
|
136
|
+
export type UtilityFunction = (...args: any[]) => any;
|
|
137
|
+
export type AsyncUtilityFunction = (...args: any[]) => Promise<any>;
|
|
138
|
+
export interface Result<T> {
|
|
139
|
+
success: boolean;
|
|
140
|
+
data?: T;
|
|
141
|
+
error?: Error;
|
|
142
|
+
}
|
|
143
|
+
export interface BaseConfig {
|
|
144
|
+
[key: string]: unknown;
|
|
145
|
+
}
|
|
146
|
+
export type CoreEventType = string;
|
|
147
|
+
export const CORE_EVENTS: Record<string, string>;
|
|
148
|
+
|
|
149
|
+
// Logging
|
|
150
|
+
export function getLogger(name: string): any;
|
|
151
|
+
export function log(level: string, message: string, ...args: any[]): void;
|
|
152
|
+
|
|
153
|
+
// Events
|
|
154
|
+
export function getEventBus(): EventBus;
|
|
155
|
+
|
|
156
|
+
// Errors
|
|
157
|
+
export function success<T>(data: T): Result<T>;
|
|
158
|
+
export function failure(error: Error): Result<never>;
|
|
159
|
+
export function isSuccess<T>(result: Result<T>): boolean;
|
|
160
|
+
export function isFailure<T>(result: Result<T>): boolean;
|
|
161
|
+
export class BaseWundrError extends Error {
|
|
162
|
+
code: string;
|
|
163
|
+
constructor(message: string, code: string);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// RAG (not yet in built dist)
|
|
167
|
+
export interface RagInitOptions {
|
|
168
|
+
projectPath?: string;
|
|
169
|
+
projectName?: string;
|
|
170
|
+
force?: boolean;
|
|
171
|
+
skipIndexing?: boolean;
|
|
172
|
+
includePatterns?: string[];
|
|
173
|
+
excludePatterns?: string[];
|
|
174
|
+
chunkSize?: number;
|
|
175
|
+
chunkOverlap?: number;
|
|
176
|
+
embeddingModel?: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface RagInitResult {
|
|
180
|
+
success: boolean;
|
|
181
|
+
filesIndexed: number;
|
|
182
|
+
chunksCreated: number;
|
|
183
|
+
storePath: string;
|
|
184
|
+
configPath: string;
|
|
185
|
+
excludePath: string;
|
|
186
|
+
errors: string[];
|
|
187
|
+
warnings: string[];
|
|
188
|
+
framework: {
|
|
189
|
+
name: string;
|
|
190
|
+
projectType: string;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function initProjectRag(
|
|
195
|
+
projectPathOrOptions: string | RagInitOptions,
|
|
196
|
+
options?: RagInitOptions
|
|
197
|
+
): Promise<RagInitResult>;
|
|
198
|
+
export function isRagInitialized(projectPath: string): Promise<boolean>;
|
|
199
|
+
export function removeRag(projectPath: string): Promise<void>;
|
|
200
|
+
export function reindexProject(projectPath: string): Promise<RagInitResult>;
|
|
201
|
+
|
|
202
|
+
export const version: string;
|
|
203
|
+
export const name: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// ---------------------------------------------------------------------------
|
|
207
|
+
// @wundr.io/governance
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
|
|
210
|
+
declare module '@wundr.io/governance' {
|
|
211
|
+
export interface EvaluationContext {
|
|
212
|
+
projectPath?: string;
|
|
213
|
+
configPath?: string;
|
|
214
|
+
environment?: string;
|
|
215
|
+
evaluationId?: string;
|
|
216
|
+
timestamp?: Date;
|
|
217
|
+
source?: string;
|
|
218
|
+
repository?: string;
|
|
219
|
+
metadata?: Record<string, unknown>;
|
|
220
|
+
[key: string]: unknown;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface EvaluationResult {
|
|
224
|
+
passed: boolean;
|
|
225
|
+
score: number;
|
|
226
|
+
overallScore: number;
|
|
227
|
+
violations: PolicyViolation[];
|
|
228
|
+
warnings: string[];
|
|
229
|
+
details: EvaluationDetail[];
|
|
230
|
+
results: EvaluationResult[];
|
|
231
|
+
criticalIssues: string[];
|
|
232
|
+
issues: any[];
|
|
233
|
+
recommendations: any[];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface EvaluationDetail {
|
|
237
|
+
evaluator: string;
|
|
238
|
+
passed: boolean;
|
|
239
|
+
score: number;
|
|
240
|
+
message: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface PolicyViolation {
|
|
244
|
+
rule: string;
|
|
245
|
+
severity: string;
|
|
246
|
+
message: string;
|
|
247
|
+
description: string;
|
|
248
|
+
policyName: string;
|
|
249
|
+
policyId: string;
|
|
250
|
+
file?: string;
|
|
251
|
+
line?: number;
|
|
252
|
+
location: string;
|
|
253
|
+
suggestion?: string;
|
|
254
|
+
suggestedFix: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface ComplianceResult {
|
|
258
|
+
compliant: boolean;
|
|
259
|
+
score: number;
|
|
260
|
+
violations: PolicyViolation[];
|
|
261
|
+
recommendations: string[];
|
|
262
|
+
passedPolicies: any[];
|
|
263
|
+
skippedPolicies: any[];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface IPREConfig {
|
|
267
|
+
version: string;
|
|
268
|
+
metadata?: {
|
|
269
|
+
name?: string;
|
|
270
|
+
description?: string;
|
|
271
|
+
author?: string;
|
|
272
|
+
};
|
|
273
|
+
intent?: any;
|
|
274
|
+
policies?: any;
|
|
275
|
+
rewards?: any;
|
|
276
|
+
evaluators?: any;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface PolicyRule {
|
|
280
|
+
name: string;
|
|
281
|
+
description: string;
|
|
282
|
+
severity: string;
|
|
283
|
+
check: (context: EvaluationContext) => Promise<boolean>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface EvaluatorSuite {
|
|
287
|
+
policyCompliance: EvaluatorAgent & {
|
|
288
|
+
checkPolicyCompliance(
|
|
289
|
+
context: EvaluationContext
|
|
290
|
+
): Promise<ComplianceResult>;
|
|
291
|
+
};
|
|
292
|
+
rewardAlignment: EvaluatorAgent;
|
|
293
|
+
driftDetection: EvaluatorAgent;
|
|
294
|
+
[key: string]: any;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export class EvaluatorAgent {
|
|
298
|
+
constructor(config: any);
|
|
299
|
+
evaluate(context: EvaluationContext): Promise<EvaluationResult>;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function createEvaluator(config: any): EvaluatorAgent;
|
|
303
|
+
export function createEvaluatorSuite(configs?: any): EvaluatorSuite;
|
|
304
|
+
export function runEvaluatorSuite(
|
|
305
|
+
suite: EvaluatorAgent[] | EvaluatorSuite,
|
|
306
|
+
context: EvaluationContext
|
|
307
|
+
): Promise<EvaluationResult>;
|
|
308
|
+
|
|
309
|
+
export class PolicyEngine {
|
|
310
|
+
constructor(config?: any);
|
|
311
|
+
loadPolicies(path: string): Promise<void>;
|
|
312
|
+
check(context: EvaluationContext): Promise<ComplianceResult>;
|
|
313
|
+
addRule(rule: PolicyRule): void;
|
|
314
|
+
getViolationStats(): {
|
|
315
|
+
total: number;
|
|
316
|
+
bySeverity: Record<string, number>;
|
|
317
|
+
byCategory: Record<string, number>;
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export const version: string;
|
|
322
|
+
export const name: string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// ---------------------------------------------------------------------------
|
|
326
|
+
// @wundr.io/guardian-dashboard
|
|
327
|
+
// ---------------------------------------------------------------------------
|
|
328
|
+
|
|
329
|
+
declare module '@wundr.io/guardian-dashboard' {
|
|
330
|
+
export type HealthStatus =
|
|
331
|
+
| 'healthy'
|
|
332
|
+
| 'degraded'
|
|
333
|
+
| 'unhealthy'
|
|
334
|
+
| 'unknown'
|
|
335
|
+
| 'HEALTHY'
|
|
336
|
+
| 'CONCERNING'
|
|
337
|
+
| 'CRITICAL'
|
|
338
|
+
| 'DEGRADED'
|
|
339
|
+
| 'UNHEALTHY'
|
|
340
|
+
| 'UNKNOWN';
|
|
341
|
+
export type InterventionSeverity = 'critical' | 'high' | 'medium' | 'low';
|
|
342
|
+
|
|
343
|
+
export interface SessionDriftData {
|
|
344
|
+
sessionId: string;
|
|
345
|
+
driftScore: number;
|
|
346
|
+
timestamp: Date;
|
|
347
|
+
metrics: Record<string, number>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface AggregatedDriftReport {
|
|
351
|
+
averageDrift: number;
|
|
352
|
+
averageScore: number;
|
|
353
|
+
maxDrift: number;
|
|
354
|
+
minScore: number;
|
|
355
|
+
maxScore: number;
|
|
356
|
+
sessionCount: number;
|
|
357
|
+
totalSessions: number;
|
|
358
|
+
overallStatus: HealthStatus;
|
|
359
|
+
trend: string;
|
|
360
|
+
trendDirection: 'improving' | 'stable' | 'degrading';
|
|
361
|
+
sessions: SessionDriftData[];
|
|
362
|
+
criticalSessions: SessionDriftData[];
|
|
363
|
+
concerningSessions: SessionDriftData[];
|
|
364
|
+
timestamp: Date;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface InterventionRecommendation {
|
|
368
|
+
id: string;
|
|
369
|
+
severity: InterventionSeverity;
|
|
370
|
+
title: string;
|
|
371
|
+
description: string;
|
|
372
|
+
suggestedAction: string;
|
|
373
|
+
estimatedImpact: number;
|
|
374
|
+
dimension: string;
|
|
375
|
+
action: string;
|
|
376
|
+
rationale: string;
|
|
377
|
+
urgency: number;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface AlignmentDriftMetrics {
|
|
381
|
+
overallDrift: number;
|
|
382
|
+
componentDrifts: Record<string, number>;
|
|
383
|
+
healthStatus: HealthStatus;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export class AlignmentDebtCalculator {
|
|
387
|
+
constructor(config?: any);
|
|
388
|
+
calculate(metrics: AlignmentDriftMetrics): number;
|
|
389
|
+
getDebtTrend(history: AlignmentDriftMetrics[]): string;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export class DriftScoreAggregator {
|
|
393
|
+
constructor(config?: any);
|
|
394
|
+
aggregate(sessions: SessionDriftData[]): AggregatedDriftReport;
|
|
395
|
+
addSessions(sessions: SessionDriftData[]): void;
|
|
396
|
+
aggregateSessionScores(sessions: SessionDriftData[]): AggregatedDriftReport;
|
|
397
|
+
getHealthStatus(score: number): HealthStatus;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export class InterventionRecommender {
|
|
401
|
+
constructor(config?: any);
|
|
402
|
+
recommend(report: AggregatedDriftReport): InterventionRecommendation[];
|
|
403
|
+
recommendInterventions(data: any): InterventionRecommendation[];
|
|
404
|
+
prioritize(
|
|
405
|
+
recommendations: InterventionRecommendation[]
|
|
406
|
+
): InterventionRecommendation[];
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// ---------------------------------------------------------------------------
|
|
411
|
+
// @wundr/computer-setup (legacy without .io)
|
|
412
|
+
// ---------------------------------------------------------------------------
|
|
413
|
+
|
|
3
414
|
declare module '@wundr/computer-setup' {
|
|
4
415
|
export class ComputerSetupManager {
|
|
5
416
|
static getInstance(): ComputerSetupManager;
|
|
@@ -22,6 +433,10 @@ declare module '@wundr/computer-setup' {
|
|
|
22
433
|
}
|
|
23
434
|
}
|
|
24
435
|
|
|
436
|
+
// ---------------------------------------------------------------------------
|
|
437
|
+
// @wundr/core (legacy without .io)
|
|
438
|
+
// ---------------------------------------------------------------------------
|
|
439
|
+
|
|
25
440
|
declare module '@wundr/core' {
|
|
26
441
|
export interface CoreConfig {
|
|
27
442
|
[key: string]: any;
|
|
@@ -30,6 +445,10 @@ declare module '@wundr/core' {
|
|
|
30
445
|
export function getLogger(name: string): any;
|
|
31
446
|
}
|
|
32
447
|
|
|
448
|
+
// ---------------------------------------------------------------------------
|
|
449
|
+
// @wundr/project-templates
|
|
450
|
+
// ---------------------------------------------------------------------------
|
|
451
|
+
|
|
33
452
|
declare module '@wundr/project-templates' {
|
|
34
453
|
export interface TemplateConfig {
|
|
35
454
|
name: string;
|
|
@@ -42,6 +461,10 @@ declare module '@wundr/project-templates' {
|
|
|
42
461
|
export const projectTemplates: Record<string, any>;
|
|
43
462
|
}
|
|
44
463
|
|
|
464
|
+
// ---------------------------------------------------------------------------
|
|
465
|
+
// open
|
|
466
|
+
// ---------------------------------------------------------------------------
|
|
467
|
+
|
|
45
468
|
declare module 'open' {
|
|
46
469
|
interface Options {
|
|
47
470
|
app?: string | string[];
|
|
@@ -39,8 +39,7 @@ export class BackupRollbackManager {
|
|
|
39
39
|
|
|
40
40
|
constructor(backupDir?: string) {
|
|
41
41
|
this.homeDir = process.env.HOME || process.env.USERPROFILE || '';
|
|
42
|
-
this.backupDir =
|
|
43
|
-
backupDir || path.join(this.homeDir, '.wundr', 'backups');
|
|
42
|
+
this.backupDir = backupDir || path.join(this.homeDir, '.wundr', 'backups');
|
|
44
43
|
this.metadataFile = path.join(this.backupDir, 'metadata.json');
|
|
45
44
|
}
|
|
46
45
|
|
|
@@ -67,7 +66,7 @@ export class BackupRollbackManager {
|
|
|
67
66
|
*/
|
|
68
67
|
async createBackup(
|
|
69
68
|
files: string[],
|
|
70
|
-
reason: string = 'Manual backup'
|
|
69
|
+
reason: string = 'Manual backup'
|
|
71
70
|
): Promise<BackupMetadata> {
|
|
72
71
|
const backupId = this.generateBackupId();
|
|
73
72
|
const timestamp = new Date().toISOString();
|
|
@@ -203,7 +202,9 @@ export class BackupRollbackManager {
|
|
|
203
202
|
console.log(chalk.green(`\n✅ Restored ${restoredFiles.length} files`));
|
|
204
203
|
|
|
205
204
|
if (failedFiles.length > 0) {
|
|
206
|
-
console.log(
|
|
205
|
+
console.log(
|
|
206
|
+
chalk.red(`❌ Failed to restore ${failedFiles.length} files`)
|
|
207
|
+
);
|
|
207
208
|
failedFiles.forEach(file => {
|
|
208
209
|
console.log(chalk.red(` - ${file}`));
|
|
209
210
|
});
|
|
@@ -224,8 +225,9 @@ export class BackupRollbackManager {
|
|
|
224
225
|
try {
|
|
225
226
|
const content = await fs.readFile(this.metadataFile, 'utf-8');
|
|
226
227
|
const backups = JSON.parse(content) as BackupMetadata[];
|
|
227
|
-
return backups.sort(
|
|
228
|
-
|
|
228
|
+
return backups.sort(
|
|
229
|
+
(a, b) =>
|
|
230
|
+
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
229
231
|
);
|
|
230
232
|
} catch (error) {
|
|
231
233
|
logger.error('Failed to list backups', error);
|
|
@@ -347,8 +349,9 @@ export class BackupRollbackManager {
|
|
|
347
349
|
console.log(chalk.white('Backup ID:'), chalk.green(metadata.backupId));
|
|
348
350
|
console.log(chalk.white('Timestamp:'), chalk.gray(metadata.timestamp));
|
|
349
351
|
console.log(chalk.white('Reason:'), chalk.gray(metadata.reason));
|
|
350
|
-
console.log(
|
|
351
|
-
|
|
352
|
+
console.log(
|
|
353
|
+
chalk.white('Status:'),
|
|
354
|
+
metadata.success ? chalk.green('Success') : chalk.red('Failed')
|
|
352
355
|
);
|
|
353
356
|
console.log(chalk.white('Files:'), chalk.cyan(metadata.files.length));
|
|
354
357
|
|
|
@@ -104,7 +104,7 @@ export class ConfigManager {
|
|
|
104
104
|
'WUNDR_CONFIG_INVALID',
|
|
105
105
|
'Failed to load or parse configuration file',
|
|
106
106
|
{ configPath: configFile },
|
|
107
|
-
true
|
|
107
|
+
true
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -129,7 +129,7 @@ export class ConfigManager {
|
|
|
129
129
|
'WUNDR_CONFIG_INVALID',
|
|
130
130
|
'Failed to save configuration file',
|
|
131
131
|
{ configPath: configFile },
|
|
132
|
-
false
|
|
132
|
+
false
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -169,7 +169,7 @@ export class ConfigManager {
|
|
|
169
169
|
return {
|
|
170
170
|
valid: false,
|
|
171
171
|
errors: error.issues.map(
|
|
172
|
-
issue => `${issue.path.join('.')}: ${issue.message}
|
|
172
|
+
issue => `${issue.path.join('.')}: ${issue.message}`
|
|
173
173
|
),
|
|
174
174
|
};
|
|
175
175
|
}
|
|
@@ -116,7 +116,7 @@ class ErrorHandler {
|
|
|
116
116
|
|
|
117
117
|
console.error(chalk.yellow('\n💡 This appears to be an unexpected error.'));
|
|
118
118
|
console.error(
|
|
119
|
-
chalk.yellow(' Please report this issue with the above details.')
|
|
119
|
+
chalk.yellow(' Please report this issue with the above details.')
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -167,7 +167,7 @@ class ErrorHandler {
|
|
|
167
167
|
code: string,
|
|
168
168
|
message: string,
|
|
169
169
|
context?: Record<string, any>,
|
|
170
|
-
recoverable = false
|
|
170
|
+
recoverable = false
|
|
171
171
|
): WundrError {
|
|
172
172
|
const error = new Error(message) as WundrError;
|
|
173
173
|
error.code = code;
|