@vibecheckai/cli 3.0.4 → 3.0.7

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 (108) hide show
  1. package/bin/dev/run-v2-torture.js +30 -0
  2. package/bin/runners/context/index.js +1 -1
  3. package/bin/runners/lib/analyzers.js +38 -0
  4. package/bin/runners/lib/assets/vibecheck-logo.png +0 -0
  5. package/bin/runners/lib/contracts/auth-contract.js +8 -0
  6. package/bin/runners/lib/contracts/env-contract.js +3 -0
  7. package/bin/runners/lib/contracts/external-contract.js +10 -2
  8. package/bin/runners/lib/contracts/route-contract.js +7 -0
  9. package/bin/runners/lib/contracts.js +804 -0
  10. package/bin/runners/lib/detectors-v2.js +703 -0
  11. package/bin/runners/lib/drift.js +425 -0
  12. package/bin/runners/lib/entitlements-v2.js +3 -1
  13. package/bin/runners/lib/entitlements.js +11 -3
  14. package/bin/runners/lib/env-resolver.js +417 -0
  15. package/bin/runners/lib/extractors/client-calls.js +990 -0
  16. package/bin/runners/lib/extractors/fastify-route-dump.js +573 -0
  17. package/bin/runners/lib/extractors/fastify-routes.js +426 -0
  18. package/bin/runners/lib/extractors/index.js +363 -0
  19. package/bin/runners/lib/extractors/next-routes.js +524 -0
  20. package/bin/runners/lib/extractors/proof-graph.js +431 -0
  21. package/bin/runners/lib/extractors/route-matcher.js +451 -0
  22. package/bin/runners/lib/extractors/truthpack-v2.js +377 -0
  23. package/bin/runners/lib/extractors/ui-bindings.js +547 -0
  24. package/bin/runners/lib/findings-schema.js +281 -0
  25. package/bin/runners/lib/html-report.js +650 -0
  26. package/bin/runners/lib/missions/templates.js +45 -0
  27. package/bin/runners/lib/policy.js +295 -0
  28. package/bin/runners/lib/reality/correlation-detectors.js +359 -0
  29. package/bin/runners/lib/reality/index.js +318 -0
  30. package/bin/runners/lib/reality/request-hashing.js +416 -0
  31. package/bin/runners/lib/reality/request-mapper.js +453 -0
  32. package/bin/runners/lib/reality/safety-rails.js +463 -0
  33. package/bin/runners/lib/reality/semantic-snapshot.js +408 -0
  34. package/bin/runners/lib/reality/toast-detector.js +393 -0
  35. package/bin/runners/lib/report-html.js +5 -0
  36. package/bin/runners/lib/report-templates.js +5 -0
  37. package/bin/runners/lib/report.js +135 -0
  38. package/bin/runners/lib/route-truth.js +10 -10
  39. package/bin/runners/lib/schema-validator.js +350 -0
  40. package/bin/runners/lib/schemas/contracts.schema.json +160 -0
  41. package/bin/runners/lib/schemas/finding.schema.json +100 -0
  42. package/bin/runners/lib/schemas/mission-pack.schema.json +206 -0
  43. package/bin/runners/lib/schemas/proof-graph.schema.json +176 -0
  44. package/bin/runners/lib/schemas/reality-report.schema.json +162 -0
  45. package/bin/runners/lib/schemas/share-pack.schema.json +180 -0
  46. package/bin/runners/lib/schemas/ship-report.schema.json +117 -0
  47. package/bin/runners/lib/schemas/truthpack-v2.schema.json +303 -0
  48. package/bin/runners/lib/schemas/validator.js +438 -0
  49. package/bin/runners/lib/ui.js +562 -0
  50. package/bin/runners/lib/verdict-engine.js +628 -0
  51. package/bin/runners/runAIAgent.js +228 -1
  52. package/bin/runners/runBadge.js +181 -1
  53. package/bin/runners/runCtx.js +7 -2
  54. package/bin/runners/runCtxDiff.js +301 -0
  55. package/bin/runners/runGuard.js +168 -0
  56. package/bin/runners/runInitGha.js +78 -15
  57. package/bin/runners/runLabs.js +341 -0
  58. package/bin/runners/runLaunch.js +180 -1
  59. package/bin/runners/runMdc.js +203 -1
  60. package/bin/runners/runProof.zip +0 -0
  61. package/bin/runners/runProve.js +23 -0
  62. package/bin/runners/runReplay.js +114 -84
  63. package/bin/runners/runScan.js +111 -32
  64. package/bin/runners/runShip.js +23 -2
  65. package/bin/runners/runTruthpack.js +9 -7
  66. package/bin/runners/runValidate.js +161 -1
  67. package/bin/vibecheck.js +416 -770
  68. package/mcp-server/.guardrail/audit/audit.log.jsonl +2 -0
  69. package/mcp-server/.specs/architecture.mdc +90 -0
  70. package/mcp-server/.specs/security.mdc +30 -0
  71. package/mcp-server/README.md +252 -0
  72. package/mcp-server/agent-checkpoint.js +364 -0
  73. package/mcp-server/architect-tools.js +707 -0
  74. package/mcp-server/audit-mcp.js +206 -0
  75. package/mcp-server/codebase-architect-tools.js +838 -0
  76. package/mcp-server/consolidated-tools.js +804 -0
  77. package/mcp-server/hygiene-tools.js +428 -0
  78. package/mcp-server/index-v1.js +698 -0
  79. package/mcp-server/index.js +2092 -0
  80. package/mcp-server/index.old.js +4137 -0
  81. package/mcp-server/intelligence-tools.js +664 -0
  82. package/mcp-server/intent-drift-tools.js +873 -0
  83. package/mcp-server/mdc-generator.js +298 -0
  84. package/mcp-server/package-lock.json +165 -0
  85. package/mcp-server/package.json +47 -0
  86. package/mcp-server/premium-tools.js +1275 -0
  87. package/mcp-server/test-mcp.js +108 -0
  88. package/mcp-server/test-tools.js +36 -0
  89. package/mcp-server/tier-auth.js +147 -0
  90. package/mcp-server/tools/index.js +72 -0
  91. package/mcp-server/tools-reorganized.ts +244 -0
  92. package/mcp-server/truth-context.js +581 -0
  93. package/mcp-server/truth-firewall-tools.js +1500 -0
  94. package/mcp-server/vibecheck-2.0-tools.js +748 -0
  95. package/mcp-server/vibecheck-tools.js +1075 -0
  96. package/package.json +10 -8
  97. package/bin/guardrail.js +0 -834
  98. package/bin/runners/runAudit.js +0 -2
  99. package/bin/runners/runAutopilot.js +0 -2
  100. package/bin/runners/runCertify.js +0 -2
  101. package/bin/runners/runDashboard.js +0 -10
  102. package/bin/runners/runEnhancedShip.js +0 -2
  103. package/bin/runners/runFixPacks.js +0 -2
  104. package/bin/runners/runNaturalLanguage.js +0 -3
  105. package/bin/runners/runProof.js +0 -2
  106. package/bin/runners/runRealitySniff.js +0 -2
  107. package/bin/runners/runUpgrade.js +0 -2
  108. package/bin/runners/runVerifyAgentOutput.js +0 -2
