@vibecheckai/cli 3.5.0 → 3.5.2
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/registry.js +214 -237
- package/bin/runners/cli-utils.js +33 -2
- package/bin/runners/context/analyzer.js +52 -1
- package/bin/runners/context/generators/cursor.js +2 -49
- package/bin/runners/context/git-context.js +3 -1
- package/bin/runners/context/team-conventions.js +33 -7
- package/bin/runners/lib/analysis-core.js +25 -5
- package/bin/runners/lib/analyzers.js +431 -481
- package/bin/runners/lib/default-config.js +127 -0
- package/bin/runners/lib/doctor/modules/security.js +3 -1
- package/bin/runners/lib/engine/ast-cache.js +210 -0
- package/bin/runners/lib/engine/auth-extractor.js +211 -0
- package/bin/runners/lib/engine/billing-extractor.js +112 -0
- package/bin/runners/lib/engine/enforcement-extractor.js +100 -0
- package/bin/runners/lib/engine/env-extractor.js +207 -0
- package/bin/runners/lib/engine/express-extractor.js +208 -0
- package/bin/runners/lib/engine/extractors.js +849 -0
- package/bin/runners/lib/engine/index.js +207 -0
- package/bin/runners/lib/engine/repo-index.js +514 -0
- package/bin/runners/lib/engine/types.js +124 -0
- package/bin/runners/lib/engines/accessibility-engine.js +18 -218
- package/bin/runners/lib/engines/api-consistency-engine.js +30 -335
- package/bin/runners/lib/engines/cross-file-analysis-engine.js +27 -292
- package/bin/runners/lib/engines/empty-catch-engine.js +17 -127
- package/bin/runners/lib/engines/mock-data-engine.js +10 -53
- package/bin/runners/lib/engines/performance-issues-engine.js +36 -176
- package/bin/runners/lib/engines/security-vulnerabilities-engine.js +54 -382
- package/bin/runners/lib/engines/type-aware-engine.js +39 -263
- package/bin/runners/lib/engines/vibecheck-engines/index.js +13 -122
- package/bin/runners/lib/engines/vibecheck-engines/lib/ast-cache.js +164 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/code-quality-engine.js +291 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/console-logs-engine.js +83 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/dead-code-engine.js +198 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/deprecated-api-engine.js +275 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/empty-catch-engine.js +167 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/file-filter.js +217 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/hardcoded-secrets-engine.js +73 -373
- package/bin/runners/lib/engines/vibecheck-engines/lib/mock-data-engine.js +140 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/parallel-processor.js +164 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/performance-issues-engine.js +234 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/type-aware-engine.js +217 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/unsafe-regex-engine.js +78 -0
- package/bin/runners/lib/entitlements-v2.js +73 -97
- package/bin/runners/lib/error-handler.js +44 -3
- package/bin/runners/lib/error-messages.js +289 -0
- package/bin/runners/lib/evidence-pack.js +7 -1
- package/bin/runners/lib/finding-id.js +69 -0
- package/bin/runners/lib/finding-sorter.js +89 -0
- package/bin/runners/lib/html-proof-report.js +700 -350
- package/bin/runners/lib/missions/plan.js +6 -46
- package/bin/runners/lib/missions/templates.js +0 -232
- package/bin/runners/lib/next-action.js +560 -0
- package/bin/runners/lib/prerequisites.js +149 -0
- package/bin/runners/lib/route-detection.js +137 -68
- package/bin/runners/lib/scan-output.js +91 -76
- package/bin/runners/lib/scan-runner.js +135 -0
- package/bin/runners/lib/schemas/ajv-validator.js +464 -0
- package/bin/runners/lib/schemas/error-envelope.schema.json +105 -0
- package/bin/runners/lib/schemas/finding-v3.schema.json +151 -0
- package/bin/runners/lib/schemas/report-artifact.schema.json +120 -0
- package/bin/runners/lib/schemas/run-request.schema.json +108 -0
- package/bin/runners/lib/schemas/validator.js +27 -0
- package/bin/runners/lib/schemas/verdict.schema.json +140 -0
- package/bin/runners/lib/ship-output-enterprise.js +23 -23
- package/bin/runners/lib/ship-output.js +75 -31
- package/bin/runners/lib/terminal-ui.js +6 -113
- package/bin/runners/lib/truth.js +351 -10
- package/bin/runners/lib/unified-cli-output.js +430 -603
- package/bin/runners/lib/unified-output.js +13 -9
- package/bin/runners/runAIAgent.js +10 -5
- package/bin/runners/runAgent.js +0 -3
- package/bin/runners/runAllowlist.js +389 -0
- package/bin/runners/runApprove.js +0 -33
- package/bin/runners/runAuth.js +73 -45
- package/bin/runners/runCheckpoint.js +51 -11
- package/bin/runners/runClassify.js +85 -21
- package/bin/runners/runContext.js +0 -3
- package/bin/runners/runDoctor.js +41 -28
- package/bin/runners/runEvidencePack.js +362 -0
- package/bin/runners/runFirewall.js +0 -3
- package/bin/runners/runFirewallHook.js +0 -3
- package/bin/runners/runFix.js +66 -76
- package/bin/runners/runGuard.js +18 -411
- package/bin/runners/runInit.js +113 -30
- package/bin/runners/runLabs.js +424 -0
- package/bin/runners/runMcp.js +19 -25
- package/bin/runners/runPolish.js +64 -240
- package/bin/runners/runPromptFirewall.js +12 -5
- package/bin/runners/runProve.js +57 -22
- package/bin/runners/runQuickstart.js +531 -0
- package/bin/runners/runReality.js +59 -68
- package/bin/runners/runReport.js +38 -33
- package/bin/runners/runRuntime.js +8 -5
- package/bin/runners/runScan.js +1413 -190
- package/bin/runners/runShip.js +113 -719
- package/bin/runners/runTruth.js +0 -3
- package/bin/runners/runValidate.js +13 -9
- package/bin/runners/runWatch.js +23 -14
- package/bin/scan.js +6 -1
- package/bin/vibecheck.js +204 -185
- package/mcp-server/deprecation-middleware.js +282 -0
- package/mcp-server/handlers/index.ts +15 -0
- package/mcp-server/handlers/tool-handler.ts +554 -0
- package/mcp-server/index-v1.js +698 -0
- package/mcp-server/index.js +210 -238
- package/mcp-server/lib/cache-wrapper.cjs +383 -0
- package/mcp-server/lib/error-envelope.js +138 -0
- package/mcp-server/lib/executor.ts +499 -0
- package/mcp-server/lib/index.ts +19 -0
- package/mcp-server/lib/rate-limiter.js +166 -0
- package/mcp-server/lib/sandbox.test.ts +519 -0
- package/mcp-server/lib/sandbox.ts +395 -0
- package/mcp-server/lib/types.ts +267 -0
- package/mcp-server/package.json +12 -3
- package/mcp-server/registry/tool-registry.js +794 -0
- package/mcp-server/registry/tools.json +605 -0
- package/mcp-server/registry.test.ts +334 -0
- package/mcp-server/tests/tier-gating.test.js +297 -0
- package/mcp-server/tier-auth.js +378 -45
- package/mcp-server/tools-v3.js +353 -442
- package/mcp-server/tsconfig.json +37 -0
- package/mcp-server/vibecheck-2.0-tools.js +14 -1
- package/package.json +1 -1
- package/bin/runners/lib/agent-firewall/learning/learning-engine.js +0 -849
- package/bin/runners/lib/audit-logger.js +0 -532
- package/bin/runners/lib/authority/authorities/architecture.js +0 -364
- package/bin/runners/lib/authority/authorities/compliance.js +0 -341
- package/bin/runners/lib/authority/authorities/human.js +0 -343
- package/bin/runners/lib/authority/authorities/quality.js +0 -420
- package/bin/runners/lib/authority/authorities/security.js +0 -228
- package/bin/runners/lib/authority/index.js +0 -293
- package/bin/runners/lib/bundle/bundle-intelligence.js +0 -846
- package/bin/runners/lib/cli-charts.js +0 -368
- package/bin/runners/lib/cli-config-display.js +0 -405
- package/bin/runners/lib/cli-demo.js +0 -275
- package/bin/runners/lib/cli-errors.js +0 -438
- package/bin/runners/lib/cli-help-formatter.js +0 -439
- package/bin/runners/lib/cli-interactive-menu.js +0 -509
- package/bin/runners/lib/cli-prompts.js +0 -441
- package/bin/runners/lib/cli-scan-cards.js +0 -362
- package/bin/runners/lib/compliance-reporter.js +0 -710
- package/bin/runners/lib/conductor/index.js +0 -671
- package/bin/runners/lib/easy/README.md +0 -123
- package/bin/runners/lib/easy/index.js +0 -140
- package/bin/runners/lib/easy/interactive-wizard.js +0 -788
- package/bin/runners/lib/easy/one-click-firewall.js +0 -564
- package/bin/runners/lib/easy/zero-config-reality.js +0 -714
- package/bin/runners/lib/engines/async-patterns-engine.js +0 -444
- package/bin/runners/lib/engines/bundle-size-engine.js +0 -433
- package/bin/runners/lib/engines/confidence-scoring.js +0 -276
- package/bin/runners/lib/engines/context-detection.js +0 -264
- package/bin/runners/lib/engines/database-patterns-engine.js +0 -429
- package/bin/runners/lib/engines/duplicate-code-engine.js +0 -354
- package/bin/runners/lib/engines/env-variables-engine.js +0 -458
- package/bin/runners/lib/engines/error-handling-engine.js +0 -437
- package/bin/runners/lib/engines/false-positive-prevention.js +0 -630
- package/bin/runners/lib/engines/framework-adapters/index.js +0 -607
- package/bin/runners/lib/engines/framework-detection.js +0 -508
- package/bin/runners/lib/engines/import-order-engine.js +0 -429
- package/bin/runners/lib/engines/naming-conventions-engine.js +0 -544
- package/bin/runners/lib/engines/noise-reduction-engine.js +0 -452
- package/bin/runners/lib/engines/orchestrator.js +0 -334
- package/bin/runners/lib/engines/react-patterns-engine.js +0 -457
- package/bin/runners/lib/engines/vibecheck-engines/lib/ai-hallucination-engine.js +0 -806
- package/bin/runners/lib/engines/vibecheck-engines/lib/smart-fix-engine.js +0 -577
- package/bin/runners/lib/engines/vibecheck-engines/lib/vibe-score-engine.js +0 -543
- package/bin/runners/lib/engines/vibecheck-engines.js +0 -514
- package/bin/runners/lib/enhanced-features/index.js +0 -305
- package/bin/runners/lib/enhanced-output.js +0 -631
- package/bin/runners/lib/enterprise.js +0 -300
- package/bin/runners/lib/firewall/command-validator.js +0 -351
- package/bin/runners/lib/firewall/config.js +0 -341
- package/bin/runners/lib/firewall/content-validator.js +0 -519
- package/bin/runners/lib/firewall/index.js +0 -101
- package/bin/runners/lib/firewall/path-validator.js +0 -256
- package/bin/runners/lib/intelligence/cross-repo-intelligence.js +0 -817
- package/bin/runners/lib/mcp-utils.js +0 -425
- package/bin/runners/lib/output/index.js +0 -1022
- package/bin/runners/lib/policy-engine.js +0 -652
- package/bin/runners/lib/polish/autofix/accessibility-fixes.js +0 -333
- package/bin/runners/lib/polish/autofix/async-handlers.js +0 -273
- package/bin/runners/lib/polish/autofix/dead-code.js +0 -280
- package/bin/runners/lib/polish/autofix/imports-optimizer.js +0 -344
- package/bin/runners/lib/polish/autofix/index.js +0 -200
- package/bin/runners/lib/polish/autofix/remove-consoles.js +0 -209
- package/bin/runners/lib/polish/autofix/strengthen-types.js +0 -245
- package/bin/runners/lib/polish/backend-checks.js +0 -148
- package/bin/runners/lib/polish/documentation-checks.js +0 -111
- package/bin/runners/lib/polish/frontend-checks.js +0 -168
- package/bin/runners/lib/polish/index.js +0 -71
- package/bin/runners/lib/polish/infrastructure-checks.js +0 -131
- package/bin/runners/lib/polish/library-detection.js +0 -175
- package/bin/runners/lib/polish/performance-checks.js +0 -100
- package/bin/runners/lib/polish/security-checks.js +0 -148
- package/bin/runners/lib/polish/utils.js +0 -203
- package/bin/runners/lib/prompt-builder.js +0 -540
- package/bin/runners/lib/proof-certificate.js +0 -634
- package/bin/runners/lib/reality/accessibility-audit.js +0 -946
- package/bin/runners/lib/reality/api-contract-validator.js +0 -1012
- package/bin/runners/lib/reality/chaos-engineering.js +0 -1084
- package/bin/runners/lib/reality/performance-tracker.js +0 -1077
- package/bin/runners/lib/reality/scenario-generator.js +0 -1404
- package/bin/runners/lib/reality/visual-regression.js +0 -852
- package/bin/runners/lib/reality-profiler.js +0 -717
- package/bin/runners/lib/replay/flight-recorder-viewer.js +0 -1160
- package/bin/runners/lib/review/ai-code-review.js +0 -832
- package/bin/runners/lib/rules/custom-rule-engine.js +0 -985
- package/bin/runners/lib/sbom-generator.js +0 -641
- package/bin/runners/lib/scan-output-enhanced.js +0 -512
- package/bin/runners/lib/security/owasp-scanner.js +0 -939
- package/bin/runners/lib/validators/contract-validator.js +0 -283
- package/bin/runners/lib/validators/dead-export-detector.js +0 -279
- package/bin/runners/lib/validators/dep-audit.js +0 -245
- package/bin/runners/lib/validators/env-validator.js +0 -319
- package/bin/runners/lib/validators/index.js +0 -120
- package/bin/runners/lib/validators/license-checker.js +0 -252
- package/bin/runners/lib/validators/route-validator.js +0 -290
- package/bin/runners/runAuthority.js +0 -528
- package/bin/runners/runConductor.js +0 -772
- package/bin/runners/runContainer.js +0 -366
- package/bin/runners/runEasy.js +0 -410
- package/bin/runners/runIaC.js +0 -372
- package/bin/runners/runVibe.js +0 -791
- package/mcp-server/tools.js +0 -495
package/bin/runners/runInit.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vibecheck init - Project Setup
|
|
2
|
+
* vibecheck init - Enterprise Project Setup
|
|
3
3
|
*
|
|
4
4
|
* ═══════════════════════════════════════════════════════════════════════════════
|
|
5
|
-
*
|
|
5
|
+
* ENTERPRISE EDITION - World-Class Terminal Experience
|
|
6
6
|
* ═══════════════════════════════════════════════════════════════════════════════
|
|
7
7
|
*
|
|
8
8
|
* Configure your project for production-grade verification.
|
|
@@ -31,15 +31,64 @@ try {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
34
|
-
// TERMINAL
|
|
34
|
+
// ADVANCED TERMINAL - ANSI CODES & UTILITIES
|
|
35
35
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const c = {
|
|
38
|
+
reset: '\x1b[0m',
|
|
39
|
+
bold: '\x1b[1m',
|
|
40
|
+
dim: '\x1b[2m',
|
|
41
|
+
italic: '\x1b[3m',
|
|
42
|
+
underline: '\x1b[4m',
|
|
43
|
+
blink: '\x1b[5m',
|
|
44
|
+
inverse: '\x1b[7m',
|
|
45
|
+
hidden: '\x1b[8m',
|
|
46
|
+
strike: '\x1b[9m',
|
|
47
|
+
// Colors
|
|
48
|
+
black: '\x1b[30m',
|
|
49
|
+
red: '\x1b[31m',
|
|
50
|
+
green: '\x1b[32m',
|
|
51
|
+
yellow: '\x1b[33m',
|
|
52
|
+
blue: '\x1b[34m',
|
|
53
|
+
magenta: '\x1b[35m',
|
|
54
|
+
cyan: '\x1b[36m',
|
|
55
|
+
white: '\x1b[37m',
|
|
56
|
+
// Bright colors
|
|
57
|
+
gray: '\x1b[90m',
|
|
58
|
+
brightRed: '\x1b[91m',
|
|
59
|
+
brightGreen: '\x1b[92m',
|
|
60
|
+
brightYellow: '\x1b[93m',
|
|
61
|
+
brightBlue: '\x1b[94m',
|
|
62
|
+
brightMagenta: '\x1b[95m',
|
|
63
|
+
brightCyan: '\x1b[96m',
|
|
64
|
+
brightWhite: '\x1b[97m',
|
|
65
|
+
// Background
|
|
66
|
+
bgBlack: '\x1b[40m',
|
|
67
|
+
bgRed: '\x1b[41m',
|
|
68
|
+
bgGreen: '\x1b[42m',
|
|
69
|
+
bgYellow: '\x1b[43m',
|
|
70
|
+
bgBlue: '\x1b[44m',
|
|
71
|
+
bgMagenta: '\x1b[45m',
|
|
72
|
+
bgCyan: '\x1b[46m',
|
|
73
|
+
bgWhite: '\x1b[47m',
|
|
74
|
+
// Cursor control
|
|
75
|
+
cursorUp: (n = 1) => `\x1b[${n}A`,
|
|
76
|
+
cursorDown: (n = 1) => `\x1b[${n}B`,
|
|
77
|
+
cursorRight: (n = 1) => `\x1b[${n}C`,
|
|
78
|
+
cursorLeft: (n = 1) => `\x1b[${n}D`,
|
|
79
|
+
clearLine: '\x1b[2K',
|
|
80
|
+
clearScreen: '\x1b[2J',
|
|
81
|
+
saveCursor: '\x1b[s',
|
|
82
|
+
restoreCursor: '\x1b[u',
|
|
83
|
+
hideCursor: '\x1b[?25l',
|
|
84
|
+
showCursor: '\x1b[?25h',
|
|
85
|
+
};
|
|
38
86
|
|
|
39
|
-
//
|
|
40
|
-
const
|
|
87
|
+
// True color support
|
|
88
|
+
const rgb = (r, g, b) => `\x1b[38;2;${r};${g};${b}m`;
|
|
89
|
+
const bgRgb = (r, g, b) => `\x1b[48;2;${r};${g};${b}m`;
|
|
41
90
|
|
|
42
|
-
//
|
|
91
|
+
// Premium color palette (gold/amber theme for "init/setup")
|
|
43
92
|
const colors = {
|
|
44
93
|
// Gradient for banner
|
|
45
94
|
gradient1: rgb(255, 215, 100), // Gold
|
|
@@ -98,7 +147,7 @@ ${rgb(255, 140, 40)} ╚████╔╝ ██║██████╔╝
|
|
|
98
147
|
${rgb(255, 120, 20)} ╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝${c.reset}
|
|
99
148
|
|
|
100
149
|
${c.dim} ┌─────────────────────────────────────────────────────────────────────┐${c.reset}
|
|
101
|
-
${c.dim} │${c.reset} ${rgb(255, 200, 100)}⚡${c.reset} ${c.bold}INIT${c.reset} ${c.dim}•${c.reset} ${rgb(200, 200, 200)}Project Setup${c.reset} ${c.dim}•${c.reset} ${rgb(150, 150, 150)}
|
|
150
|
+
${c.dim} │${c.reset} ${rgb(255, 200, 100)}⚡${c.reset} ${c.bold}INIT${c.reset} ${c.dim}•${c.reset} ${rgb(200, 200, 200)}Project Setup${c.reset} ${c.dim}•${c.reset} ${rgb(150, 150, 150)}Enterprise Ready${c.reset} ${c.dim}│${c.reset}
|
|
102
151
|
${c.dim} └─────────────────────────────────────────────────────────────────────┘${c.reset}
|
|
103
152
|
`;
|
|
104
153
|
|
|
@@ -645,8 +694,8 @@ async function runRepairMode(targetDir, projectName, opts) {
|
|
|
645
694
|
if (!opts.dryRun) {
|
|
646
695
|
startSpinner('Generating truthpack...', colors.accent);
|
|
647
696
|
try {
|
|
648
|
-
const {
|
|
649
|
-
await
|
|
697
|
+
const { runContext } = require("./runContext");
|
|
698
|
+
await runContext(["--path", targetDir, "--quiet"]);
|
|
650
699
|
stopSpinner('Truthpack generated', true);
|
|
651
700
|
fixes.push("Generated: .vibecheck/truthpack.json");
|
|
652
701
|
} catch (e) {
|
|
@@ -994,7 +1043,7 @@ function printNextSteps(options = {}) {
|
|
|
994
1043
|
if (options.hasCI) {
|
|
995
1044
|
steps.push({ num: 3, cmd: 'git push', desc: 'CI will run automatically' });
|
|
996
1045
|
} else {
|
|
997
|
-
steps.push({ num: 3, cmd: 'vibecheck init --connect', desc: 'Add GitHub integration [
|
|
1046
|
+
steps.push({ num: 3, cmd: 'vibecheck init --connect', desc: 'Add GitHub integration [STARTER]' });
|
|
998
1047
|
}
|
|
999
1048
|
}
|
|
1000
1049
|
|
|
@@ -1010,7 +1059,8 @@ function printNextSteps(options = {}) {
|
|
|
1010
1059
|
// Upsell box
|
|
1011
1060
|
console.log(` ${c.dim}╭────────────────────────────────────────────────────────────╮${c.reset}`);
|
|
1012
1061
|
console.log(` ${c.dim}│${c.reset} ${c.dim}│${c.reset}`);
|
|
1013
|
-
console.log(` ${c.dim}│${c.reset} ${colors.accent}
|
|
1062
|
+
console.log(` ${c.dim}│${c.reset} ${colors.accent}⚡ STARTER${c.reset} ${c.dim}•${c.reset} AI-powered fixes, GitHub CI, MCP tools ${c.dim}│${c.reset}`);
|
|
1063
|
+
console.log(` ${c.dim}│${c.reset} ${colors.accent}🏆 PRO${c.reset} ${c.dim}•${c.reset} Runtime proof, verified badges, AI testing ${c.dim}│${c.reset}`);
|
|
1014
1064
|
console.log(` ${c.dim}│${c.reset} ${c.dim}│${c.reset}`);
|
|
1015
1065
|
console.log(` ${c.dim}│${c.reset} ${colors.info}vibecheck login${c.reset} ${c.dim}to upgrade • vibecheck.dev/pricing${c.reset} ${c.dim}│${c.reset}`);
|
|
1016
1066
|
console.log(` ${c.dim}│${c.reset} ${c.dim}│${c.reset}`);
|
|
@@ -1360,13 +1410,17 @@ async function runLocalSetup(targetDir, projectName, opts, filesCreated) {
|
|
|
1360
1410
|
if (!opts.dryRun) {
|
|
1361
1411
|
startSpinner('Building truthpack...', colors.accent);
|
|
1362
1412
|
try {
|
|
1363
|
-
const {
|
|
1364
|
-
await
|
|
1413
|
+
const { runContext } = require("./runContext");
|
|
1414
|
+
await runContext(["--path", targetDir, "--quiet"]);
|
|
1365
1415
|
stopSpinner('Truthpack generated', true);
|
|
1366
1416
|
filesCreated.push('.vibecheck/truthpack.json');
|
|
1367
1417
|
} catch (e) {
|
|
1368
1418
|
stopSpinner('Truthpack generation failed', false);
|
|
1369
|
-
throw
|
|
1419
|
+
// Don't throw - truthpack generation is optional for init
|
|
1420
|
+
if (!opts.json) {
|
|
1421
|
+
console.log(` ${colors.warning}${ICONS.warning}${c.reset} ${e.message}`);
|
|
1422
|
+
console.log(` ${c.dim}Run 'vibecheck context' manually to generate truthpack${c.reset}`);
|
|
1423
|
+
}
|
|
1370
1424
|
}
|
|
1371
1425
|
} else {
|
|
1372
1426
|
printSetupStep('truthpack.json', 'dry-run', 'would generate via vibecheck ctx build');
|
|
@@ -1434,21 +1488,36 @@ async function runLocalSetup(targetDir, projectName, opts, filesCreated) {
|
|
|
1434
1488
|
printSetupStep('IDE rules', 'dry-run', 'would generate via vibecheck context');
|
|
1435
1489
|
}
|
|
1436
1490
|
|
|
1437
|
-
// 6. Create .vibecheckrc at project root
|
|
1491
|
+
// 6. Create .vibecheckrc at project root (create both for compatibility)
|
|
1438
1492
|
logStep('Creating root config');
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1493
|
+
const rcPathJson = path.join(targetDir, ".vibecheckrc.json");
|
|
1494
|
+
const rcPath = path.join(targetDir, ".vibecheckrc");
|
|
1495
|
+
const rc = {
|
|
1496
|
+
extends: ".vibecheck/config.json",
|
|
1497
|
+
tier: "free",
|
|
1498
|
+
};
|
|
1499
|
+
|
|
1500
|
+
if (!fs.existsSync(rcPathJson) && !fs.existsSync(rcPath)) {
|
|
1445
1501
|
if (opts.dryRun) {
|
|
1502
|
+
printSetupStep('.vibecheckrc', 'dry-run', 'would create');
|
|
1446
1503
|
printSetupStep('.vibecheckrc.json', 'dry-run', 'would create');
|
|
1447
1504
|
} else {
|
|
1505
|
+
// Create .vibecheckrc (without .json) for compatibility with tests/expectations
|
|
1448
1506
|
fs.writeFileSync(rcPath, JSON.stringify(rc, null, 2));
|
|
1449
|
-
printSetupStep('.vibecheckrc
|
|
1507
|
+
printSetupStep('.vibecheckrc', 'success', 'root config created');
|
|
1508
|
+
filesCreated.push('.vibecheckrc');
|
|
1509
|
+
|
|
1510
|
+
// Also create .vibecheckrc.json for backward compatibility
|
|
1511
|
+
fs.writeFileSync(rcPathJson, JSON.stringify(rc, null, 2));
|
|
1450
1512
|
filesCreated.push('.vibecheckrc.json');
|
|
1451
1513
|
}
|
|
1514
|
+
} else if (fs.existsSync(rcPathJson) && !fs.existsSync(rcPath)) {
|
|
1515
|
+
// If only .vibecheckrc.json exists, create .vibecheckrc for compatibility
|
|
1516
|
+
if (!opts.dryRun) {
|
|
1517
|
+
fs.writeFileSync(rcPath, JSON.stringify(rc, null, 2));
|
|
1518
|
+
printSetupStep('.vibecheckrc', 'success', 'root config created (compatibility)');
|
|
1519
|
+
filesCreated.push('.vibecheckrc');
|
|
1520
|
+
}
|
|
1452
1521
|
}
|
|
1453
1522
|
|
|
1454
1523
|
// 7. Update .gitignore
|
|
@@ -1472,7 +1541,8 @@ async function runLocalSetup(targetDir, projectName, opts, filesCreated) {
|
|
|
1472
1541
|
}
|
|
1473
1542
|
}
|
|
1474
1543
|
|
|
1475
|
-
|
|
1544
|
+
// Return both filesCreated and detection for use in main function
|
|
1545
|
+
return { filesCreated, detection };
|
|
1476
1546
|
}
|
|
1477
1547
|
|
|
1478
1548
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
@@ -1573,10 +1643,11 @@ async function runInit(args) {
|
|
|
1573
1643
|
return 0;
|
|
1574
1644
|
}
|
|
1575
1645
|
|
|
1576
|
-
// --quick mode
|
|
1646
|
+
// --quick mode runs local setup with non-interactive defaults
|
|
1577
1647
|
if (opts.quick) {
|
|
1578
|
-
|
|
1579
|
-
|
|
1648
|
+
opts.local = true;
|
|
1649
|
+
opts.nonInteractive = true;
|
|
1650
|
+
// Continue with normal init flow below
|
|
1580
1651
|
}
|
|
1581
1652
|
|
|
1582
1653
|
const targetDir = path.resolve(opts.path);
|
|
@@ -1674,6 +1745,7 @@ async function runInit(args) {
|
|
|
1674
1745
|
}
|
|
1675
1746
|
|
|
1676
1747
|
let filesCreated = [];
|
|
1748
|
+
let detection = null; // Declare detection in main function scope
|
|
1677
1749
|
const result = {
|
|
1678
1750
|
success: true,
|
|
1679
1751
|
project: projectName,
|
|
@@ -1687,7 +1759,15 @@ async function runInit(args) {
|
|
|
1687
1759
|
// Always run local setup first
|
|
1688
1760
|
if (opts.local || opts.connect) {
|
|
1689
1761
|
try {
|
|
1690
|
-
|
|
1762
|
+
// runLocalSetup returns both filesCreated and detection
|
|
1763
|
+
const setupResult = await runLocalSetup(targetDir, projectName, opts, filesCreated);
|
|
1764
|
+
if (setupResult && typeof setupResult === 'object' && 'filesCreated' in setupResult) {
|
|
1765
|
+
filesCreated = setupResult.filesCreated;
|
|
1766
|
+
detection = setupResult.detection || null;
|
|
1767
|
+
} else {
|
|
1768
|
+
// Backward compatibility: if it returns just an array, use it
|
|
1769
|
+
filesCreated = Array.isArray(setupResult) ? setupResult : filesCreated;
|
|
1770
|
+
}
|
|
1691
1771
|
} catch (e) {
|
|
1692
1772
|
result.errors.push({ step: 'local', error: e.message, stack: e.stack });
|
|
1693
1773
|
if (!opts.json) {
|
|
@@ -1697,8 +1777,11 @@ async function runInit(args) {
|
|
|
1697
1777
|
}
|
|
1698
1778
|
console.log(` ${colors.info}${ICONS.info}${c.reset} Run ${c.cyan}vibecheck init --repair${c.reset} to fix partial state`);
|
|
1699
1779
|
}
|
|
1700
|
-
|
|
1701
|
-
|
|
1780
|
+
// Don't exit on error - continue and report errors in result
|
|
1781
|
+
// Only exit if critical setup failed AND we're not in dry-run mode
|
|
1782
|
+
if (!opts.dryRun && result.errors.length > 0 && filesCreated.length === 0) {
|
|
1783
|
+
// Only exit if NO files were created at all (complete failure)
|
|
1784
|
+
return EXIT.INTERNAL_ERROR;
|
|
1702
1785
|
}
|
|
1703
1786
|
}
|
|
1704
1787
|
}
|
|
@@ -0,0 +1,424 @@
|
|
|
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
|
+
// Colors
|
|
13
|
+
const c = {
|
|
14
|
+
reset: '\x1b[0m',
|
|
15
|
+
bold: '\x1b[1m',
|
|
16
|
+
dim: '\x1b[2m',
|
|
17
|
+
green: '\x1b[32m',
|
|
18
|
+
yellow: '\x1b[33m',
|
|
19
|
+
cyan: '\x1b[36m',
|
|
20
|
+
red: '\x1b[31m',
|
|
21
|
+
magenta: '\x1b[35m',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const rgb = (r, g, b) => `\x1b[38;2;${r};${g};${b}m`;
|
|
25
|
+
|
|
26
|
+
const colors = {
|
|
27
|
+
accent: rgb(0, 212, 255),
|
|
28
|
+
success: rgb(16, 185, 129),
|
|
29
|
+
warning: rgb(245, 158, 11),
|
|
30
|
+
error: rgb(239, 68, 68),
|
|
31
|
+
purple: rgb(168, 85, 247),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const sym = {
|
|
35
|
+
check: '✓',
|
|
36
|
+
cross: '✗',
|
|
37
|
+
warning: '⚠',
|
|
38
|
+
info: 'ℹ',
|
|
39
|
+
pending: '○',
|
|
40
|
+
lightning: '⚡',
|
|
41
|
+
star: '★',
|
|
42
|
+
arrow: '→',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
46
|
+
// LABS FEATURE REGISTRY
|
|
47
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
48
|
+
const LABS_FEATURES = {
|
|
49
|
+
// Experimental - Working but API may change
|
|
50
|
+
"ai-agent": {
|
|
51
|
+
status: "experimental",
|
|
52
|
+
description: "AI autonomous testing agent",
|
|
53
|
+
docs: "https://docs.vibecheckai.dev/labs/ai-agent",
|
|
54
|
+
runner: () => require("./runAIAgent").runAIAgent,
|
|
55
|
+
},
|
|
56
|
+
"deep-scan": {
|
|
57
|
+
status: "experimental",
|
|
58
|
+
description: "Extended static analysis with ML patterns",
|
|
59
|
+
runner: async (args, ctx) => {
|
|
60
|
+
const { runScan } = require("./runScan");
|
|
61
|
+
return runScan(["--profile", "deep", ...args], ctx);
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
"hallucination-check": {
|
|
65
|
+
status: "experimental",
|
|
66
|
+
description: "Detect AI-generated code hallucinations",
|
|
67
|
+
runner: async (args, ctx) => {
|
|
68
|
+
const { runCheckpoint } = require("./runCheckpoint");
|
|
69
|
+
return runCheckpoint(["--hallucination", ...args], ctx);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
"truth-diff": {
|
|
73
|
+
status: "experimental",
|
|
74
|
+
description: "Diff truthpack changes across commits",
|
|
75
|
+
runner: async (args) => {
|
|
76
|
+
console.log(`\n ${c.yellow}${sym.warning} truth-diff${c.reset} is coming soon.\n`);
|
|
77
|
+
console.log(` ${c.dim}This feature will compare truthpack snapshots across git commits.${c.reset}\n`);
|
|
78
|
+
return 0;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Beta - Feature complete, gathering feedback
|
|
83
|
+
"smart-fix": {
|
|
84
|
+
status: "beta",
|
|
85
|
+
description: "AI-powered intelligent fix suggestions",
|
|
86
|
+
runner: async (args, ctx) => {
|
|
87
|
+
const { runFix } = require("./runFix");
|
|
88
|
+
return runFix(["--smart", ...args], ctx);
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
"security-audit": {
|
|
92
|
+
status: "beta",
|
|
93
|
+
description: "Comprehensive security audit mode",
|
|
94
|
+
runner: async (args, ctx) => {
|
|
95
|
+
const { runScan } = require("./runScan");
|
|
96
|
+
return runScan(["--profile", "security", ...args], ctx);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
// Stubs - Planned but not implemented
|
|
101
|
+
"autopilot": {
|
|
102
|
+
status: "stub",
|
|
103
|
+
description: "Continuous protection mode (auto-fix on commit)",
|
|
104
|
+
eta: "Q2 2026",
|
|
105
|
+
},
|
|
106
|
+
"certify": {
|
|
107
|
+
status: "stub",
|
|
108
|
+
description: "Generate compliance certification badges",
|
|
109
|
+
eta: "Q2 2026",
|
|
110
|
+
},
|
|
111
|
+
"audit-trail": {
|
|
112
|
+
status: "stub",
|
|
113
|
+
description: "Full audit trail for compliance (SOC2, HIPAA)",
|
|
114
|
+
eta: "Q3 2026",
|
|
115
|
+
},
|
|
116
|
+
"natural-language": {
|
|
117
|
+
status: "stub",
|
|
118
|
+
description: "Natural language command interface",
|
|
119
|
+
eta: "Q2 2026",
|
|
120
|
+
},
|
|
121
|
+
"fix-packs": {
|
|
122
|
+
status: "stub",
|
|
123
|
+
description: "Downloadable fix pack templates",
|
|
124
|
+
eta: "Q2 2026",
|
|
125
|
+
},
|
|
126
|
+
"dashboard-live": {
|
|
127
|
+
status: "stub",
|
|
128
|
+
description: "Real-time live monitoring dashboard",
|
|
129
|
+
eta: "Q3 2026",
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
// Aliases - Redirect to main commands
|
|
133
|
+
"ship-strict": {
|
|
134
|
+
status: "alias",
|
|
135
|
+
target: "ship --strict",
|
|
136
|
+
description: "Enhanced ship mode (use: vibecheck ship --strict)",
|
|
137
|
+
},
|
|
138
|
+
"reality-agent": {
|
|
139
|
+
status: "alias",
|
|
140
|
+
target: "reality --agent",
|
|
141
|
+
description: "Reality with AI agent (use: vibecheck reality --agent)",
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
146
|
+
// STATUS DISPLAY
|
|
147
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
148
|
+
const STATUS_CONFIG = {
|
|
149
|
+
experimental: {
|
|
150
|
+
icon: sym.lightning,
|
|
151
|
+
color: c.yellow,
|
|
152
|
+
label: "EXPERIMENTAL",
|
|
153
|
+
description: "Working but API may change",
|
|
154
|
+
},
|
|
155
|
+
beta: {
|
|
156
|
+
icon: sym.star,
|
|
157
|
+
color: c.cyan,
|
|
158
|
+
label: "BETA",
|
|
159
|
+
description: "Feature complete, gathering feedback",
|
|
160
|
+
},
|
|
161
|
+
stub: {
|
|
162
|
+
icon: sym.pending,
|
|
163
|
+
color: c.dim,
|
|
164
|
+
label: "PLANNED",
|
|
165
|
+
description: "Not yet implemented",
|
|
166
|
+
},
|
|
167
|
+
alias: {
|
|
168
|
+
icon: sym.arrow,
|
|
169
|
+
color: c.dim,
|
|
170
|
+
label: "ALIAS",
|
|
171
|
+
description: "Use the main command instead",
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
function formatStatus(status) {
|
|
176
|
+
const config = STATUS_CONFIG[status];
|
|
177
|
+
if (!config) return status;
|
|
178
|
+
return `${config.color}${config.icon} ${config.label}${c.reset}`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
182
|
+
// HELP DISPLAY
|
|
183
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
184
|
+
function printHelp() {
|
|
185
|
+
console.log(`
|
|
186
|
+
${colors.accent}${c.bold}vibecheck labs${c.reset} - Experimental & Internal Features
|
|
187
|
+
|
|
188
|
+
${c.yellow}${sym.warning} These features are experimental and may change without notice.${c.reset}
|
|
189
|
+
`);
|
|
190
|
+
|
|
191
|
+
// Group by status
|
|
192
|
+
const groups = {
|
|
193
|
+
experimental: [],
|
|
194
|
+
beta: [],
|
|
195
|
+
stub: [],
|
|
196
|
+
alias: [],
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
for (const [name, feature] of Object.entries(LABS_FEATURES)) {
|
|
200
|
+
if (groups[feature.status]) {
|
|
201
|
+
groups[feature.status].push({ name, ...feature });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Experimental
|
|
206
|
+
if (groups.experimental.length > 0) {
|
|
207
|
+
console.log(` ${c.yellow}${sym.lightning} EXPERIMENTAL${c.reset} ${c.dim}(working, API may change)${c.reset}\n`);
|
|
208
|
+
|
|
209
|
+
for (const feature of groups.experimental) {
|
|
210
|
+
console.log(` ${c.cyan}vibecheck labs ${feature.name}${c.reset}`);
|
|
211
|
+
console.log(` ${c.dim}${feature.description}${c.reset}`);
|
|
212
|
+
if (feature.docs) {
|
|
213
|
+
console.log(` ${c.dim}Docs: ${feature.docs}${c.reset}`);
|
|
214
|
+
}
|
|
215
|
+
console.log("");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Beta
|
|
220
|
+
if (groups.beta.length > 0) {
|
|
221
|
+
console.log(` ${c.cyan}${sym.star} BETA${c.reset} ${c.dim}(feature complete, gathering feedback)${c.reset}\n`);
|
|
222
|
+
|
|
223
|
+
for (const feature of groups.beta) {
|
|
224
|
+
console.log(` ${c.cyan}vibecheck labs ${feature.name}${c.reset}`);
|
|
225
|
+
console.log(` ${c.dim}${feature.description}${c.reset}`);
|
|
226
|
+
console.log("");
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Stubs
|
|
231
|
+
if (groups.stub.length > 0) {
|
|
232
|
+
console.log(` ${c.dim}${sym.pending} PLANNED${c.reset} ${c.dim}(not yet implemented)${c.reset}\n`);
|
|
233
|
+
|
|
234
|
+
for (const feature of groups.stub) {
|
|
235
|
+
const eta = feature.eta ? `${c.dim}(ETA: ${feature.eta})${c.reset}` : '';
|
|
236
|
+
console.log(` ${c.dim}${feature.name}${c.reset} ${feature.description} ${eta}`);
|
|
237
|
+
}
|
|
238
|
+
console.log("");
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Aliases
|
|
242
|
+
if (groups.alias.length > 0) {
|
|
243
|
+
console.log(` ${c.dim}${sym.arrow} ALIASES${c.reset} ${c.dim}(use the main command instead)${c.reset}\n`);
|
|
244
|
+
|
|
245
|
+
for (const feature of groups.alias) {
|
|
246
|
+
console.log(` ${c.dim}labs ${feature.name}${c.reset} ${sym.arrow} ${c.cyan}vibecheck ${feature.target}${c.reset}`);
|
|
247
|
+
}
|
|
248
|
+
console.log("");
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Usage
|
|
252
|
+
console.log(` ${c.dim}${"─".repeat(60)}${c.reset}`);
|
|
253
|
+
console.log(`
|
|
254
|
+
${c.bold}Usage${c.reset}
|
|
255
|
+
|
|
256
|
+
vibecheck labs <feature> [options]
|
|
257
|
+
|
|
258
|
+
${c.bold}Examples${c.reset}
|
|
259
|
+
|
|
260
|
+
${c.dim}# Run AI agent testing${c.reset}
|
|
261
|
+
vibecheck labs ai-agent --url http://localhost:3000
|
|
262
|
+
|
|
263
|
+
${c.dim}# Deep security scan${c.reset}
|
|
264
|
+
vibecheck labs security-audit
|
|
265
|
+
|
|
266
|
+
${c.dim}# Smart AI fixes${c.reset}
|
|
267
|
+
vibecheck labs smart-fix
|
|
268
|
+
|
|
269
|
+
${c.dim}${"─".repeat(60)}${c.reset}
|
|
270
|
+
|
|
271
|
+
${c.bold}Feedback${c.reset}
|
|
272
|
+
|
|
273
|
+
Want a feature prioritized? Let us know:
|
|
274
|
+
${c.cyan}https://github.com/vibecheckai/vibecheck/discussions${c.reset}
|
|
275
|
+
`);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function printFeatureStub(name, feature) {
|
|
279
|
+
console.log(`
|
|
280
|
+
${c.yellow}╭${"─".repeat(58)}╮${c.reset}
|
|
281
|
+
${c.yellow}│${c.reset} ${c.bold}vibecheck labs ${name}${c.reset}${" ".repeat(58 - 18 - name.length)}${c.yellow}│${c.reset}
|
|
282
|
+
${c.yellow}╰${"─".repeat(58)}╯${c.reset}
|
|
283
|
+
|
|
284
|
+
${feature.description}
|
|
285
|
+
|
|
286
|
+
${c.dim}This feature is not yet implemented.${c.reset}
|
|
287
|
+
${feature.eta ? `${c.dim}Expected: ${feature.eta}${c.reset}` : ""}
|
|
288
|
+
|
|
289
|
+
${c.dim}Want this feature? Vote for it:${c.reset}
|
|
290
|
+
${c.cyan}https://github.com/vibecheckai/vibecheck/discussions${c.reset}
|
|
291
|
+
`);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function printAliasWarning(name, feature) {
|
|
295
|
+
console.log(`\n ${c.yellow}${sym.warning}${c.reset} '${name}' is now available as: ${c.cyan}vibecheck ${feature.target}${c.reset}\n`);
|
|
296
|
+
console.log(` ${c.dim}The labs alias will be removed in a future version.${c.reset}\n`);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
300
|
+
// MAIN RUNNER
|
|
301
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
302
|
+
async function runLabs(args = [], context = {}) {
|
|
303
|
+
// Filter out global flags that are passed through from main CLI
|
|
304
|
+
const GLOBAL_FLAGS = new Set([
|
|
305
|
+
'--offline', '--local', '--json', '--ci', '--quiet', '-q',
|
|
306
|
+
'--verbose', '--debug', '--strict', '--no-banner',
|
|
307
|
+
]);
|
|
308
|
+
|
|
309
|
+
// Find first non-flag argument as subcommand
|
|
310
|
+
let subCmd = null;
|
|
311
|
+
const subArgs = [];
|
|
312
|
+
let skipNext = false;
|
|
313
|
+
|
|
314
|
+
for (let i = 0; i < args.length; i++) {
|
|
315
|
+
const arg = args[i];
|
|
316
|
+
|
|
317
|
+
if (skipNext) {
|
|
318
|
+
skipNext = false;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Skip global flags (and their values for --path, --output)
|
|
323
|
+
if (GLOBAL_FLAGS.has(arg)) continue;
|
|
324
|
+
if (arg === '--path' || arg === '-p' || arg === '--output' || arg === '-o') {
|
|
325
|
+
skipNext = true;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
if (arg.startsWith('--path=') || arg.startsWith('--output=')) continue;
|
|
329
|
+
|
|
330
|
+
// First non-flag arg is the subcommand
|
|
331
|
+
if (!subCmd && !arg.startsWith('-')) {
|
|
332
|
+
subCmd = arg;
|
|
333
|
+
} else {
|
|
334
|
+
subArgs.push(arg);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Show help if no command
|
|
339
|
+
if (!subCmd || subCmd === "--help" || subCmd === "-h") {
|
|
340
|
+
printHelp();
|
|
341
|
+
return 0;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// List all features
|
|
345
|
+
if (subCmd === "--list" || subCmd === "-l") {
|
|
346
|
+
console.log(`\n ${c.bold}Labs Features${c.reset}\n`);
|
|
347
|
+
|
|
348
|
+
for (const [name, f] of Object.entries(LABS_FEATURES)) {
|
|
349
|
+
if (f.status !== 'stub' && f.status !== 'alias') {
|
|
350
|
+
console.log(` ${formatStatus(f.status).padEnd(30)} ${c.cyan}${name.padEnd(20)}${c.reset} ${c.dim}${f.description}${c.reset}`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
console.log("");
|
|
354
|
+
return 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Find feature
|
|
358
|
+
const feature = LABS_FEATURES[subCmd];
|
|
359
|
+
|
|
360
|
+
if (!feature) {
|
|
361
|
+
console.log(`\n ${c.red}${sym.cross}${c.reset} Unknown labs feature: ${c.yellow}${subCmd}${c.reset}\n`);
|
|
362
|
+
console.log(` ${c.dim}Available features:${c.reset}`);
|
|
363
|
+
console.log(` ${Object.keys(LABS_FEATURES).filter(k =>
|
|
364
|
+
LABS_FEATURES[k].status !== "stub" &&
|
|
365
|
+
LABS_FEATURES[k].status !== "alias"
|
|
366
|
+
).join(", ")}`);
|
|
367
|
+
console.log(`\n ${c.dim}Run 'vibecheck labs --help' for details.${c.reset}\n`);
|
|
368
|
+
return 1;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Handle stubs
|
|
372
|
+
if (feature.status === "stub") {
|
|
373
|
+
printFeatureStub(subCmd, feature);
|
|
374
|
+
return 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// Handle aliases
|
|
378
|
+
if (feature.status === "alias") {
|
|
379
|
+
printAliasWarning(subCmd, feature);
|
|
380
|
+
|
|
381
|
+
// Try to run the aliased command
|
|
382
|
+
const [cmd, ...aliasArgs] = feature.target.split(" ");
|
|
383
|
+
try {
|
|
384
|
+
if (cmd === "ship") {
|
|
385
|
+
const { runShip } = require("./runShip");
|
|
386
|
+
return await runShip([...aliasArgs, ...subArgs], context);
|
|
387
|
+
}
|
|
388
|
+
if (cmd === "reality") {
|
|
389
|
+
const { runReality } = require("./runReality");
|
|
390
|
+
return await runReality([...aliasArgs, ...subArgs], context);
|
|
391
|
+
}
|
|
392
|
+
} catch (e) {
|
|
393
|
+
console.log(` ${c.dim}Please run the command directly: vibecheck ${feature.target}${c.reset}\n`);
|
|
394
|
+
}
|
|
395
|
+
return 0;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Run the feature
|
|
399
|
+
try {
|
|
400
|
+
const runner = feature.runner();
|
|
401
|
+
|
|
402
|
+
// Show experimental warning
|
|
403
|
+
if (feature.status === "experimental") {
|
|
404
|
+
console.log(`\n ${c.yellow}${sym.warning} EXPERIMENTAL:${c.reset} ${c.dim}This feature may change without notice.${c.reset}\n`);
|
|
405
|
+
} else if (feature.status === "beta") {
|
|
406
|
+
console.log(`\n ${c.cyan}${sym.star} BETA:${c.reset} ${c.dim}Feedback welcome! github.com/vibecheckai/vibecheck${c.reset}\n`);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return await runner(subArgs, context);
|
|
410
|
+
} catch (e) {
|
|
411
|
+
if (e.code === "MODULE_NOT_FOUND") {
|
|
412
|
+
console.log(`\n ${c.red}${sym.cross}${c.reset} Feature '${subCmd}' is not available in this version.\n`);
|
|
413
|
+
console.log(` ${c.dim}Try updating: npm update -g @vibecheckai/cli${c.reset}\n`);
|
|
414
|
+
} else {
|
|
415
|
+
console.error(`\n ${c.red}${sym.cross}${c.reset} Error running labs ${subCmd}: ${e.message}`);
|
|
416
|
+
if (process.env.VIBECHECK_DEBUG) {
|
|
417
|
+
console.error(c.dim + e.stack + c.reset);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return 1;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
module.exports = { runLabs, LABS_FEATURES };
|