@wundr.io/cli 1.0.10 → 1.0.12
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/package.json +23 -23
- 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/LICENSE +0 -21
- package/dist/ai/ai-service.d.ts +0 -152
- package/dist/ai/ai-service.d.ts.map +0 -1
- package/dist/ai/ai-service.js +0 -430
- package/dist/ai/ai-service.js.map +0 -1
- package/dist/ai/claude-client.d.ts +0 -130
- package/dist/ai/claude-client.d.ts.map +0 -1
- package/dist/ai/claude-client.js +0 -340
- package/dist/ai/claude-client.js.map +0 -1
- package/dist/ai/conversation-manager.d.ts +0 -164
- package/dist/ai/conversation-manager.d.ts.map +0 -1
- package/dist/ai/conversation-manager.js +0 -614
- package/dist/ai/conversation-manager.js.map +0 -1
- package/dist/ai/index.d.ts +0 -5
- package/dist/ai/index.d.ts.map +0 -1
- package/dist/ai/index.js +0 -8
- package/dist/ai/index.js.map +0 -1
- package/dist/cli.d.ts +0 -36
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -192
- package/dist/cli.js.map +0 -1
- package/dist/commands/ai.d.ts +0 -89
- package/dist/commands/ai.d.ts.map +0 -1
- package/dist/commands/ai.js +0 -799
- package/dist/commands/ai.js.map +0 -1
- package/dist/commands/alignment.d.ts +0 -78
- package/dist/commands/alignment.d.ts.map +0 -1
- package/dist/commands/alignment.js +0 -817
- package/dist/commands/alignment.js.map +0 -1
- package/dist/commands/analyze-optimized.d.ts +0 -14
- package/dist/commands/analyze-optimized.d.ts.map +0 -1
- package/dist/commands/analyze-optimized.js +0 -600
- package/dist/commands/analyze-optimized.js.map +0 -1
- package/dist/commands/analyze.d.ts +0 -65
- package/dist/commands/analyze.d.ts.map +0 -1
- package/dist/commands/analyze.js +0 -435
- package/dist/commands/analyze.js.map +0 -1
- package/dist/commands/batch.d.ts +0 -71
- package/dist/commands/batch.d.ts.map +0 -1
- package/dist/commands/batch.js +0 -738
- package/dist/commands/batch.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -71
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -674
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/claude-init.d.ts +0 -28
- package/dist/commands/claude-init.d.ts.map +0 -1
- package/dist/commands/claude-init.js +0 -591
- package/dist/commands/claude-init.js.map +0 -1
- package/dist/commands/claude-setup.d.ts +0 -119
- package/dist/commands/claude-setup.d.ts.map +0 -1
- package/dist/commands/claude-setup.js +0 -1073
- package/dist/commands/claude-setup.js.map +0 -1
- 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/computer-setup.d.ts +0 -7
- package/dist/commands/computer-setup.d.ts.map +0 -1
- package/dist/commands/computer-setup.js +0 -849
- package/dist/commands/computer-setup.js.map +0 -1
- package/dist/commands/create-command.d.ts +0 -7
- package/dist/commands/create-command.d.ts.map +0 -1
- package/dist/commands/create-command.js +0 -158
- package/dist/commands/create-command.js.map +0 -1
- package/dist/commands/create.d.ts +0 -74
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js +0 -556
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -91
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/dashboard.js +0 -538
- package/dist/commands/dashboard.js.map +0 -1
- package/dist/commands/govern.d.ts +0 -70
- package/dist/commands/govern.d.ts.map +0 -1
- package/dist/commands/govern.js +0 -481
- package/dist/commands/govern.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -17
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -703
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/guardian.d.ts +0 -20
- package/dist/commands/guardian.d.ts.map +0 -1
- package/dist/commands/guardian.js +0 -597
- package/dist/commands/guardian.js.map +0 -1
- package/dist/commands/init.d.ts +0 -59
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -650
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/orchestrator.d.ts +0 -7
- package/dist/commands/orchestrator.d.ts.map +0 -1
- package/dist/commands/orchestrator.js +0 -571
- package/dist/commands/orchestrator.js.map +0 -1
- package/dist/commands/performance-optimizer.d.ts +0 -30
- package/dist/commands/performance-optimizer.d.ts.map +0 -1
- package/dist/commands/performance-optimizer.js +0 -650
- package/dist/commands/performance-optimizer.js.map +0 -1
- package/dist/commands/plugins.d.ts +0 -87
- package/dist/commands/plugins.d.ts.map +0 -1
- package/dist/commands/plugins.js +0 -685
- package/dist/commands/plugins.js.map +0 -1
- package/dist/commands/rag.d.ts +0 -7
- package/dist/commands/rag.d.ts.map +0 -1
- package/dist/commands/rag.js +0 -748
- package/dist/commands/rag.js.map +0 -1
- package/dist/commands/session.d.ts +0 -41
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js +0 -441
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -29
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -397
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/test-init.d.ts +0 -9
- package/dist/commands/test-init.d.ts.map +0 -1
- package/dist/commands/test-init.js +0 -222
- package/dist/commands/test-init.js.map +0 -1
- package/dist/commands/test.d.ts +0 -25
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -217
- package/dist/commands/test.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/dist/commands/watch.d.ts +0 -76
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/watch.js +0 -613
- package/dist/commands/watch.js.map +0 -1
- package/dist/commands/worktree.d.ts +0 -63
- package/dist/commands/worktree.d.ts.map +0 -1
- package/dist/commands/worktree.js +0 -774
- package/dist/commands/worktree.js.map +0 -1
- package/dist/context/context-manager.d.ts +0 -155
- package/dist/context/context-manager.d.ts.map +0 -1
- package/dist/context/context-manager.js +0 -383
- package/dist/context/context-manager.js.map +0 -1
- package/dist/context/index.d.ts +0 -3
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -6
- package/dist/context/index.js.map +0 -1
- package/dist/context/session-manager.d.ts +0 -207
- package/dist/context/session-manager.d.ts.map +0 -1
- package/dist/context/session-manager.js +0 -686
- package/dist/context/session-manager.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -1
- package/dist/interactive/interactive-mode.d.ts +0 -76
- package/dist/interactive/interactive-mode.d.ts.map +0 -1
- package/dist/interactive/interactive-mode.js +0 -732
- package/dist/interactive/interactive-mode.js.map +0 -1
- package/dist/nlp/command-mapper.d.ts +0 -174
- package/dist/nlp/command-mapper.d.ts.map +0 -1
- package/dist/nlp/command-mapper.js +0 -624
- package/dist/nlp/command-mapper.js.map +0 -1
- package/dist/nlp/command-parser.d.ts +0 -106
- package/dist/nlp/command-parser.d.ts.map +0 -1
- package/dist/nlp/command-parser.js +0 -417
- package/dist/nlp/command-parser.js.map +0 -1
- package/dist/nlp/index.d.ts +0 -5
- package/dist/nlp/index.d.ts.map +0 -1
- package/dist/nlp/index.js +0 -8
- package/dist/nlp/index.js.map +0 -1
- package/dist/nlp/intent-classifier.d.ts +0 -59
- package/dist/nlp/intent-classifier.d.ts.map +0 -1
- package/dist/nlp/intent-classifier.js +0 -384
- package/dist/nlp/intent-classifier.js.map +0 -1
- package/dist/nlp/intent-parser.d.ts +0 -152
- package/dist/nlp/intent-parser.d.ts.map +0 -1
- package/dist/nlp/intent-parser.js +0 -744
- package/dist/nlp/intent-parser.js.map +0 -1
- package/dist/plugins/plugin-manager.d.ts +0 -120
- package/dist/plugins/plugin-manager.d.ts.map +0 -1
- package/dist/plugins/plugin-manager.js +0 -595
- package/dist/plugins/plugin-manager.js.map +0 -1
- package/dist/types/index.d.ts +0 -224
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/utils/backup-rollback-manager.d.ts +0 -72
- package/dist/utils/backup-rollback-manager.d.ts.map +0 -1
- package/dist/utils/backup-rollback-manager.js +0 -289
- package/dist/utils/backup-rollback-manager.js.map +0 -1
- package/dist/utils/claude-config-installer.d.ts +0 -98
- package/dist/utils/claude-config-installer.d.ts.map +0 -1
- package/dist/utils/claude-config-installer.js +0 -678
- package/dist/utils/claude-config-installer.js.map +0 -1
- package/dist/utils/config-manager.d.ts +0 -73
- package/dist/utils/config-manager.d.ts.map +0 -1
- package/dist/utils/config-manager.js +0 -339
- package/dist/utils/config-manager.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -46
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -169
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -25
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -105
- package/dist/utils/logger.js.map +0 -1
- package/src/commands/computer-setup-commands.ts +0 -872
package/src/commands/guardian.ts
CHANGED
|
@@ -41,7 +41,7 @@ const SESSIONS_STATE_FILE = path.join(
|
|
|
41
41
|
os.homedir(),
|
|
42
42
|
'.wundr',
|
|
43
43
|
'sessions',
|
|
44
|
-
'state.json'
|
|
44
|
+
'state.json'
|
|
45
45
|
);
|
|
46
46
|
const REPORTS_DIR = path.join(GUARDIAN_BASE_DIR, 'reports');
|
|
47
47
|
|
|
@@ -126,7 +126,7 @@ async function ensureGuardianDir(): Promise<void> {
|
|
|
126
126
|
* Get color function based on severity
|
|
127
127
|
*/
|
|
128
128
|
function getSeverityColor(
|
|
129
|
-
severity: InterventionSeverity
|
|
129
|
+
severity: InterventionSeverity
|
|
130
130
|
): (str: string) => string {
|
|
131
131
|
switch (severity) {
|
|
132
132
|
case 'critical':
|
|
@@ -184,7 +184,7 @@ async function loadGuardianState(): Promise<GuardianState> {
|
|
|
184
184
|
try {
|
|
185
185
|
const interventionsContent = await fs.readFile(
|
|
186
186
|
INTERVENTIONS_FILE,
|
|
187
|
-
'utf-8'
|
|
187
|
+
'utf-8'
|
|
188
188
|
);
|
|
189
189
|
interventions = JSON.parse(interventionsContent) as StoredIntervention[];
|
|
190
190
|
} catch {
|
|
@@ -211,11 +211,11 @@ async function saveGuardianState(state: GuardianState): Promise<void> {
|
|
|
211
211
|
await ensureGuardianDir();
|
|
212
212
|
await fs.writeFile(
|
|
213
213
|
INTERVENTIONS_FILE,
|
|
214
|
-
JSON.stringify(state.interventions, null, 2)
|
|
214
|
+
JSON.stringify(state.interventions, null, 2)
|
|
215
215
|
);
|
|
216
216
|
await fs.writeFile(
|
|
217
217
|
REVIEW_QUEUE_FILE,
|
|
218
|
-
JSON.stringify(state.reviewQueue, null, 2)
|
|
218
|
+
JSON.stringify(state.reviewQueue, null, 2)
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -338,7 +338,7 @@ async function generateReport(options: ReportOptions): Promise<void> {
|
|
|
338
338
|
dateStr,
|
|
339
339
|
report,
|
|
340
340
|
recommendations,
|
|
341
|
-
guardianState
|
|
341
|
+
guardianState
|
|
342
342
|
);
|
|
343
343
|
|
|
344
344
|
if (options.output) {
|
|
@@ -351,7 +351,7 @@ async function generateReport(options: ReportOptions): Promise<void> {
|
|
|
351
351
|
} catch (error) {
|
|
352
352
|
spinner.fail('Failed to generate report');
|
|
353
353
|
console.error(
|
|
354
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
354
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
355
355
|
);
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -363,7 +363,7 @@ function generateMarkdownReport(
|
|
|
363
363
|
dateStr: string,
|
|
364
364
|
report: AggregatedDriftReport,
|
|
365
365
|
recommendations: InterventionRecommendation[],
|
|
366
|
-
guardianState: GuardianState
|
|
366
|
+
guardianState: GuardianState
|
|
367
367
|
): string {
|
|
368
368
|
let md = '# Guardian Daily Alignment Report\n\n';
|
|
369
369
|
md += `**Date:** ${dateStr}\n`;
|
|
@@ -411,7 +411,7 @@ function displayTerminalReport(
|
|
|
411
411
|
dateStr: string,
|
|
412
412
|
report: AggregatedDriftReport,
|
|
413
413
|
recommendations: InterventionRecommendation[],
|
|
414
|
-
guardianState: GuardianState
|
|
414
|
+
guardianState: GuardianState
|
|
415
415
|
): void {
|
|
416
416
|
console.log(chalk.cyan('\n' + '='.repeat(70)));
|
|
417
417
|
console.log(chalk.cyan.bold(' GUARDIAN DAILY ALIGNMENT REPORT'));
|
|
@@ -427,15 +427,15 @@ function displayTerminalReport(
|
|
|
427
427
|
const statusColor = getStatusColor(report.overallStatus);
|
|
428
428
|
console.log(`Total Sessions: ${chalk.white(report.totalSessions)}`);
|
|
429
429
|
console.log(
|
|
430
|
-
`Average Drift Score: ${chalk.white(report.averageScore.toFixed(1))}
|
|
430
|
+
`Average Drift Score: ${chalk.white(report.averageScore.toFixed(1))}`
|
|
431
431
|
);
|
|
432
432
|
console.log(`Overall Status: ${statusColor(report.overallStatus)}`);
|
|
433
433
|
console.log(`Trend: ${chalk.white(report.trend)}`);
|
|
434
434
|
console.log(
|
|
435
|
-
`Critical Sessions: ${report.criticalSessions.length > 0 ? chalk.red(report.criticalSessions.length) : chalk.green('0')}
|
|
435
|
+
`Critical Sessions: ${report.criticalSessions.length > 0 ? chalk.red(report.criticalSessions.length) : chalk.green('0')}`
|
|
436
436
|
);
|
|
437
437
|
console.log(
|
|
438
|
-
`Concerning Sessions: ${report.concerningSessions.length > 0 ? chalk.yellow(report.concerningSessions.length) : chalk.green('0')}
|
|
438
|
+
`Concerning Sessions: ${report.concerningSessions.length > 0 ? chalk.yellow(report.concerningSessions.length) : chalk.green('0')}`
|
|
439
439
|
);
|
|
440
440
|
console.log('');
|
|
441
441
|
|
|
@@ -447,7 +447,7 @@ function displayTerminalReport(
|
|
|
447
447
|
for (const rec of recommendations) {
|
|
448
448
|
const severityColor = getSeverityColor(rec.severity);
|
|
449
449
|
console.log(
|
|
450
|
-
`${severityColor(getSeverityBadge(rec.severity))} ${chalk.white(rec.dimension)}
|
|
450
|
+
`${severityColor(getSeverityBadge(rec.severity))} ${chalk.white(rec.dimension)}`
|
|
451
451
|
);
|
|
452
452
|
console.log(` Action: ${rec.action}`);
|
|
453
453
|
console.log(` Urgency: ${rec.urgency}h`);
|
|
@@ -465,8 +465,8 @@ function displayTerminalReport(
|
|
|
465
465
|
console.log(chalk.gray('-'.repeat(40)));
|
|
466
466
|
console.log(
|
|
467
467
|
chalk.yellow(
|
|
468
|
-
`${pendingReviews.length} session(s) flagged for Guardian attention
|
|
469
|
-
)
|
|
468
|
+
`${pendingReviews.length} session(s) flagged for Guardian attention.`
|
|
469
|
+
)
|
|
470
470
|
);
|
|
471
471
|
console.log(chalk.gray('Run "wundr guardian review" for details.\n'));
|
|
472
472
|
}
|
|
@@ -492,7 +492,7 @@ async function showReviewQueue(): Promise<void> {
|
|
|
492
492
|
if (pendingReviews.length === 0) {
|
|
493
493
|
console.log(chalk.green('\nNo sessions require Guardian review.'));
|
|
494
494
|
console.log(
|
|
495
|
-
chalk.gray('All systems operating within acceptable parameters.\n')
|
|
495
|
+
chalk.gray('All systems operating within acceptable parameters.\n')
|
|
496
496
|
);
|
|
497
497
|
return;
|
|
498
498
|
}
|
|
@@ -504,8 +504,8 @@ async function showReviewQueue(): Promise<void> {
|
|
|
504
504
|
padRight('Severity', 12) +
|
|
505
505
|
padRight('Drift Score', 14) +
|
|
506
506
|
padRight('Flagged At', 22) +
|
|
507
|
-
padRight('Reason', 22)
|
|
508
|
-
)
|
|
507
|
+
padRight('Reason', 22)
|
|
508
|
+
)
|
|
509
509
|
);
|
|
510
510
|
console.log(chalk.gray('-'.repeat(90)));
|
|
511
511
|
|
|
@@ -519,22 +519,22 @@ async function showReviewQueue(): Promise<void> {
|
|
|
519
519
|
severityColor(padRight(getSeverityBadge(item.severity), 12)) +
|
|
520
520
|
padRight(item.driftScore.toFixed(1), 14) +
|
|
521
521
|
padRight(flaggedAt, 22) +
|
|
522
|
-
chalk.gray(truncate(item.reason, 22))
|
|
522
|
+
chalk.gray(truncate(item.reason, 22))
|
|
523
523
|
);
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
console.log(chalk.gray('-'.repeat(90)));
|
|
527
527
|
console.log(
|
|
528
|
-
chalk.gray(`Total: ${pendingReviews.length} session(s) pending review\n`)
|
|
528
|
+
chalk.gray(`Total: ${pendingReviews.length} session(s) pending review\n`)
|
|
529
529
|
);
|
|
530
530
|
|
|
531
531
|
// Show summary by severity
|
|
532
532
|
const criticalCount = pendingReviews.filter(
|
|
533
|
-
r => r.severity === 'critical'
|
|
533
|
+
r => r.severity === 'critical'
|
|
534
534
|
).length;
|
|
535
535
|
const highCount = pendingReviews.filter(r => r.severity === 'high').length;
|
|
536
536
|
const mediumCount = pendingReviews.filter(
|
|
537
|
-
r => r.severity === 'medium'
|
|
537
|
+
r => r.severity === 'medium'
|
|
538
538
|
).length;
|
|
539
539
|
|
|
540
540
|
if (criticalCount > 0) {
|
|
@@ -550,7 +550,7 @@ async function showReviewQueue(): Promise<void> {
|
|
|
550
550
|
} catch (error) {
|
|
551
551
|
spinner.fail('Failed to load review queue');
|
|
552
552
|
console.error(
|
|
553
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
553
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
554
554
|
);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
@@ -571,20 +571,20 @@ async function listInterventions(options: InterventionsOptions): Promise<void> {
|
|
|
571
571
|
cutoffDate.setDate(cutoffDate.getDate() - days);
|
|
572
572
|
|
|
573
573
|
interventions = interventions.filter(
|
|
574
|
-
i => new Date(i.timestamp) >= cutoffDate
|
|
574
|
+
i => new Date(i.timestamp) >= cutoffDate
|
|
575
575
|
);
|
|
576
576
|
|
|
577
577
|
// Filter by session
|
|
578
578
|
if (options.session) {
|
|
579
579
|
interventions = interventions.filter(
|
|
580
|
-
i => i.sessionId === options.session
|
|
580
|
+
i => i.sessionId === options.session
|
|
581
581
|
);
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
// Sort by timestamp descending (most recent first)
|
|
585
585
|
interventions.sort(
|
|
586
586
|
(a, b) =>
|
|
587
|
-
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
587
|
+
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
|
|
588
588
|
);
|
|
589
589
|
|
|
590
590
|
spinner.stop();
|
|
@@ -592,14 +592,14 @@ async function listInterventions(options: InterventionsOptions): Promise<void> {
|
|
|
592
592
|
console.log(chalk.cyan('\nGuardian Interventions'));
|
|
593
593
|
console.log(
|
|
594
594
|
chalk.gray(
|
|
595
|
-
`Last ${days} days${options.session ? ` - Session: ${options.session}` : ''}
|
|
596
|
-
)
|
|
595
|
+
`Last ${days} days${options.session ? ` - Session: ${options.session}` : ''}`
|
|
596
|
+
)
|
|
597
597
|
);
|
|
598
598
|
console.log(chalk.gray('='.repeat(100)));
|
|
599
599
|
|
|
600
600
|
if (interventions.length === 0) {
|
|
601
601
|
console.log(
|
|
602
|
-
chalk.green('\nNo interventions recorded in the specified time period.')
|
|
602
|
+
chalk.green('\nNo interventions recorded in the specified time period.')
|
|
603
603
|
);
|
|
604
604
|
console.log('');
|
|
605
605
|
return;
|
|
@@ -613,8 +613,8 @@ async function listInterventions(options: InterventionsOptions): Promise<void> {
|
|
|
613
613
|
padRight('Severity', 12) +
|
|
614
614
|
padRight('Dimension', 20) +
|
|
615
615
|
padRight('Status', 12) +
|
|
616
|
-
padRight('Time', 18)
|
|
617
|
-
)
|
|
616
|
+
padRight('Time', 18)
|
|
617
|
+
)
|
|
618
618
|
);
|
|
619
619
|
console.log(chalk.gray('-'.repeat(100)));
|
|
620
620
|
|
|
@@ -635,7 +635,7 @@ async function listInterventions(options: InterventionsOptions): Promise<void> {
|
|
|
635
635
|
severityColor(padRight(getSeverityBadge(intervention.severity), 12)) +
|
|
636
636
|
padRight(truncate(intervention.dimension, 18), 20) +
|
|
637
637
|
statusColor(padRight(`[${intervention.status.toUpperCase()}]`, 12)) +
|
|
638
|
-
chalk.gray(padRight(timestamp, 18))
|
|
638
|
+
chalk.gray(padRight(timestamp, 18))
|
|
639
639
|
);
|
|
640
640
|
}
|
|
641
641
|
|
|
@@ -646,18 +646,18 @@ async function listInterventions(options: InterventionsOptions): Promise<void> {
|
|
|
646
646
|
const applied = interventions.filter(i => i.status === 'applied').length;
|
|
647
647
|
const pending = interventions.filter(i => i.status === 'pending').length;
|
|
648
648
|
const dismissed = interventions.filter(
|
|
649
|
-
i => i.status === 'dismissed'
|
|
649
|
+
i => i.status === 'dismissed'
|
|
650
650
|
).length;
|
|
651
651
|
|
|
652
652
|
console.log(chalk.gray('Summary:'));
|
|
653
653
|
console.log(
|
|
654
|
-
` Applied: ${chalk.green(applied)} Pending: ${chalk.yellow(pending)} Dismissed: ${chalk.gray(dismissed)}
|
|
654
|
+
` Applied: ${chalk.green(applied)} Pending: ${chalk.yellow(pending)} Dismissed: ${chalk.gray(dismissed)}`
|
|
655
655
|
);
|
|
656
656
|
console.log('');
|
|
657
657
|
} catch (error) {
|
|
658
658
|
spinner.fail('Failed to load interventions');
|
|
659
659
|
console.error(
|
|
660
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
660
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
661
661
|
);
|
|
662
662
|
}
|
|
663
663
|
}
|
|
@@ -692,13 +692,13 @@ async function displayDashboard(): Promise<void> {
|
|
|
692
692
|
|
|
693
693
|
console.log(chalk.cyan.bold('\n' + '='.repeat(80)));
|
|
694
694
|
console.log(
|
|
695
|
-
chalk.cyan.bold(' GUARDIAN ALIGNMENT DASHBOARD')
|
|
695
|
+
chalk.cyan.bold(' GUARDIAN ALIGNMENT DASHBOARD')
|
|
696
696
|
);
|
|
697
697
|
console.log(chalk.cyan.bold('='.repeat(80)));
|
|
698
698
|
console.log(
|
|
699
699
|
chalk.gray(
|
|
700
|
-
` Last Updated: ${new Date().toLocaleString()}
|
|
701
|
-
)
|
|
700
|
+
` Last Updated: ${new Date().toLocaleString()}`
|
|
701
|
+
)
|
|
702
702
|
);
|
|
703
703
|
console.log('');
|
|
704
704
|
|
|
@@ -708,7 +708,7 @@ async function displayDashboard(): Promise<void> {
|
|
|
708
708
|
|
|
709
709
|
const statusColor = getStatusColor(report.overallStatus);
|
|
710
710
|
console.log(
|
|
711
|
-
` Overall Status: ${statusColor(report.overallStatus.padEnd(12))} Avg Drift Score: ${chalk.white(report.averageScore.toFixed(1).padEnd(8))} Trend: ${chalk.white(report.trend)}
|
|
711
|
+
` Overall Status: ${statusColor(report.overallStatus.padEnd(12))} Avg Drift Score: ${chalk.white(report.averageScore.toFixed(1).padEnd(8))} Trend: ${chalk.white(report.trend)}`
|
|
712
712
|
);
|
|
713
713
|
console.log('');
|
|
714
714
|
|
|
@@ -716,7 +716,7 @@ async function displayDashboard(): Promise<void> {
|
|
|
716
716
|
console.log(chalk.cyan.bold(' SESSIONS'));
|
|
717
717
|
console.log(chalk.gray(' ' + '-'.repeat(78)));
|
|
718
718
|
console.log(
|
|
719
|
-
` Total: ${chalk.white(report.totalSessions.toString().padEnd(6))} Critical: ${report.criticalSessions.length > 0 ? chalk.red(report.criticalSessions.length.toString().padEnd(4)) : chalk.green('0'.padEnd(4))} Concerning: ${report.concerningSessions.length > 0 ? chalk.yellow(report.concerningSessions.length.toString().padEnd(4)) : chalk.green('0'.padEnd(4))} Healthy: ${chalk.green((report.totalSessions - report.criticalSessions.length - report.concerningSessions.length).toString())}
|
|
719
|
+
` Total: ${chalk.white(report.totalSessions.toString().padEnd(6))} Critical: ${report.criticalSessions.length > 0 ? chalk.red(report.criticalSessions.length.toString().padEnd(4)) : chalk.green('0'.padEnd(4))} Concerning: ${report.concerningSessions.length > 0 ? chalk.yellow(report.concerningSessions.length.toString().padEnd(4)) : chalk.green('0'.padEnd(4))} Healthy: ${chalk.green((report.totalSessions - report.criticalSessions.length - report.concerningSessions.length).toString())}`
|
|
720
720
|
);
|
|
721
721
|
console.log('');
|
|
722
722
|
|
|
@@ -725,16 +725,16 @@ async function displayDashboard(): Promise<void> {
|
|
|
725
725
|
console.log(chalk.gray(' ' + '-'.repeat(78)));
|
|
726
726
|
|
|
727
727
|
const pendingInterventions = guardianState.interventions.filter(
|
|
728
|
-
i => i.status === 'pending'
|
|
728
|
+
i => i.status === 'pending'
|
|
729
729
|
);
|
|
730
730
|
const recentApplied = guardianState.interventions.filter(
|
|
731
731
|
i =>
|
|
732
732
|
i.status === 'applied' &&
|
|
733
|
-
new Date(i.timestamp) > new Date(Date.now() - 24 * 60 * 60 * 1000)
|
|
733
|
+
new Date(i.timestamp) > new Date(Date.now() - 24 * 60 * 60 * 1000)
|
|
734
734
|
);
|
|
735
735
|
|
|
736
736
|
console.log(
|
|
737
|
-
` Pending: ${pendingInterventions.length > 0 ? chalk.yellow(pendingInterventions.length.toString().padEnd(6)) : chalk.green('0'.padEnd(6))} Applied (24h): ${chalk.white(recentApplied.length.toString().padEnd(6))} Recommended: ${recommendations.length > 0 ? chalk.yellow(recommendations.length.toString()) : chalk.green('0')}
|
|
737
|
+
` Pending: ${pendingInterventions.length > 0 ? chalk.yellow(pendingInterventions.length.toString().padEnd(6)) : chalk.green('0'.padEnd(6))} Applied (24h): ${chalk.white(recentApplied.length.toString().padEnd(6))} Recommended: ${recommendations.length > 0 ? chalk.yellow(recommendations.length.toString()) : chalk.green('0')}`
|
|
738
738
|
);
|
|
739
739
|
console.log('');
|
|
740
740
|
|
|
@@ -748,14 +748,14 @@ async function displayDashboard(): Promise<void> {
|
|
|
748
748
|
console.log(chalk.green(' No sessions require Guardian review.'));
|
|
749
749
|
} else {
|
|
750
750
|
const criticalReviews = pendingReviews.filter(
|
|
751
|
-
r => r.severity === 'critical'
|
|
751
|
+
r => r.severity === 'critical'
|
|
752
752
|
).length;
|
|
753
753
|
const highReviews = pendingReviews.filter(
|
|
754
|
-
r => r.severity === 'high'
|
|
754
|
+
r => r.severity === 'high'
|
|
755
755
|
).length;
|
|
756
756
|
|
|
757
757
|
console.log(
|
|
758
|
-
` Pending: ${chalk.yellow(pendingReviews.length.toString().padEnd(6))} Critical: ${criticalReviews > 0 ? chalk.red(criticalReviews.toString().padEnd(6)) : chalk.green('0'.padEnd(6))} High: ${highReviews > 0 ? chalk.yellow(highReviews.toString()) : chalk.green('0')}
|
|
758
|
+
` Pending: ${chalk.yellow(pendingReviews.length.toString().padEnd(6))} Critical: ${criticalReviews > 0 ? chalk.red(criticalReviews.toString().padEnd(6)) : chalk.green('0'.padEnd(6))} High: ${highReviews > 0 ? chalk.yellow(highReviews.toString()) : chalk.green('0')}`
|
|
759
759
|
);
|
|
760
760
|
}
|
|
761
761
|
console.log('');
|
|
@@ -768,13 +768,13 @@ async function displayDashboard(): Promise<void> {
|
|
|
768
768
|
for (const rec of recommendations.slice(0, 3)) {
|
|
769
769
|
const severityColor = getSeverityColor(rec.severity);
|
|
770
770
|
console.log(
|
|
771
|
-
` ${severityColor(getSeverityBadge(rec.severity))} ${rec.dimension}: ${truncate(rec.action, 50)}
|
|
771
|
+
` ${severityColor(getSeverityBadge(rec.severity))} ${rec.dimension}: ${truncate(rec.action, 50)}`
|
|
772
772
|
);
|
|
773
773
|
}
|
|
774
774
|
|
|
775
775
|
if (recommendations.length > 3) {
|
|
776
776
|
console.log(
|
|
777
|
-
chalk.gray(` ... and ${recommendations.length - 3} more`)
|
|
777
|
+
chalk.gray(` ... and ${recommendations.length - 3} more`)
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
780
|
console.log('');
|
|
@@ -785,16 +785,16 @@ async function displayDashboard(): Promise<void> {
|
|
|
785
785
|
console.log(chalk.gray(' ' + '-'.repeat(78)));
|
|
786
786
|
console.log(
|
|
787
787
|
chalk.gray(
|
|
788
|
-
' wundr guardian report - Generate full alignment report'
|
|
789
|
-
)
|
|
788
|
+
' wundr guardian report - Generate full alignment report'
|
|
789
|
+
)
|
|
790
790
|
);
|
|
791
791
|
console.log(
|
|
792
792
|
chalk.gray(
|
|
793
|
-
' wundr guardian review - View sessions requiring attention'
|
|
794
|
-
)
|
|
793
|
+
' wundr guardian review - View sessions requiring attention'
|
|
794
|
+
)
|
|
795
795
|
);
|
|
796
796
|
console.log(
|
|
797
|
-
chalk.gray(' wundr guardian interventions - List recent interventions')
|
|
797
|
+
chalk.gray(' wundr guardian interventions - List recent interventions')
|
|
798
798
|
);
|
|
799
799
|
console.log('');
|
|
800
800
|
|
|
@@ -803,7 +803,7 @@ async function displayDashboard(): Promise<void> {
|
|
|
803
803
|
} catch (error) {
|
|
804
804
|
spinner.fail('Failed to load dashboard');
|
|
805
805
|
console.error(
|
|
806
|
-
chalk.red(error instanceof Error ? error.message : String(error))
|
|
806
|
+
chalk.red(error instanceof Error ? error.message : String(error))
|
|
807
807
|
);
|
|
808
808
|
}
|
|
809
809
|
}
|
|
@@ -818,7 +818,7 @@ async function displayDashboard(): Promise<void> {
|
|
|
818
818
|
export function createGuardianCommand(): Command {
|
|
819
819
|
const guardian = new Command('guardian')
|
|
820
820
|
.description(
|
|
821
|
-
'Guardian Dashboard - AI alignment monitoring and intervention management'
|
|
821
|
+
'Guardian Dashboard - AI alignment monitoring and intervention management'
|
|
822
822
|
)
|
|
823
823
|
.addHelpText(
|
|
824
824
|
'after',
|
|
@@ -831,7 +831,7 @@ Examples:
|
|
|
831
831
|
${chalk.green('wundr guardian review')} Show sessions requiring Guardian review
|
|
832
832
|
${chalk.green('wundr guardian interventions')} List recent interventions
|
|
833
833
|
${chalk.green('wundr guardian interventions --days 14')} Show interventions from last 14 days
|
|
834
|
-
`)
|
|
834
|
+
`)
|
|
835
835
|
);
|
|
836
836
|
|
|
837
837
|
// Default action - show dashboard
|
package/src/commands/init.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class InitCommands {
|
|
|
19
19
|
constructor(
|
|
20
20
|
private program: Command,
|
|
21
21
|
private configManager: ConfigManager,
|
|
22
|
-
private pluginManager: PluginManager
|
|
22
|
+
private pluginManager: PluginManager
|
|
23
23
|
) {
|
|
24
24
|
this.registerCommands();
|
|
25
25
|
}
|
|
@@ -37,7 +37,10 @@ export class InitCommands {
|
|
|
37
37
|
.option('--skip-git', 'skip git initialization')
|
|
38
38
|
.option('--skip-install', 'skip dependency installation')
|
|
39
39
|
.option('--monorepo', 'initialize as monorepo')
|
|
40
|
-
.option(
|
|
40
|
+
.option(
|
|
41
|
+
'--with-rag',
|
|
42
|
+
'initialize RAG (Retrieval-Augmented Generation) support'
|
|
43
|
+
)
|
|
41
44
|
.action(async (name, options) => {
|
|
42
45
|
await this.initProject(name, options);
|
|
43
46
|
});
|
|
@@ -132,10 +135,10 @@ export class InitCommands {
|
|
|
132
135
|
|
|
133
136
|
if (ragResult.success) {
|
|
134
137
|
logger.success(
|
|
135
|
-
`RAG initialized: ${ragResult.filesIndexed} files indexed
|
|
138
|
+
`RAG initialized: ${ragResult.filesIndexed} files indexed`
|
|
136
139
|
);
|
|
137
140
|
logger.info(
|
|
138
|
-
` Framework detected: ${chalk.cyan(ragResult.framework.name)}
|
|
141
|
+
` Framework detected: ${chalk.cyan(ragResult.framework.name)}`
|
|
139
142
|
);
|
|
140
143
|
} else {
|
|
141
144
|
logger.warn('RAG initialization had issues:');
|
|
@@ -158,7 +161,7 @@ export class InitCommands {
|
|
|
158
161
|
'WUNDR_INIT_PROJECT_FAILED',
|
|
159
162
|
'Failed to initialize project',
|
|
160
163
|
{ name, options },
|
|
161
|
-
true
|
|
164
|
+
true
|
|
162
165
|
);
|
|
163
166
|
}
|
|
164
167
|
}
|
|
@@ -189,7 +192,7 @@ export class InitCommands {
|
|
|
189
192
|
logger.info(` Exclusions: ${chalk.cyan(result.excludePath)}`);
|
|
190
193
|
logger.info(` Files indexed: ${chalk.cyan(result.filesIndexed)}`);
|
|
191
194
|
logger.info(
|
|
192
|
-
` Framework: ${chalk.cyan(result.framework.name)} (${result.framework.projectType})
|
|
195
|
+
` Framework: ${chalk.cyan(result.framework.name)} (${result.framework.projectType})`
|
|
193
196
|
);
|
|
194
197
|
} else {
|
|
195
198
|
logger.error('RAG initialization failed:');
|
|
@@ -206,7 +209,7 @@ export class InitCommands {
|
|
|
206
209
|
'WUNDR_INIT_RAG_FAILED',
|
|
207
210
|
'Failed to initialize RAG',
|
|
208
211
|
{ options },
|
|
209
|
-
true
|
|
212
|
+
true
|
|
210
213
|
);
|
|
211
214
|
}
|
|
212
215
|
}
|
|
@@ -234,7 +237,7 @@ export class InitCommands {
|
|
|
234
237
|
'WUNDR_INIT_CONFIG_FAILED',
|
|
235
238
|
'Failed to initialize configuration',
|
|
236
239
|
{ options },
|
|
237
|
-
true
|
|
240
|
+
true
|
|
238
241
|
);
|
|
239
242
|
}
|
|
240
243
|
}
|
|
@@ -269,7 +272,7 @@ export class InitCommands {
|
|
|
269
272
|
// Create workspace-specific wundr config
|
|
270
273
|
await this.configManager.loadConfig();
|
|
271
274
|
await this.configManager.saveConfig(
|
|
272
|
-
path.join(process.cwd(), 'wundr.config.json')
|
|
275
|
+
path.join(process.cwd(), 'wundr.config.json')
|
|
273
276
|
);
|
|
274
277
|
|
|
275
278
|
logger.success('Workspace initialized successfully!');
|
|
@@ -278,7 +281,7 @@ export class InitCommands {
|
|
|
278
281
|
'WUNDR_INIT_WORKSPACE_FAILED',
|
|
279
282
|
'Failed to initialize workspace',
|
|
280
283
|
{ options },
|
|
281
|
-
true
|
|
284
|
+
true
|
|
282
285
|
);
|
|
283
286
|
}
|
|
284
287
|
}
|
|
@@ -305,7 +308,7 @@ export class InitCommands {
|
|
|
305
308
|
'WUNDR_INIT_PLUGINS_FAILED',
|
|
306
309
|
'Failed to initialize plugins',
|
|
307
310
|
{ options },
|
|
308
|
-
true
|
|
311
|
+
true
|
|
309
312
|
);
|
|
310
313
|
}
|
|
311
314
|
}
|
|
@@ -315,7 +318,7 @@ export class InitCommands {
|
|
|
315
318
|
*/
|
|
316
319
|
private async createProjectStructure(
|
|
317
320
|
projectPath: string,
|
|
318
|
-
options: any
|
|
321
|
+
options: any
|
|
319
322
|
): Promise<void> {
|
|
320
323
|
await fs.ensureDir(projectPath);
|
|
321
324
|
|
|
@@ -332,7 +335,7 @@ export class InitCommands {
|
|
|
332
335
|
// Create project-specific config
|
|
333
336
|
const config = await this.configManager.loadConfig();
|
|
334
337
|
await this.configManager.saveConfig(
|
|
335
|
-
path.join(projectPath, 'wundr.config.json')
|
|
338
|
+
path.join(projectPath, 'wundr.config.json')
|
|
336
339
|
);
|
|
337
340
|
}
|
|
338
341
|
|
|
@@ -341,11 +344,11 @@ export class InitCommands {
|
|
|
341
344
|
*/
|
|
342
345
|
private async createDefaultStructure(
|
|
343
346
|
projectPath: string,
|
|
344
|
-
options: any
|
|
347
|
+
options: any
|
|
345
348
|
): Promise<void> {
|
|
346
349
|
const directories = options.monorepo
|
|
347
|
-
? ['packages', 'apps', 'tools', 'docs', 'scripts', '.
|
|
348
|
-
: ['src', 'tests', 'docs', 'scripts', '.
|
|
350
|
+
? ['packages', 'apps', 'tools', 'docs', 'scripts', '.ruflo']
|
|
351
|
+
: ['src', 'tests', 'docs', 'scripts', '.ruflo'];
|
|
349
352
|
|
|
350
353
|
for (const dir of directories) {
|
|
351
354
|
await fs.ensureDir(path.join(projectPath, dir));
|
|
@@ -644,11 +647,11 @@ fi
|
|
|
644
647
|
|
|
645
648
|
await fs.writeFile(
|
|
646
649
|
path.join(projectPath, 'scripts', 'verify-claims.sh'),
|
|
647
|
-
verifyScript
|
|
650
|
+
verifyScript
|
|
648
651
|
);
|
|
649
652
|
await fs.chmod(
|
|
650
653
|
path.join(projectPath, 'scripts', 'verify-claims.sh'),
|
|
651
|
-
'755'
|
|
654
|
+
'755'
|
|
652
655
|
);
|
|
653
656
|
|
|
654
657
|
// Create FAILURES.md
|
|
@@ -678,7 +681,7 @@ _(None yet - will be populated when failures are resolved)_
|
|
|
678
681
|
|
|
679
682
|
await fs.writeFile(
|
|
680
683
|
path.join(projectPath, 'docs', 'FAILURES.md'),
|
|
681
|
-
failuresMd
|
|
684
|
+
failuresMd
|
|
682
685
|
);
|
|
683
686
|
|
|
684
687
|
// Create verification hooks
|
|
@@ -716,9 +719,9 @@ _(None yet - will be populated when failures are resolved)_
|
|
|
716
719
|
};
|
|
717
720
|
|
|
718
721
|
await fs.writeJson(
|
|
719
|
-
path.join(projectPath, '.
|
|
722
|
+
path.join(projectPath, '.ruflo', 'verification-hooks.json'),
|
|
720
723
|
verificationHooks,
|
|
721
|
-
{ spaces: 2 }
|
|
724
|
+
{ spaces: 2 }
|
|
722
725
|
);
|
|
723
726
|
|
|
724
727
|
// Create agent verification protocol
|
|
@@ -759,7 +762,7 @@ Remember: It's better to report a failure honestly than to claim false success.
|
|
|
759
762
|
|
|
760
763
|
await fs.writeFile(
|
|
761
764
|
path.join(projectPath, 'docs', 'AGENT_VERIFICATION_PROTOCOL.md'),
|
|
762
|
-
agentProtocol
|
|
765
|
+
agentProtocol
|
|
763
766
|
);
|
|
764
767
|
|
|
765
768
|
logger.debug('Verification files created');
|