@@ -0,0 +1,341 @@
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: "experimental",
33
+ description: "Real-time monitoring dashboard",
34
+ runner: () => require("./runDashboard").runDashboard,
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 };
@@ -1,2 +1,181 @@
1
- async function runLaunch(args) { console.log("Launch wizard not yet implemented"); return 0; }
1
+ /**
2
+ * vibecheck launch - Pre-launch checklist wizard
3
+ */
4
+
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const readline = require("readline");
8
+
9
+ const c = {
10
+ reset: "\x1b[0m",
11
+ bold: "\x1b[1m",
12
+ dim: "\x1b[2m",
13
+ green: "\x1b[32m",
14
+ yellow: "\x1b[33m",
15
+ red: "\x1b[31m",
16
+ cyan: "\x1b[36m",
17
+ bgGreen: "\x1b[42m",
18
+ bgYellow: "\x1b[43m",
19
+ bgRed: "\x1b[41m",
20
+ white: "\x1b[37m",
21
+ };
22
+
23
+ const CHECKLIST = [
24
+ { id: "env", name: "Environment variables documented", category: "Config" },
25
+ { id: "secrets", name: "No hardcoded secrets", category: "Security" },
26
+ { id: "auth", name: "Authentication configured", category: "Security" },
27
+ { id: "https", name: "HTTPS/TLS enabled", category: "Security" },
28
+ { id: "cors", name: "CORS configured properly", category: "Security" },
29
+ { id: "rate-limit", name: "Rate limiting enabled", category: "Security" },
30
+ { id: "errors", name: "Error handling in place", category: "Reliability" },
31
+ { id: "logging", name: "Logging configured", category: "Observability" },
32
+ { id: "monitoring", name: "Monitoring/alerting set up", category: "Observability" },
33
+ { id: "backup", name: "Database backup configured", category: "Data" },
34
+ { id: "tests", name: "Tests passing", category: "Quality" },
35
+ { id: "docs", name: "README updated", category: "Documentation" },
36
+ { id: "changelog", name: "CHANGELOG updated", category: "Documentation" },
37
+ { id: "version", name: "Version bumped", category: "Release" },
38
+ ];
39
+
40
+ function parseArgs(args) {
41
+ const opts = {
42
+ help: false,
43
+ interactive: true,
44
+ json: false,
45
+ check: null,
46
+ };
47
+
48
+ for (let i = 0; i < args.length; i++) {
49
+ const arg = args[i];
50
+ switch (arg) {
51
+ case "--help":
52
+ case "-h":
53
+ opts.help = true;
54
+ break;
55
+ case "--json":
56
+ opts.json = true;
57
+ opts.interactive = false;
58
+ break;
59
+ case "--check":
60
+ opts.check = args[++i];
61
+ opts.interactive = false;
62
+ break;
63
+ case "--no-interactive":
64
+ opts.interactive = false;
65
+ break;
66
+ }
67
+ }
68
+
69
+ return opts;
70
+ }
71
+
72
+ function printHelp() {
73
+ console.log(`
74
+ ${c.bold}vibecheck launch${c.reset} - Pre-launch checklist wizard
75
+
76
+ ${c.bold}USAGE${c.reset}
77
+ vibecheck launch [options]
78
+
79
+ ${c.bold}OPTIONS${c.reset}
80
+ --help, -h Show this help
81
+ --json Output checklist as JSON
82
+ --check <id> Auto-check specific item
83
+ --no-interactive Non-interactive mode
84
+
85
+ ${c.bold}CHECKLIST ITEMS${c.reset}
86
+ ${CHECKLIST.map(item => ` ${item.id.padEnd(12)} ${item.name}`).join("\n")}
87
+
88
+ ${c.bold}EXAMPLES${c.reset}
89
+ vibecheck launch # Interactive wizard
90
+ vibecheck launch --json # Get checklist as JSON
91
+ vibecheck launch --check env # Mark env as done
92
+ `);
93
+ }
94
+
95
+ async function runInteractiveChecklist() {
96
+ const rl = readline.createInterface({
97
+ input: process.stdin,
98
+ output: process.stdout,
99
+ });
100
+
101
+ const ask = (q) => new Promise((resolve) => rl.question(q, resolve));
102
+
103
+ console.log(`
104
+ ${c.bold}🚀 PRE-LAUNCH CHECKLIST${c.reset}
105
+ ${c.dim}─────────────────────────────────────────${c.reset}
106
+ `);
107
+
108
+ const results = [];
109
+ let currentCategory = "";
110
+
111
+ for (const item of CHECKLIST) {
112
+ if (item.category !== currentCategory) {
113
+ currentCategory = item.category;
114
+ console.log(`\n${c.cyan}${c.bold}${currentCategory}${c.reset}`);
115
+ }
116
+
117
+ const answer = await ask(` ${item.name}? [y/n/s] `);
118
+ const status = answer.toLowerCase() === "y" ? "done" :
119
+ answer.toLowerCase() === "s" ? "skip" : "pending";
120
+
121
+ results.push({ ...item, status });
122
+
123
+ if (status === "done") {
124
+ process.stdout.write(`\x1b[1A\x1b[2K ${c.green}✓${c.reset} ${item.name}\n`);
125
+ } else if (status === "skip") {
126
+ process.stdout.write(`\x1b[1A\x1b[2K ${c.yellow}↷${c.reset} ${item.name} ${c.dim}(skipped)${c.reset}\n`);
127
+ } else {
128
+ process.stdout.write(`\x1b[1A\x1b[2K ${c.red}✗${c.reset} ${item.name}\n`);
129
+ }
130
+ }
131
+
132
+ rl.close();
133
+
134
+ // Summary
135
+ const done = results.filter(r => r.status === "done").length;
136
+ const pending = results.filter(r => r.status === "pending").length;
137
+ const skipped = results.filter(r => r.status === "skip").length;
138
+
139
+ console.log(`
140
+ ${c.bold}─────────────────────────────────────────${c.reset}
141
+ ${c.bold}SUMMARY${c.reset}
142
+ ${c.green}✓ Done:${c.reset} ${done}
143
+ ${c.red}✗ Pending:${c.reset} ${pending}
144
+ ${c.yellow}↷ Skipped:${c.reset} ${skipped}
145
+ `);
146
+
147
+ if (pending === 0) {
148
+ console.log(`${c.bgGreen}${c.white}${c.bold} 🚀 READY TO LAUNCH! ${c.reset}\n`);
149
+ return 0;
150
+ } else {
151
+ console.log(`${c.bgYellow}${c.white}${c.bold} ⚠ ${pending} items remaining ${c.reset}\n`);
152
+ return 1;
153
+ }
154
+ }
155
+
156
+ async function runLaunch(args) {
157
+ const opts = parseArgs(args);
158
+
159
+ if (opts.help) {
160
+ printHelp();
161
+ return 0;
162
+ }
163
+
164
+ if (opts.json) {
165
+ console.log(JSON.stringify({ checklist: CHECKLIST }, null, 2));
166
+ return 0;
167
+ }
168
+
169
+ if (!opts.interactive) {
170
+ console.log(`\n${c.bold}Pre-Launch Checklist${c.reset}\n`);
171
+ for (const item of CHECKLIST) {
172
+ console.log(` [ ] ${item.name}`);
173
+ }
174
+ console.log(`\n${c.dim}Run 'vibecheck launch' for interactive mode${c.reset}\n`);
175
+ return 0;
176
+ }
177
+
178
+ return runInteractiveChecklist();
179
+ }
180
+
2
181
  module.exports = { runLaunch };