@vibecheckai/cli 2.8.2 → 3.0.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 +8 -8
- package/bin/_deprecations.js +35 -0
- package/bin/_router.js +46 -0
- package/bin/cli-hygiene.js +241 -0
- package/bin/guardrail.js +834 -0
- package/bin/runners/cli-utils.js +1070 -0
- package/bin/runners/context/ai-task-decomposer.js +337 -0
- package/bin/runners/context/analyzer.js +462 -0
- package/bin/runners/context/api-contracts.js +427 -0
- package/bin/runners/context/context-diff.js +342 -0
- package/bin/runners/context/context-pruner.js +291 -0
- package/bin/runners/context/dependency-graph.js +414 -0
- package/bin/runners/context/generators/claude.js +107 -0
- package/bin/runners/context/generators/codex.js +108 -0
- package/bin/runners/context/generators/copilot.js +119 -0
- package/bin/runners/context/generators/cursor.js +514 -0
- package/bin/runners/context/generators/mcp.js +151 -0
- package/bin/runners/context/generators/windsurf.js +180 -0
- package/bin/runners/context/git-context.js +302 -0
- package/bin/runners/context/index.js +1042 -0
- package/bin/runners/context/insights.js +173 -0
- package/bin/runners/context/mcp-server/generate-rules.js +337 -0
- package/bin/runners/context/mcp-server/index.js +1176 -0
- package/bin/runners/context/mcp-server/package.json +24 -0
- package/bin/runners/context/memory.js +200 -0
- package/bin/runners/context/monorepo.js +215 -0
- package/bin/runners/context/multi-repo-federation.js +404 -0
- package/bin/runners/context/patterns.js +253 -0
- package/bin/runners/context/proof-context.js +972 -0
- package/bin/runners/context/security-scanner.js +303 -0
- package/bin/runners/context/semantic-search.js +350 -0
- package/bin/runners/context/shared.js +264 -0
- package/bin/runners/context/team-conventions.js +310 -0
- package/bin/runners/lib/ai-bridge.js +416 -0
- package/bin/runners/lib/analysis-core.js +271 -0
- package/bin/runners/lib/analyzers.js +541 -0
- package/bin/runners/lib/audit-bridge.js +391 -0
- package/bin/runners/lib/auth-truth.js +193 -0
- package/bin/runners/lib/auth.js +215 -0
- package/bin/runners/lib/backup.js +62 -0
- package/bin/runners/lib/billing.js +107 -0
- package/bin/runners/lib/claims.js +118 -0
- package/bin/runners/lib/cli-ui.js +540 -0
- package/bin/runners/lib/compliance-bridge-new.js +0 -0
- package/bin/runners/lib/compliance-bridge.js +165 -0
- package/bin/runners/lib/contracts/auth-contract.js +194 -0
- package/bin/runners/lib/contracts/env-contract.js +178 -0
- package/bin/runners/lib/contracts/external-contract.js +198 -0
- package/bin/runners/lib/contracts/guard.js +168 -0
- package/bin/runners/lib/contracts/index.js +89 -0
- package/bin/runners/lib/contracts/plan-validator.js +311 -0
- package/bin/runners/lib/contracts/route-contract.js +192 -0
- package/bin/runners/lib/detect.js +89 -0
- package/bin/runners/lib/doctor/autofix.js +254 -0
- package/bin/runners/lib/doctor/index.js +37 -0
- package/bin/runners/lib/doctor/modules/dependencies.js +325 -0
- package/bin/runners/lib/doctor/modules/index.js +46 -0
- package/bin/runners/lib/doctor/modules/network.js +250 -0
- package/bin/runners/lib/doctor/modules/project.js +312 -0
- package/bin/runners/lib/doctor/modules/runtime.js +224 -0
- package/bin/runners/lib/doctor/modules/security.js +348 -0
- package/bin/runners/lib/doctor/modules/system.js +213 -0
- package/bin/runners/lib/doctor/modules/vibecheck.js +394 -0
- package/bin/runners/lib/doctor/reporter.js +262 -0
- package/bin/runners/lib/doctor/service.js +262 -0
- package/bin/runners/lib/doctor/types.js +113 -0
- package/bin/runners/lib/doctor/ui.js +263 -0
- package/bin/runners/lib/doctor-enhanced.js +233 -0
- package/bin/runners/lib/doctor-v2.js +608 -0
- package/bin/runners/lib/enforcement.js +72 -0
- package/bin/runners/lib/enterprise-detect.js +603 -0
- package/bin/runners/lib/enterprise-init.js +942 -0
- package/bin/runners/lib/entitlements-v2.js +381 -0
- package/bin/runners/lib/entitlements.generated.js +0 -0
- package/bin/runners/lib/entitlements.js +332 -0
- package/bin/runners/lib/env-template.js +66 -0
- package/bin/runners/lib/env.js +189 -0
- package/bin/runners/lib/error-handler.js +320 -0
- package/bin/runners/lib/firewall-prompt.js +50 -0
- package/bin/runners/lib/graph/graph-builder.js +265 -0
- package/bin/runners/lib/graph/html-renderer.js +413 -0
- package/bin/runners/lib/graph/index.js +32 -0
- package/bin/runners/lib/graph/runtime-collector.js +215 -0
- package/bin/runners/lib/graph/static-extractor.js +518 -0
- package/bin/runners/lib/init-wizard.js +308 -0
- package/bin/runners/lib/json-output.js +76 -0
- package/bin/runners/lib/llm.js +75 -0
- package/bin/runners/lib/meter.js +61 -0
- package/bin/runners/lib/missions/evidence.js +126 -0
- package/bin/runners/lib/missions/plan.js +69 -0
- package/bin/runners/lib/missions/templates.js +147 -0
- package/bin/runners/lib/patch.js +40 -0
- package/bin/runners/lib/permissions/auth-model.js +213 -0
- package/bin/runners/lib/permissions/idor-prover.js +205 -0
- package/bin/runners/lib/permissions/index.js +45 -0
- package/bin/runners/lib/permissions/matrix-builder.js +198 -0
- package/bin/runners/lib/pkgjson.js +28 -0
- package/bin/runners/lib/preflight.js +142 -0
- package/bin/runners/lib/reality-findings.js +84 -0
- package/bin/runners/lib/redact.js +29 -0
- package/bin/runners/lib/replay/capsule-manager.js +154 -0
- package/bin/runners/lib/replay/index.js +263 -0
- package/bin/runners/lib/replay/player.js +348 -0
- package/bin/runners/lib/replay/recorder.js +331 -0
- package/bin/runners/lib/report-engine.js +447 -0
- package/bin/runners/lib/report-html.js +1117 -0
- package/bin/runners/lib/report-templates.js +964 -0
- package/bin/runners/lib/route-detection.js +1140 -0
- package/bin/runners/lib/route-truth.js +477 -0
- package/bin/runners/lib/sandbox/index.js +59 -0
- package/bin/runners/lib/sandbox/proof-chain.js +399 -0
- package/bin/runners/lib/sandbox/sandbox-runner.js +205 -0
- package/bin/runners/lib/sandbox/worktree.js +174 -0
- package/bin/runners/lib/scan-cache.js +330 -0
- package/bin/runners/lib/scan-output-schema.js +344 -0
- package/bin/runners/lib/score-history.js +282 -0
- package/bin/runners/lib/security-bridge.js +249 -0
- package/bin/runners/lib/server-usage.js +513 -0
- package/bin/runners/lib/share-pack.js +239 -0
- package/bin/runners/lib/snippets.js +67 -0
- package/bin/runners/lib/truth.js +667 -0
- package/bin/runners/lib/unified-output.js +189 -0
- package/bin/runners/lib/validate-patch.js +156 -0
- package/bin/runners/lib/verification.js +345 -0
- package/bin/runners/reality/engine.js +917 -0
- package/bin/runners/reality/flows.js +122 -0
- package/bin/runners/reality/report.js +378 -0
- package/bin/runners/reality/session.js +193 -0
- package/bin/runners/runAIAgent.js +2 -0
- package/bin/runners/runAudit.js +2 -0
- package/bin/runners/runAuth.js +106 -0
- package/bin/runners/runAutopilot.js +2 -0
- package/bin/runners/runBadge.js +2 -0
- package/bin/runners/runCertify.js +2 -0
- package/bin/runners/runClaimVerifier.js +483 -0
- package/bin/runners/runContext.js +56 -0
- package/bin/runners/runContextCompiler.js +385 -0
- package/bin/runners/runCtx.js +187 -0
- package/bin/runners/runCtxGuard.js +176 -0
- package/bin/runners/runCtxSync.js +116 -0
- package/bin/runners/runDashboard.js +10 -0
- package/bin/runners/runDoctor.js +245 -0
- package/bin/runners/runEnhancedShip.js +2 -0
- package/bin/runners/runFix.js +735 -0
- package/bin/runners/runFixPacks.js +2 -0
- package/bin/runners/runGate.js +17 -0
- package/bin/runners/runGraph.js +283 -0
- package/bin/runners/runInit.js +260 -0
- package/bin/runners/runInitGha.js +101 -0
- package/bin/runners/runInstall.js +76 -0
- package/bin/runners/runInteractive.js +388 -0
- package/bin/runners/runLaunch.js +2 -0
- package/bin/runners/runMcp.js +19 -0
- package/bin/runners/runMdc.js +2 -0
- package/bin/runners/runMissionGenerator.js +282 -0
- package/bin/runners/runNaturalLanguage.js +3 -0
- package/bin/runners/runPR.js +96 -0
- package/bin/runners/runPermissions.js +290 -0
- package/bin/runners/runPromptFirewall.js +211 -0
- package/bin/runners/runProof.js +2 -0
- package/bin/runners/runProve.js +392 -0
- package/bin/runners/runReality.js +489 -0
- package/bin/runners/runRealitySniff.js +2 -0
- package/bin/runners/runReplay.js +469 -0
- package/bin/runners/runReport.js +478 -0
- package/bin/runners/runScan.js +835 -0
- package/bin/runners/runShare.js +34 -0
- package/bin/runners/runShip.js +1062 -0
- package/bin/runners/runStatus.js +136 -0
- package/bin/runners/runTruthpack.js +634 -0
- package/bin/runners/runUpgrade.js +2 -0
- package/bin/runners/runValidate.js +2 -0
- package/bin/runners/runVerifyAgentOutput.js +2 -0
- package/bin/runners/runWatch.js +230 -0
- package/bin/runners/utils.js +360 -0
- package/bin/scan.js +612 -0
- package/bin/vibecheck.js +834 -0
- package/package.json +11 -11
- package/dist/autopatch/verified-autopatch.d.ts +0 -111
- package/dist/autopatch/verified-autopatch.d.ts.map +0 -1
- package/dist/autopatch/verified-autopatch.js +0 -503
- package/dist/autopatch/verified-autopatch.js.map +0 -1
- package/dist/bundles/index.js +0 -8
- package/dist/bundles/vibecheck-core.js +0 -25799
- package/dist/bundles/vibecheck-security.js +0 -208693
- package/dist/bundles/vibecheck-ship.js +0 -2318
- package/dist/commands/baseline.d.ts +0 -7
- package/dist/commands/baseline.d.ts.map +0 -1
- package/dist/commands/baseline.js +0 -79
- package/dist/commands/baseline.js.map +0 -1
- package/dist/commands/cache.d.ts +0 -13
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/cache.js +0 -165
- package/dist/commands/cache.js.map +0 -1
- package/dist/commands/checkpoint.d.ts +0 -8
- package/dist/commands/checkpoint.d.ts.map +0 -1
- package/dist/commands/checkpoint.js +0 -35
- package/dist/commands/checkpoint.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -17
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -226
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/evidence.d.ts +0 -45
- package/dist/commands/evidence.d.ts.map +0 -1
- package/dist/commands/evidence.js +0 -197
- package/dist/commands/evidence.js.map +0 -1
- package/dist/commands/explain.d.ts +0 -8
- package/dist/commands/explain.d.ts.map +0 -1
- package/dist/commands/explain.js +0 -52
- package/dist/commands/explain.js.map +0 -1
- package/dist/commands/fix-consolidated.d.ts +0 -19
- package/dist/commands/fix-consolidated.d.ts.map +0 -1
- package/dist/commands/fix-consolidated.js +0 -165
- package/dist/commands/fix-consolidated.js.map +0 -1
- package/dist/commands/index.d.ts +0 -8
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -15
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -8
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -125
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/launcher.d.ts +0 -10
- package/dist/commands/launcher.d.ts.map +0 -1
- package/dist/commands/launcher.js +0 -174
- package/dist/commands/launcher.js.map +0 -1
- package/dist/commands/on.d.ts +0 -8
- package/dist/commands/on.d.ts.map +0 -1
- package/dist/commands/on.js +0 -123
- package/dist/commands/on.js.map +0 -1
- package/dist/commands/replay.d.ts +0 -8
- package/dist/commands/replay.d.ts.map +0 -1
- package/dist/commands/replay.js +0 -52
- package/dist/commands/replay.js.map +0 -1
- package/dist/commands/scan-consolidated.d.ts +0 -61
- package/dist/commands/scan-consolidated.d.ts.map +0 -1
- package/dist/commands/scan-consolidated.js +0 -243
- package/dist/commands/scan-consolidated.js.map +0 -1
- package/dist/commands/scan-secrets.d.ts +0 -47
- package/dist/commands/scan-secrets.d.ts.map +0 -1
- package/dist/commands/scan-secrets.js +0 -225
- package/dist/commands/scan-secrets.js.map +0 -1
- package/dist/commands/scan-vulnerabilities-enhanced.d.ts +0 -41
- package/dist/commands/scan-vulnerabilities-enhanced.d.ts.map +0 -1
- package/dist/commands/scan-vulnerabilities-enhanced.js +0 -368
- package/dist/commands/scan-vulnerabilities-enhanced.js.map +0 -1
- package/dist/commands/scan-vulnerabilities-osv.d.ts +0 -58
- package/dist/commands/scan-vulnerabilities-osv.d.ts.map +0 -1
- package/dist/commands/scan-vulnerabilities-osv.js +0 -722
- package/dist/commands/scan-vulnerabilities-osv.js.map +0 -1
- package/dist/commands/scan-vulnerabilities.d.ts +0 -32
- package/dist/commands/scan-vulnerabilities.d.ts.map +0 -1
- package/dist/commands/scan-vulnerabilities.js +0 -283
- package/dist/commands/scan-vulnerabilities.js.map +0 -1
- package/dist/commands/secrets-allowlist.d.ts +0 -7
- package/dist/commands/secrets-allowlist.d.ts.map +0 -1
- package/dist/commands/secrets-allowlist.js +0 -85
- package/dist/commands/secrets-allowlist.js.map +0 -1
- package/dist/commands/ship-consolidated.d.ts +0 -58
- package/dist/commands/ship-consolidated.d.ts.map +0 -1
- package/dist/commands/ship-consolidated.js +0 -515
- package/dist/commands/ship-consolidated.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -8
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js +0 -134
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -8
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -30
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/fix/applicator.d.ts +0 -44
- package/dist/fix/applicator.d.ts.map +0 -1
- package/dist/fix/applicator.js +0 -144
- package/dist/fix/applicator.js.map +0 -1
- package/dist/fix/backup.d.ts +0 -38
- package/dist/fix/backup.d.ts.map +0 -1
- package/dist/fix/backup.js +0 -154
- package/dist/fix/backup.js.map +0 -1
- package/dist/fix/engine.d.ts +0 -55
- package/dist/fix/engine.d.ts.map +0 -1
- package/dist/fix/engine.js +0 -285
- package/dist/fix/engine.js.map +0 -1
- package/dist/fix/index.d.ts +0 -5
- package/dist/fix/index.d.ts.map +0 -1
- package/dist/fix/index.js +0 -12
- package/dist/fix/index.js.map +0 -1
- package/dist/fix/interactive.d.ts +0 -22
- package/dist/fix/interactive.d.ts.map +0 -1
- package/dist/fix/interactive.js +0 -172
- package/dist/fix/interactive.js.map +0 -1
- package/dist/formatters/index.d.ts +0 -6
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js +0 -11
- package/dist/formatters/index.js.map +0 -1
- package/dist/formatters/sarif-enhanced.d.ts +0 -78
- package/dist/formatters/sarif-enhanced.d.ts.map +0 -1
- package/dist/formatters/sarif-enhanced.js +0 -144
- package/dist/formatters/sarif-enhanced.js.map +0 -1
- package/dist/formatters/sarif-v2.d.ts +0 -121
- package/dist/formatters/sarif-v2.d.ts.map +0 -1
- package/dist/formatters/sarif-v2.js +0 -356
- package/dist/formatters/sarif-v2.js.map +0 -1
- package/dist/formatters/sarif.d.ts +0 -72
- package/dist/formatters/sarif.d.ts.map +0 -1
- package/dist/formatters/sarif.js +0 -146
- package/dist/formatters/sarif.js.map +0 -1
- package/dist/index.d.ts +0 -61
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4388
- package/dist/index.js.map +0 -1
- package/dist/init/ci-generator.d.ts +0 -18
- package/dist/init/ci-generator.d.ts.map +0 -1
- package/dist/init/ci-generator.js +0 -317
- package/dist/init/ci-generator.js.map +0 -1
- package/dist/init/detect-framework.d.ts +0 -15
- package/dist/init/detect-framework.d.ts.map +0 -1
- package/dist/init/detect-framework.js +0 -301
- package/dist/init/detect-framework.js.map +0 -1
- package/dist/init/hooks-installer.d.ts +0 -22
- package/dist/init/hooks-installer.d.ts.map +0 -1
- package/dist/init/hooks-installer.js +0 -310
- package/dist/init/hooks-installer.js.map +0 -1
- package/dist/init/index.d.ts +0 -8
- package/dist/init/index.d.ts.map +0 -1
- package/dist/init/index.js +0 -22
- package/dist/init/index.js.map +0 -1
- package/dist/init/templates.d.ts +0 -402
- package/dist/init/templates.d.ts.map +0 -1
- package/dist/init/templates.js +0 -240
- package/dist/init/templates.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -12
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -42
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/telemetry.d.ts +0 -40
- package/dist/mcp/telemetry.d.ts.map +0 -1
- package/dist/mcp/telemetry.js +0 -98
- package/dist/mcp/telemetry.js.map +0 -1
- package/dist/reality/no-dead-buttons/button-sweep-generator.d.ts +0 -32
- package/dist/reality/no-dead-buttons/button-sweep-generator.d.ts.map +0 -1
- package/dist/reality/no-dead-buttons/button-sweep-generator.js +0 -236
- package/dist/reality/no-dead-buttons/button-sweep-generator.js.map +0 -1
- package/dist/reality/no-dead-buttons/index.d.ts +0 -11
- package/dist/reality/no-dead-buttons/index.d.ts.map +0 -1
- package/dist/reality/no-dead-buttons/index.js +0 -18
- package/dist/reality/no-dead-buttons/index.js.map +0 -1
- package/dist/reality/no-dead-buttons/static-scanner.d.ts +0 -34
- package/dist/reality/no-dead-buttons/static-scanner.d.ts.map +0 -1
- package/dist/reality/no-dead-buttons/static-scanner.js +0 -230
- package/dist/reality/no-dead-buttons/static-scanner.js.map +0 -1
- package/dist/reality/reality-graph.d.ts +0 -192
- package/dist/reality/reality-graph.d.ts.map +0 -1
- package/dist/reality/reality-graph.js +0 -600
- package/dist/reality/reality-graph.js.map +0 -1
- package/dist/reality/reality-runner.d.ts +0 -89
- package/dist/reality/reality-runner.d.ts.map +0 -1
- package/dist/reality/reality-runner.js +0 -540
- package/dist/reality/reality-runner.js.map +0 -1
- package/dist/reality/receipt-generator.d.ts +0 -152
- package/dist/reality/receipt-generator.d.ts.map +0 -1
- package/dist/reality/receipt-generator.js +0 -495
- package/dist/reality/receipt-generator.js.map +0 -1
- package/dist/reality/runtime-tracer.d.ts +0 -75
- package/dist/reality/runtime-tracer.d.ts.map +0 -1
- package/dist/reality/runtime-tracer.js +0 -109
- package/dist/reality/runtime-tracer.js.map +0 -1
- package/dist/runtime/auth-utils.d.ts +0 -43
- package/dist/runtime/auth-utils.d.ts.map +0 -1
- package/dist/runtime/auth-utils.js +0 -130
- package/dist/runtime/auth-utils.js.map +0 -1
- package/dist/runtime/client.d.ts +0 -74
- package/dist/runtime/client.d.ts.map +0 -1
- package/dist/runtime/client.js +0 -222
- package/dist/runtime/client.js.map +0 -1
- package/dist/runtime/creds.d.ts +0 -48
- package/dist/runtime/creds.d.ts.map +0 -1
- package/dist/runtime/creds.js +0 -245
- package/dist/runtime/creds.js.map +0 -1
- package/dist/runtime/exit-codes.d.ts +0 -49
- package/dist/runtime/exit-codes.d.ts.map +0 -1
- package/dist/runtime/exit-codes.js +0 -93
- package/dist/runtime/exit-codes.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -9
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -25
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/json-output.d.ts +0 -42
- package/dist/runtime/json-output.d.ts.map +0 -1
- package/dist/runtime/json-output.js +0 -59
- package/dist/runtime/json-output.js.map +0 -1
- package/dist/runtime/semver.d.ts +0 -37
- package/dist/runtime/semver.d.ts.map +0 -1
- package/dist/runtime/semver.js +0 -110
- package/dist/runtime/semver.js.map +0 -1
- package/dist/scan/dead-ui-detector.d.ts +0 -48
- package/dist/scan/dead-ui-detector.d.ts.map +0 -1
- package/dist/scan/dead-ui-detector.js +0 -170
- package/dist/scan/dead-ui-detector.js.map +0 -1
- package/dist/scan/playwright-sweep.d.ts +0 -40
- package/dist/scan/playwright-sweep.d.ts.map +0 -1
- package/dist/scan/playwright-sweep.js +0 -216
- package/dist/scan/playwright-sweep.js.map +0 -1
- package/dist/scan/proof-bundle.d.ts +0 -25
- package/dist/scan/proof-bundle.d.ts.map +0 -1
- package/dist/scan/proof-bundle.js +0 -203
- package/dist/scan/proof-bundle.js.map +0 -1
- package/dist/scan/proof-graph.d.ts +0 -59
- package/dist/scan/proof-graph.d.ts.map +0 -1
- package/dist/scan/proof-graph.js +0 -64
- package/dist/scan/proof-graph.js.map +0 -1
- package/dist/scan/reality-sniff.d.ts +0 -56
- package/dist/scan/reality-sniff.d.ts.map +0 -1
- package/dist/scan/reality-sniff.js +0 -200
- package/dist/scan/reality-sniff.js.map +0 -1
- package/dist/scan/structural-verifier.d.ts +0 -20
- package/dist/scan/structural-verifier.d.ts.map +0 -1
- package/dist/scan/structural-verifier.js +0 -112
- package/dist/scan/structural-verifier.js.map +0 -1
- package/dist/scan/verification-engine.d.ts +0 -47
- package/dist/scan/verification-engine.d.ts.map +0 -1
- package/dist/scan/verification-engine.js +0 -141
- package/dist/scan/verification-engine.js.map +0 -1
- package/dist/scanner/baseline.d.ts +0 -52
- package/dist/scanner/baseline.d.ts.map +0 -1
- package/dist/scanner/baseline.js +0 -85
- package/dist/scanner/baseline.js.map +0 -1
- package/dist/scanner/incremental.d.ts +0 -30
- package/dist/scanner/incremental.d.ts.map +0 -1
- package/dist/scanner/incremental.js +0 -82
- package/dist/scanner/incremental.js.map +0 -1
- package/dist/scanner/parallel.d.ts +0 -43
- package/dist/scanner/parallel.d.ts.map +0 -1
- package/dist/scanner/parallel.js +0 -99
- package/dist/scanner/parallel.js.map +0 -1
- package/dist/standalone.d.ts +0 -1
- package/dist/standalone.d.ts.map +0 -1
- package/dist/standalone.js +0 -1
- package/dist/standalone.js.map +0 -1
- package/dist/truth-pack/index.d.ts +0 -102
- package/dist/truth-pack/index.d.ts.map +0 -1
- package/dist/truth-pack/index.js +0 -694
- package/dist/truth-pack/index.js.map +0 -1
- package/dist/ui/frame.d.ts +0 -68
- package/dist/ui/frame.d.ts.map +0 -1
- package/dist/ui/frame.js +0 -165
- package/dist/ui/frame.js.map +0 -1
- package/dist/ui/index.d.ts +0 -5
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -16
- package/dist/ui/index.js.map +0 -1
- package/dist/ui.d.ts +0 -36
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -45
- package/dist/ui.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// bin/runners/runGate.js
|
|
2
|
+
// CI/CD gate command - wraps ship for pass/fail CI pipelines
|
|
3
|
+
const { runShip } = require("./runShip");
|
|
4
|
+
|
|
5
|
+
async function runGate(args) {
|
|
6
|
+
// Gate is essentially ship with strict exit codes for CI
|
|
7
|
+
// Pass through args to ship
|
|
8
|
+
const exitCode = await runShip([...args, "--ci"]);
|
|
9
|
+
|
|
10
|
+
// Exit codes:
|
|
11
|
+
// 0 = SHIP (pass)
|
|
12
|
+
// 1 = WARN (pass by default, fail with --strict)
|
|
13
|
+
// 2 = BLOCK (fail)
|
|
14
|
+
return exitCode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = { runGate };
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vibecheck graph - Reality Proof Graph
|
|
3
|
+
*
|
|
4
|
+
* Builds and visualizes the complete causal chain:
|
|
5
|
+
* UI action → client function → network call → server route → handler → DB/external
|
|
6
|
+
*
|
|
7
|
+
* Identifies broken edges that indicate:
|
|
8
|
+
* - Routes referenced but don't exist
|
|
9
|
+
* - Routes that fail at runtime
|
|
10
|
+
* - UI showing success but server returning errors
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
15
|
+
const path = require("path");
|
|
16
|
+
const fs = require("fs");
|
|
17
|
+
const { buildTruthpack, loadTruthpack } = require("./lib/truth");
|
|
18
|
+
const {
|
|
19
|
+
extractStaticGraph,
|
|
20
|
+
buildProofGraph,
|
|
21
|
+
getFindingsFromGraph,
|
|
22
|
+
renderGraphHtml,
|
|
23
|
+
renderGraphMermaid,
|
|
24
|
+
generateFetchWrapper,
|
|
25
|
+
collectRequests,
|
|
26
|
+
buildRuntimeEdges,
|
|
27
|
+
mergeRuntimeResults
|
|
28
|
+
} = require("./lib/graph");
|
|
29
|
+
|
|
30
|
+
const c = {
|
|
31
|
+
reset: '\x1b[0m',
|
|
32
|
+
bold: '\x1b[1m',
|
|
33
|
+
dim: '\x1b[2m',
|
|
34
|
+
green: '\x1b[32m',
|
|
35
|
+
yellow: '\x1b[33m',
|
|
36
|
+
cyan: '\x1b[36m',
|
|
37
|
+
red: '\x1b[31m',
|
|
38
|
+
blue: '\x1b[34m',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function ensureDir(p) {
|
|
42
|
+
fs.mkdirSync(p, { recursive: true });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function runGraph(args) {
|
|
46
|
+
const opts = parseArgs(args);
|
|
47
|
+
|
|
48
|
+
if (opts.help) {
|
|
49
|
+
printHelp();
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const root = path.resolve(opts.path || process.cwd());
|
|
54
|
+
const outDir = path.join(root, ".vibecheck", "graph");
|
|
55
|
+
ensureDir(outDir);
|
|
56
|
+
|
|
57
|
+
console.log(`\n${c.cyan}${c.bold}🔍 vibecheck graph${c.reset}`);
|
|
58
|
+
console.log(`${c.dim}Building Reality Proof Graph...${c.reset}\n`);
|
|
59
|
+
|
|
60
|
+
// Load or build truthpack
|
|
61
|
+
let truthpack = loadTruthpack(root);
|
|
62
|
+
if (!truthpack) {
|
|
63
|
+
console.log(`${c.dim}Building truthpack...${c.reset}`);
|
|
64
|
+
truthpack = await buildTruthpack({ repoRoot: root, fastifyEntry: opts.fastifyEntry });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Extract static graph
|
|
68
|
+
console.log(`${c.dim}Extracting static edges...${c.reset}`);
|
|
69
|
+
const staticData = await extractStaticGraph(root, truthpack);
|
|
70
|
+
|
|
71
|
+
// Build proof graph
|
|
72
|
+
let graph = buildProofGraph({
|
|
73
|
+
nodes: staticData.nodes,
|
|
74
|
+
edges: staticData.edges,
|
|
75
|
+
meta: { repoRoot: root }
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Runtime verification (optional)
|
|
79
|
+
if (opts.runtime && opts.url) {
|
|
80
|
+
console.log(`${c.dim}Collecting runtime edges from ${opts.url}...${c.reset}`);
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
const runtimeEdges = await collectRuntimeEdges(opts.url, graph, opts);
|
|
84
|
+
graph = mergeRuntimeResults(graph, runtimeEdges);
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.log(`${c.yellow}⚠️ Runtime collection failed: ${e.message}${c.reset}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Get findings from broken edges
|
|
91
|
+
const findings = getFindingsFromGraph(graph);
|
|
92
|
+
|
|
93
|
+
// Write outputs
|
|
94
|
+
fs.writeFileSync(path.join(outDir, "graph.json"), JSON.stringify(graph, null, 2), "utf8");
|
|
95
|
+
|
|
96
|
+
if (!opts.jsonOnly) {
|
|
97
|
+
const html = renderGraphHtml(graph);
|
|
98
|
+
fs.writeFileSync(path.join(outDir, "graph.html"), html, "utf8");
|
|
99
|
+
|
|
100
|
+
const mermaid = renderGraphMermaid(graph);
|
|
101
|
+
fs.writeFileSync(path.join(outDir, "graph.mmd"), mermaid, "utf8");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (findings.length > 0) {
|
|
105
|
+
fs.writeFileSync(path.join(outDir, "broken-edges.json"), JSON.stringify(findings, null, 2), "utf8");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Print summary
|
|
109
|
+
console.log(`\n${c.bold}Graph Summary${c.reset}`);
|
|
110
|
+
console.log(` Nodes: ${graph.nodes.length}`);
|
|
111
|
+
console.log(` Valid edges: ${c.green}${graph.edges.length}${c.reset}`);
|
|
112
|
+
console.log(` Broken edges: ${graph.brokenEdges.length > 0 ? c.red : c.green}${graph.brokenEdges.length}${c.reset}`);
|
|
113
|
+
console.log(` Coverage: ${graph.coverage.percent}%`);
|
|
114
|
+
|
|
115
|
+
if (opts.broken || findings.length > 0) {
|
|
116
|
+
console.log(`\n${c.bold}Broken Edges${c.reset}`);
|
|
117
|
+
|
|
118
|
+
if (findings.length === 0) {
|
|
119
|
+
console.log(` ${c.green}✓ No broken edges found${c.reset}`);
|
|
120
|
+
} else {
|
|
121
|
+
for (const f of findings.slice(0, 10)) {
|
|
122
|
+
const icon = f.severity === "BLOCK" ? `${c.red}✗` : `${c.yellow}⚠`;
|
|
123
|
+
console.log(` ${icon} ${f.title}${c.reset}`);
|
|
124
|
+
}
|
|
125
|
+
if (findings.length > 10) {
|
|
126
|
+
console.log(` ${c.dim}... and ${findings.length - 10} more${c.reset}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log(`\n${c.bold}Output${c.reset}`);
|
|
132
|
+
console.log(` ${c.dim}Graph:${c.reset} .vibecheck/graph/graph.json`);
|
|
133
|
+
if (!opts.jsonOnly) {
|
|
134
|
+
console.log(` ${c.dim}Visualization:${c.reset} .vibecheck/graph/graph.html`);
|
|
135
|
+
console.log(` ${c.dim}Mermaid:${c.reset} .vibecheck/graph/graph.mmd`);
|
|
136
|
+
}
|
|
137
|
+
if (findings.length > 0) {
|
|
138
|
+
console.log(` ${c.dim}Broken edges:${c.reset} .vibecheck/graph/broken-edges.json`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (opts.view && !opts.jsonOnly) {
|
|
142
|
+
const htmlPath = path.join(outDir, "graph.html");
|
|
143
|
+
console.log(`\n${c.dim}Opening graph visualization...${c.reset}`);
|
|
144
|
+
|
|
145
|
+
// Cross-platform open
|
|
146
|
+
const { exec } = require("child_process");
|
|
147
|
+
const cmd = process.platform === "win32" ? `start "" "${htmlPath}"` :
|
|
148
|
+
process.platform === "darwin" ? `open "${htmlPath}"` :
|
|
149
|
+
`xdg-open "${htmlPath}"`;
|
|
150
|
+
exec(cmd);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const blocks = findings.filter(f => f.severity === "BLOCK").length;
|
|
154
|
+
const warns = findings.filter(f => f.severity === "WARN").length;
|
|
155
|
+
|
|
156
|
+
console.log(`\n${c.bold}Verdict:${c.reset} ${blocks ? `${c.red}🛑 BLOCK${c.reset}` : warns ? `${c.yellow}⚠️ WARN${c.reset}` : `${c.green}✅ CLEAN${c.reset}`}`);
|
|
157
|
+
|
|
158
|
+
return blocks ? 2 : warns ? 1 : 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function collectRuntimeEdges(url, staticGraph, opts) {
|
|
162
|
+
let chromium;
|
|
163
|
+
try {
|
|
164
|
+
chromium = require("playwright").chromium;
|
|
165
|
+
} catch {
|
|
166
|
+
throw new Error("Playwright not installed. Run: npm i -D playwright");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const browser = await chromium.launch({ headless: !opts.headed });
|
|
170
|
+
const context = await browser.newContext();
|
|
171
|
+
const page = await context.newPage();
|
|
172
|
+
|
|
173
|
+
// Inject fetch wrapper
|
|
174
|
+
await page.addInitScript(generateFetchWrapper());
|
|
175
|
+
|
|
176
|
+
// Navigate and interact
|
|
177
|
+
await page.goto(url, { waitUntil: "domcontentloaded" });
|
|
178
|
+
await page.waitForLoadState("networkidle", { timeout: 10000 }).catch(() => {});
|
|
179
|
+
|
|
180
|
+
// Click some interactive elements to trigger requests
|
|
181
|
+
const buttons = await page.locator("button, a[href^='/'], [role='button']").all();
|
|
182
|
+
for (const btn of buttons.slice(0, 10)) {
|
|
183
|
+
try {
|
|
184
|
+
await btn.click({ timeout: 1000 });
|
|
185
|
+
await page.waitForTimeout(500);
|
|
186
|
+
} catch {
|
|
187
|
+
// Ignore click failures
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Collect requests
|
|
192
|
+
const requests = await collectRequests(page);
|
|
193
|
+
|
|
194
|
+
await browser.close();
|
|
195
|
+
|
|
196
|
+
// Build runtime edges
|
|
197
|
+
return buildRuntimeEdges(requests, staticGraph);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function parseArgs(args) {
|
|
201
|
+
const opts = {
|
|
202
|
+
path: process.cwd(),
|
|
203
|
+
url: null,
|
|
204
|
+
runtime: false,
|
|
205
|
+
view: false,
|
|
206
|
+
broken: false,
|
|
207
|
+
jsonOnly: false,
|
|
208
|
+
headed: false,
|
|
209
|
+
fastifyEntry: null,
|
|
210
|
+
help: false,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
for (let i = 0; i < args.length; i++) {
|
|
214
|
+
const arg = args[i];
|
|
215
|
+
if (arg === "--build") continue; // Default behavior
|
|
216
|
+
else if (arg === "--runtime") opts.runtime = true;
|
|
217
|
+
else if (arg === "--url") opts.url = args[++i];
|
|
218
|
+
else if (arg === "--view") opts.view = true;
|
|
219
|
+
else if (arg === "--broken") opts.broken = true;
|
|
220
|
+
else if (arg === "--json") opts.jsonOnly = true;
|
|
221
|
+
else if (arg === "--headed") opts.headed = true;
|
|
222
|
+
else if (arg === "--fastify-entry") opts.fastifyEntry = args[++i];
|
|
223
|
+
else if (arg === "--path" || arg === "-p") opts.path = args[++i];
|
|
224
|
+
else if (arg === "--help" || arg === "-h") opts.help = true;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return opts;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function printHelp() {
|
|
231
|
+
console.log(`
|
|
232
|
+
${c.cyan}${c.bold}🔍 vibecheck graph${c.reset} - Reality Proof Graph
|
|
233
|
+
|
|
234
|
+
Build and visualize the complete causal chain from UI to database.
|
|
235
|
+
Identify broken edges that indicate missing routes, runtime failures, or causal contradictions.
|
|
236
|
+
|
|
237
|
+
${c.bold}USAGE${c.reset}
|
|
238
|
+
vibecheck graph ${c.dim}# Build static graph${c.reset}
|
|
239
|
+
vibecheck graph --runtime --url http://... ${c.dim}# Add runtime edges${c.reset}
|
|
240
|
+
vibecheck graph --view ${c.dim}# Open visualization${c.reset}
|
|
241
|
+
vibecheck graph --broken ${c.dim}# List broken edges${c.reset}
|
|
242
|
+
|
|
243
|
+
${c.bold}OPTIONS${c.reset}
|
|
244
|
+
--build Build static graph (default)
|
|
245
|
+
--runtime Collect runtime edges via Playwright
|
|
246
|
+
--url <url> Target URL for runtime collection
|
|
247
|
+
--view Open interactive HTML visualization
|
|
248
|
+
--broken Show only broken edges
|
|
249
|
+
--json Output JSON only (no HTML/Mermaid)
|
|
250
|
+
--headed Run browser in headed mode
|
|
251
|
+
--fastify-entry Fastify entry file (e.g. src/server.ts)
|
|
252
|
+
--path, -p Project path (default: current directory)
|
|
253
|
+
--help, -h Show this help
|
|
254
|
+
|
|
255
|
+
${c.bold}GRAPH NODES${c.reset}
|
|
256
|
+
• UI Action onClick, onSubmit, etc.
|
|
257
|
+
• Client Function Functions that make network calls
|
|
258
|
+
• Network Call fetch(), axios.*()
|
|
259
|
+
• Server Route Next API routes, Fastify routes
|
|
260
|
+
• Handler Route handler functions
|
|
261
|
+
• DB Call Prisma, raw SQL
|
|
262
|
+
• External Call Stripe, GitHub, etc.
|
|
263
|
+
|
|
264
|
+
${c.bold}BROKEN EDGE TYPES${c.reset}
|
|
265
|
+
• ${c.red}MissingRoute${c.reset} Route referenced but doesn't exist
|
|
266
|
+
• ${c.red}RuntimeFailure${c.reset} Route returns 4xx/5xx at runtime
|
|
267
|
+
• ${c.red}CausalContradiction${c.reset} UI shows success but server returned error
|
|
268
|
+
|
|
269
|
+
${c.bold}OUTPUT${c.reset}
|
|
270
|
+
.vibecheck/graph/
|
|
271
|
+
graph.json Machine-readable graph
|
|
272
|
+
graph.html Interactive D3 visualization
|
|
273
|
+
graph.mmd Mermaid diagram
|
|
274
|
+
broken-edges.json Broken edges as findings
|
|
275
|
+
|
|
276
|
+
${c.bold}EXAMPLES${c.reset}
|
|
277
|
+
vibecheck graph --view ${c.dim}# Build + open visualization${c.reset}
|
|
278
|
+
vibecheck graph --runtime --url http://localhost:3000 --view
|
|
279
|
+
vibecheck graph --broken --json ${c.dim}# CI mode: just broken edges${c.reset}
|
|
280
|
+
`);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
module.exports = { runGraph };
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
// Use enhanced wizard if available
|
|
5
|
+
let InitWizard;
|
|
6
|
+
try {
|
|
7
|
+
InitWizard = require("./lib/init-wizard").InitWizard;
|
|
8
|
+
} catch {
|
|
9
|
+
InitWizard = null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Enterprise init
|
|
13
|
+
let EnterpriseInit;
|
|
14
|
+
try {
|
|
15
|
+
EnterpriseInit = require("./lib/enterprise-init").EnterpriseInit;
|
|
16
|
+
} catch {
|
|
17
|
+
EnterpriseInit = null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function parseArgs(args) {
|
|
21
|
+
const out = {
|
|
22
|
+
path: ".",
|
|
23
|
+
gitHooks: false,
|
|
24
|
+
help: false,
|
|
25
|
+
quick: false,
|
|
26
|
+
// Enterprise options
|
|
27
|
+
enterprise: false,
|
|
28
|
+
ci: false, // true or "github" | "gitlab"
|
|
29
|
+
compliance: false, // true or "soc2" | "hipaa" | "gdpr" | "pci"
|
|
30
|
+
team: false,
|
|
31
|
+
mcp: false,
|
|
32
|
+
strict: false,
|
|
33
|
+
failOnWarn: false,
|
|
34
|
+
detect: false, // Just detect, don't write
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
for (let i = 0; i < args.length; i++) {
|
|
38
|
+
const a = args[i];
|
|
39
|
+
if (a.startsWith("--path=")) out.path = a.split("=")[1];
|
|
40
|
+
if (a === "--path" || a === "-p") out.path = args[++i];
|
|
41
|
+
if (a === "--git-hooks") out.gitHooks = true;
|
|
42
|
+
if (a === "--help" || a === "-h") out.help = true;
|
|
43
|
+
if (a === "--quick" || a === "-q") out.quick = true;
|
|
44
|
+
|
|
45
|
+
// Enterprise flags
|
|
46
|
+
if (a === "--enterprise" || a === "-e") out.enterprise = true;
|
|
47
|
+
if (a === "--ci") {
|
|
48
|
+
const next = args[i + 1];
|
|
49
|
+
if (next && !next.startsWith("-")) {
|
|
50
|
+
out.ci = args[++i];
|
|
51
|
+
} else {
|
|
52
|
+
out.ci = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (a === "--gha" || a === "--github-actions") out.ci = "github";
|
|
56
|
+
if (a === "--gitlab") out.ci = "gitlab";
|
|
57
|
+
if (a === "--compliance") {
|
|
58
|
+
const next = args[i + 1];
|
|
59
|
+
if (next && !next.startsWith("-")) {
|
|
60
|
+
out.compliance = args[++i];
|
|
61
|
+
} else {
|
|
62
|
+
out.compliance = true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (a === "--soc2") out.compliance = "soc2";
|
|
66
|
+
if (a === "--hipaa") out.compliance = "hipaa";
|
|
67
|
+
if (a === "--gdpr") out.compliance = "gdpr";
|
|
68
|
+
if (a === "--pci") out.compliance = "pci";
|
|
69
|
+
if (a === "--team") out.team = true;
|
|
70
|
+
if (a === "--mcp") out.mcp = true;
|
|
71
|
+
if (a === "--strict") out.strict = true;
|
|
72
|
+
if (a === "--fail-on-warn") out.failOnWarn = true;
|
|
73
|
+
if (a === "--detect") out.detect = true;
|
|
74
|
+
if (a === "--full") {
|
|
75
|
+
out.enterprise = true;
|
|
76
|
+
out.ci = true;
|
|
77
|
+
out.team = true;
|
|
78
|
+
out.mcp = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async function runInit(args) {
|
|
85
|
+
const opts = parseArgs(args);
|
|
86
|
+
|
|
87
|
+
if (opts.help) {
|
|
88
|
+
printHelp();
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const targetDir = path.resolve(opts.path);
|
|
93
|
+
|
|
94
|
+
// Enterprise mode - comprehensive setup
|
|
95
|
+
const useEnterprise = opts.enterprise || opts.ci || opts.compliance ||
|
|
96
|
+
opts.team || opts.mcp || opts.detect || opts.full;
|
|
97
|
+
|
|
98
|
+
if (EnterpriseInit && useEnterprise) {
|
|
99
|
+
const enterprise = new EnterpriseInit(targetDir, opts);
|
|
100
|
+
return await enterprise.run();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Detect-only mode (quick detection report)
|
|
104
|
+
if (opts.detect) {
|
|
105
|
+
const { detectAll } = require("./lib/enterprise-detect");
|
|
106
|
+
const detection = detectAll(targetDir);
|
|
107
|
+
console.log(JSON.stringify(detection, null, 2));
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Use wizard for interactive setup (unless --quick)
|
|
112
|
+
if (InitWizard && !opts.quick) {
|
|
113
|
+
const wizard = new InitWizard(targetDir, opts);
|
|
114
|
+
return await wizard.run();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Quick mode - legacy behavior
|
|
118
|
+
console.log("\n 🚀 vibecheck INIT\n");
|
|
119
|
+
|
|
120
|
+
// Create config file
|
|
121
|
+
const configPath = path.join(targetDir, ".vibecheckrc");
|
|
122
|
+
if (!fs.existsSync(configPath)) {
|
|
123
|
+
const defaultConfig = {
|
|
124
|
+
version: "1.0.0",
|
|
125
|
+
checks: ["integrity"],
|
|
126
|
+
output: ".vibecheck",
|
|
127
|
+
policy: {
|
|
128
|
+
allowlist: { domains: [], packages: [] },
|
|
129
|
+
ignore: { paths: ["node_modules", "__tests__", "*.test.*"] },
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2));
|
|
133
|
+
console.log(" ✅ Created .vibecheckrc");
|
|
134
|
+
} else {
|
|
135
|
+
console.log(" ⚠️ .vibecheckrc already exists");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Create output directory
|
|
139
|
+
const outputDir = path.join(targetDir, ".vibecheck");
|
|
140
|
+
if (!fs.existsSync(outputDir)) {
|
|
141
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
142
|
+
console.log(" ✅ Created .vibecheck/");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Install git hooks if requested
|
|
146
|
+
if (opts.gitHooks) {
|
|
147
|
+
const huskyDir = path.join(targetDir, ".husky");
|
|
148
|
+
if (!fs.existsSync(huskyDir)) {
|
|
149
|
+
fs.mkdirSync(huskyDir, { recursive: true });
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const prePushHook = `#!/usr/bin/env sh
|
|
153
|
+
. "$(dirname -- "$0")/_/husky.sh"
|
|
154
|
+
|
|
155
|
+
echo "🚦 Running vibecheck gate..."
|
|
156
|
+
npx vibecheck gate
|
|
157
|
+
|
|
158
|
+
if [ $? -ne 0 ]; then
|
|
159
|
+
echo "❌ Push blocked: Gate failed!"
|
|
160
|
+
exit 1
|
|
161
|
+
fi
|
|
162
|
+
`;
|
|
163
|
+
fs.writeFileSync(path.join(huskyDir, "pre-push"), prePushHook, {
|
|
164
|
+
mode: 0o755,
|
|
165
|
+
});
|
|
166
|
+
console.log(" ✅ Installed git pre-push hook");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Add to .gitignore
|
|
170
|
+
const gitignorePath = path.join(targetDir, ".gitignore");
|
|
171
|
+
if (fs.existsSync(gitignorePath)) {
|
|
172
|
+
let gitignore = fs.readFileSync(gitignorePath, "utf-8");
|
|
173
|
+
if (!gitignore.includes(".vibecheck/")) {
|
|
174
|
+
gitignore += "\n# vibecheck\n.vibecheck/\n";
|
|
175
|
+
fs.writeFileSync(gitignorePath, gitignore);
|
|
176
|
+
console.log(" ✅ Added .vibecheck/ to .gitignore");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
console.log("\n ✅ vibecheck initialized!\n");
|
|
181
|
+
console.log(" Next steps:");
|
|
182
|
+
console.log(" 1. Run: vibecheck scan");
|
|
183
|
+
console.log(" 2. Review: .vibecheck/report.html");
|
|
184
|
+
console.log(" 3. Fix issues and re-scan\n");
|
|
185
|
+
|
|
186
|
+
return 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function printHelp() {
|
|
190
|
+
console.log(`
|
|
191
|
+
\x1b[1m\x1b[36m⚡ vibecheck init\x1b[0m — Enterprise Project Setup
|
|
192
|
+
|
|
193
|
+
\x1b[2mConfigure your project for production-grade verification.\x1b[0m
|
|
194
|
+
|
|
195
|
+
\x1b[1mUSAGE\x1b[0m
|
|
196
|
+
vibecheck init Interactive setup wizard
|
|
197
|
+
vibecheck init --enterprise Full enterprise configuration
|
|
198
|
+
vibecheck init --full Everything: CI, team, MCP, security
|
|
199
|
+
|
|
200
|
+
\x1b[1mBASIC OPTIONS\x1b[0m
|
|
201
|
+
--path, -p <dir> Project path (default: current directory)
|
|
202
|
+
--quick, -q Skip wizard, use defaults
|
|
203
|
+
--git-hooks Install git pre-push hook
|
|
204
|
+
--help, -h Show this help
|
|
205
|
+
|
|
206
|
+
\x1b[1m\x1b[35mENTERPRISE OPTIONS\x1b[0m
|
|
207
|
+
--enterprise, -e Enable enterprise mode (detection + config)
|
|
208
|
+
--full All enterprise features (CI + team + MCP)
|
|
209
|
+
--detect Detection only (JSON output, no writes)
|
|
210
|
+
|
|
211
|
+
\x1b[1m\x1b[33mCI/CD INTEGRATION\x1b[0m
|
|
212
|
+
--ci [provider] Setup CI/CD (auto-detects if no provider)
|
|
213
|
+
--gha GitHub Actions workflow
|
|
214
|
+
--gitlab GitLab CI configuration
|
|
215
|
+
--fail-on-warn CI fails on WARN (default: only BLOCK)
|
|
216
|
+
|
|
217
|
+
\x1b[1m\x1b[32mCOMPLIANCE TEMPLATES\x1b[0m
|
|
218
|
+
--compliance [type] Generate compliance templates
|
|
219
|
+
--soc2 SOC 2 Type II baseline
|
|
220
|
+
--hipaa HIPAA compliance baseline
|
|
221
|
+
--gdpr GDPR compliance baseline
|
|
222
|
+
--pci PCI-DSS compliance baseline
|
|
223
|
+
|
|
224
|
+
\x1b[1m\x1b[34mTEAM & SECURITY\x1b[0m
|
|
225
|
+
--team Generate team configuration (multi-env)
|
|
226
|
+
--mcp Generate MCP server config (AI agents)
|
|
227
|
+
--strict Enable strict mode (zero tolerance)
|
|
228
|
+
|
|
229
|
+
\x1b[1mCREATED FILES\x1b[0m
|
|
230
|
+
.vibecheck/config.json Main configuration
|
|
231
|
+
.vibecheck/invariants.yml Ship killers & warnings
|
|
232
|
+
.vibecheck/security-policy.json Security headers, CORS, rate limits
|
|
233
|
+
.vibecheck/schemas/ JSON validation schemas
|
|
234
|
+
.vibecheck/team.json Team/environment config (--team)
|
|
235
|
+
.vibecheck/mcp.json MCP server config (--mcp)
|
|
236
|
+
.vibecheck/compliance/ Compliance templates (--compliance)
|
|
237
|
+
.github/workflows/vibecheck.yml GitHub Actions (--gha)
|
|
238
|
+
|
|
239
|
+
\x1b[1mEXAMPLES\x1b[0m
|
|
240
|
+
vibecheck init # Interactive wizard
|
|
241
|
+
vibecheck init --enterprise # Enterprise config
|
|
242
|
+
vibecheck init --full # Everything
|
|
243
|
+
vibecheck init --gha # + GitHub Actions
|
|
244
|
+
vibecheck init --gha --fail-on-warn # Strict CI
|
|
245
|
+
vibecheck init --soc2 # + SOC 2 compliance
|
|
246
|
+
vibecheck init --enterprise --team # + Team environments
|
|
247
|
+
vibecheck init --detect # Detection report only
|
|
248
|
+
|
|
249
|
+
\x1b[1mDETECTION INCLUDES\x1b[0m
|
|
250
|
+
Frameworks Next.js, Remix, Nuxt, SvelteKit, React, Vue, Fastify, Express, NestJS, Hono
|
|
251
|
+
Databases Prisma, Drizzle, Mongoose, Supabase, Firebase, Redis
|
|
252
|
+
Auth NextAuth, Clerk, Auth0, Lucia, Passport
|
|
253
|
+
Payments Stripe, Lemon Squeezy, Paddle
|
|
254
|
+
CI/CD GitHub Actions, GitLab CI, CircleCI, Jenkins
|
|
255
|
+
Deploy Vercel, Netlify, Railway, Render, Fly.io, Docker, Kubernetes
|
|
256
|
+
Testing Jest, Vitest, Playwright, Cypress
|
|
257
|
+
`);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
module.exports = { runInit };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// bin/runners/runInitGha.js
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
function ensureDir(p) {
|
|
6
|
+
fs.mkdirSync(p, { recursive: true });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function workflowYaml({ packageRunner = "npx vibecheck", failOnWarn = false } = {}) {
|
|
10
|
+
return `name: vibecheck
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
pull_request:
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
pull-requests: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
vibecheck:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: 20
|
|
28
|
+
|
|
29
|
+
- name: Install deps (auto)
|
|
30
|
+
run: |
|
|
31
|
+
set -e
|
|
32
|
+
if [ -f pnpm-lock.yaml ]; then
|
|
33
|
+
corepack enable
|
|
34
|
+
pnpm install --frozen-lockfile
|
|
35
|
+
elif [ -f package-lock.json ]; then
|
|
36
|
+
npm ci
|
|
37
|
+
elif [ -f yarn.lock ]; then
|
|
38
|
+
corepack enable
|
|
39
|
+
yarn install --frozen-lockfile
|
|
40
|
+
else
|
|
41
|
+
npm install
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
- name: vibecheck pr (generate comment)
|
|
45
|
+
id: vc
|
|
46
|
+
run: |
|
|
47
|
+
set +e
|
|
48
|
+
mkdir -p .vibecheck
|
|
49
|
+
${packageRunner} pr --out .vibecheck/pr_comment.md ${failOnWarn ? "--fail-on-warn" : ""}
|
|
50
|
+
code=$?
|
|
51
|
+
echo "code=$code" >> $GITHUB_OUTPUT
|
|
52
|
+
echo "---- vibecheck exit code: $code ----"
|
|
53
|
+
exit 0
|
|
54
|
+
|
|
55
|
+
- name: Post PR comment
|
|
56
|
+
uses: actions/github-script@v7
|
|
57
|
+
with:
|
|
58
|
+
script: |
|
|
59
|
+
const fs = require('fs');
|
|
60
|
+
const body = fs.readFileSync('.vibecheck/pr_comment.md', 'utf8');
|
|
61
|
+
const pr = context.payload.pull_request;
|
|
62
|
+
if (!pr) { core.warning('No pull_request in context; skipping comment'); return; }
|
|
63
|
+
await github.rest.issues.createComment({
|
|
64
|
+
owner: context.repo.owner,
|
|
65
|
+
repo: context.repo.repo,
|
|
66
|
+
issue_number: pr.number,
|
|
67
|
+
body
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
- name: Enforce verdict
|
|
71
|
+
run: |
|
|
72
|
+
code="\${{ steps.vc.outputs.code }}"
|
|
73
|
+
echo "vibecheck code=$code"
|
|
74
|
+
if [ "$code" = "0" ]; then
|
|
75
|
+
echo "SHIP/WARN allowed."
|
|
76
|
+
exit 0
|
|
77
|
+
fi
|
|
78
|
+
if [ "$code" = "1" ]; then
|
|
79
|
+
echo "WARN failing (policy)."
|
|
80
|
+
exit 1
|
|
81
|
+
fi
|
|
82
|
+
echo "BLOCK failing."
|
|
83
|
+
exit 1
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function runInitGha({ repoRoot, failOnWarn = false } = {}) {
|
|
88
|
+
const root = repoRoot || process.cwd();
|
|
89
|
+
const wfDir = path.join(root, ".github", "workflows");
|
|
90
|
+
ensureDir(wfDir);
|
|
91
|
+
|
|
92
|
+
const wfPath = path.join(wfDir, "vibecheck.yml");
|
|
93
|
+
fs.writeFileSync(wfPath, workflowYaml({ failOnWarn }), "utf8");
|
|
94
|
+
|
|
95
|
+
console.log(`✅ Wrote: ${path.relative(root, wfPath).replace(/\\/g, "/")}`);
|
|
96
|
+
console.log(`\nNotes:`);
|
|
97
|
+
console.log(`- If your CLI isn't called via "npx vibecheck", edit the workflow line.`);
|
|
98
|
+
console.log(`- Set VIBECHECK_API_KEY as a GitHub Actions secret for cloud features.`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = { runInitGha };
|