@vibecheckai/cli 3.0.1 ā 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.
- package/package.json +10 -1
- package/bin/cli-hygiene.js +0 -241
- package/bin/guardrail.js +0 -834
- package/bin/runners/cli-utils.js +0 -1070
- package/bin/runners/context/ai-task-decomposer.js +0 -337
- package/bin/runners/context/analyzer.js +0 -462
- package/bin/runners/context/api-contracts.js +0 -427
- package/bin/runners/context/context-diff.js +0 -342
- package/bin/runners/context/context-pruner.js +0 -291
- package/bin/runners/context/dependency-graph.js +0 -414
- package/bin/runners/context/generators/claude.js +0 -107
- package/bin/runners/context/generators/codex.js +0 -108
- package/bin/runners/context/generators/copilot.js +0 -119
- package/bin/runners/context/generators/cursor.js +0 -514
- package/bin/runners/context/generators/mcp.js +0 -151
- package/bin/runners/context/generators/windsurf.js +0 -180
- package/bin/runners/context/git-context.js +0 -302
- package/bin/runners/context/index.js +0 -1042
- package/bin/runners/context/insights.js +0 -173
- package/bin/runners/context/mcp-server/generate-rules.js +0 -337
- package/bin/runners/context/mcp-server/index.js +0 -1176
- package/bin/runners/context/mcp-server/package.json +0 -24
- package/bin/runners/context/memory.js +0 -200
- package/bin/runners/context/monorepo.js +0 -215
- package/bin/runners/context/multi-repo-federation.js +0 -404
- package/bin/runners/context/patterns.js +0 -253
- package/bin/runners/context/proof-context.js +0 -972
- package/bin/runners/context/security-scanner.js +0 -303
- package/bin/runners/context/semantic-search.js +0 -350
- package/bin/runners/context/shared.js +0 -264
- package/bin/runners/context/team-conventions.js +0 -310
- package/bin/runners/lib/ai-bridge.js +0 -416
- package/bin/runners/lib/analysis-core.js +0 -271
- package/bin/runners/lib/analyzers.js +0 -541
- package/bin/runners/lib/audit-bridge.js +0 -391
- package/bin/runners/lib/auth-truth.js +0 -193
- package/bin/runners/lib/auth.js +0 -215
- package/bin/runners/lib/backup.js +0 -62
- package/bin/runners/lib/billing.js +0 -107
- package/bin/runners/lib/claims.js +0 -118
- package/bin/runners/lib/cli-ui.js +0 -540
- package/bin/runners/lib/compliance-bridge-new.js +0 -0
- package/bin/runners/lib/compliance-bridge.js +0 -165
- package/bin/runners/lib/contracts/auth-contract.js +0 -194
- package/bin/runners/lib/contracts/env-contract.js +0 -178
- package/bin/runners/lib/contracts/external-contract.js +0 -198
- package/bin/runners/lib/contracts/guard.js +0 -168
- package/bin/runners/lib/contracts/index.js +0 -89
- package/bin/runners/lib/contracts/plan-validator.js +0 -311
- package/bin/runners/lib/contracts/route-contract.js +0 -192
- package/bin/runners/lib/detect.js +0 -89
- package/bin/runners/lib/doctor/autofix.js +0 -254
- package/bin/runners/lib/doctor/index.js +0 -37
- package/bin/runners/lib/doctor/modules/dependencies.js +0 -325
- package/bin/runners/lib/doctor/modules/index.js +0 -46
- package/bin/runners/lib/doctor/modules/network.js +0 -250
- package/bin/runners/lib/doctor/modules/project.js +0 -312
- package/bin/runners/lib/doctor/modules/runtime.js +0 -224
- package/bin/runners/lib/doctor/modules/security.js +0 -348
- package/bin/runners/lib/doctor/modules/system.js +0 -213
- package/bin/runners/lib/doctor/modules/vibecheck.js +0 -394
- package/bin/runners/lib/doctor/reporter.js +0 -262
- package/bin/runners/lib/doctor/service.js +0 -262
- package/bin/runners/lib/doctor/types.js +0 -113
- package/bin/runners/lib/doctor/ui.js +0 -263
- package/bin/runners/lib/doctor-enhanced.js +0 -233
- package/bin/runners/lib/doctor-v2.js +0 -608
- package/bin/runners/lib/enforcement.js +0 -72
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibecheckai/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Vibecheck CLI - Ship with confidence. One verdict: SHIP | WARN | BLOCK.",
|
|
5
5
|
"main": "bin/vibecheck.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,13 +20,22 @@
|
|
|
20
20
|
"prepublishOnly": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@babel/parser": "^7.23.0",
|
|
24
|
+
"@babel/traverse": "^7.23.0",
|
|
25
|
+
"@babel/types": "^7.23.0",
|
|
23
26
|
"chalk": "^5.3.0",
|
|
24
27
|
"commander": "^12.0.0",
|
|
28
|
+
"debug": "^4.3.4",
|
|
29
|
+
"fast-glob": "^3.3.0",
|
|
30
|
+
"js-yaml": "^4.1.0",
|
|
25
31
|
"ora": "^8.0.0",
|
|
32
|
+
"uuid": "^9.0.0",
|
|
33
|
+
"yaml": "^2.3.0",
|
|
26
34
|
"zod": "^3.23.0"
|
|
27
35
|
},
|
|
28
36
|
"optionalDependencies": {
|
|
29
37
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
38
|
+
"@playwright/test": "^1.40.0",
|
|
30
39
|
"playwright": "^1.40.0",
|
|
31
40
|
"archiver": "^6.0.0"
|
|
32
41
|
},
|
package/bin/cli-hygiene.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* vibecheck Repo Hygiene CLI
|
|
5
|
-
*
|
|
6
|
-
* Enhanced false-positive detection for framework-managed files.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* node bin/cli-hygiene.js [command] [options]
|
|
10
|
-
*
|
|
11
|
-
* Commands:
|
|
12
|
-
* scan Full hygiene scan (default)
|
|
13
|
-
* duplicates Scan for duplicate files only
|
|
14
|
-
* unused Scan for unused files only
|
|
15
|
-
* errors Scan for lint/type errors only
|
|
16
|
-
*
|
|
17
|
-
* Options:
|
|
18
|
-
* --path, -p Project path (default: current directory)
|
|
19
|
-
* --json Output JSON instead of markdown
|
|
20
|
-
* --no-interactive Skip prompts
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const path = require("path");
|
|
24
|
-
const fs = require("fs");
|
|
25
|
-
|
|
26
|
-
// Import hygiene modules
|
|
27
|
-
const {
|
|
28
|
-
findDuplicates,
|
|
29
|
-
findUnusedFiles,
|
|
30
|
-
collectAllErrors,
|
|
31
|
-
analyzeRootDirectory,
|
|
32
|
-
generateHygieneReport,
|
|
33
|
-
calculateHygieneScore,
|
|
34
|
-
} = require("../scripts/hygiene");
|
|
35
|
-
|
|
36
|
-
// Parse arguments
|
|
37
|
-
const args = process.argv.slice(2);
|
|
38
|
-
const command = args.find((a) => !a.startsWith("-")) || "scan";
|
|
39
|
-
const projectPath = getArg("--path", "-p") || ".";
|
|
40
|
-
const jsonOutput = args.includes("--json");
|
|
41
|
-
|
|
42
|
-
function getArg(long, short) {
|
|
43
|
-
const longIdx = args.findIndex((a) => a.startsWith(long + "=") || a === long);
|
|
44
|
-
if (longIdx !== -1) {
|
|
45
|
-
if (args[longIdx].includes("=")) return args[longIdx].split("=")[1];
|
|
46
|
-
return args[longIdx + 1];
|
|
47
|
-
}
|
|
48
|
-
if (short) {
|
|
49
|
-
const shortIdx = args.findIndex((a) => a === short);
|
|
50
|
-
if (shortIdx !== -1) return args[shortIdx + 1];
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function runFullScan(resolvedPath) {
|
|
56
|
-
console.log("š Scanning for duplicates...");
|
|
57
|
-
const duplicates = findDuplicates(resolvedPath);
|
|
58
|
-
|
|
59
|
-
console.log("š¦ Building import graph...");
|
|
60
|
-
const unused = findUnusedFiles(resolvedPath);
|
|
61
|
-
|
|
62
|
-
console.log("š“ Collecting errors...");
|
|
63
|
-
const errors = collectAllErrors(resolvedPath);
|
|
64
|
-
|
|
65
|
-
console.log("š Analyzing root directory...");
|
|
66
|
-
const rootCleanup = analyzeRootDirectory(resolvedPath);
|
|
67
|
-
|
|
68
|
-
return { projectPath: resolvedPath, duplicates, unused, errors, rootCleanup };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function main() {
|
|
72
|
-
const resolvedPath = path.resolve(projectPath);
|
|
73
|
-
|
|
74
|
-
console.log(`\nš§¹ vibecheck Repo Hygiene\n`);
|
|
75
|
-
console.log(`š Project: ${resolvedPath}\n`);
|
|
76
|
-
|
|
77
|
-
switch (command) {
|
|
78
|
-
case "scan":
|
|
79
|
-
await handleScan(resolvedPath);
|
|
80
|
-
break;
|
|
81
|
-
case "duplicates":
|
|
82
|
-
await handleDuplicates(resolvedPath);
|
|
83
|
-
break;
|
|
84
|
-
case "unused":
|
|
85
|
-
await handleUnused(resolvedPath);
|
|
86
|
-
break;
|
|
87
|
-
case "errors":
|
|
88
|
-
await handleErrors(resolvedPath);
|
|
89
|
-
break;
|
|
90
|
-
default:
|
|
91
|
-
console.error(`Unknown command: ${command}`);
|
|
92
|
-
console.error("Available: scan, duplicates, unused, errors");
|
|
93
|
-
process.exit(1);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async function handleScan(resolvedPath) {
|
|
98
|
-
const results = await runFullScan(resolvedPath);
|
|
99
|
-
const score = calculateHygieneScore(results);
|
|
100
|
-
|
|
101
|
-
if (jsonOutput) {
|
|
102
|
-
console.log(JSON.stringify({ ...results, score }, null, 2));
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Print report
|
|
107
|
-
const report = generateHygieneReport(results);
|
|
108
|
-
console.log("\n" + report);
|
|
109
|
-
|
|
110
|
-
// Print false-positive summary
|
|
111
|
-
printFalsePositiveSummary(results.unused);
|
|
112
|
-
|
|
113
|
-
// Save artifacts
|
|
114
|
-
const reportDir = path.join(resolvedPath, ".vibecheck");
|
|
115
|
-
if (!fs.existsSync(reportDir)) fs.mkdirSync(reportDir, { recursive: true });
|
|
116
|
-
|
|
117
|
-
fs.writeFileSync(path.join(reportDir, "hygiene-report.md"), report);
|
|
118
|
-
fs.writeFileSync(
|
|
119
|
-
path.join(reportDir, "hygiene-results.json"),
|
|
120
|
-
JSON.stringify(results, null, 2),
|
|
121
|
-
);
|
|
122
|
-
fs.writeFileSync(
|
|
123
|
-
path.join(reportDir, "hygiene-score.json"),
|
|
124
|
-
JSON.stringify(score, null, 2),
|
|
125
|
-
);
|
|
126
|
-
fs.writeFileSync(
|
|
127
|
-
path.join(reportDir, "unused-files.json"),
|
|
128
|
-
JSON.stringify(results.unused, null, 2),
|
|
129
|
-
);
|
|
130
|
-
fs.writeFileSync(
|
|
131
|
-
path.join(reportDir, "duplicates.json"),
|
|
132
|
-
JSON.stringify(results.duplicates, null, 2),
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
console.log(`\nš Reports saved to: ${reportDir}/\n`);
|
|
136
|
-
|
|
137
|
-
// Exit code based on score
|
|
138
|
-
if (score.score < 60) {
|
|
139
|
-
process.exit(1);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function printFalsePositiveSummary(unused) {
|
|
144
|
-
if (!unused?.stats) return;
|
|
145
|
-
|
|
146
|
-
const { falsePositives, trueUnused } = unused.stats;
|
|
147
|
-
|
|
148
|
-
console.log("\n" + "ā".repeat(60));
|
|
149
|
-
console.log("\nš **False-Positive Detection Summary**\n");
|
|
150
|
-
console.log(` ā
Framework-managed files detected: ${falsePositives || 0}`);
|
|
151
|
-
console.log(` šļø Truly unused files: ${trueUnused || 0}`);
|
|
152
|
-
|
|
153
|
-
if (unused.unused?.definitelyUnused?.length > 0) {
|
|
154
|
-
console.log("\n **Safe to delete:**");
|
|
155
|
-
for (const file of unused.unused.definitelyUnused.slice(0, 10)) {
|
|
156
|
-
console.log(` - ${file.file}`);
|
|
157
|
-
}
|
|
158
|
-
if (unused.unused.definitelyUnused.length > 10) {
|
|
159
|
-
console.log(
|
|
160
|
-
` ... and ${unused.unused.definitelyUnused.length - 10} more`,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
console.log("");
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
async function handleDuplicates(resolvedPath) {
|
|
169
|
-
console.log("š Scanning for duplicates...");
|
|
170
|
-
const duplicates = findDuplicates(resolvedPath);
|
|
171
|
-
|
|
172
|
-
if (jsonOutput) {
|
|
173
|
-
console.log(JSON.stringify(duplicates, null, 2));
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
console.log("\n## Duplicate Analysis\n");
|
|
178
|
-
console.log(`| Type | Count |`);
|
|
179
|
-
console.log(`|------|-------|`);
|
|
180
|
-
console.log(`| Exact duplicates | ${duplicates.exact?.length || 0} |`);
|
|
181
|
-
console.log(`| Near-duplicates | ${duplicates.near?.length || 0} |`);
|
|
182
|
-
console.log(`| Copy-paste blocks | ${duplicates.copyPaste?.length || 0} |`);
|
|
183
|
-
|
|
184
|
-
if (duplicates.exact?.length > 0) {
|
|
185
|
-
console.log("\n### Exact Duplicates\n");
|
|
186
|
-
for (const dup of duplicates.exact.slice(0, 10)) {
|
|
187
|
-
console.log(
|
|
188
|
-
`- ${dup.files?.map((f) => f.path).join(" = ") || JSON.stringify(dup)}`,
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
async function handleUnused(resolvedPath) {
|
|
195
|
-
console.log("š¦ Building import graph...");
|
|
196
|
-
const unused = findUnusedFiles(resolvedPath);
|
|
197
|
-
|
|
198
|
-
if (jsonOutput) {
|
|
199
|
-
console.log(JSON.stringify(unused, null, 2));
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
console.log("\n## Unused File Analysis\n");
|
|
204
|
-
console.log(`| Category | Count |`);
|
|
205
|
-
console.log(`|----------|-------|`);
|
|
206
|
-
console.log(
|
|
207
|
-
`| Framework-managed (false positives) | ${unused.unused?.falsePositives?.length || 0} |`,
|
|
208
|
-
);
|
|
209
|
-
console.log(
|
|
210
|
-
`| Definitely unused | ${unused.unused?.definitelyUnused?.length || 0} |`,
|
|
211
|
-
);
|
|
212
|
-
console.log(
|
|
213
|
-
`| Probably unused | ${unused.unused?.probablyUnused?.length || 0} |`,
|
|
214
|
-
);
|
|
215
|
-
console.log(`| Test files | ${unused.unused?.testOnly?.length || 0} |`);
|
|
216
|
-
|
|
217
|
-
printFalsePositiveSummary(unused);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
async function handleErrors(resolvedPath) {
|
|
221
|
-
console.log("š“ Collecting errors...");
|
|
222
|
-
const errors = collectAllErrors(resolvedPath);
|
|
223
|
-
|
|
224
|
-
if (jsonOutput) {
|
|
225
|
-
console.log(JSON.stringify(errors, null, 2));
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
console.log("\n## Error Analysis\n");
|
|
230
|
-
console.log(`| Type | Count |`);
|
|
231
|
-
console.log(`|------|-------|`);
|
|
232
|
-
console.log(`| TypeScript errors | ${errors.typescript?.length || 0} |`);
|
|
233
|
-
console.log(`| ESLint errors | ${errors.eslint?.length || 0} |`);
|
|
234
|
-
console.log(`| Syntax errors | ${errors.syntax?.length || 0} |`);
|
|
235
|
-
console.log(`| Import errors | ${errors.imports?.length || 0} |`);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
main().catch((err) => {
|
|
239
|
-
console.error("Error:", err.message);
|
|
240
|
-
process.exit(1);
|
|
241
|
-
});
|