@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,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vibecheck ctx guard - Context Contracts Guard
|
|
3
|
+
*
|
|
4
|
+
* CI gate that validates code against contracts.
|
|
5
|
+
* Blocks if:
|
|
6
|
+
* - New route usage not declared
|
|
7
|
+
* - Env var used not declared
|
|
8
|
+
* - Protected matcher changes without proof
|
|
9
|
+
* - Webhook without verification
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
const path = require("path");
|
|
15
|
+
const fs = require("fs");
|
|
16
|
+
const { buildTruthpack, loadTruthpack } = require("./lib/truth");
|
|
17
|
+
const {
|
|
18
|
+
loadContracts,
|
|
19
|
+
guardContracts,
|
|
20
|
+
getGuardSummary,
|
|
21
|
+
formatGuardResult
|
|
22
|
+
} = require("./lib/contracts");
|
|
23
|
+
|
|
24
|
+
const c = {
|
|
25
|
+
reset: '\x1b[0m',
|
|
26
|
+
bold: '\x1b[1m',
|
|
27
|
+
dim: '\x1b[2m',
|
|
28
|
+
green: '\x1b[32m',
|
|
29
|
+
yellow: '\x1b[33m',
|
|
30
|
+
cyan: '\x1b[36m',
|
|
31
|
+
red: '\x1b[31m',
|
|
32
|
+
blue: '\x1b[34m',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
async function runCtxGuard(opts = {}) {
|
|
36
|
+
const root = path.resolve(opts.repoRoot || process.cwd());
|
|
37
|
+
|
|
38
|
+
console.log(`\n${c.cyan}${c.bold}đĄī¸ vibecheck ctx guard${c.reset}`);
|
|
39
|
+
console.log(`${c.dim}Validating code against contracts...${c.reset}\n`);
|
|
40
|
+
|
|
41
|
+
// Load contracts
|
|
42
|
+
const contracts = loadContracts(root);
|
|
43
|
+
|
|
44
|
+
if (Object.keys(contracts).length === 0) {
|
|
45
|
+
console.log(`${c.yellow}â ī¸ No contracts found${c.reset}`);
|
|
46
|
+
console.log(`${c.dim}Run 'vibecheck ctx sync' first to generate contracts${c.reset}\n`);
|
|
47
|
+
return opts.failOnMissing ? 2 : 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Load or build truthpack
|
|
51
|
+
let truthpack = loadTruthpack(root);
|
|
52
|
+
if (!truthpack) {
|
|
53
|
+
console.log(`${c.dim}Building truthpack...${c.reset}`);
|
|
54
|
+
truthpack = await buildTruthpack({ repoRoot: root, fastifyEntry: opts.fastifyEntry });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Run guard validation
|
|
58
|
+
const guardResult = guardContracts(contracts, truthpack, {
|
|
59
|
+
realityResults: opts.realityResults
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const summary = getGuardSummary(guardResult);
|
|
63
|
+
|
|
64
|
+
// Print results
|
|
65
|
+
console.log(`${c.bold}Contracts Loaded:${c.reset}`);
|
|
66
|
+
if (contracts.routes) console.log(` â routes.json (${contracts.routes.routes?.length || 0} routes)`);
|
|
67
|
+
if (contracts.env) console.log(` â env.json (${contracts.env.vars?.length || 0} vars)`);
|
|
68
|
+
if (contracts.auth) console.log(` â auth.json (${contracts.auth.protectedPatterns?.length || 0} patterns)`);
|
|
69
|
+
if (contracts.external) console.log(` â external.json (${contracts.external.services?.length || 0} services)`);
|
|
70
|
+
|
|
71
|
+
console.log("");
|
|
72
|
+
console.log(formatGuardResult(guardResult));
|
|
73
|
+
|
|
74
|
+
// Print verdict
|
|
75
|
+
console.log("");
|
|
76
|
+
if (summary.verdict === "PASS") {
|
|
77
|
+
console.log(`${c.green}â
PASS${c.reset} - All contracts satisfied`);
|
|
78
|
+
} else if (summary.verdict === "WARN") {
|
|
79
|
+
console.log(`${c.yellow}â ī¸ WARN${c.reset} - ${summary.summary.warns} warnings`);
|
|
80
|
+
} else {
|
|
81
|
+
console.log(`${c.red}đ BLOCK${c.reset} - ${summary.summary.blocks} violations`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// JSON output for CI
|
|
85
|
+
if (opts.json) {
|
|
86
|
+
const jsonPath = path.join(root, ".vibecheck", "guard-result.json");
|
|
87
|
+
fs.mkdirSync(path.dirname(jsonPath), { recursive: true });
|
|
88
|
+
fs.writeFileSync(jsonPath, JSON.stringify(summary, null, 2), "utf8");
|
|
89
|
+
console.log(`\n${c.dim}JSON output: .vibecheck/guard-result.json${c.reset}`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log("");
|
|
93
|
+
|
|
94
|
+
// Return appropriate exit code
|
|
95
|
+
if (opts.failOnWarn && summary.verdict === "WARN") {
|
|
96
|
+
return 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return summary.exitCode;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function parseArgs(args) {
|
|
103
|
+
const opts = {
|
|
104
|
+
repoRoot: process.cwd(),
|
|
105
|
+
fastifyEntry: null,
|
|
106
|
+
json: false,
|
|
107
|
+
failOnWarn: false,
|
|
108
|
+
failOnMissing: false,
|
|
109
|
+
help: false
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
for (let i = 0; i < args.length; i++) {
|
|
113
|
+
const arg = args[i];
|
|
114
|
+
if (arg === "--json") opts.json = true;
|
|
115
|
+
else if (arg === "--fail-on-warn") opts.failOnWarn = true;
|
|
116
|
+
else if (arg === "--fail-on-missing") opts.failOnMissing = true;
|
|
117
|
+
else if (arg === "--fastify-entry") opts.fastifyEntry = args[++i];
|
|
118
|
+
else if (arg === "--path" || arg === "-p") opts.repoRoot = args[++i];
|
|
119
|
+
else if (arg === "--help" || arg === "-h") opts.help = true;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return opts;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function printHelp() {
|
|
126
|
+
console.log(`
|
|
127
|
+
${c.cyan}${c.bold}đĄī¸ vibecheck ctx guard${c.reset} - Contract Guard (CI Gate)
|
|
128
|
+
|
|
129
|
+
Validates current code against contracts. Use in CI to block drift.
|
|
130
|
+
|
|
131
|
+
${c.bold}USAGE${c.reset}
|
|
132
|
+
vibecheck ctx guard ${c.dim}# Validate against contracts${c.reset}
|
|
133
|
+
vibecheck ctx guard --json ${c.dim}# Output JSON for CI${c.reset}
|
|
134
|
+
vibecheck ctx guard --fail-on-warn ${c.dim}# Exit 1 on warnings${c.reset}
|
|
135
|
+
|
|
136
|
+
${c.bold}OPTIONS${c.reset}
|
|
137
|
+
--json Output JSON result to .vibecheck/guard-result.json
|
|
138
|
+
--fail-on-warn Exit 1 on warnings (default: only blocks)
|
|
139
|
+
--fail-on-missing Exit 2 if no contracts exist
|
|
140
|
+
--fastify-entry Fastify entry file (e.g. src/server.ts)
|
|
141
|
+
--path, -p Project path (default: current directory)
|
|
142
|
+
--help, -h Show this help
|
|
143
|
+
|
|
144
|
+
${c.bold}VIOLATIONS (BLOCK)${c.reset}
|
|
145
|
+
âĸ Route used in code but not in routes.json
|
|
146
|
+
âĸ Webhook without signature verification
|
|
147
|
+
âĸ Protected route accessible anonymously
|
|
148
|
+
|
|
149
|
+
${c.bold}WARNINGS${c.reset}
|
|
150
|
+
âĸ Env var used but not in env.json
|
|
151
|
+
âĸ Required env var not used
|
|
152
|
+
âĸ Undeclared external service
|
|
153
|
+
|
|
154
|
+
${c.bold}EXIT CODES${c.reset}
|
|
155
|
+
0 = PASS (or WARN without --fail-on-warn)
|
|
156
|
+
1 = WARN (with --fail-on-warn)
|
|
157
|
+
2 = BLOCK
|
|
158
|
+
|
|
159
|
+
${c.bold}EXAMPLES${c.reset}
|
|
160
|
+
vibecheck ctx guard ${c.dim}# Local validation${c.reset}
|
|
161
|
+
vibecheck ctx guard --json --fail-on-warn ${c.dim}# CI mode${c.reset}
|
|
162
|
+
`);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async function main(args) {
|
|
166
|
+
const opts = parseArgs(args);
|
|
167
|
+
|
|
168
|
+
if (opts.help) {
|
|
169
|
+
printHelp();
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return runCtxGuard(opts);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
module.exports = { runCtxGuard, main };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vibecheck ctx sync - Context Contracts Sync
|
|
3
|
+
*
|
|
4
|
+
* Generates/updates contracts from truthpack:
|
|
5
|
+
* - routes.json
|
|
6
|
+
* - env.json
|
|
7
|
+
* - auth.json
|
|
8
|
+
* - external.json
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const fs = require("fs");
|
|
15
|
+
const { buildTruthpack, loadTruthpack } = require("./lib/truth");
|
|
16
|
+
const {
|
|
17
|
+
buildAllContracts,
|
|
18
|
+
loadContracts,
|
|
19
|
+
saveContracts,
|
|
20
|
+
diffAllContracts,
|
|
21
|
+
hasContractChanges
|
|
22
|
+
} = require("./lib/contracts");
|
|
23
|
+
|
|
24
|
+
const c = {
|
|
25
|
+
reset: '\x1b[0m',
|
|
26
|
+
bold: '\x1b[1m',
|
|
27
|
+
dim: '\x1b[2m',
|
|
28
|
+
green: '\x1b[32m',
|
|
29
|
+
yellow: '\x1b[33m',
|
|
30
|
+
cyan: '\x1b[36m',
|
|
31
|
+
red: '\x1b[31m',
|
|
32
|
+
blue: '\x1b[34m',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
async function runCtxSync(opts = {}) {
|
|
36
|
+
const root = path.resolve(opts.repoRoot || process.cwd());
|
|
37
|
+
const contractDir = path.join(root, ".vibecheck", "contracts");
|
|
38
|
+
|
|
39
|
+
console.log(`\n${c.cyan}${c.bold}đ vibecheck ctx sync${c.reset}`);
|
|
40
|
+
console.log(`${c.dim}Syncing contracts from truthpack...${c.reset}\n`);
|
|
41
|
+
|
|
42
|
+
// Load or build truthpack
|
|
43
|
+
let truthpack = loadTruthpack(root);
|
|
44
|
+
if (!truthpack) {
|
|
45
|
+
console.log(`${c.dim}Building truthpack...${c.reset}`);
|
|
46
|
+
truthpack = await buildTruthpack({ repoRoot: root, fastifyEntry: opts.fastifyEntry });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Load existing contracts for diff
|
|
50
|
+
const existingContracts = loadContracts(root);
|
|
51
|
+
const hasExisting = Object.keys(existingContracts).length > 0;
|
|
52
|
+
|
|
53
|
+
// Build new contracts
|
|
54
|
+
const newContracts = buildAllContracts(truthpack);
|
|
55
|
+
|
|
56
|
+
// Calculate diff
|
|
57
|
+
let diff = null;
|
|
58
|
+
if (hasExisting) {
|
|
59
|
+
diff = diffAllContracts(existingContracts, newContracts);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Save contracts
|
|
63
|
+
saveContracts(root, newContracts);
|
|
64
|
+
|
|
65
|
+
// Print summary
|
|
66
|
+
console.log(`${c.bold}Contracts saved to:${c.reset} .vibecheck/contracts/\n`);
|
|
67
|
+
|
|
68
|
+
console.log(`${c.bold}Routes Contract${c.reset}`);
|
|
69
|
+
console.log(` Routes: ${newContracts.routes.routes.length}`);
|
|
70
|
+
if (diff?.routes) {
|
|
71
|
+
if (diff.routes.added?.length) console.log(` ${c.green}+${diff.routes.added.length} added${c.reset}`);
|
|
72
|
+
if (diff.routes.removed?.length) console.log(` ${c.red}-${diff.routes.removed.length} removed${c.reset}`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
console.log(`\n${c.bold}Env Contract${c.reset}`);
|
|
76
|
+
console.log(` Variables: ${newContracts.env.vars.length}`);
|
|
77
|
+
const required = newContracts.env.vars.filter(v => v.required).length;
|
|
78
|
+
console.log(` Required: ${required}`);
|
|
79
|
+
if (diff?.env) {
|
|
80
|
+
if (diff.env.added?.length) console.log(` ${c.green}+${diff.env.added.length} added${c.reset}`);
|
|
81
|
+
if (diff.env.removed?.length) console.log(` ${c.red}-${diff.env.removed.length} removed${c.reset}`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
console.log(`\n${c.bold}Auth Contract${c.reset}`);
|
|
85
|
+
console.log(` Protected patterns: ${newContracts.auth.protectedPatterns.length}`);
|
|
86
|
+
console.log(` Roles: ${newContracts.auth.roles.length}`);
|
|
87
|
+
if (diff?.auth) {
|
|
88
|
+
if (diff.auth.protectedAdded?.length) console.log(` ${c.green}+${diff.auth.protectedAdded.length} patterns added${c.reset}`);
|
|
89
|
+
if (diff.auth.protectedRemoved?.length) console.log(` ${c.red}-${diff.auth.protectedRemoved.length} patterns removed${c.reset}`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
console.log(`\n${c.bold}External Contract${c.reset}`);
|
|
93
|
+
console.log(` Services: ${newContracts.external.services.length}`);
|
|
94
|
+
for (const svc of newContracts.external.services) {
|
|
95
|
+
console.log(` - ${svc.name} (${svc.envVars.length} env vars)`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Print files created
|
|
99
|
+
console.log(`\n${c.bold}Files:${c.reset}`);
|
|
100
|
+
console.log(` ${c.dim}routes.json${c.reset} Route definitions + auth requirements`);
|
|
101
|
+
console.log(` ${c.dim}env.json${c.reset} Environment variable contract`);
|
|
102
|
+
console.log(` ${c.dim}auth.json${c.reset} Authentication patterns + roles`);
|
|
103
|
+
console.log(` ${c.dim}external.json${c.reset} External service integrations`);
|
|
104
|
+
|
|
105
|
+
if (hasExisting && hasContractChanges(diff)) {
|
|
106
|
+
console.log(`\n${c.yellow}â ī¸ Contracts changed since last sync${c.reset}`);
|
|
107
|
+
console.log(`${c.dim}Run 'vibecheck ctx diff' to see detailed changes${c.reset}`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log(`\n${c.green}â${c.reset} Contracts synced successfully`);
|
|
111
|
+
console.log(`${c.dim}Run 'vibecheck ctx guard' to validate code against contracts${c.reset}\n`);
|
|
112
|
+
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
module.exports = { runCtxSync };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Stub: runDashboard.js
|
|
2
|
+
async function runDashboard(args) {
|
|
3
|
+
console.log("Dashboard command not yet implemented");
|
|
4
|
+
return 0;
|
|
5
|
+
}
|
|
6
|
+
async function runDemo(args) {
|
|
7
|
+
console.log("Demo command not yet implemented");
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
module.exports = { runDashboard, runDemo };
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
// Use Enterprise Doctor Service
|
|
5
|
+
let DoctorService;
|
|
6
|
+
try {
|
|
7
|
+
DoctorService = require("./lib/doctor").DoctorService;
|
|
8
|
+
} catch {
|
|
9
|
+
// Fallback to legacy implementations
|
|
10
|
+
try {
|
|
11
|
+
DoctorService = require("./lib/doctor-v2").DoctorV2;
|
|
12
|
+
} catch {
|
|
13
|
+
DoctorService = require("./lib/doctor-enhanced").DoctorEnhanced;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function runDoctor(args) {
|
|
18
|
+
const opts = parseArgs(args);
|
|
19
|
+
|
|
20
|
+
if (opts.help) {
|
|
21
|
+
printHelp();
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const projectPath = path.resolve(opts.path || process.cwd());
|
|
26
|
+
|
|
27
|
+
// Use new DoctorService if available
|
|
28
|
+
if (DoctorService.name === 'DoctorService') {
|
|
29
|
+
const doctor = new DoctorService(projectPath, {
|
|
30
|
+
json: opts.json,
|
|
31
|
+
fix: opts.fix,
|
|
32
|
+
fixDryRun: opts.dryRun,
|
|
33
|
+
quiet: opts.quiet,
|
|
34
|
+
verbose: opts.verbose,
|
|
35
|
+
categories: opts.categories,
|
|
36
|
+
skipNetwork: opts.skipNetwork,
|
|
37
|
+
saveReport: opts.saveReport,
|
|
38
|
+
failOnWarn: opts.failOnWarn,
|
|
39
|
+
});
|
|
40
|
+
return await doctor.run();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Legacy fallback
|
|
44
|
+
const doctor = new DoctorService(projectPath, opts);
|
|
45
|
+
return await doctor.diagnose();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function parseArgs(args) {
|
|
49
|
+
const opts = {
|
|
50
|
+
path: process.cwd(),
|
|
51
|
+
help: false,
|
|
52
|
+
json: false,
|
|
53
|
+
fix: false,
|
|
54
|
+
dryRun: false,
|
|
55
|
+
quiet: false,
|
|
56
|
+
verbose: false,
|
|
57
|
+
categories: null,
|
|
58
|
+
skipNetwork: false,
|
|
59
|
+
saveReport: true,
|
|
60
|
+
failOnWarn: false,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
for (let i = 0; i < args.length; i++) {
|
|
64
|
+
const arg = args[i];
|
|
65
|
+
switch (arg) {
|
|
66
|
+
case '--help':
|
|
67
|
+
case '-h':
|
|
68
|
+
opts.help = true;
|
|
69
|
+
break;
|
|
70
|
+
case '--path':
|
|
71
|
+
case '-p':
|
|
72
|
+
opts.path = args[++i];
|
|
73
|
+
break;
|
|
74
|
+
case '--json':
|
|
75
|
+
opts.json = true;
|
|
76
|
+
break;
|
|
77
|
+
case '--fix':
|
|
78
|
+
opts.fix = true;
|
|
79
|
+
break;
|
|
80
|
+
case '--dry-run':
|
|
81
|
+
opts.dryRun = true;
|
|
82
|
+
break;
|
|
83
|
+
case '--quiet':
|
|
84
|
+
case '-q':
|
|
85
|
+
opts.quiet = true;
|
|
86
|
+
break;
|
|
87
|
+
case '--verbose':
|
|
88
|
+
case '-v':
|
|
89
|
+
opts.verbose = true;
|
|
90
|
+
break;
|
|
91
|
+
case '--category':
|
|
92
|
+
case '-c':
|
|
93
|
+
if (!opts.categories) opts.categories = [];
|
|
94
|
+
opts.categories.push(args[++i]);
|
|
95
|
+
break;
|
|
96
|
+
case '--skip-network':
|
|
97
|
+
opts.skipNetwork = true;
|
|
98
|
+
break;
|
|
99
|
+
case '--no-report':
|
|
100
|
+
opts.saveReport = false;
|
|
101
|
+
break;
|
|
102
|
+
case '--fail-on-warn':
|
|
103
|
+
opts.failOnWarn = true;
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
if (!arg.startsWith('-')) {
|
|
107
|
+
opts.path = path.resolve(arg);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return opts;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function printHelp() {
|
|
116
|
+
console.log(`
|
|
117
|
+
${'\x1b[36m'}đŠē vibecheck doctor${'\x1b[0m'} â Enterprise Environment Diagnostics
|
|
118
|
+
|
|
119
|
+
Comprehensive environment checks with auto-fix capability.
|
|
120
|
+
|
|
121
|
+
${'\x1b[1m'}Usage:${'\x1b[0m'} vibecheck doctor [options] [path]
|
|
122
|
+
|
|
123
|
+
${'\x1b[1m'}Options:${'\x1b[0m'}
|
|
124
|
+
--path, -p <path> Project path (default: current directory)
|
|
125
|
+
--json Output JSON report only
|
|
126
|
+
--fix Auto-fix issues when possible
|
|
127
|
+
--dry-run Show what fixes would be applied
|
|
128
|
+
--quiet, -q Minimal output
|
|
129
|
+
--verbose, -v Show detailed output and fix commands
|
|
130
|
+
--category, -c <cat> Run specific category (can repeat)
|
|
131
|
+
--skip-network Skip network connectivity checks
|
|
132
|
+
--no-report Don't save report files
|
|
133
|
+
--fail-on-warn Exit code 2 for warnings (CI mode)
|
|
134
|
+
--help, -h Show this help
|
|
135
|
+
|
|
136
|
+
${'\x1b[1m'}Categories:${'\x1b[0m'}
|
|
137
|
+
system OS, memory, disk, CPU
|
|
138
|
+
runtime Node.js, npm, package managers
|
|
139
|
+
project package.json, dependencies, TypeScript
|
|
140
|
+
dependencies Outdated packages, vulnerabilities
|
|
141
|
+
security Secrets, gitignore, env files
|
|
142
|
+
network Internet, npm registry, API connectivity
|
|
143
|
+
vibecheck Config, truth pack, scan status
|
|
144
|
+
|
|
145
|
+
${'\x1b[1m'}Examples:${'\x1b[0m'}
|
|
146
|
+
vibecheck doctor # Full diagnostic
|
|
147
|
+
vibecheck doctor --json # JSON output for CI
|
|
148
|
+
vibecheck doctor --fix # Auto-fix issues
|
|
149
|
+
vibecheck doctor -c security # Security checks only
|
|
150
|
+
vibecheck doctor --skip-network # Skip slow network checks
|
|
151
|
+
|
|
152
|
+
${'\x1b[1m'}Exit Codes:${'\x1b[0m'}
|
|
153
|
+
0 = Healthy (or warnings without --fail-on-warn)
|
|
154
|
+
1 = Errors found
|
|
155
|
+
2 = Warnings found (with --fail-on-warn)
|
|
156
|
+
3 = Critical issues found
|
|
157
|
+
`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Legacy function for backwards compatibility
|
|
161
|
+
function runDoctorLegacy() {
|
|
162
|
+
console.log("\n đŠē vibecheck DOCTOR\n");
|
|
163
|
+
|
|
164
|
+
const checks = [];
|
|
165
|
+
|
|
166
|
+
// Node version
|
|
167
|
+
const nodeVersion = process.version;
|
|
168
|
+
const nodeMajor = parseInt(nodeVersion.slice(1).split(".")[0], 10);
|
|
169
|
+
checks.push({
|
|
170
|
+
name: "Node.js",
|
|
171
|
+
status: nodeMajor >= 18 ? "pass" : "fail",
|
|
172
|
+
message: `${nodeVersion}`,
|
|
173
|
+
fix: nodeMajor < 18 ? "Upgrade to Node.js 18+" : null,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// Config file
|
|
177
|
+
const configPath = path.join(process.cwd(), ".vibecheckrc");
|
|
178
|
+
const hasConfig =
|
|
179
|
+
fs.existsSync(configPath) ||
|
|
180
|
+
fs.existsSync(path.join(process.cwd(), ".vibecheckrc"));
|
|
181
|
+
checks.push({
|
|
182
|
+
name: "Config",
|
|
183
|
+
status: hasConfig ? "pass" : "warn",
|
|
184
|
+
message: hasConfig ? "Found" : "Not found",
|
|
185
|
+
fix: !hasConfig ? "Run: vibecheck init" : null,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Output directory
|
|
189
|
+
const outputDir = path.join(process.cwd(), ".vibecheck");
|
|
190
|
+
const hasOutput = fs.existsSync(outputDir);
|
|
191
|
+
checks.push({
|
|
192
|
+
name: "Output Dir",
|
|
193
|
+
status: hasOutput ? "pass" : "info",
|
|
194
|
+
message: hasOutput ? ".vibecheck/" : "Will be created on first scan",
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// Package.json
|
|
198
|
+
const pkgPath = path.join(process.cwd(), "package.json");
|
|
199
|
+
const hasPkg = fs.existsSync(pkgPath);
|
|
200
|
+
checks.push({
|
|
201
|
+
name: "package.json",
|
|
202
|
+
status: hasPkg ? "pass" : "warn",
|
|
203
|
+
message: hasPkg ? "Found" : "Not found",
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// TypeScript
|
|
207
|
+
const hasTsConfig = fs.existsSync(path.join(process.cwd(), "tsconfig.json"));
|
|
208
|
+
checks.push({
|
|
209
|
+
name: "TypeScript",
|
|
210
|
+
status: hasTsConfig ? "pass" : "info",
|
|
211
|
+
message: hasTsConfig ? "Enabled" : "JavaScript project",
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// Print results
|
|
215
|
+
let hasIssues = false;
|
|
216
|
+
for (const check of checks) {
|
|
217
|
+
const icon =
|
|
218
|
+
check.status === "pass"
|
|
219
|
+
? "â
"
|
|
220
|
+
: check.status === "fail"
|
|
221
|
+
? "â"
|
|
222
|
+
: check.status === "warn"
|
|
223
|
+
? "â ī¸"
|
|
224
|
+
: "âšī¸";
|
|
225
|
+
console.log(` ${icon} ${check.name.padEnd(12)} ${check.message}`);
|
|
226
|
+
if (check.fix) {
|
|
227
|
+
console.log(` Fix: ${check.fix}`);
|
|
228
|
+
}
|
|
229
|
+
if (check.status === "fail") hasIssues = true;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
console.log("");
|
|
233
|
+
if (hasIssues) {
|
|
234
|
+
console.log(" â Issues found. Fix them and run doctor again.\n");
|
|
235
|
+
return 2;
|
|
236
|
+
} else {
|
|
237
|
+
console.log(" â
Environment healthy!\n");
|
|
238
|
+
return 0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
module.exports = {
|
|
243
|
+
runDoctor: runDoctor,
|
|
244
|
+
runDoctorLegacy: runDoctorLegacy,
|
|
245
|
+
};
|