@vibecheckai/cli 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +9 -1
  2. package/bin/cli-hygiene.js +0 -241
  3. package/bin/guardrail.js +0 -834
  4. package/bin/runners/cli-utils.js +0 -1070
  5. package/bin/runners/context/ai-task-decomposer.js +0 -337
  6. package/bin/runners/context/analyzer.js +0 -462
  7. package/bin/runners/context/api-contracts.js +0 -427
  8. package/bin/runners/context/context-diff.js +0 -342
  9. package/bin/runners/context/context-pruner.js +0 -291
  10. package/bin/runners/context/dependency-graph.js +0 -414
  11. package/bin/runners/context/generators/claude.js +0 -107
  12. package/bin/runners/context/generators/codex.js +0 -108
  13. package/bin/runners/context/generators/copilot.js +0 -119
  14. package/bin/runners/context/generators/cursor.js +0 -514
  15. package/bin/runners/context/generators/mcp.js +0 -151
  16. package/bin/runners/context/generators/windsurf.js +0 -180
  17. package/bin/runners/context/git-context.js +0 -302
  18. package/bin/runners/context/index.js +0 -1042
  19. package/bin/runners/context/insights.js +0 -173
  20. package/bin/runners/context/mcp-server/generate-rules.js +0 -337
  21. package/bin/runners/context/mcp-server/index.js +0 -1176
  22. package/bin/runners/context/mcp-server/package.json +0 -24
  23. package/bin/runners/context/memory.js +0 -200
  24. package/bin/runners/context/monorepo.js +0 -215
  25. package/bin/runners/context/multi-repo-federation.js +0 -404
  26. package/bin/runners/context/patterns.js +0 -253
  27. package/bin/runners/context/proof-context.js +0 -972
  28. package/bin/runners/context/security-scanner.js +0 -303
  29. package/bin/runners/context/semantic-search.js +0 -350
  30. package/bin/runners/context/shared.js +0 -264
  31. package/bin/runners/context/team-conventions.js +0 -310
  32. package/bin/runners/lib/ai-bridge.js +0 -416
  33. package/bin/runners/lib/analysis-core.js +0 -271
  34. package/bin/runners/lib/analyzers.js +0 -541
  35. package/bin/runners/lib/audit-bridge.js +0 -391
  36. package/bin/runners/lib/auth-truth.js +0 -193
  37. package/bin/runners/lib/auth.js +0 -215
  38. package/bin/runners/lib/backup.js +0 -62
  39. package/bin/runners/lib/billing.js +0 -107
  40. package/bin/runners/lib/claims.js +0 -118
  41. package/bin/runners/lib/cli-ui.js +0 -540
  42. package/bin/runners/lib/compliance-bridge-new.js +0 -0
  43. package/bin/runners/lib/compliance-bridge.js +0 -165
  44. package/bin/runners/lib/contracts/auth-contract.js +0 -194
  45. package/bin/runners/lib/contracts/env-contract.js +0 -178
  46. package/bin/runners/lib/contracts/external-contract.js +0 -198
  47. package/bin/runners/lib/contracts/guard.js +0 -168
  48. package/bin/runners/lib/contracts/index.js +0 -89
  49. package/bin/runners/lib/contracts/plan-validator.js +0 -311
  50. package/bin/runners/lib/contracts/route-contract.js +0 -192
  51. package/bin/runners/lib/detect.js +0 -89
  52. package/bin/runners/lib/doctor/autofix.js +0 -254
  53. package/bin/runners/lib/doctor/index.js +0 -37
  54. package/bin/runners/lib/doctor/modules/dependencies.js +0 -325
  55. package/bin/runners/lib/doctor/modules/index.js +0 -46
  56. package/bin/runners/lib/doctor/modules/network.js +0 -250
  57. package/bin/runners/lib/doctor/modules/project.js +0 -312
  58. package/bin/runners/lib/doctor/modules/runtime.js +0 -224
  59. package/bin/runners/lib/doctor/modules/security.js +0 -348
  60. package/bin/runners/lib/doctor/modules/system.js +0 -213
  61. package/bin/runners/lib/doctor/modules/vibecheck.js +0 -394
  62. package/bin/runners/lib/doctor/reporter.js +0 -262
  63. package/bin/runners/lib/doctor/service.js +0 -262
  64. package/bin/runners/lib/doctor/types.js +0 -113
  65. package/bin/runners/lib/doctor/ui.js +0 -263
  66. package/bin/runners/lib/doctor-enhanced.js +0 -233
  67. package/bin/runners/lib/doctor-v2.js +0 -608
  68. package/bin/runners/lib/enforcement.js +0 -72
