@vibecheckai/cli 3.1.1 → 3.1.4

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 (45) hide show
  1. package/README.md +60 -33
  2. package/bin/registry.js +319 -34
  3. package/bin/runners/CLI_REFACTOR_SUMMARY.md +229 -0
  4. package/bin/runners/REPORT_AUDIT.md +64 -0
  5. package/bin/runners/lib/entitlements-v2.js +97 -28
  6. package/bin/runners/lib/init-wizard.js +1 -1
  7. package/bin/runners/lib/report-engine.js +459 -280
  8. package/bin/runners/lib/report-html.js +1154 -1423
  9. package/bin/runners/lib/report-output.js +187 -0
  10. package/bin/runners/lib/report-templates.js +848 -850
  11. package/bin/runners/lib/scan-output.js +545 -0
  12. package/bin/runners/lib/ship-output.js +641 -0
  13. package/bin/runners/lib/status-output.js +253 -0
  14. package/bin/runners/lib/terminal-ui.js +853 -0
  15. package/bin/runners/runCheckpoint.js +502 -0
  16. package/bin/runners/runContracts.js +105 -0
  17. package/bin/runners/runExport.js +93 -0
  18. package/bin/runners/runFix.js +31 -24
  19. package/bin/runners/runInit.js +377 -112
  20. package/bin/runners/runInstall.js +1 -5
  21. package/bin/runners/runLabs.js +3 -3
  22. package/bin/runners/runPolish.js +2452 -0
  23. package/bin/runners/runProve.js +2 -2
  24. package/bin/runners/runReport.js +251 -200
  25. package/bin/runners/runRuntime.js +110 -0
  26. package/bin/runners/runScan.js +477 -379
  27. package/bin/runners/runSecurity.js +92 -0
  28. package/bin/runners/runShip.js +137 -207
  29. package/bin/runners/runStatus.js +16 -68
  30. package/bin/runners/utils.js +5 -5
  31. package/bin/vibecheck.js +25 -11
  32. package/mcp-server/index.js +150 -18
  33. package/mcp-server/package.json +2 -2
  34. package/mcp-server/premium-tools.js +13 -13
  35. package/mcp-server/tier-auth.js +292 -27
  36. package/mcp-server/vibecheck-tools.js +9 -9
  37. package/package.json +1 -1
  38. package/bin/runners/runClaimVerifier.js +0 -483
  39. package/bin/runners/runContextCompiler.js +0 -385
  40. package/bin/runners/runGate.js +0 -17
  41. package/bin/runners/runInitGha.js +0 -164
  42. package/bin/runners/runInteractive.js +0 -388
  43. package/bin/runners/runMdc.js +0 -204
  44. package/bin/runners/runMissionGenerator.js +0 -282
  45. package/bin/runners/runTruthpack.js +0 -636
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Status Output - Project Status Display
3
+ *
4
+ * Handles all status command output formatting:
5
+ * - Project health dashboard
6
+ * - Verdict summary
7
+ * - Findings overview
8
+ * - Truth pack stats
9
+ * - Quick actions
10
+ */
11
+
12
+ const path = require('path');
13
+ const {
14
+ ansi,
15
+ colors,
16
+ box,
17
+ icons,
18
+ renderSection,
19
+ formatDuration,
20
+ } = require('./terminal-ui');
21
+
22
+ // ═══════════════════════════════════════════════════════════════════════════════
23
+ // STATUS-SPECIFIC ICONS
24
+ // ═══════════════════════════════════════════════════════════════════════════════
25
+
26
+ const statusIcons = {
27
+ dashboard: '📊',
28
+ verdict: '🎯',
29
+ findings: '🔍',
30
+ truthpack: '📦',
31
+ reality: '🌐',
32
+ files: '📁',
33
+ actions: '⚡',
34
+ check: '✓',
35
+ cross: '✗',
36
+ warning: '⚠',
37
+ };
38
+
39
+ // ═══════════════════════════════════════════════════════════════════════════════
40
+ // TIME UTILITIES
41
+ // ═══════════════════════════════════════════════════════════════════════════════
42
+
43
+ function timeAgo(dateStr) {
44
+ if (!dateStr) return 'never';
45
+ const d = new Date(dateStr);
46
+ const now = Date.now();
47
+ const diff = now - d.getTime();
48
+
49
+ if (diff < 60000) return 'just now';
50
+ if (diff < 3600000) return `${Math.round(diff / 60000)}m ago`;
51
+ if (diff < 86400000) return `${Math.round(diff / 3600000)}h ago`;
52
+ return `${Math.round(diff / 86400000)}d ago`;
53
+ }
54
+
55
+ // ═══════════════════════════════════════════════════════════════════════════════
56
+ // VERDICT DISPLAY
57
+ // ═══════════════════════════════════════════════════════════════════════════════
58
+
59
+ function renderVerdictIcon(verdict) {
60
+ if (verdict === 'SHIP') return `${colors.success}${icons.success} SHIP${ansi.reset}`;
61
+ if (verdict === 'WARN') return `${colors.warning}${icons.warning} WARN${ansi.reset}`;
62
+ if (verdict === 'BLOCK') return `${colors.error}${icons.error} BLOCK${ansi.reset}`;
63
+ return `${ansi.dim}—${ansi.reset}`;
64
+ }
65
+
66
+ function renderVerdictSection(verdict, lastShipAt) {
67
+ const lines = [];
68
+ lines.push(renderSection('VERDICT', statusIcons.verdict));
69
+ lines.push('');
70
+ lines.push(` Current: ${renderVerdictIcon(verdict)}`);
71
+ lines.push(` Last ship: ${ansi.dim}${timeAgo(lastShipAt)}${ansi.reset}`);
72
+ return lines.join('\n');
73
+ }
74
+
75
+ // ═══════════════════════════════════════════════════════════════════════════════
76
+ // FINDINGS DISPLAY
77
+ // ═══════════════════════════════════════════════════════════════════════════════
78
+
79
+ function renderFindingsSection(blockers, warnings) {
80
+ const lines = [];
81
+ lines.push(renderSection('FINDINGS', statusIcons.findings));
82
+ lines.push('');
83
+ lines.push(` BLOCK: ${blockers ? `${colors.error}${blockers}${ansi.reset}` : `${colors.success}0${ansi.reset}`}`);
84
+ lines.push(` WARN: ${warnings ? `${colors.warning}${warnings}${ansi.reset}` : `${colors.success}0${ansi.reset}`}`);
85
+ return lines.join('\n');
86
+ }
87
+
88
+ // ═══════════════════════════════════════════════════════════════════════════════
89
+ // TRUTH PACK DISPLAY
90
+ // ═══════════════════════════════════════════════════════════════════════════════
91
+
92
+ function renderTruthpackSection(routes, envVars, gaps) {
93
+ const lines = [];
94
+ lines.push(renderSection('TRUTH PACK', statusIcons.truthpack));
95
+ lines.push('');
96
+ lines.push(` Routes: ${colors.accent}${routes}${ansi.reset}`);
97
+ lines.push(` Env vars: ${colors.accent}${envVars}${ansi.reset}`);
98
+ lines.push(` Gaps: ${gaps ? `${colors.warning}${gaps}${ansi.reset}` : `${colors.success}0${ansi.reset}`}`);
99
+ return lines.join('\n');
100
+ }
101
+
102
+ // ═══════════════════════════════════════════════════════════════════════════════
103
+ // REALITY DISPLAY
104
+ // ═══════════════════════════════════════════════════════════════════════════════
105
+
106
+ function renderRealitySection(lastRealityAt, coverage) {
107
+ const lines = [];
108
+ lines.push(renderSection('REALITY', statusIcons.reality));
109
+ lines.push('');
110
+ lines.push(` Last run: ${ansi.dim}${timeAgo(lastRealityAt)}${ansi.reset}`);
111
+ lines.push(` Coverage: ${coverage != null ? `${colors.accent}${coverage}%${ansi.reset}` : `${ansi.dim}—${ansi.reset}`}`);
112
+ return lines.join('\n');
113
+ }
114
+
115
+ // ═══════════════════════════════════════════════════════════════════════════════
116
+ // FILES DISPLAY
117
+ // ═══════════════════════════════════════════════════════════════════════════════
118
+
119
+ function checkExists(filePath) {
120
+ const fs = require('fs');
121
+ return fs.existsSync(filePath) ? `${colors.success}${icons.success}${ansi.reset}` : `${ansi.dim}—${ansi.reset}`;
122
+ }
123
+
124
+ function renderFilesSection(root) {
125
+ const lines = [];
126
+ lines.push(renderSection('FILES', statusIcons.files));
127
+ lines.push('');
128
+ lines.push(` .vibecheck/config.json: ${checkExists(path.join(root, '.vibecheck', 'config.json'))}`);
129
+ lines.push(` .vibecheck/truth/truthpack: ${checkExists(path.join(root, '.vibecheck', 'truth', 'truthpack.json'))}`);
130
+ lines.push(` .vibecheck/last_ship.json: ${checkExists(path.join(root, '.vibecheck', 'last_ship.json'))}`);
131
+
132
+ const envExample = checkExists(path.join(root, '.env.example')) || checkExists(path.join(root, '.env.template'));
133
+ lines.push(` .env.example: ${envExample}`);
134
+
135
+ return lines.join('\n');
136
+ }
137
+
138
+ // ═══════════════════════════════════════════════════════════════════════════════
139
+ // QUICK ACTIONS
140
+ // ═══════════════════════════════════════════════════════════════════════════════
141
+
142
+ function renderQuickActions(verdict, hasTruthpack, hasReality) {
143
+ const lines = [];
144
+ lines.push(renderSection('QUICK ACTIONS', statusIcons.actions));
145
+ lines.push('');
146
+
147
+ if (verdict === 'BLOCK') {
148
+ lines.push(` ${colors.warning}→${ansi.reset} Run: ${colors.accent}vibecheck fix --apply${ansi.reset}`);
149
+ }
150
+ if (!hasTruthpack) {
151
+ lines.push(` ${colors.warning}→${ansi.reset} Run: ${colors.accent}vibecheck install${ansi.reset}`);
152
+ }
153
+ if (!hasReality) {
154
+ lines.push(` ${colors.warning}→${ansi.reset} Run: ${colors.accent}vibecheck reality --url <your-app>${ansi.reset}`);
155
+ }
156
+ if (verdict === 'SHIP') {
157
+ lines.push(` ${colors.success}${icons.success}${ansi.reset} Ready to deploy!`);
158
+ }
159
+
160
+ if (lines.length === 2) {
161
+ lines.push(` ${ansi.dim}All systems operational${ansi.reset}`);
162
+ }
163
+
164
+ return lines.join('\n');
165
+ }
166
+
167
+ // ═══════════════════════════════════════════════════════════════════════════════
168
+ // BANNER
169
+ // ═══════════════════════════════════════════════════════════════════════════════
170
+
171
+ const BANNER = `
172
+ ${ansi.rgb(0, 200, 255)} ██╗ ██╗██╗██████╗ ███████╗ ██████╗██╗ ██╗███████╗ ██████╗██╗ ██╗${ansi.reset}
173
+ ${ansi.rgb(30, 180, 255)} ██║ ██║██║██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██║ ██╔╝${ansi.reset}
174
+ ${ansi.rgb(60, 160, 255)} ██║ ██║██║██████╔╝█████╗ ██║ ███████║█████╗ ██║ █████╔╝ ${ansi.reset}
175
+ ${ansi.rgb(90, 140, 255)} ╚██╗ ██╔╝██║██╔══██╗██╔══╝ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗ ${ansi.reset}
176
+ ${ansi.rgb(120, 120, 255)} ╚████╔╝ ██║██████╔╝███████╗╚██████╗██║ ██║███████╗╚██████╗██║ ██╗${ansi.reset}
177
+ ${ansi.rgb(150, 100, 255)} ╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝${ansi.reset}
178
+
179
+ ${ansi.dim} ┌─────────────────────────────────────────────────────────────────────┐${ansi.reset}
180
+ ${ansi.dim} │${ansi.reset} ${ansi.rgb(255, 255, 255)}${ansi.bold}Status Dashboard${ansi.reset} ${ansi.dim}•${ansi.reset} ${ansi.rgb(200, 200, 200)}Project Health${ansi.reset} ${ansi.dim}•${ansi.reset} ${ansi.rgb(150, 150, 150)}Quick Overview${ansi.reset} ${ansi.dim}│${ansi.reset}
181
+ ${ansi.dim} └─────────────────────────────────────────────────────────────────────┘${ansi.reset}
182
+ `;
183
+
184
+ // ═══════════════════════════════════════════════════════════════════════════════
185
+ // FULL STATUS OUTPUT
186
+ // ═══════════════════════════════════════════════════════════════════════════════
187
+
188
+ function formatStatusOutput(status, options = {}) {
189
+ const { root = '.' } = options;
190
+
191
+ const {
192
+ verdict = null,
193
+ lastShipAt = null,
194
+ blockers = 0,
195
+ warnings = 0,
196
+ routes = 0,
197
+ envVars = 0,
198
+ gaps = 0,
199
+ lastRealityAt = null,
200
+ coverage = null,
201
+ hasTruthpack = false,
202
+ hasReality = false,
203
+ } = status;
204
+
205
+ const lines = [];
206
+
207
+ // Banner
208
+ lines.push(BANNER);
209
+ lines.push('');
210
+
211
+ // Verdict
212
+ lines.push(renderVerdictSection(verdict, lastShipAt));
213
+ lines.push('');
214
+
215
+ // Findings
216
+ lines.push(renderFindingsSection(blockers, warnings));
217
+ lines.push('');
218
+
219
+ // Truth Pack
220
+ lines.push(renderTruthpackSection(routes, envVars, gaps));
221
+ lines.push('');
222
+
223
+ // Reality
224
+ lines.push(renderRealitySection(lastRealityAt, coverage));
225
+ lines.push('');
226
+
227
+ // Files
228
+ lines.push(renderFilesSection(root));
229
+ lines.push('');
230
+
231
+ // Quick Actions
232
+ lines.push(renderQuickActions(verdict, hasTruthpack, hasReality));
233
+
234
+ return lines.filter(Boolean).join('\n');
235
+ }
236
+
237
+ // ═══════════════════════════════════════════════════════════════════════════════
238
+ // EXPORTS
239
+ // ═══════════════════════════════════════════════════════════════════════════════
240
+
241
+ module.exports = {
242
+ formatStatusOutput,
243
+ renderVerdictSection,
244
+ renderFindingsSection,
245
+ renderTruthpackSection,
246
+ renderRealitySection,
247
+ renderFilesSection,
248
+ renderQuickActions,
249
+ timeAgo,
250
+ renderVerdictIcon,
251
+ BANNER,
252
+ statusIcons,
253
+ };