@vibecheckai/cli 3.1.6 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -32
- package/bin/registry.js +208 -343
- package/bin/runners/context/generators/mcp.js +18 -0
- package/bin/runners/context/index.js +72 -4
- package/bin/runners/context/proof-context.js +293 -1
- package/bin/runners/context/security-scanner.js +311 -73
- package/bin/runners/lib/analyzers.js +607 -20
- package/bin/runners/lib/detectors-v2.js +172 -15
- package/bin/runners/lib/entitlements-v2.js +48 -1
- package/bin/runners/lib/evidence-pack.js +678 -0
- package/bin/runners/lib/html-proof-report.js +913 -0
- package/bin/runners/lib/missions/plan.js +231 -41
- package/bin/runners/lib/missions/templates.js +125 -0
- package/bin/runners/lib/scan-output.js +492 -253
- package/bin/runners/lib/ship-output.js +901 -641
- package/bin/runners/runCheckpoint.js +44 -3
- package/bin/runners/runContext.d.ts +4 -0
- package/bin/runners/runContext.js +2 -3
- package/bin/runners/runDoctor.js +11 -4
- package/bin/runners/runFix.js +51 -341
- package/bin/runners/runInit.js +37 -20
- package/bin/runners/runPolish.d.ts +4 -0
- package/bin/runners/runPolish.js +608 -29
- package/bin/runners/runProve.js +210 -25
- package/bin/runners/runReality.js +861 -107
- package/bin/runners/runScan.js +238 -4
- package/bin/runners/runShip.js +19 -3
- package/bin/runners/runWatch.js +25 -5
- package/bin/vibecheck.js +35 -47
- package/mcp-server/consolidated-tools.js +408 -42
- package/mcp-server/index.js +152 -15
- package/mcp-server/package.json +1 -1
- package/mcp-server/proof-tools.js +571 -0
- package/mcp-server/tier-auth.js +22 -19
- package/mcp-server/tools-v3.js +744 -0
- package/mcp-server/truth-firewall-tools.js +190 -4
- package/package.json +3 -1
- package/bin/runners/runBadge.js +0 -916
- package/bin/runners/runContracts.js +0 -105
- package/bin/runners/runCtx.js +0 -680
- package/bin/runners/runCtxDiff.js +0 -301
- package/bin/runners/runCtxGuard.js +0 -176
- package/bin/runners/runCtxSync.js +0 -116
- package/bin/runners/runExport.js +0 -93
- package/bin/runners/runGraph.js +0 -454
- package/bin/runners/runInstall.js +0 -273
- package/bin/runners/runLabs.js +0 -341
- package/bin/runners/runLaunch.js +0 -181
- package/bin/runners/runPR.js +0 -255
- package/bin/runners/runPermissions.js +0 -310
- package/bin/runners/runPreflight.js +0 -580
- package/bin/runners/runReplay.js +0 -499
- package/bin/runners/runSecurity.js +0 -92
- package/bin/runners/runShare.js +0 -212
- package/bin/runners/runStatus.js +0 -102
- package/bin/runners/runVerify.js +0 -272
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibecheck install - Zero-friction Onboarding
|
|
3
|
-
*
|
|
4
|
-
* ═══════════════════════════════════════════════════════════════════════════════
|
|
5
|
-
* ENTERPRISE EDITION - World-Class Terminal Experience
|
|
6
|
-
* ═══════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const fs = require("fs");
|
|
10
|
-
const path = require("path");
|
|
11
|
-
const { buildTruthpack, writeTruthpack } = require("./lib/truth");
|
|
12
|
-
const { detectPackageManager, detectNext, detectFastify, detectFastifyEntry } = require("./lib/detect");
|
|
13
|
-
const { readPkg, writePkg, upsertScripts } = require("./lib/pkgjson");
|
|
14
|
-
const { writeEnvTemplateFromTruthpack } = require("./lib/env-template");
|
|
15
|
-
|
|
16
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
17
|
-
// ADVANCED TERMINAL - ANSI CODES & UTILITIES
|
|
18
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
19
|
-
|
|
20
|
-
const c = {
|
|
21
|
-
reset: '\x1b[0m',
|
|
22
|
-
bold: '\x1b[1m',
|
|
23
|
-
dim: '\x1b[2m',
|
|
24
|
-
italic: '\x1b[3m',
|
|
25
|
-
red: '\x1b[31m',
|
|
26
|
-
green: '\x1b[32m',
|
|
27
|
-
yellow: '\x1b[33m',
|
|
28
|
-
blue: '\x1b[34m',
|
|
29
|
-
magenta: '\x1b[35m',
|
|
30
|
-
cyan: '\x1b[36m',
|
|
31
|
-
white: '\x1b[37m',
|
|
32
|
-
gray: '\x1b[90m',
|
|
33
|
-
clearLine: '\x1b[2K',
|
|
34
|
-
hideCursor: '\x1b[?25l',
|
|
35
|
-
showCursor: '\x1b[?25h',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const rgb = (r, g, b) => `\x1b[38;2;${r};${g};${b}m`;
|
|
39
|
-
|
|
40
|
-
const colors = {
|
|
41
|
-
gradient1: rgb(255, 200, 100),
|
|
42
|
-
gradient2: rgb(255, 180, 80),
|
|
43
|
-
gradient3: rgb(255, 160, 60),
|
|
44
|
-
shipGreen: rgb(0, 255, 150),
|
|
45
|
-
warnAmber: rgb(255, 200, 0),
|
|
46
|
-
blockRed: rgb(255, 80, 80),
|
|
47
|
-
accent: rgb(255, 200, 100),
|
|
48
|
-
muted: rgb(120, 120, 140),
|
|
49
|
-
next: rgb(100, 200, 255),
|
|
50
|
-
fastify: rgb(255, 150, 200),
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
54
|
-
// PREMIUM BANNER
|
|
55
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
56
|
-
|
|
57
|
-
const INSTALL_BANNER = `
|
|
58
|
-
${rgb(255, 200, 100)} ██╗███╗ ██╗███████╗████████╗ █████╗ ██╗ ██╗ ${c.reset}
|
|
59
|
-
${rgb(255, 180, 80)} ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ${c.reset}
|
|
60
|
-
${rgb(255, 160, 60)} ██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ ${c.reset}
|
|
61
|
-
${rgb(255, 140, 40)} ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ${c.reset}
|
|
62
|
-
${rgb(255, 120, 20)} ██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗${c.reset}
|
|
63
|
-
${rgb(255, 100, 0)} ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝${c.reset}
|
|
64
|
-
`;
|
|
65
|
-
|
|
66
|
-
const BANNER_FULL = `
|
|
67
|
-
${rgb(255, 200, 100)} ██╗ ██╗██╗██████╗ ███████╗ ██████╗██╗ ██╗███████╗ ██████╗██╗ ██╗${c.reset}
|
|
68
|
-
${rgb(255, 190, 90)} ██║ ██║██║██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██║ ██╔╝${c.reset}
|
|
69
|
-
${rgb(255, 180, 80)} ██║ ██║██║██████╔╝█████╗ ██║ ███████║█████╗ ██║ █████╔╝ ${c.reset}
|
|
70
|
-
${rgb(255, 160, 60)} ╚██╗ ██╔╝██║██╔══██╗██╔══╝ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗ ${c.reset}
|
|
71
|
-
${rgb(255, 140, 40)} ╚████╔╝ ██║██████╔╝███████╗╚██████╗██║ ██║███████╗╚██████╗██║ ██╗${c.reset}
|
|
72
|
-
${rgb(255, 120, 20)} ╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝${c.reset}
|
|
73
|
-
|
|
74
|
-
${c.dim} ┌─────────────────────────────────────────────────────────────────────┐${c.reset}
|
|
75
|
-
${c.dim} │${c.reset} ${rgb(255, 200, 100)}📥${c.reset} ${c.bold}INSTALL${c.reset} ${c.dim}•${c.reset} ${rgb(200, 200, 200)}Zero-Friction${c.reset} ${c.dim}•${c.reset} ${rgb(150, 150, 150)}Auto-Detect${c.reset} ${c.dim}•${c.reset} ${rgb(100, 100, 100)}Onboarding${c.reset} ${c.dim}│${c.reset}
|
|
76
|
-
${c.dim} └─────────────────────────────────────────────────────────────────────┘${c.reset}
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
const ICONS = {
|
|
80
|
-
install: '📥',
|
|
81
|
-
package: '📦',
|
|
82
|
-
file: '📄',
|
|
83
|
-
check: '✓',
|
|
84
|
-
cross: '✗',
|
|
85
|
-
warning: '⚠',
|
|
86
|
-
arrow: '→',
|
|
87
|
-
bullet: '•',
|
|
88
|
-
sparkle: '✨',
|
|
89
|
-
folder: '📁',
|
|
90
|
-
next: '▲',
|
|
91
|
-
fastify: '⚡',
|
|
92
|
-
npm: '📦',
|
|
93
|
-
gear: '⚙️',
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const SPINNER_DOTS = ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷'];
|
|
97
|
-
let spinnerIndex = 0;
|
|
98
|
-
let spinnerInterval = null;
|
|
99
|
-
let spinnerStartTime = null;
|
|
100
|
-
|
|
101
|
-
function formatDuration(ms) {
|
|
102
|
-
if (ms < 1000) return `${ms}ms`;
|
|
103
|
-
return `${(ms / 1000).toFixed(1)}s`;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function startSpinner(message) {
|
|
107
|
-
spinnerStartTime = Date.now();
|
|
108
|
-
process.stdout.write(c.hideCursor);
|
|
109
|
-
spinnerInterval = setInterval(() => {
|
|
110
|
-
const elapsed = formatDuration(Date.now() - spinnerStartTime);
|
|
111
|
-
process.stdout.write(`\r${c.clearLine} ${colors.accent}${SPINNER_DOTS[spinnerIndex]}${c.reset} ${message} ${c.dim}${elapsed}${c.reset}`);
|
|
112
|
-
spinnerIndex = (spinnerIndex + 1) % SPINNER_DOTS.length;
|
|
113
|
-
}, 80);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function stopSpinner(message, success = true) {
|
|
117
|
-
if (spinnerInterval) {
|
|
118
|
-
clearInterval(spinnerInterval);
|
|
119
|
-
spinnerInterval = null;
|
|
120
|
-
}
|
|
121
|
-
const elapsed = spinnerStartTime ? formatDuration(Date.now() - spinnerStartTime) : '';
|
|
122
|
-
const icon = success ? `${colors.shipGreen}${ICONS.check}${c.reset}` : `${colors.blockRed}${ICONS.cross}${c.reset}`;
|
|
123
|
-
process.stdout.write(`\r${c.clearLine} ${icon} ${message} ${c.dim}${elapsed}${c.reset}\n`);
|
|
124
|
-
process.stdout.write(c.showCursor);
|
|
125
|
-
spinnerStartTime = null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function printDivider(char = '─', width = 69, color = c.dim) {
|
|
129
|
-
console.log(`${color} ${char.repeat(width)}${c.reset}`);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function printSection(title, icon = '◆') {
|
|
133
|
-
console.log();
|
|
134
|
-
console.log(` ${colors.accent}${icon}${c.reset} ${c.bold}${title}${c.reset}`);
|
|
135
|
-
printDivider();
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function printHelp() {
|
|
139
|
-
console.log(BANNER_FULL);
|
|
140
|
-
console.log(`
|
|
141
|
-
${c.bold}Usage:${c.reset} vibecheck install [options]
|
|
142
|
-
|
|
143
|
-
${c.bold}Zero-Friction Onboarding${c.reset} — Auto-detect and configure your project.
|
|
144
|
-
|
|
145
|
-
${c.bold}Options:${c.reset}
|
|
146
|
-
${colors.accent}--path, -p <dir>${c.reset} Project path ${c.dim}(default: current directory)${c.reset}
|
|
147
|
-
${colors.accent}--help, -h${c.reset} Show this help
|
|
148
|
-
|
|
149
|
-
${c.bold}What It Does:${c.reset}
|
|
150
|
-
${colors.shipGreen}1.${c.reset} Detects package manager ${c.dim}(npm, yarn, pnpm)${c.reset}
|
|
151
|
-
${colors.shipGreen}2.${c.reset} Detects frameworks ${c.dim}(Next.js, Fastify)${c.reset}
|
|
152
|
-
${colors.shipGreen}3.${c.reset} Builds initial truthpack
|
|
153
|
-
${colors.shipGreen}4.${c.reset} Creates .vibecheck/config.json
|
|
154
|
-
${colors.shipGreen}5.${c.reset} Generates env template from truthpack
|
|
155
|
-
${colors.shipGreen}6.${c.reset} Adds vibecheck scripts to package.json
|
|
156
|
-
|
|
157
|
-
${c.bold}Created Files:${c.reset}
|
|
158
|
-
${ICONS.file} ${colors.accent}.vibecheck/config.json${c.reset} ${c.dim}Local configuration${c.reset}
|
|
159
|
-
${ICONS.file} ${colors.accent}.vibecheck/truthpack.json${c.reset} ${c.dim}Ground truth for AI agents${c.reset}
|
|
160
|
-
${ICONS.file} ${colors.accent}.env.template${c.reset} ${c.dim}Env vars from truthpack${c.reset}
|
|
161
|
-
|
|
162
|
-
${c.bold}Examples:${c.reset}
|
|
163
|
-
${c.dim}# Install in current directory${c.reset}
|
|
164
|
-
vibecheck install
|
|
165
|
-
|
|
166
|
-
${c.dim}# Install in specific directory${c.reset}
|
|
167
|
-
vibecheck install --path ./my-app
|
|
168
|
-
`);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function ensureDir(p) {
|
|
172
|
-
fs.mkdirSync(p, { recursive: true });
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
async function runInstall(argsOrContext = {}) {
|
|
176
|
-
// Handle array args from CLI
|
|
177
|
-
if (Array.isArray(argsOrContext)) {
|
|
178
|
-
if (argsOrContext.includes("--help") || argsOrContext.includes("-h")) {
|
|
179
|
-
printHelp();
|
|
180
|
-
return 0;
|
|
181
|
-
}
|
|
182
|
-
argsOrContext = { repoRoot: process.cwd() };
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const { repoRoot } = argsOrContext;
|
|
186
|
-
const root = repoRoot || process.cwd();
|
|
187
|
-
const projectName = path.basename(root);
|
|
188
|
-
|
|
189
|
-
// Print banner
|
|
190
|
-
console.log(BANNER_FULL);
|
|
191
|
-
console.log(` ${c.dim}Project:${c.reset} ${c.bold}${projectName}${c.reset}`);
|
|
192
|
-
console.log(` ${c.dim}Path:${c.reset} ${root}`);
|
|
193
|
-
console.log();
|
|
194
|
-
|
|
195
|
-
const { path: pkgPath, json: pkg } = readPkg(root);
|
|
196
|
-
|
|
197
|
-
// Detect environment
|
|
198
|
-
startSpinner('Detecting environment...');
|
|
199
|
-
const pm = detectPackageManager(root);
|
|
200
|
-
const next = detectNext(root, pkg);
|
|
201
|
-
const fastify = detectFastify(root, pkg);
|
|
202
|
-
const fastifyEntry = fastify.enabled ? await detectFastifyEntry(root) : null;
|
|
203
|
-
stopSpinner('Environment detected', true);
|
|
204
|
-
|
|
205
|
-
// Build truthpack
|
|
206
|
-
startSpinner('Building truthpack...');
|
|
207
|
-
const truthpack = await buildTruthpack({ repoRoot: root, fastifyEntry: fastifyEntry || undefined });
|
|
208
|
-
writeTruthpack(root, truthpack);
|
|
209
|
-
stopSpinner('Truthpack built', true);
|
|
210
|
-
|
|
211
|
-
// Write config
|
|
212
|
-
startSpinner('Writing configuration...');
|
|
213
|
-
const cfgDir = path.join(root, ".vibecheck");
|
|
214
|
-
ensureDir(cfgDir);
|
|
215
|
-
|
|
216
|
-
const cfg = {
|
|
217
|
-
version: 1,
|
|
218
|
-
detected: {
|
|
219
|
-
packageManager: pm,
|
|
220
|
-
next: next.enabled,
|
|
221
|
-
fastify: fastify.enabled
|
|
222
|
-
},
|
|
223
|
-
fastifyEntry: fastifyEntry || null
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
fs.writeFileSync(path.join(cfgDir, "config.json"), JSON.stringify(cfg, null, 2), "utf8");
|
|
227
|
-
stopSpinner('Configuration written', true);
|
|
228
|
-
|
|
229
|
-
// Generate env template
|
|
230
|
-
startSpinner('Generating env template...');
|
|
231
|
-
const envRes = writeEnvTemplateFromTruthpack(root, truthpack);
|
|
232
|
-
stopSpinner(envRes.wrote ? `Env template generated (+${envRes.added.length} vars)` : 'Env template up to date', true);
|
|
233
|
-
|
|
234
|
-
// Add scripts
|
|
235
|
-
startSpinner('Updating package.json scripts...');
|
|
236
|
-
const scriptsToAdd = {
|
|
237
|
-
"vibecheck:ctx": "vibecheck ctx",
|
|
238
|
-
"vibecheck:ship": "vibecheck ship",
|
|
239
|
-
"vibecheck:fix": "vibecheck fix --apply",
|
|
240
|
-
"vibecheck:pr": "vibecheck pr"
|
|
241
|
-
};
|
|
242
|
-
const changedScripts = upsertScripts(pkg, scriptsToAdd);
|
|
243
|
-
if (changedScripts.length) writePkg(pkgPath, pkg);
|
|
244
|
-
stopSpinner(changedScripts.length ? `Added ${changedScripts.length} scripts` : 'Scripts up to date', true);
|
|
245
|
-
|
|
246
|
-
// Summary
|
|
247
|
-
printSection('DETECTED', ICONS.gear);
|
|
248
|
-
console.log();
|
|
249
|
-
console.log(` ${ICONS.npm} ${c.bold}Package Manager:${c.reset} ${colors.accent}${pm}${c.reset}`);
|
|
250
|
-
console.log(` ${colors.next}${ICONS.next}${c.reset} ${c.bold}Next.js:${c.reset} ${next.enabled ? `${colors.shipGreen}yes${c.reset}` : `${c.dim}no${c.reset}`}`);
|
|
251
|
-
console.log(` ${colors.fastify}${ICONS.fastify}${c.reset} ${c.bold}Fastify:${c.reset} ${fastify.enabled ? `${colors.shipGreen}yes${c.reset}` : `${c.dim}no${c.reset}`}`);
|
|
252
|
-
if (fastifyEntry) {
|
|
253
|
-
console.log(` ${c.dim} Entry:${c.reset} ${colors.accent}${fastifyEntry}${c.reset}`);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
printSection('CREATED FILES', ICONS.folder);
|
|
257
|
-
console.log();
|
|
258
|
-
console.log(` ${colors.shipGreen}${ICONS.check}${c.reset} ${ICONS.file} ${colors.accent}.vibecheck/config.json${c.reset}`);
|
|
259
|
-
console.log(` ${colors.shipGreen}${ICONS.check}${c.reset} ${ICONS.file} ${colors.accent}.vibecheck/truthpack.json${c.reset}`);
|
|
260
|
-
if (envRes.wrote) {
|
|
261
|
-
console.log(` ${colors.shipGreen}${ICONS.check}${c.reset} ${ICONS.file} ${colors.accent}${envRes.outRel}${c.reset} ${c.dim}(+${envRes.added.length} vars)${c.reset}`);
|
|
262
|
-
}
|
|
263
|
-
if (changedScripts.length) {
|
|
264
|
-
console.log(` ${colors.shipGreen}${ICONS.check}${c.reset} ${ICONS.file} ${colors.accent}package.json${c.reset} ${c.dim}(${changedScripts.join(', ')})${c.reset}`);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// Installation complete
|
|
268
|
-
console.log();
|
|
269
|
-
console.log(` ${colors.shipGreen}${ICONS.sparkle}${c.reset} Installation complete!`);
|
|
270
|
-
console.log();
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
module.exports = { runInstall };
|
package/bin/runners/runLabs.js
DELETED
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibecheck labs - Experimental Features
|
|
3
|
-
*
|
|
4
|
-
* Access to experimental, internal, and beta features.
|
|
5
|
-
* These may change or be removed without notice.
|
|
6
|
-
*
|
|
7
|
-
* @module runners/runLabs
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";
|
|
11
|
-
|
|
12
|
-
const { c, sym, box, printHeader, table } = require("./lib/ui");
|
|
13
|
-
|
|
14
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
15
|
-
// LABS FEATURE REGISTRY
|
|
16
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
17
|
-
const LABS_FEATURES = {
|
|
18
|
-
// Experimental - Working but API may change
|
|
19
|
-
"ai-test": {
|
|
20
|
-
status: "experimental",
|
|
21
|
-
description: "AI agent for autonomous app testing",
|
|
22
|
-
docs: "https://docs.vibecheckai.dev/labs/ai-test",
|
|
23
|
-
runner: () => require("./runAIAgent").runAIAgent,
|
|
24
|
-
},
|
|
25
|
-
"launch": {
|
|
26
|
-
status: "experimental",
|
|
27
|
-
description: "Pre-launch checklist wizard",
|
|
28
|
-
docs: "https://docs.vibecheckai.dev/labs/launch",
|
|
29
|
-
runner: () => require("./runLaunch").runLaunch,
|
|
30
|
-
},
|
|
31
|
-
"dashboard": {
|
|
32
|
-
status: "stub",
|
|
33
|
-
description: "Real-time monitoring dashboard (coming soon)",
|
|
34
|
-
eta: "Q2 2025",
|
|
35
|
-
},
|
|
36
|
-
"permissions": {
|
|
37
|
-
status: "experimental",
|
|
38
|
-
description: "AuthZ matrix & IDOR vulnerability prover",
|
|
39
|
-
runner: () => require("./runPermissions").runPermissions,
|
|
40
|
-
},
|
|
41
|
-
"replay": {
|
|
42
|
-
status: "experimental",
|
|
43
|
-
description: "Record and replay user sessions for testing",
|
|
44
|
-
runner: () => require("./runReplay").runReplay,
|
|
45
|
-
},
|
|
46
|
-
"graph": {
|
|
47
|
-
status: "experimental",
|
|
48
|
-
description: "Reality proof graph visualization",
|
|
49
|
-
runner: () => require("./runGraph").runGraph,
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
// Beta - Feature complete, gathering feedback
|
|
53
|
-
"ctx-diff": {
|
|
54
|
-
status: "beta",
|
|
55
|
-
description: "Diff truthpack changes across commits",
|
|
56
|
-
runner: () => require("./runCtxDiff").main,
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
// Stubs - Planned but not implemented
|
|
60
|
-
"autopilot": {
|
|
61
|
-
status: "stub",
|
|
62
|
-
description: "Continuous protection mode (auto-fix on commit)",
|
|
63
|
-
eta: "Q2 2025",
|
|
64
|
-
},
|
|
65
|
-
"certify": {
|
|
66
|
-
status: "stub",
|
|
67
|
-
description: "Generate compliance certification badges",
|
|
68
|
-
eta: "Q2 2025",
|
|
69
|
-
},
|
|
70
|
-
"audit": {
|
|
71
|
-
status: "stub",
|
|
72
|
-
description: "Full audit trail for compliance (SOC2, HIPAA)",
|
|
73
|
-
eta: "Q3 2025",
|
|
74
|
-
},
|
|
75
|
-
"natural-language": {
|
|
76
|
-
status: "stub",
|
|
77
|
-
description: "Natural language command parsing",
|
|
78
|
-
eta: "Q2 2025",
|
|
79
|
-
},
|
|
80
|
-
"fix-packs": {
|
|
81
|
-
status: "stub",
|
|
82
|
-
description: "Downloadable fix pack templates",
|
|
83
|
-
eta: "Q2 2025",
|
|
84
|
-
},
|
|
85
|
-
"mdc": {
|
|
86
|
-
status: "stub",
|
|
87
|
-
description: "MDC documentation generator",
|
|
88
|
-
eta: "Q3 2025",
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
// Aliases - Redirect to main commands
|
|
92
|
-
"enhanced-ship": {
|
|
93
|
-
status: "alias",
|
|
94
|
-
target: "ship --strict",
|
|
95
|
-
description: "Enhanced ship mode (use: vibecheck ship --strict)",
|
|
96
|
-
},
|
|
97
|
-
"sniff": {
|
|
98
|
-
status: "alias",
|
|
99
|
-
target: "reality --sniff",
|
|
100
|
-
description: "Reality sniff mode (use: vibecheck reality --sniff)",
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
105
|
-
// STATUS DISPLAY
|
|
106
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
107
|
-
const STATUS_CONFIG = {
|
|
108
|
-
experimental: {
|
|
109
|
-
icon: sym.lightning,
|
|
110
|
-
color: c.yellow,
|
|
111
|
-
label: "EXPERIMENTAL",
|
|
112
|
-
description: "Working but API may change",
|
|
113
|
-
},
|
|
114
|
-
beta: {
|
|
115
|
-
icon: sym.star,
|
|
116
|
-
color: c.cyan,
|
|
117
|
-
label: "BETA",
|
|
118
|
-
description: "Feature complete, gathering feedback",
|
|
119
|
-
},
|
|
120
|
-
stub: {
|
|
121
|
-
icon: sym.pending,
|
|
122
|
-
color: c.dim,
|
|
123
|
-
label: "PLANNED",
|
|
124
|
-
description: "Not yet implemented",
|
|
125
|
-
},
|
|
126
|
-
alias: {
|
|
127
|
-
icon: sym.arrow,
|
|
128
|
-
color: c.dim,
|
|
129
|
-
label: "ALIAS",
|
|
130
|
-
description: "Use the main command instead",
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
function formatStatus(status) {
|
|
135
|
-
const config = STATUS_CONFIG[status];
|
|
136
|
-
if (!config) return status;
|
|
137
|
-
return `${config.color}${config.icon} ${config.label}${c.reset}`;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
141
|
-
// HELP DISPLAY
|
|
142
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
143
|
-
function printHelp() {
|
|
144
|
-
printHeader("LABS", {
|
|
145
|
-
icon: sym.lightning,
|
|
146
|
-
subtitle: "Experimental & Internal Features"
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
console.log(`${c.yellow}${sym.warning} These features are experimental and may change without notice.${c.reset}\n`);
|
|
150
|
-
|
|
151
|
-
// Group by status
|
|
152
|
-
const groups = {
|
|
153
|
-
experimental: [],
|
|
154
|
-
beta: [],
|
|
155
|
-
stub: [],
|
|
156
|
-
alias: [],
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
for (const [name, feature] of Object.entries(LABS_FEATURES)) {
|
|
160
|
-
if (groups[feature.status]) {
|
|
161
|
-
groups[feature.status].push({ name, ...feature });
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Experimental
|
|
166
|
-
if (groups.experimental.length > 0) {
|
|
167
|
-
console.log(`${c.yellow}${sym.lightning} EXPERIMENTAL${c.reset} ${c.dim}(working, API may change)${c.reset}\n`);
|
|
168
|
-
|
|
169
|
-
for (const feature of groups.experimental) {
|
|
170
|
-
console.log(` ${c.cyan}vibecheck labs ${feature.name}${c.reset}`);
|
|
171
|
-
console.log(` ${c.dim}${feature.description}${c.reset}`);
|
|
172
|
-
if (feature.docs) {
|
|
173
|
-
console.log(` ${c.dim}Docs: ${feature.docs}${c.reset}`);
|
|
174
|
-
}
|
|
175
|
-
console.log("");
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Beta
|
|
180
|
-
if (groups.beta.length > 0) {
|
|
181
|
-
console.log(`${c.cyan}${sym.star} BETA${c.reset} ${c.dim}(feature complete, gathering feedback)${c.reset}\n`);
|
|
182
|
-
|
|
183
|
-
for (const feature of groups.beta) {
|
|
184
|
-
console.log(` ${c.cyan}vibecheck labs ${feature.name}${c.reset}`);
|
|
185
|
-
console.log(` ${c.dim}${feature.description}${c.reset}`);
|
|
186
|
-
console.log("");
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// Stubs
|
|
191
|
-
if (groups.stub.length > 0) {
|
|
192
|
-
console.log(`${c.dim}${sym.pending} PLANNED${c.reset} ${c.dim}(not yet implemented)${c.reset}\n`);
|
|
193
|
-
|
|
194
|
-
const stubData = groups.stub.map(f => [
|
|
195
|
-
`${c.dim}${f.name}${c.reset}`,
|
|
196
|
-
`${c.dim}${f.description}${c.reset}`,
|
|
197
|
-
f.eta ? `${c.dim}ETA: ${f.eta}${c.reset}` : "",
|
|
198
|
-
]);
|
|
199
|
-
|
|
200
|
-
console.log(table(stubData, { indent: 2 }));
|
|
201
|
-
console.log("");
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Aliases
|
|
205
|
-
if (groups.alias.length > 0) {
|
|
206
|
-
console.log(`${c.dim}${sym.arrow} ALIASES${c.reset} ${c.dim}(use the main command instead)${c.reset}\n`);
|
|
207
|
-
|
|
208
|
-
for (const feature of groups.alias) {
|
|
209
|
-
console.log(` ${c.dim}labs ${feature.name}${c.reset} ${sym.arrow} ${c.cyan}vibecheck ${feature.target}${c.reset}`);
|
|
210
|
-
}
|
|
211
|
-
console.log("");
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// Usage
|
|
215
|
-
console.log(`${c.dim}${"─".repeat(60)}${c.reset}`);
|
|
216
|
-
console.log(`${c.bold}Usage${c.reset}\n`);
|
|
217
|
-
console.log(` vibecheck labs <feature> [options]\n`);
|
|
218
|
-
console.log(`${c.dim}Example:${c.reset}`);
|
|
219
|
-
console.log(` vibecheck labs ai-test --url http://localhost:3000`);
|
|
220
|
-
console.log("");
|
|
221
|
-
|
|
222
|
-
// Feedback
|
|
223
|
-
console.log(`${c.dim}${"─".repeat(60)}${c.reset}`);
|
|
224
|
-
console.log(`${c.bold}Feedback${c.reset}\n`);
|
|
225
|
-
console.log(` ${c.dim}Want a feature prioritized? Let us know:${c.reset}`);
|
|
226
|
-
console.log(` ${c.cyan}https://github.com/vibecheckai/vibecheck/discussions${c.reset}`);
|
|
227
|
-
console.log("");
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function printFeatureStub(name, feature) {
|
|
231
|
-
console.log(box(
|
|
232
|
-
`${c.bold}vibecheck labs ${name}${c.reset}\n\n` +
|
|
233
|
-
`${feature.description}\n\n` +
|
|
234
|
-
`${c.dim}This feature is not yet implemented.${c.reset}\n` +
|
|
235
|
-
(feature.eta ? `${c.dim}Expected: ${feature.eta}${c.reset}\n` : "") +
|
|
236
|
-
`\n${c.dim}Want this feature? Vote for it:${c.reset}\n` +
|
|
237
|
-
`${c.cyan}https://github.com/vibecheckai/vibecheck/discussions${c.reset}`,
|
|
238
|
-
{ title: "PLANNED", borderColor: c.yellow }
|
|
239
|
-
));
|
|
240
|
-
console.log("");
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function printAliasWarning(name, feature) {
|
|
244
|
-
console.log(`${c.yellow}${sym.warning}${c.reset} '${name}' is now available as: ${c.cyan}vibecheck ${feature.target}${c.reset}\n`);
|
|
245
|
-
console.log(`${c.dim}The labs alias will be removed in a future version.${c.reset}\n`);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
249
|
-
// MAIN RUNNER
|
|
250
|
-
// ═══════════════════════════════════════════════════════════════════════════════
|
|
251
|
-
async function runLabs(args = []) {
|
|
252
|
-
const subCmd = args[0];
|
|
253
|
-
const subArgs = args.slice(1);
|
|
254
|
-
|
|
255
|
-
// Show help if no command
|
|
256
|
-
if (!subCmd || subCmd === "--help" || subCmd === "-h") {
|
|
257
|
-
printHelp();
|
|
258
|
-
return 0;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// List all features
|
|
262
|
-
if (subCmd === "--list" || subCmd === "-l") {
|
|
263
|
-
const features = Object.entries(LABS_FEATURES).map(([name, f]) => [
|
|
264
|
-
name,
|
|
265
|
-
formatStatus(f.status),
|
|
266
|
-
f.description.slice(0, 40),
|
|
267
|
-
]);
|
|
268
|
-
|
|
269
|
-
console.log(table(features, {
|
|
270
|
-
headers: ["Feature", "Status", "Description"],
|
|
271
|
-
indent: 2,
|
|
272
|
-
}));
|
|
273
|
-
console.log("");
|
|
274
|
-
return 0;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// Find feature
|
|
278
|
-
const feature = LABS_FEATURES[subCmd];
|
|
279
|
-
|
|
280
|
-
if (!feature) {
|
|
281
|
-
console.log(`${c.red}${sym.error}${c.reset} Unknown labs feature: ${c.yellow}${subCmd}${c.reset}\n`);
|
|
282
|
-
console.log(`${c.dim}Available features:${c.reset}`);
|
|
283
|
-
console.log(` ${Object.keys(LABS_FEATURES).filter(k => LABS_FEATURES[k].status !== "stub").join(", ")}`);
|
|
284
|
-
console.log(`\n${c.dim}Run 'vibecheck labs --help' for details.${c.reset}\n`);
|
|
285
|
-
return 1;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// Handle stubs
|
|
289
|
-
if (feature.status === "stub") {
|
|
290
|
-
printFeatureStub(subCmd, feature);
|
|
291
|
-
return 0;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// Handle aliases
|
|
295
|
-
if (feature.status === "alias") {
|
|
296
|
-
printAliasWarning(subCmd, feature);
|
|
297
|
-
|
|
298
|
-
// Try to run the aliased command
|
|
299
|
-
const [cmd, ...aliasArgs] = feature.target.split(" ");
|
|
300
|
-
try {
|
|
301
|
-
const { runShip } = require("./runShip");
|
|
302
|
-
if (cmd === "ship") {
|
|
303
|
-
return await runShip([...aliasArgs, ...subArgs]);
|
|
304
|
-
}
|
|
305
|
-
const { runReality } = require("./runReality");
|
|
306
|
-
if (cmd === "reality") {
|
|
307
|
-
return await runReality([...aliasArgs, ...subArgs]);
|
|
308
|
-
}
|
|
309
|
-
} catch (e) {
|
|
310
|
-
console.log(`${c.dim}Please run the command directly: vibecheck ${feature.target}${c.reset}\n`);
|
|
311
|
-
}
|
|
312
|
-
return 0;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Run the feature
|
|
316
|
-
try {
|
|
317
|
-
const runner = feature.runner();
|
|
318
|
-
|
|
319
|
-
// Show experimental warning
|
|
320
|
-
if (feature.status === "experimental") {
|
|
321
|
-
console.log(`${c.yellow}${sym.warning} EXPERIMENTAL:${c.reset} ${c.dim}This feature may change without notice.${c.reset}\n`);
|
|
322
|
-
} else if (feature.status === "beta") {
|
|
323
|
-
console.log(`${c.cyan}${sym.star} BETA:${c.reset} ${c.dim}Feedback welcome! Report issues at github.com/vibecheckai/vibecheck${c.reset}\n`);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return await runner(subArgs);
|
|
327
|
-
} catch (e) {
|
|
328
|
-
if (e.code === "MODULE_NOT_FOUND") {
|
|
329
|
-
console.log(`${c.red}${sym.error}${c.reset} Feature '${subCmd}' is not available in this version.\n`);
|
|
330
|
-
console.log(`${c.dim}Try updating: npm update -g @vibecheckai/cli${c.reset}\n`);
|
|
331
|
-
} else {
|
|
332
|
-
console.error(`${c.red}${sym.error}${c.reset} Error running labs ${subCmd}: ${e.message}`);
|
|
333
|
-
if (process.env.VIBECHECK_DEBUG) {
|
|
334
|
-
console.error(c.dim + e.stack + c.reset);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return 1;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
module.exports = { runLabs, LABS_FEATURES };
|