@@ -1,233 +0,0 @@
1
- /**
2
- * Enhanced Doctor Command
3
- *
4
- * Self-diagnosing CLI that catches 90% of setup issues.
5
- * Goal: kill support tickets by being brutally helpful.
6
- */
7
-
8
- const fs = require('fs');
9
- const path = require('path');
10
- const { execSync } = require('child_process');
11
-
12
- const c = {
13
- reset: '\x1b[0m',
14
- bold: '\x1b[1m',
15
- dim: '\x1b[2m',
16
- red: '\x1b[31m',
17
- green: '\x1b[32m',
18
- yellow: '\x1b[33m',
19
- cyan: '\x1b[36m',
20
- };
21
-
22
- class DoctorEnhanced {
23
- constructor(projectPath) {
24
- this.projectPath = projectPath;
25
- this.issues = [];
26
- this.fixes = [];
27
- }
28
-
29
- async diagnose() {
30
- console.log('\nšŸ” vibecheck Doctor\n');
31
- console.log('Checking your environment...\n');
32
-
33
- await this.checkNodeVersion();
34
- await this.checkPackageManager();
35
- await this.checkRequiredBinaries();
36
- await this.checkEnvVars();
37
- await this.checkPermissions();
38
- await this.checkProjectStructure();
39
- await this.checkCanBuild();
40
- await this.checkCanRun();
41
-
42
- this.printReport();
43
- return this.issues.length === 0 ? 0 : 1;
44
- }
45
-
46
- async checkNodeVersion() {
47
- try {
48
- const version = process.version;
49
- const major = parseInt(version.slice(1).split('.')[0]);
50
-
51
- if (major < 18) {
52
- this.issue('Node version too old', `You're running Node ${version}. vibecheck requires Node 18+.`, `nvm install 18 && nvm use 18`);
53
- } else {
54
- this.pass(`Node version: ${version}`);
55
- }
56
- } catch {
57
- this.issue('Cannot detect Node version', 'Node.js may not be installed.', 'Install Node.js from nodejs.org');
58
- }
59
- }
60
-
61
- async checkPackageManager() {
62
- const managers = ['pnpm', 'npm', 'yarn'];
63
- let found = null;
64
-
65
- for (const mgr of managers) {
66
- try {
67
- execSync(`${mgr} --version`, { stdio: 'ignore' });
68
- found = mgr;
69
- break;
70
- } catch {
71
- // Not found
72
- }
73
- }
74
-
75
- if (!found) {
76
- this.issue('No package manager found', 'Install pnpm, npm, or yarn.', 'npm install -g pnpm');
77
- } else {
78
- this.pass(`Package manager: ${found}`);
79
- }
80
- }
81
-
82
- async checkRequiredBinaries() {
83
- const binaries = [
84
- { name: 'git', required: true },
85
- { name: 'playwright', required: false, check: 'npx playwright --version' },
86
- ];
87
-
88
- for (const bin of binaries) {
89
- try {
90
- if (bin.check) {
91
- execSync(bin.check, { stdio: 'ignore' });
92
- } else {
93
- execSync(`which ${bin.name}`, { stdio: 'ignore' });
94
- }
95
- this.pass(`${bin.name} found`);
96
- } catch {
97
- if (bin.required) {
98
- this.issue(`${bin.name} not found`, `${bin.name} is required.`, `Install ${bin.name}`);
99
- } else {
100
- this.warn(`${bin.name} not found`, `Optional: ${bin.name} enables runtime verification.`, `npx playwright install`);
101
- }
102
- }
103
- }
104
- }
105
-
106
- async checkEnvVars() {
107
- const required = process.env.VIBECHECK_API_KEY ? [] : ['VIBECHECK_API_KEY (optional)'];
108
- const sensitive = ['API_KEY', 'SECRET', 'TOKEN', 'PASSWORD'];
109
-
110
- // Check for common missing env vars
111
- const envFile = path.join(this.projectPath, '.env');
112
- if (!fs.existsSync(envFile)) {
113
- this.warn('No .env file', 'Consider creating .env for local configuration.', 'touch .env');
114
- }
115
-
116
- // Check for exposed secrets (but never print them)
117
- const envExample = path.join(this.projectPath, '.env.example');
118
- if (fs.existsSync(envExample)) {
119
- const content = fs.readFileSync(envExample, 'utf8');
120
- const hasSecrets = sensitive.some(s => content.includes(s));
121
- if (hasSecrets) {
122
- this.pass('.env.example found');
123
- }
124
- }
125
- }
126
-
127
- async checkPermissions() {
128
- try {
129
- const testFile = path.join(this.projectPath, '.vibecheck', '.test-write');
130
- fs.mkdirSync(path.dirname(testFile), { recursive: true });
131
- fs.writeFileSync(testFile, 'test');
132
- fs.unlinkSync(testFile);
133
- this.pass('Write permissions OK');
134
- } catch {
135
- this.issue('No write permissions', 'Cannot write to .vibecheck directory.', `chmod -R u+w ${this.projectPath}`);
136
- }
137
- }
138
-
139
- async checkProjectStructure() {
140
- const packageJson = path.join(this.projectPath, 'package.json');
141
- if (!fs.existsSync(packageJson)) {
142
- this.issue('No package.json', 'This doesn\'t look like a Node.js project.', 'Run vibecheck init');
143
- return;
144
- }
145
-
146
- this.pass('package.json found');
147
-
148
- // Check for common project structures
149
- const hasSrc = fs.existsSync(path.join(this.projectPath, 'src')) ||
150
- fs.existsSync(path.join(this.projectPath, 'app')) ||
151
- fs.existsSync(path.join(this.projectPath, 'pages'));
152
-
153
- if (!hasSrc) {
154
- this.warn('No source directory found', 'vibecheck works best with standard project structures.', 'Consider organizing code in src/ or app/');
155
- }
156
- }
157
-
158
- async checkCanBuild() {
159
- try {
160
- const packageJson = JSON.parse(fs.readFileSync(path.join(this.projectPath, 'package.json'), 'utf8'));
161
- if (packageJson.scripts?.build) {
162
- try {
163
- execSync('npm run build', { cwd: this.projectPath, stdio: 'ignore', timeout: 10000 });
164
- this.pass('Project builds successfully');
165
- } catch {
166
- this.warn('Build failed', 'Project may have build errors.', 'Run: npm run build');
167
- }
168
- }
169
- } catch {
170
- // Can't check build
171
- }
172
- }
173
-
174
- async checkCanRun() {
175
- // Minimal runtime check would go here
176
- // For now, just pass
177
- this.pass('Runtime check skipped (use --runtime for full check)');
178
- }
179
-
180
- issue(title, description, fix) {
181
- this.issues.push({ type: 'error', title, description, fix });
182
- }
183
-
184
- warn(title, description, fix) {
185
- this.issues.push({ type: 'warning', title, description, fix });
186
- }
187
-
188
- pass(message) {
189
- // Silent pass - only show issues
190
- }
191
-
192
- printReport() {
193
- if (this.issues.length === 0) {
194
- console.log(`${c.green}${c.bold}āœ“ All checks passed!${c.reset}\n`);
195
- return;
196
- }
197
-
198
- console.log('\n' + '═'.repeat(70));
199
- console.log(`${c.bold}DIAGNOSIS REPORT${c.reset}`);
200
- console.log('═'.repeat(70) + '\n');
201
-
202
- const errors = this.issues.filter(i => i.type === 'error');
203
- const warnings = this.issues.filter(i => i.type === 'warning');
204
-
205
- if (errors.length > 0) {
206
- console.log(`${c.red}${c.bold}āŒ ERRORS (${errors.length}):${c.reset}\n`);
207
- for (const issue of errors) {
208
- console.log(` ${c.bold}${issue.title}${c.reset}`);
209
- console.log(` ${c.dim}${issue.description}${c.reset}`);
210
- if (issue.fix) {
211
- console.log(` ${c.cyan}→ Fix: ${issue.fix}${c.reset}`);
212
- }
213
- console.log('');
214
- }
215
- }
216
-
217
- if (warnings.length > 0) {
218
- console.log(`${c.yellow}${c.bold}āš ļø WARNINGS (${warnings.length}):${c.reset}\n`);
219
- for (const issue of warnings) {
220
- console.log(` ${c.bold}${issue.title}${c.reset}`);
221
- console.log(` ${c.dim}${issue.description}${c.reset}`);
222
- if (issue.fix) {
223
- console.log(` ${c.cyan}→ Fix: ${issue.fix}${c.reset}`);
224
- }
225
- console.log('');
226
- }
227
- }
228
-
229
- console.log('═'.repeat(70) + '\n');
230
- }
231
- }
232
-
233
- module.exports = { DoctorEnhanced };