vibecheck-ai 2.0.1 → 5.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/bin/.generated +25 -0
- package/bin/_deprecations.js +463 -0
- package/bin/_router.js +46 -0
- package/bin/cli-hygiene.js +241 -0
- package/bin/dev/run-v2-torture.js +30 -0
- package/bin/registry.js +656 -0
- package/bin/runners/CLI_REFACTOR_SUMMARY.md +229 -0
- package/bin/runners/ENHANCEMENT_GUIDE.md +121 -0
- package/bin/runners/REPORT_AUDIT.md +64 -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 +513 -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-enhanced.js +2525 -0
- package/bin/runners/context/generators/cursor.js +514 -0
- package/bin/runners/context/generators/mcp.js +169 -0
- package/bin/runners/context/generators/windsurf.js +180 -0
- package/bin/runners/context/git-context.js +304 -0
- package/bin/runners/context/index.js +1110 -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 +1264 -0
- package/bin/runners/context/security-scanner.js +541 -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 +336 -0
- package/bin/runners/lib/__tests__/entitlements-v2.test.js +295 -0
- package/bin/runners/lib/agent-firewall/ai/false-positive-analyzer.js +474 -0
- package/bin/runners/lib/agent-firewall/change-packet/builder.js +488 -0
- package/bin/runners/lib/agent-firewall/change-packet/schema.json +228 -0
- package/bin/runners/lib/agent-firewall/change-packet/store.js +200 -0
- package/bin/runners/lib/agent-firewall/claims/claim-types.js +21 -0
- package/bin/runners/lib/agent-firewall/claims/extractor.js +303 -0
- package/bin/runners/lib/agent-firewall/claims/patterns.js +24 -0
- package/bin/runners/lib/agent-firewall/critic/index.js +151 -0
- package/bin/runners/lib/agent-firewall/critic/judge.js +432 -0
- package/bin/runners/lib/agent-firewall/critic/prompts.js +305 -0
- package/bin/runners/lib/agent-firewall/enforcement/gateway.js +1059 -0
- package/bin/runners/lib/agent-firewall/enforcement/index.js +98 -0
- package/bin/runners/lib/agent-firewall/enforcement/mode.js +318 -0
- package/bin/runners/lib/agent-firewall/enforcement/orchestrator.js +484 -0
- package/bin/runners/lib/agent-firewall/enforcement/proof-artifact.js +418 -0
- package/bin/runners/lib/agent-firewall/enforcement/schemas/change-event.schema.json +173 -0
- package/bin/runners/lib/agent-firewall/enforcement/schemas/intent.schema.json +181 -0
- package/bin/runners/lib/agent-firewall/enforcement/schemas/verdict.schema.json +222 -0
- package/bin/runners/lib/agent-firewall/enforcement/verdict-v2.js +333 -0
- package/bin/runners/lib/agent-firewall/evidence/auth-evidence.js +88 -0
- package/bin/runners/lib/agent-firewall/evidence/contract-evidence.js +75 -0
- package/bin/runners/lib/agent-firewall/evidence/env-evidence.js +127 -0
- package/bin/runners/lib/agent-firewall/evidence/resolver.js +102 -0
- package/bin/runners/lib/agent-firewall/evidence/route-evidence.js +213 -0
- package/bin/runners/lib/agent-firewall/evidence/side-effect-evidence.js +145 -0
- package/bin/runners/lib/agent-firewall/fs-hook/daemon.js +19 -0
- package/bin/runners/lib/agent-firewall/fs-hook/installer.js +87 -0
- package/bin/runners/lib/agent-firewall/fs-hook/watcher.js +184 -0
- package/bin/runners/lib/agent-firewall/git-hook/pre-commit.js +163 -0
- package/bin/runners/lib/agent-firewall/ide-extension/cursor.js +107 -0
- package/bin/runners/lib/agent-firewall/ide-extension/vscode.js +68 -0
- package/bin/runners/lib/agent-firewall/ide-extension/windsurf.js +66 -0
- package/bin/runners/lib/agent-firewall/index.js +200 -0
- package/bin/runners/lib/agent-firewall/integration/index.js +20 -0
- package/bin/runners/lib/agent-firewall/integration/ship-gate.js +437 -0
- package/bin/runners/lib/agent-firewall/intent/alignment-engine.js +634 -0
- package/bin/runners/lib/agent-firewall/intent/auto-detect.js +426 -0
- package/bin/runners/lib/agent-firewall/intent/index.js +102 -0
- package/bin/runners/lib/agent-firewall/intent/schema.js +352 -0
- package/bin/runners/lib/agent-firewall/intent/store.js +283 -0
- package/bin/runners/lib/agent-firewall/interception/fs-interceptor.js +502 -0
- package/bin/runners/lib/agent-firewall/interception/index.js +23 -0
- package/bin/runners/lib/agent-firewall/interceptor/base.js +308 -0
- package/bin/runners/lib/agent-firewall/interceptor/cursor.js +35 -0
- package/bin/runners/lib/agent-firewall/interceptor/vscode.js +35 -0
- package/bin/runners/lib/agent-firewall/interceptor/windsurf.js +34 -0
- package/bin/runners/lib/agent-firewall/lawbook/distributor.js +465 -0
- package/bin/runners/lib/agent-firewall/lawbook/evaluator.js +604 -0
- package/bin/runners/lib/agent-firewall/lawbook/index.js +304 -0
- package/bin/runners/lib/agent-firewall/lawbook/registry.js +514 -0
- package/bin/runners/lib/agent-firewall/lawbook/schema.js +420 -0
- package/bin/runners/lib/agent-firewall/logger.js +141 -0
- package/bin/runners/lib/agent-firewall/policy/default-policy.json +90 -0
- package/bin/runners/lib/agent-firewall/policy/engine.js +103 -0
- package/bin/runners/lib/agent-firewall/policy/loader.js +451 -0
- package/bin/runners/lib/agent-firewall/policy/rules/auth-drift.js +50 -0
- package/bin/runners/lib/agent-firewall/policy/rules/contract-drift.js +50 -0
- package/bin/runners/lib/agent-firewall/policy/rules/fake-success.js +79 -0
- package/bin/runners/lib/agent-firewall/policy/rules/ghost-env.js +227 -0
- package/bin/runners/lib/agent-firewall/policy/rules/ghost-route.js +191 -0
- package/bin/runners/lib/agent-firewall/policy/rules/scope.js +93 -0
- package/bin/runners/lib/agent-firewall/policy/rules/unsafe-side-effect.js +57 -0
- package/bin/runners/lib/agent-firewall/policy/schema.json +183 -0
- package/bin/runners/lib/agent-firewall/policy/verdict.js +54 -0
- package/bin/runners/lib/agent-firewall/proposal/extractor.js +394 -0
- package/bin/runners/lib/agent-firewall/proposal/index.js +212 -0
- package/bin/runners/lib/agent-firewall/proposal/schema.js +251 -0
- package/bin/runners/lib/agent-firewall/proposal/validator.js +386 -0
- package/bin/runners/lib/agent-firewall/reality/index.js +332 -0
- package/bin/runners/lib/agent-firewall/reality/state.js +625 -0
- package/bin/runners/lib/agent-firewall/reality/watcher.js +322 -0
- package/bin/runners/lib/agent-firewall/risk/index.js +173 -0
- package/bin/runners/lib/agent-firewall/risk/scorer.js +328 -0
- package/bin/runners/lib/agent-firewall/risk/thresholds.js +322 -0
- package/bin/runners/lib/agent-firewall/risk/vectors.js +421 -0
- package/bin/runners/lib/agent-firewall/session/collector.js +451 -0
- package/bin/runners/lib/agent-firewall/session/index.js +26 -0
- package/bin/runners/lib/agent-firewall/simulator/diff-simulator.js +472 -0
- package/bin/runners/lib/agent-firewall/simulator/import-resolver.js +346 -0
- package/bin/runners/lib/agent-firewall/simulator/index.js +181 -0
- package/bin/runners/lib/agent-firewall/simulator/route-validator.js +380 -0
- package/bin/runners/lib/agent-firewall/time-machine/incident-correlator.js +661 -0
- package/bin/runners/lib/agent-firewall/time-machine/index.js +267 -0
- package/bin/runners/lib/agent-firewall/time-machine/replay-engine.js +436 -0
- package/bin/runners/lib/agent-firewall/time-machine/state-reconstructor.js +490 -0
- package/bin/runners/lib/agent-firewall/time-machine/timeline-builder.js +530 -0
- package/bin/runners/lib/agent-firewall/truthpack/index.js +67 -0
- package/bin/runners/lib/agent-firewall/truthpack/loader.js +137 -0
- package/bin/runners/lib/agent-firewall/unblock/planner.js +337 -0
- package/bin/runners/lib/agent-firewall/utils/ignore-checker.js +118 -0
- package/bin/runners/lib/ai-bridge.js +416 -0
- package/bin/runners/lib/analysis-core.js +309 -0
- package/bin/runners/lib/analyzers.js +2500 -0
- package/bin/runners/lib/api-client.js +269 -0
- package/bin/runners/lib/approve-output.js +235 -0
- package/bin/runners/lib/artifact-envelope.js +540 -0
- package/bin/runners/lib/assets/vibecheck-logo.png +0 -0
- package/bin/runners/lib/audit-bridge.js +391 -0
- package/bin/runners/lib/auth-shared.js +977 -0
- package/bin/runners/lib/auth-truth.js +193 -0
- package/bin/runners/lib/auth.js +215 -0
- package/bin/runners/lib/authority-badge.js +425 -0
- package/bin/runners/lib/backup.js +62 -0
- package/bin/runners/lib/billing.js +107 -0
- package/bin/runners/lib/checkpoint.js +941 -0
- package/bin/runners/lib/claims.js +118 -0
- package/bin/runners/lib/classify-output.js +204 -0
- package/bin/runners/lib/cleanup/engine.js +571 -0
- package/bin/runners/lib/cleanup/index.js +53 -0
- package/bin/runners/lib/cleanup/output.js +375 -0
- package/bin/runners/lib/cleanup/rules.js +1060 -0
- package/bin/runners/lib/cli-output.js +400 -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 +202 -0
- package/bin/runners/lib/contracts/env-contract.js +181 -0
- package/bin/runners/lib/contracts/external-contract.js +206 -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 +199 -0
- package/bin/runners/lib/contracts.js +804 -0
- package/bin/runners/lib/default-config.js +127 -0
- package/bin/runners/lib/detect.js +89 -0
- package/bin/runners/lib/detectors-v2.js +622 -0
- package/bin/runners/lib/doctor/autofix.js +254 -0
- package/bin/runners/lib/doctor/diagnosis-receipt.js +454 -0
- package/bin/runners/lib/doctor/failure-signatures.js +526 -0
- package/bin/runners/lib/doctor/fix-script.js +336 -0
- package/bin/runners/lib/doctor/index.js +37 -0
- package/bin/runners/lib/doctor/modules/build-tools.js +453 -0
- package/bin/runners/lib/doctor/modules/dependencies.js +325 -0
- package/bin/runners/lib/doctor/modules/index.js +105 -0
- package/bin/runners/lib/doctor/modules/network.js +250 -0
- package/bin/runners/lib/doctor/modules/os-quirks.js +706 -0
- package/bin/runners/lib/doctor/modules/project.js +312 -0
- package/bin/runners/lib/doctor/modules/repo-integrity.js +485 -0
- package/bin/runners/lib/doctor/modules/runtime.js +224 -0
- package/bin/runners/lib/doctor/modules/security.js +350 -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/safe-repair.js +384 -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-output.js +226 -0
- package/bin/runners/lib/doctor-v2.js +608 -0
- package/bin/runners/lib/drift.js +425 -0
- package/bin/runners/lib/enforcement.js +72 -0
- package/bin/runners/lib/engine/ast-cache.js +210 -0
- package/bin/runners/lib/engine/auth-extractor.js +211 -0
- package/bin/runners/lib/engine/billing-extractor.js +112 -0
- package/bin/runners/lib/engine/enforcement-extractor.js +100 -0
- package/bin/runners/lib/engine/env-extractor.js +207 -0
- package/bin/runners/lib/engine/express-extractor.js +208 -0
- package/bin/runners/lib/engine/extractors.js +849 -0
- package/bin/runners/lib/engine/index.js +207 -0
- package/bin/runners/lib/engine/repo-index.js +514 -0
- package/bin/runners/lib/engine/types.js +124 -0
- package/bin/runners/lib/engines/accessibility-engine.js +190 -0
- package/bin/runners/lib/engines/api-consistency-engine.js +162 -0
- package/bin/runners/lib/engines/ast-cache.js +99 -0
- package/bin/runners/lib/engines/attack-detector.js +1192 -0
- package/bin/runners/lib/engines/code-quality-engine.js +255 -0
- package/bin/runners/lib/engines/console-logs-engine.js +115 -0
- package/bin/runners/lib/engines/cross-file-analysis-engine.js +268 -0
- package/bin/runners/lib/engines/dead-code-engine.js +198 -0
- package/bin/runners/lib/engines/deprecated-api-engine.js +226 -0
- package/bin/runners/lib/engines/empty-catch-engine.js +150 -0
- package/bin/runners/lib/engines/file-filter.js +131 -0
- package/bin/runners/lib/engines/hardcoded-secrets-engine.js +251 -0
- package/bin/runners/lib/engines/mock-data-engine.js +272 -0
- package/bin/runners/lib/engines/parallel-processor.js +71 -0
- package/bin/runners/lib/engines/performance-issues-engine.js +265 -0
- package/bin/runners/lib/engines/security-vulnerabilities-engine.js +243 -0
- package/bin/runners/lib/engines/todo-fixme-engine.js +115 -0
- package/bin/runners/lib/engines/type-aware-engine.js +152 -0
- package/bin/runners/lib/engines/unsafe-regex-engine.js +225 -0
- package/bin/runners/lib/engines/vibecheck-engines/README.md +53 -0
- package/bin/runners/lib/engines/vibecheck-engines/index.js +15 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/ast-cache.js +164 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/code-quality-engine.js +291 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/console-logs-engine.js +83 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/dead-code-engine.js +198 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/deprecated-api-engine.js +275 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/empty-catch-engine.js +167 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/file-filter.js +217 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/hardcoded-secrets-engine.js +139 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/mock-data-engine.js +140 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/parallel-processor.js +164 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/performance-issues-engine.js +234 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/type-aware-engine.js +217 -0
- package/bin/runners/lib/engines/vibecheck-engines/lib/unsafe-regex-engine.js +78 -0
- package/bin/runners/lib/engines/vibecheck-engines/package.json +13 -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 +265 -0
- package/bin/runners/lib/entitlements.generated.js +0 -0
- package/bin/runners/lib/entitlements.js +340 -0
- package/bin/runners/lib/env-resolver.js +417 -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 +368 -0
- package/bin/runners/lib/error-messages.js +289 -0
- package/bin/runners/lib/evidence-pack.js +684 -0
- package/bin/runners/lib/exit-codes.js +275 -0
- package/bin/runners/lib/extractors/client-calls.js +990 -0
- package/bin/runners/lib/extractors/fastify-route-dump.js +573 -0
- package/bin/runners/lib/extractors/fastify-routes.js +426 -0
- package/bin/runners/lib/extractors/index.js +363 -0
- package/bin/runners/lib/extractors/next-routes.js +524 -0
- package/bin/runners/lib/extractors/proof-graph.js +431 -0
- package/bin/runners/lib/extractors/route-matcher.js +451 -0
- package/bin/runners/lib/extractors/truthpack-v2.js +377 -0
- package/bin/runners/lib/extractors/ui-bindings.js +547 -0
- package/bin/runners/lib/finding-id.js +69 -0
- package/bin/runners/lib/finding-sorter.js +89 -0
- package/bin/runners/lib/findings-schema.js +281 -0
- package/bin/runners/lib/fingerprint.js +377 -0
- package/bin/runners/lib/firewall-prompt.js +50 -0
- package/bin/runners/lib/fix-output.js +228 -0
- package/bin/runners/lib/global-flags.js +250 -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/help-formatter.js +413 -0
- package/bin/runners/lib/html-proof-report.js +913 -0
- package/bin/runners/lib/html-report.js +650 -0
- package/bin/runners/lib/init-wizard.js +601 -0
- package/bin/runners/lib/interactive-menu.js +1496 -0
- package/bin/runners/lib/json-output.js +76 -0
- package/bin/runners/lib/llm.js +75 -0
- package/bin/runners/lib/logger.js +38 -0
- package/bin/runners/lib/meter.js +61 -0
- package/bin/runners/lib/missions/briefing.js +427 -0
- package/bin/runners/lib/missions/checkpoint.js +753 -0
- package/bin/runners/lib/missions/evidence.js +126 -0
- package/bin/runners/lib/missions/hardening.js +851 -0
- package/bin/runners/lib/missions/plan.js +648 -0
- package/bin/runners/lib/missions/safety-gates.js +645 -0
- package/bin/runners/lib/missions/schema.js +478 -0
- package/bin/runners/lib/missions/templates.js +317 -0
- package/bin/runners/lib/next-action.js +560 -0
- package/bin/runners/lib/packs/bundle.js +675 -0
- package/bin/runners/lib/packs/evidence-pack.js +671 -0
- package/bin/runners/lib/packs/pack-factory.js +837 -0
- package/bin/runners/lib/packs/permissions-pack.js +686 -0
- package/bin/runners/lib/packs/proof-graph-pack.js +779 -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/policy.js +295 -0
- package/bin/runners/lib/polish/accessibility.js +62 -0
- package/bin/runners/lib/polish/analyzer.js +93 -0
- package/bin/runners/lib/polish/backend.js +87 -0
- package/bin/runners/lib/polish/configuration.js +83 -0
- package/bin/runners/lib/polish/documentation.js +83 -0
- package/bin/runners/lib/polish/frontend.js +817 -0
- package/bin/runners/lib/polish/index.js +27 -0
- package/bin/runners/lib/polish/infrastructure.js +80 -0
- package/bin/runners/lib/polish/internationalization.js +85 -0
- package/bin/runners/lib/polish/libraries.js +180 -0
- package/bin/runners/lib/polish/observability.js +75 -0
- package/bin/runners/lib/polish/performance.js +64 -0
- package/bin/runners/lib/polish/privacy.js +110 -0
- package/bin/runners/lib/polish/resilience.js +92 -0
- package/bin/runners/lib/polish/security.js +78 -0
- package/bin/runners/lib/polish/seo.js +71 -0
- package/bin/runners/lib/polish/styles.js +62 -0
- package/bin/runners/lib/polish/utils.js +104 -0
- package/bin/runners/lib/preflight.js +142 -0
- package/bin/runners/lib/prerequisites.js +149 -0
- package/bin/runners/lib/prove-output.js +220 -0
- package/bin/runners/lib/reality/correlation-detectors.js +359 -0
- package/bin/runners/lib/reality/index.js +318 -0
- package/bin/runners/lib/reality/request-hashing.js +416 -0
- package/bin/runners/lib/reality/request-mapper.js +453 -0
- package/bin/runners/lib/reality/safety-rails.js +463 -0
- package/bin/runners/lib/reality/semantic-snapshot.js +408 -0
- package/bin/runners/lib/reality/toast-detector.js +393 -0
- package/bin/runners/lib/reality-findings.js +84 -0
- package/bin/runners/lib/reality-output.js +231 -0
- package/bin/runners/lib/receipts.js +179 -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 +626 -0
- package/bin/runners/lib/report-html.js +1233 -0
- package/bin/runners/lib/report-output.js +366 -0
- package/bin/runners/lib/report-templates.js +967 -0
- package/bin/runners/lib/report.js +135 -0
- package/bin/runners/lib/route-detection.js +1209 -0
- package/bin/runners/lib/route-truth.js +1322 -0
- package/bin/runners/lib/safelist/index.js +96 -0
- package/bin/runners/lib/safelist/integration.js +334 -0
- package/bin/runners/lib/safelist/matcher.js +696 -0
- package/bin/runners/lib/safelist/schema.js +948 -0
- package/bin/runners/lib/safelist/store.js +438 -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/scan-output.js +631 -0
- package/bin/runners/lib/scan-runner.js +135 -0
- package/bin/runners/lib/schema-validator.js +350 -0
- package/bin/runners/lib/schemas/ajv-validator.js +464 -0
- package/bin/runners/lib/schemas/contracts.schema.json +160 -0
- package/bin/runners/lib/schemas/error-envelope.schema.json +105 -0
- package/bin/runners/lib/schemas/finding-v3.schema.json +151 -0
- package/bin/runners/lib/schemas/finding.schema.json +100 -0
- package/bin/runners/lib/schemas/mission-pack.schema.json +206 -0
- package/bin/runners/lib/schemas/proof-graph.schema.json +176 -0
- package/bin/runners/lib/schemas/reality-report.schema.json +162 -0
- package/bin/runners/lib/schemas/report-artifact.schema.json +120 -0
- package/bin/runners/lib/schemas/run-request.schema.json +108 -0
- package/bin/runners/lib/schemas/share-pack.schema.json +180 -0
- package/bin/runners/lib/schemas/ship-manifest.schema.json +251 -0
- package/bin/runners/lib/schemas/ship-report.schema.json +117 -0
- package/bin/runners/lib/schemas/truthpack-v2.schema.json +303 -0
- package/bin/runners/lib/schemas/validator.js +465 -0
- package/bin/runners/lib/schemas/verdict.schema.json +140 -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/ship-gate.js +832 -0
- package/bin/runners/lib/ship-manifest.js +1153 -0
- package/bin/runners/lib/ship-output-enterprise.js +239 -0
- package/bin/runners/lib/ship-output.js +1128 -0
- package/bin/runners/lib/snippets.js +67 -0
- package/bin/runners/lib/status-output.js +340 -0
- package/bin/runners/lib/terminal-ui.js +356 -0
- package/bin/runners/lib/truth.js +1691 -0
- package/bin/runners/lib/ui.js +562 -0
- package/bin/runners/lib/unified-cli-output.js +947 -0
- package/bin/runners/lib/unified-output.js +197 -0
- package/bin/runners/lib/upsell.js +410 -0
- package/bin/runners/lib/usage.js +153 -0
- package/bin/runners/lib/validate-patch.js +156 -0
- package/bin/runners/lib/verdict-engine.js +628 -0
- package/bin/runners/lib/verification.js +345 -0
- package/bin/runners/lib/why-tree.js +650 -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 +229 -0
- package/bin/runners/runAgent.d.ts +5 -0
- package/bin/runners/runAgent.js +161 -0
- package/bin/runners/runAllowlist.js +418 -0
- package/bin/runners/runApprove.js +320 -0
- package/bin/runners/runAudit.js +692 -0
- package/bin/runners/runAuth.js +731 -0
- package/bin/runners/runCI.js +353 -0
- package/bin/runners/runCheckpoint.js +530 -0
- package/bin/runners/runClassify.js +928 -0
- package/bin/runners/runCleanup.js +343 -0
- package/bin/runners/runContext.d.ts +4 -0
- package/bin/runners/runContext.js +175 -0
- package/bin/runners/runDoctor.js +877 -0
- package/bin/runners/runEvidencePack.js +362 -0
- package/bin/runners/runFirewall.d.ts +5 -0
- package/bin/runners/runFirewall.js +134 -0
- package/bin/runners/runFirewallHook.d.ts +5 -0
- package/bin/runners/runFirewallHook.js +56 -0
- package/bin/runners/runFix.js +1355 -0
- package/bin/runners/runForge.js +451 -0
- package/bin/runners/runGuard.js +262 -0
- package/bin/runners/runInit.js +1927 -0
- package/bin/runners/runIntent.js +906 -0
- package/bin/runners/runKickoff.js +878 -0
- package/bin/runners/runLabs.js +424 -0
- package/bin/runners/runLaunch.js +2000 -0
- package/bin/runners/runLink.js +785 -0
- package/bin/runners/runMcp.js +1875 -0
- package/bin/runners/runPacks.js +2089 -0
- package/bin/runners/runPolish.d.ts +4 -0
- package/bin/runners/runPolish.js +390 -0
- package/bin/runners/runPromptFirewall.js +211 -0
- package/bin/runners/runProve.js +1411 -0
- package/bin/runners/runQuickstart.js +531 -0
- package/bin/runners/runReality.js +2260 -0
- package/bin/runners/runReport.js +726 -0
- package/bin/runners/runRuntime.js +110 -0
- package/bin/runners/runSafelist.js +1190 -0
- package/bin/runners/runScan.js +688 -0
- package/bin/runners/runShield.js +1282 -0
- package/bin/runners/runShip.js +1660 -0
- package/bin/runners/runTruth.d.ts +5 -0
- package/bin/runners/runTruth.js +101 -0
- package/bin/runners/runValidate.js +179 -0
- package/bin/runners/runWatch.js +478 -0
- package/bin/runners/utils.js +360 -0
- package/bin/scan.js +617 -0
- package/bin/vibecheck.js +1617 -0
- package/dist/guardrail/index.d.ts +2405 -0
- package/dist/guardrail/index.js +9747 -0
- package/dist/guardrail/index.js.map +1 -0
- package/dist/scanner/index.d.ts +282 -0
- package/dist/scanner/index.js +3395 -0
- package/dist/scanner/index.js.map +1 -0
- package/package.json +123 -104
- package/README.md +0 -491
- package/dist/index.js +0 -99711
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified CLI Output - World-Class Terminal Experience
|
|
3
|
+
*
|
|
4
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
5
|
+
* THE VIBECHECK DESIGN SYSTEM v2.0
|
|
6
|
+
* ═══════════════════════════════════════════════════════════════════════════════
|
|
7
|
+
*
|
|
8
|
+
* Provides consistent, professional terminal UI across all CLI commands:
|
|
9
|
+
* • ASCII art banners (main + command-specific)
|
|
10
|
+
* • Box-drawing layouts with split columns
|
|
11
|
+
* • Progress bars and status indicators
|
|
12
|
+
* • Verdicts and action sections
|
|
13
|
+
*
|
|
14
|
+
* @version 2.0.0
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
20
|
+
// CONSTANTS
|
|
21
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
22
|
+
|
|
23
|
+
const WIDTH = 80; // Standard terminal width
|
|
24
|
+
const INNER_WIDTH = WIDTH - 4; // Inside borders
|
|
25
|
+
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
27
|
+
// ANSI CODES
|
|
28
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
29
|
+
|
|
30
|
+
const ESC = "\x1b";
|
|
31
|
+
const SUPPORTS_COLOR = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
32
|
+
const SUPPORTS_TRUECOLOR = process.env.COLORTERM === "truecolor" ||
|
|
33
|
+
process.env.TERM_PROGRAM === "iTerm.app" ||
|
|
34
|
+
process.env.WT_SESSION;
|
|
35
|
+
|
|
36
|
+
const ansi = SUPPORTS_COLOR ? {
|
|
37
|
+
reset: `${ESC}[0m`,
|
|
38
|
+
bold: `${ESC}[1m`,
|
|
39
|
+
dim: `${ESC}[2m`,
|
|
40
|
+
italic: `${ESC}[3m`,
|
|
41
|
+
underline: `${ESC}[4m`,
|
|
42
|
+
// Standard colors
|
|
43
|
+
red: `${ESC}[31m`,
|
|
44
|
+
green: `${ESC}[32m`,
|
|
45
|
+
yellow: `${ESC}[33m`,
|
|
46
|
+
blue: `${ESC}[34m`,
|
|
47
|
+
magenta: `${ESC}[35m`,
|
|
48
|
+
cyan: `${ESC}[36m`,
|
|
49
|
+
white: `${ESC}[37m`,
|
|
50
|
+
gray: `${ESC}[90m`,
|
|
51
|
+
// Bright colors
|
|
52
|
+
brightRed: `${ESC}[91m`,
|
|
53
|
+
brightGreen: `${ESC}[92m`,
|
|
54
|
+
brightYellow: `${ESC}[93m`,
|
|
55
|
+
brightCyan: `${ESC}[96m`,
|
|
56
|
+
// Backgrounds
|
|
57
|
+
bgRed: `${ESC}[41m`,
|
|
58
|
+
bgGreen: `${ESC}[42m`,
|
|
59
|
+
bgYellow: `${ESC}[43m`,
|
|
60
|
+
bgBlue: `${ESC}[44m`,
|
|
61
|
+
bgMagenta: `${ESC}[45m`,
|
|
62
|
+
bgCyan: `${ESC}[46m`,
|
|
63
|
+
// RGB (truecolor)
|
|
64
|
+
rgb: (r, g, b) => SUPPORTS_TRUECOLOR ? `${ESC}[38;2;${r};${g};${b}m` : "",
|
|
65
|
+
bgRgb: (r, g, b) => SUPPORTS_TRUECOLOR ? `${ESC}[48;2;${r};${g};${b}m` : "",
|
|
66
|
+
// Cursor control
|
|
67
|
+
hideCursor: `${ESC}[?25l`,
|
|
68
|
+
showCursor: `${ESC}[?25h`,
|
|
69
|
+
clearLine: `${ESC}[2K`,
|
|
70
|
+
cursorUp: (n = 1) => `${ESC}[${n}A`,
|
|
71
|
+
} : Object.fromEntries([
|
|
72
|
+
"reset", "bold", "dim", "italic", "underline",
|
|
73
|
+
"red", "green", "yellow", "blue", "magenta", "cyan", "white", "gray",
|
|
74
|
+
"brightRed", "brightGreen", "brightYellow", "brightCyan",
|
|
75
|
+
"bgRed", "bgGreen", "bgYellow", "bgBlue", "bgMagenta", "bgCyan",
|
|
76
|
+
"hideCursor", "showCursor", "clearLine"
|
|
77
|
+
].map(k => [k, ""]));
|
|
78
|
+
|
|
79
|
+
// Add stub functions if colors disabled
|
|
80
|
+
if (!SUPPORTS_COLOR) {
|
|
81
|
+
ansi.rgb = () => "";
|
|
82
|
+
ansi.bgRgb = () => "";
|
|
83
|
+
ansi.cursorUp = () => "";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
87
|
+
// SYMBOLS
|
|
88
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
89
|
+
|
|
90
|
+
const sym = {
|
|
91
|
+
// Status
|
|
92
|
+
check: "✓",
|
|
93
|
+
cross: "✗",
|
|
94
|
+
warning: "⚠",
|
|
95
|
+
info: "ℹ",
|
|
96
|
+
bullet: "•",
|
|
97
|
+
arrow: "→",
|
|
98
|
+
arrowRight: "▸",
|
|
99
|
+
star: "★",
|
|
100
|
+
// Aliases for compatibility
|
|
101
|
+
success: "✓",
|
|
102
|
+
error: "✗",
|
|
103
|
+
// Additional symbols
|
|
104
|
+
key: "🔑",
|
|
105
|
+
list: "📋",
|
|
106
|
+
badge: "🏅",
|
|
107
|
+
timer: "⏱️",
|
|
108
|
+
add: "+",
|
|
109
|
+
remove: "-",
|
|
110
|
+
person: "👤",
|
|
111
|
+
expired: "⌛",
|
|
112
|
+
review: "👁️",
|
|
113
|
+
pending: "○",
|
|
114
|
+
active: "●",
|
|
115
|
+
skip: "↷",
|
|
116
|
+
// Progress
|
|
117
|
+
blockFull: "█",
|
|
118
|
+
blockMed: "▓",
|
|
119
|
+
blockLight: "▒",
|
|
120
|
+
blockEmpty: "░",
|
|
121
|
+
// Box drawing (double)
|
|
122
|
+
boxTL: "╔",
|
|
123
|
+
boxTR: "╗",
|
|
124
|
+
boxBL: "╚",
|
|
125
|
+
boxBR: "╝",
|
|
126
|
+
boxH: "═",
|
|
127
|
+
boxV: "║",
|
|
128
|
+
boxTeeR: "╠",
|
|
129
|
+
boxTeeL: "╣",
|
|
130
|
+
boxTeeD: "╦",
|
|
131
|
+
boxTeeU: "╩",
|
|
132
|
+
boxCross: "╬",
|
|
133
|
+
// Box drawing (single)
|
|
134
|
+
lineTL: "┌",
|
|
135
|
+
lineTR: "┐",
|
|
136
|
+
lineBL: "└",
|
|
137
|
+
lineBR: "┘",
|
|
138
|
+
lineH: "─",
|
|
139
|
+
lineV: "│",
|
|
140
|
+
lineTeeR: "├",
|
|
141
|
+
lineTeeL: "┤",
|
|
142
|
+
lineTeeD: "┬",
|
|
143
|
+
lineTeeU: "┴",
|
|
144
|
+
lineCross: "┼",
|
|
145
|
+
// Emoji
|
|
146
|
+
rocket: "🚀",
|
|
147
|
+
fire: "🔥",
|
|
148
|
+
brain: "🧠",
|
|
149
|
+
shield: "🛡️",
|
|
150
|
+
search: "🔍",
|
|
151
|
+
lock: "🔐",
|
|
152
|
+
unlock: "🔓",
|
|
153
|
+
link: "🔗",
|
|
154
|
+
clock: "⏱",
|
|
155
|
+
target: "🎯",
|
|
156
|
+
party: "🎉",
|
|
157
|
+
skull: "💀",
|
|
158
|
+
bomb: "💣",
|
|
159
|
+
ghost: "👻",
|
|
160
|
+
money: "💰",
|
|
161
|
+
doc: "📄",
|
|
162
|
+
box: "📦",
|
|
163
|
+
sparkle: "✨",
|
|
164
|
+
lightning: "⚡",
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
168
|
+
// ASCII ART BANNERS
|
|
169
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
170
|
+
|
|
171
|
+
const VIBECHECK_BANNER = `
|
|
172
|
+
██╗ ██╗██╗██████╗ ███████╗ ██████╗██╗ ██╗███████╗ ██████╗██╗ ██╗
|
|
173
|
+
██║ ██║██║██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝██╔════╝██║ ██╔╝
|
|
174
|
+
██║ ██║██║██████╔╝█████╗ ██║ ███████║█████╗ ██║ █████╔╝
|
|
175
|
+
╚██╗ ██╔╝██║██╔══██╗██╔══╝ ██║ ██╔══██║██╔══╝ ██║ ██╔═██╗
|
|
176
|
+
╚████╔╝ ██║██████╔╝███████╗╚██████╗██║ ██║███████╗╚██████╗██║ ██╗
|
|
177
|
+
╚═══╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝`.trim();
|
|
178
|
+
|
|
179
|
+
const COMMAND_BANNERS = {
|
|
180
|
+
launch: `
|
|
181
|
+
██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗
|
|
182
|
+
██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║
|
|
183
|
+
██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║
|
|
184
|
+
██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║
|
|
185
|
+
███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║
|
|
186
|
+
╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝`.trim(),
|
|
187
|
+
|
|
188
|
+
kickoff: `
|
|
189
|
+
██╗ ██╗██╗ ██████╗██╗ ██╗ ██████╗ ███████╗███████╗
|
|
190
|
+
██║ ██╔╝██║██╔════╝██║ ██╔╝██╔═══██╗██╔════╝██╔════╝
|
|
191
|
+
█████╔╝ ██║██║ █████╔╝ ██║ ██║█████╗ █████╗
|
|
192
|
+
██╔═██╗ ██║██║ ██╔═██╗ ██║ ██║██╔══╝ ██╔══╝
|
|
193
|
+
██║ ██╗██║╚██████╗██║ ██╗╚██████╔╝██║ ██║
|
|
194
|
+
╚═╝ ╚═╝╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝`.trim(),
|
|
195
|
+
|
|
196
|
+
scan: `
|
|
197
|
+
███████╗ ██████╗ █████╗ ███╗ ██╗
|
|
198
|
+
██╔════╝██╔════╝██╔══██╗████╗ ██║
|
|
199
|
+
███████╗██║ ███████║██╔██╗ ██║
|
|
200
|
+
╚════██║██║ ██╔══██║██║╚██╗██║
|
|
201
|
+
███████║╚██████╗██║ ██║██║ ╚████║
|
|
202
|
+
╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝`.trim(),
|
|
203
|
+
|
|
204
|
+
audit: `
|
|
205
|
+
█████╗ ██╗ ██╗██████╗ ██╗████████╗
|
|
206
|
+
██╔══██╗██║ ██║██╔══██╗██║╚══██╔══╝
|
|
207
|
+
███████║██║ ██║██║ ██║██║ ██║
|
|
208
|
+
██╔══██║██║ ██║██║ ██║██║ ██║
|
|
209
|
+
██║ ██║╚██████╔╝██████╔╝██║ ██║
|
|
210
|
+
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝`.trim(),
|
|
211
|
+
|
|
212
|
+
packs: `
|
|
213
|
+
██████╗ █████╗ ██████╗██╗ ██╗███████╗
|
|
214
|
+
██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝
|
|
215
|
+
██████╔╝███████║██║ █████╔╝ ███████╗
|
|
216
|
+
██╔═══╝ ██╔══██║██║ ██╔═██╗ ╚════██║
|
|
217
|
+
██║ ██║ ██║╚██████╗██║ ██╗███████║
|
|
218
|
+
╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝`.trim(),
|
|
219
|
+
|
|
220
|
+
safelist: `
|
|
221
|
+
███████╗ █████╗ ███████╗███████╗██╗ ██╗███████╗████████╗
|
|
222
|
+
██╔════╝██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝╚══██╔══╝
|
|
223
|
+
███████╗███████║█████╗ █████╗ ██║ ██║███████╗ ██║
|
|
224
|
+
╚════██║██╔══██║██╔══╝ ██╔══╝ ██║ ██║╚════██║ ██║
|
|
225
|
+
███████║██║ ██║██║ ███████╗███████╗██║███████║ ██║
|
|
226
|
+
╚══════╝╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝╚══════╝ ╚═╝`.trim(),
|
|
227
|
+
|
|
228
|
+
doctor: `
|
|
229
|
+
██████╗ ██████╗ ██████╗████████╗ ██████╗ ██████╗
|
|
230
|
+
██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗
|
|
231
|
+
██║ ██║██║ ██║██║ ██║ ██║ ██║██████╔╝
|
|
232
|
+
██║ ██║██║ ██║██║ ██║ ██║ ██║██╔══██╗
|
|
233
|
+
██████╔╝╚██████╔╝╚██████╗ ██║ ╚██████╔╝██║ ██║
|
|
234
|
+
╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝`.trim(),
|
|
235
|
+
|
|
236
|
+
watch: `
|
|
237
|
+
██╗ ██╗ █████╗ ████████╗ ██████╗██╗ ██╗
|
|
238
|
+
██║ ██║██╔══██╗╚══██╔══╝██╔════╝██║ ██║
|
|
239
|
+
██║ █╗ ██║███████║ ██║ ██║ ███████║
|
|
240
|
+
██║███╗██║██╔══██║ ██║ ██║ ██╔══██║
|
|
241
|
+
╚███╔███╔╝██║ ██║ ██║ ╚██████╗██║ ██║
|
|
242
|
+
╚══╝╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝`.trim(),
|
|
243
|
+
|
|
244
|
+
init: `
|
|
245
|
+
██╗███╗ ██╗██╗████████╗
|
|
246
|
+
██║████╗ ██║██║╚══██╔══╝
|
|
247
|
+
██║██╔██╗ ██║██║ ██║
|
|
248
|
+
██║██║╚██╗██║██║ ██║
|
|
249
|
+
██║██║ ╚████║██║ ██║
|
|
250
|
+
╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝`.trim(),
|
|
251
|
+
|
|
252
|
+
ship: `
|
|
253
|
+
███████╗██╗ ██╗██╗██████╗
|
|
254
|
+
██╔════╝██║ ██║██║██╔══██╗
|
|
255
|
+
███████╗███████║██║██████╔╝
|
|
256
|
+
╚════██║██╔══██║██║██╔═══╝
|
|
257
|
+
███████║██║ ██║██║██║
|
|
258
|
+
╚══════╝╚═╝ ╚═╝╚═╝╚═╝`.trim(),
|
|
259
|
+
|
|
260
|
+
forge: `
|
|
261
|
+
███████╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
262
|
+
██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
|
|
263
|
+
█████╗ ██║ ██║██████╔╝██║ ███╗█████╗
|
|
264
|
+
██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
|
|
265
|
+
██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
|
|
266
|
+
╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝`.trim(),
|
|
267
|
+
|
|
268
|
+
shield: `
|
|
269
|
+
███████╗██╗ ██╗██╗███████╗██╗ ██████╗
|
|
270
|
+
██╔════╝██║ ██║██║██╔════╝██║ ██╔══██╗
|
|
271
|
+
███████╗███████║██║█████╗ ██║ ██║ ██║
|
|
272
|
+
╚════██║██╔══██║██║██╔══╝ ██║ ██║ ██║
|
|
273
|
+
███████║██║ ██║██║███████╗███████╗██████╔╝
|
|
274
|
+
╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚═════╝`.trim(),
|
|
275
|
+
|
|
276
|
+
fix: `
|
|
277
|
+
███████╗██╗██╗ ██╗
|
|
278
|
+
██╔════╝██║╚██╗██╔╝
|
|
279
|
+
█████╗ ██║ ╚███╔╝
|
|
280
|
+
██╔══╝ ██║ ██╔██╗
|
|
281
|
+
██║ ██║██╔╝ ██╗
|
|
282
|
+
╚═╝ ╚═╝╚═╝ ╚═╝`.trim(),
|
|
283
|
+
|
|
284
|
+
link: `
|
|
285
|
+
██╗ ██╗███╗ ██╗██╗ ██╗
|
|
286
|
+
██║ ██║████╗ ██║██║ ██╔╝
|
|
287
|
+
██║ ██║██╔██╗ ██║█████╔╝
|
|
288
|
+
██║ ██║██║╚██╗██║██╔═██╗
|
|
289
|
+
███████╗██║██║ ╚████║██║ ██╗
|
|
290
|
+
╚══════╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝`.trim(),
|
|
291
|
+
|
|
292
|
+
prove: `
|
|
293
|
+
██████╗ ██████╗ ██████╗ ██╗ ██╗███████╗
|
|
294
|
+
██╔══██╗██╔══██╗██╔═══██╗██║ ██║██╔════╝
|
|
295
|
+
██████╔╝██████╔╝██║ ██║██║ ██║█████╗
|
|
296
|
+
██╔═══╝ ██╔══██╗██║ ██║╚██╗ ██╔╝██╔══╝
|
|
297
|
+
██║ ██║ ██║╚██████╔╝ ╚████╔╝ ███████╗
|
|
298
|
+
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝`.trim(),
|
|
299
|
+
|
|
300
|
+
reality: `
|
|
301
|
+
██████╗ ███████╗ █████╗ ██╗ ██╗████████╗██╗ ██╗
|
|
302
|
+
██╔══██╗██╔════╝██╔══██╗██║ ██║╚══██╔══╝╚██╗ ██╔╝
|
|
303
|
+
██████╔╝█████╗ ███████║██║ ██║ ██║ ╚████╔╝
|
|
304
|
+
██╔══██╗██╔══╝ ██╔══██║██║ ██║ ██║ ╚██╔╝
|
|
305
|
+
██║ ██║███████╗██║ ██║███████╗██║ ██║ ██║
|
|
306
|
+
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝`.trim(),
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
310
|
+
// UTILITY FUNCTIONS
|
|
311
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Strip ANSI codes for length calculation
|
|
315
|
+
*/
|
|
316
|
+
function stripAnsi(str) {
|
|
317
|
+
return str.replace(/\u001b\[[0-9;]*m/g, "");
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Get visible length of string (excluding ANSI codes)
|
|
322
|
+
*/
|
|
323
|
+
function visibleLength(str) {
|
|
324
|
+
return stripAnsi(str).length;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Pad string to right with spaces
|
|
329
|
+
*/
|
|
330
|
+
function padRight(str, len) {
|
|
331
|
+
const visible = visibleLength(str);
|
|
332
|
+
if (visible >= len) return str;
|
|
333
|
+
return str + " ".repeat(len - visible);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Pad string to left with spaces
|
|
338
|
+
*/
|
|
339
|
+
function padLeft(str, len) {
|
|
340
|
+
const visible = visibleLength(str);
|
|
341
|
+
if (visible >= len) return str;
|
|
342
|
+
return " ".repeat(len - visible) + str;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Center string within given width
|
|
347
|
+
*/
|
|
348
|
+
function padCenter(str, width) {
|
|
349
|
+
const visible = visibleLength(str);
|
|
350
|
+
if (visible >= width) return str;
|
|
351
|
+
const padding = width - visible;
|
|
352
|
+
const left = Math.floor(padding / 2);
|
|
353
|
+
return " ".repeat(left) + str + " ".repeat(padding - left);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Truncate string with ellipsis
|
|
358
|
+
*/
|
|
359
|
+
function truncate(str, maxLen) {
|
|
360
|
+
const visible = visibleLength(str);
|
|
361
|
+
if (visible <= maxLen) return str;
|
|
362
|
+
return stripAnsi(str).substring(0, maxLen - 3) + "...";
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Format duration
|
|
367
|
+
*/
|
|
368
|
+
function formatDuration(ms) {
|
|
369
|
+
if (ms < 1000) return `${ms}ms`;
|
|
370
|
+
if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;
|
|
371
|
+
const minutes = Math.floor(ms / 60000);
|
|
372
|
+
const seconds = Math.floor((ms % 60000) / 1000);
|
|
373
|
+
return `${minutes}m ${seconds}s`;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Format number with commas
|
|
378
|
+
*/
|
|
379
|
+
function formatNumber(num) {
|
|
380
|
+
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
384
|
+
// PROGRESS BAR
|
|
385
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Render a progress bar
|
|
389
|
+
* @param {number} percent - 0-100
|
|
390
|
+
* @param {number} width - Character width
|
|
391
|
+
* @param {object} opts - Options { color, showPercent, label }
|
|
392
|
+
*/
|
|
393
|
+
function renderProgressBar(percent, width = 25, opts = {}) {
|
|
394
|
+
const { color = ansi.green, bgColor = ansi.gray, showPercent = false, label = "" } = opts;
|
|
395
|
+
const filled = Math.round((percent / 100) * width);
|
|
396
|
+
const empty = width - filled;
|
|
397
|
+
|
|
398
|
+
let bar = `${color}${sym.blockFull.repeat(filled)}${bgColor}${sym.blockEmpty.repeat(empty)}${ansi.reset}`;
|
|
399
|
+
|
|
400
|
+
if (showPercent) {
|
|
401
|
+
bar += ` ${percent}%`;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (label) {
|
|
405
|
+
return `${label} [${bar}]`;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return `[${bar}]`;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Render a status indicator with label
|
|
413
|
+
*/
|
|
414
|
+
function renderStatus(label, status, width = 20) {
|
|
415
|
+
const colors = {
|
|
416
|
+
OPTIMAL: ansi.green,
|
|
417
|
+
STABLE: ansi.green,
|
|
418
|
+
GOOD: ansi.green,
|
|
419
|
+
OK: ansi.green,
|
|
420
|
+
PASS: ansi.green,
|
|
421
|
+
WARNING: ansi.yellow,
|
|
422
|
+
WARN: ansi.yellow,
|
|
423
|
+
HEAVY: ansi.yellow,
|
|
424
|
+
DEGRADED: ansi.yellow,
|
|
425
|
+
CRITICAL: ansi.red,
|
|
426
|
+
FAIL: ansi.red,
|
|
427
|
+
ERROR: ansi.red,
|
|
428
|
+
LOW: ansi.red,
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
const color = colors[status.toUpperCase()] || ansi.gray;
|
|
432
|
+
return `${padRight(label, width)} ${color}[${status}]${ansi.reset}`;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
436
|
+
// HEADER RENDERING
|
|
437
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Render the full header with VIBECHECK banner and command banner
|
|
441
|
+
*/
|
|
442
|
+
function renderFullHeader(command, opts = {}) {
|
|
443
|
+
const {
|
|
444
|
+
version = "4.0.0",
|
|
445
|
+
tier = "FREE",
|
|
446
|
+
integrity = null,
|
|
447
|
+
target = process.cwd(),
|
|
448
|
+
sessionId = generateSessionId(),
|
|
449
|
+
duration = null,
|
|
450
|
+
} = opts;
|
|
451
|
+
|
|
452
|
+
const lines = [];
|
|
453
|
+
|
|
454
|
+
// Main VIBECHECK banner with gradient colors
|
|
455
|
+
const vibeLines = VIBECHECK_BANNER.split("\n");
|
|
456
|
+
const gradientColors = [
|
|
457
|
+
ansi.rgb(0, 255, 200),
|
|
458
|
+
ansi.rgb(0, 230, 220),
|
|
459
|
+
ansi.rgb(0, 200, 255),
|
|
460
|
+
ansi.rgb(50, 150, 255),
|
|
461
|
+
ansi.rgb(100, 100, 255),
|
|
462
|
+
ansi.rgb(150, 50, 255),
|
|
463
|
+
];
|
|
464
|
+
|
|
465
|
+
lines.push("");
|
|
466
|
+
vibeLines.forEach((line, i) => {
|
|
467
|
+
const color = gradientColors[i % gradientColors.length] || ansi.cyan;
|
|
468
|
+
lines.push(` ${color}${line}${ansi.reset}`);
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// Main box
|
|
472
|
+
lines.push("");
|
|
473
|
+
lines.push(`${ansi.cyan}${sym.boxTL}${sym.boxH.repeat(WIDTH - 2)}${sym.boxTR}${ansi.reset}`);
|
|
474
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
475
|
+
|
|
476
|
+
// Command banner
|
|
477
|
+
const cmdBanner = COMMAND_BANNERS[command];
|
|
478
|
+
if (cmdBanner) {
|
|
479
|
+
const cmdLines = cmdBanner.split("\n");
|
|
480
|
+
cmdLines.forEach(line => {
|
|
481
|
+
const centered = padCenter(line, WIDTH - 4);
|
|
482
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.bold}${ansi.white}${centered}${ansi.reset} ${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
487
|
+
|
|
488
|
+
// Info bar
|
|
489
|
+
const tierBadge = tier === "PRO" ? `${ansi.magenta}PRO${ansi.reset}` : `${ansi.gray}FREE${ansi.reset}`;
|
|
490
|
+
const integrityStr = integrity ? ` :: SYSTEM INTEGRITY: ${getIntegrityColor(integrity)}${integrity}${ansi.reset}` : "";
|
|
491
|
+
const infoLine = `v${version} ${tierBadge}${integrityStr}`;
|
|
492
|
+
|
|
493
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${infoLine}${" ".repeat(Math.max(0, WIDTH - 4 - visibleLength(infoLine)))}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
494
|
+
|
|
495
|
+
// Target and session line
|
|
496
|
+
const shortTarget = truncate(target, 40);
|
|
497
|
+
const durationStr = duration ? ` | Time: ${formatDuration(duration)}` : "";
|
|
498
|
+
const targetLine = `Target: ${shortTarget}${" ".repeat(6)}Session: #${sessionId}${durationStr}`;
|
|
499
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.dim}${truncate(targetLine, WIDTH - 6)}${ansi.reset}${" ".repeat(Math.max(0, WIDTH - 4 - visibleLength(targetLine)))}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
500
|
+
|
|
501
|
+
// Separator
|
|
502
|
+
lines.push(`${ansi.cyan}${sym.boxTeeR}${sym.boxH.repeat(WIDTH - 2)}${sym.boxTeeL}${ansi.reset}`);
|
|
503
|
+
|
|
504
|
+
return lines.join("\n");
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Get color for integrity level
|
|
509
|
+
*/
|
|
510
|
+
function getIntegrityColor(integrity) {
|
|
511
|
+
const upper = integrity.toUpperCase();
|
|
512
|
+
if (upper === "HIGH" || upper === "OPTIMAL") return ansi.green;
|
|
513
|
+
if (upper === "MEDIUM" || upper === "STABLE") return ansi.yellow;
|
|
514
|
+
return ansi.red;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Generate a short session ID
|
|
519
|
+
*/
|
|
520
|
+
function generateSessionId() {
|
|
521
|
+
const chars = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
|
522
|
+
let id = "";
|
|
523
|
+
for (let i = 0; i < 6; i++) {
|
|
524
|
+
id += chars[Math.floor(Math.random() * chars.length)];
|
|
525
|
+
}
|
|
526
|
+
return id;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
530
|
+
// MINIMAL HEADER (for simpler commands)
|
|
531
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Render a minimal header (no full banner, just command name)
|
|
535
|
+
*/
|
|
536
|
+
function renderMinimalHeader(command, tier = "free") {
|
|
537
|
+
const tierBadge = tier === "pro" ? `${ansi.magenta}PRO${ansi.reset}` : `${ansi.dim}free${ansi.reset}`;
|
|
538
|
+
console.log();
|
|
539
|
+
console.log(` ${ansi.cyan}${sym.boxTL}${sym.boxH.repeat(60)}${sym.boxTR}${ansi.reset}`);
|
|
540
|
+
console.log(` ${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.bold}vibecheck ${command}${ansi.reset} ${tierBadge}${" ".repeat(60 - 15 - command.length - (tier === "pro" ? 3 : 4))}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
541
|
+
console.log(` ${ansi.cyan}${sym.boxBL}${sym.boxH.repeat(60)}${sym.boxBR}${ansi.reset}`);
|
|
542
|
+
console.log();
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
546
|
+
// SPLIT COLUMN LAYOUT
|
|
547
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Render a split-column section
|
|
551
|
+
*/
|
|
552
|
+
function renderSplitColumns(leftTitle, rightTitle, leftContent, rightContent, opts = {}) {
|
|
553
|
+
const { leftWidth = 44, rightWidth = 33 } = opts;
|
|
554
|
+
const lines = [];
|
|
555
|
+
|
|
556
|
+
// Header row
|
|
557
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.bold}${padRight(leftTitle, leftWidth)}${ansi.reset}${ansi.dim}│${ansi.reset} ${ansi.bold}${padRight(rightTitle, rightWidth)}${ansi.reset}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
558
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${sym.lineH.repeat(leftWidth)}${ansi.dim}┼${ansi.reset}${sym.lineH.repeat(rightWidth + 1)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
559
|
+
|
|
560
|
+
// Content rows
|
|
561
|
+
const maxRows = Math.max(leftContent.length, rightContent.length);
|
|
562
|
+
for (let i = 0; i < maxRows; i++) {
|
|
563
|
+
const left = leftContent[i] || "";
|
|
564
|
+
const right = rightContent[i] || "";
|
|
565
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${padRight(left, leftWidth)}${ansi.dim}│${ansi.reset} ${padRight(right, rightWidth)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
return lines.join("\n");
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
572
|
+
// VITALS SECTION
|
|
573
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Render system vitals with progress bars
|
|
577
|
+
*/
|
|
578
|
+
function renderVitals(vitals) {
|
|
579
|
+
const lines = [];
|
|
580
|
+
|
|
581
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.bold}SYSTEM VITALS${ansi.reset}${" ".repeat(WIDTH - 17)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
582
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${sym.lineH.repeat(WIDTH - 4)} ${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
583
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
584
|
+
|
|
585
|
+
for (const vital of vitals) {
|
|
586
|
+
const { label, value, status, percent } = vital;
|
|
587
|
+
const statusColor = getStatusColor(status);
|
|
588
|
+
|
|
589
|
+
let line = ` ${padRight(label, 18)} ${statusColor}[${status}]${ansi.reset}`;
|
|
590
|
+
if (percent !== undefined) {
|
|
591
|
+
const bar = renderProgressBar(percent, 25);
|
|
592
|
+
line += `\n${ansi.cyan}${sym.boxV}${ansi.reset} ${bar} ${percent}%`;
|
|
593
|
+
} else if (value) {
|
|
594
|
+
line += ` ${ansi.dim}${value}${ansi.reset}`;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${line}${" ".repeat(Math.max(0, WIDTH - 4 - visibleLength(line)))}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
601
|
+
|
|
602
|
+
return lines.join("\n");
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* Get color for status
|
|
607
|
+
*/
|
|
608
|
+
function getStatusColor(status) {
|
|
609
|
+
const upper = String(status).toUpperCase();
|
|
610
|
+
if (["OPTIMAL", "STABLE", "GOOD", "PASS", "HIGH", "SHIP", "LAUNCH"].includes(upper)) return ansi.green;
|
|
611
|
+
if (["WARNING", "WARN", "HEAVY", "DEGRADED", "MEDIUM"].includes(upper)) return ansi.yellow;
|
|
612
|
+
return ansi.red;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
616
|
+
// FINDINGS/DIAGNOSTIC SECTION
|
|
617
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Render diagnostic log / findings
|
|
621
|
+
*/
|
|
622
|
+
function renderDiagnostics(findings, opts = {}) {
|
|
623
|
+
const { maxItems = 5, title = "DIAGNOSTIC LOG" } = opts;
|
|
624
|
+
const lines = [];
|
|
625
|
+
|
|
626
|
+
lines.push(`${ansi.bold}${title}${ansi.reset}`);
|
|
627
|
+
lines.push(`${sym.lineH.repeat(30)}`);
|
|
628
|
+
|
|
629
|
+
if (findings.length === 0) {
|
|
630
|
+
lines.push("");
|
|
631
|
+
lines.push(`${ansi.green}${sym.check} No issues found${ansi.reset}`);
|
|
632
|
+
return lines;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
findings.slice(0, maxItems).forEach((f, i) => {
|
|
636
|
+
const severityIcon = getSeverityIcon(f.severity);
|
|
637
|
+
const type = f.type || f.rule || "ISSUE";
|
|
638
|
+
|
|
639
|
+
lines.push("");
|
|
640
|
+
lines.push(`${severityIcon} ${type}${f.count ? ` (x${f.count})` : ""}`);
|
|
641
|
+
lines.push(`${sym.lineH.repeat(30)}`);
|
|
642
|
+
lines.push(`Severity: ${getSeverityLabel(f.severity)}`);
|
|
643
|
+
if (f.impact) lines.push(`Impact: ${f.impact}`);
|
|
644
|
+
|
|
645
|
+
if (f.instances && f.instances.length > 0) {
|
|
646
|
+
lines.push("");
|
|
647
|
+
lines.push("DETECTED INSTANCES:");
|
|
648
|
+
lines.push("");
|
|
649
|
+
f.instances.slice(0, 3).forEach((inst, j) => {
|
|
650
|
+
const file = inst.file ? truncate(inst.file, 28) : "Unknown";
|
|
651
|
+
lines.push(`${j + 1}. ${file}`);
|
|
652
|
+
if (inst.message) lines.push(` ${ansi.dim}> ${truncate(inst.message, 25)}${ansi.reset}`);
|
|
653
|
+
});
|
|
654
|
+
} else if (f.file) {
|
|
655
|
+
lines.push("");
|
|
656
|
+
lines.push(`File: ${truncate(f.file, 25)}`);
|
|
657
|
+
if (f.message) lines.push(`${ansi.dim}> ${truncate(f.message, 25)}${ansi.reset}`);
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
if (findings.length > maxItems) {
|
|
662
|
+
lines.push("");
|
|
663
|
+
lines.push(`${ansi.dim}... and ${findings.length - maxItems} more${ansi.reset}`);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
return lines;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Get icon for severity
|
|
671
|
+
*/
|
|
672
|
+
function getSeverityIcon(severity) {
|
|
673
|
+
const upper = String(severity).toUpperCase();
|
|
674
|
+
if (["CRITICAL", "BLOCK", "HIGH"].includes(upper)) return `${ansi.red}[FAIL]${ansi.reset}`;
|
|
675
|
+
if (["WARNING", "WARN", "MEDIUM"].includes(upper)) return `${ansi.yellow}[WARN]${ansi.reset}`;
|
|
676
|
+
return `${ansi.blue}[INFO]${ansi.reset}`;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Get label for severity
|
|
681
|
+
*/
|
|
682
|
+
function getSeverityLabel(severity) {
|
|
683
|
+
const upper = String(severity).toUpperCase();
|
|
684
|
+
if (["CRITICAL", "BLOCK"].includes(upper)) return `${ansi.red}CRITICAL${ansi.reset}`;
|
|
685
|
+
if (upper === "HIGH") return `${ansi.red}HIGH${ansi.reset}`;
|
|
686
|
+
if (["WARNING", "WARN", "MEDIUM"].includes(upper)) return `${ansi.yellow}MEDIUM${ansi.reset}`;
|
|
687
|
+
return `${ansi.blue}LOW${ansi.reset}`;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
691
|
+
// SECURITY AUDIT SECTION
|
|
692
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Render security audit checklist
|
|
696
|
+
*/
|
|
697
|
+
function renderSecurityAudit(checks) {
|
|
698
|
+
const lines = [];
|
|
699
|
+
|
|
700
|
+
lines.push(`${ansi.bold}SECURITY AUDIT${ansi.reset}`);
|
|
701
|
+
lines.push("");
|
|
702
|
+
|
|
703
|
+
for (const check of checks) {
|
|
704
|
+
const icon = check.pass ? `${ansi.green}${sym.check}${ansi.reset}` : `${ansi.red}${sym.cross}${ansi.reset}`;
|
|
705
|
+
const status = check.pass ? `${ansi.green}PASS${ansi.reset}` : `${ansi.red}FAIL${ansi.reset}`;
|
|
706
|
+
const dots = ".".repeat(Math.max(0, 20 - check.name.length));
|
|
707
|
+
lines.push(` ${icon} ${check.name}${ansi.dim}${dots}${ansi.reset}${status}`);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
return lines;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
714
|
+
// ACTION REQUIRED SECTION
|
|
715
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Render action required section
|
|
719
|
+
*/
|
|
720
|
+
function renderActionRequired(actions, opts = {}) {
|
|
721
|
+
const { blocking = false, title = "ACTION REQUIRED" } = opts;
|
|
722
|
+
const lines = [];
|
|
723
|
+
|
|
724
|
+
lines.push(`${ansi.cyan}${sym.boxTeeR}${sym.boxH.repeat(WIDTH - 2)}${sym.boxTeeL}${ansi.reset}`);
|
|
725
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.bold}${title}${ansi.reset}${" ".repeat(WIDTH - 4 - title.length)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
726
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${sym.lineH.repeat(WIDTH - 4)} ${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
727
|
+
|
|
728
|
+
if (blocking) {
|
|
729
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.red}[!] BLOCKING ISSUES DETECTED. DEPLOYMENT HALTED.${ansi.reset}${" ".repeat(WIDTH - 54)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
733
|
+
|
|
734
|
+
for (const action of actions) {
|
|
735
|
+
const cmd = `${ansi.cyan}> ${action.command}${ansi.reset}`;
|
|
736
|
+
const label = action.label ? `${ansi.dim}[${action.label}]${ansi.reset}` : "";
|
|
737
|
+
const desc = action.description || "";
|
|
738
|
+
|
|
739
|
+
const line = ` ${cmd}${" ".repeat(Math.max(2, 26 - action.command.length))}${label} ${desc}`;
|
|
740
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${padRight(line, WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
return lines.join("\n");
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
747
|
+
// FOOTER
|
|
748
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Render standard footer
|
|
752
|
+
*/
|
|
753
|
+
function renderFooter() {
|
|
754
|
+
return `${ansi.cyan}${sym.boxBL}${sym.boxH.repeat(WIDTH - 2)}${sym.boxBR}${ansi.reset}`;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
758
|
+
// VERDICT BOX
|
|
759
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Render a verdict box
|
|
763
|
+
*/
|
|
764
|
+
function renderVerdict(verdict, score, stats = {}) {
|
|
765
|
+
const { blockers = 0, warnings = 0, passed = 0, duration = 0 } = stats;
|
|
766
|
+
|
|
767
|
+
const verdictColors = {
|
|
768
|
+
SHIP: ansi.green,
|
|
769
|
+
LAUNCH: ansi.green,
|
|
770
|
+
PASS: ansi.green,
|
|
771
|
+
WARN: ansi.yellow,
|
|
772
|
+
WARNING: ansi.yellow,
|
|
773
|
+
BLOCK: ansi.red,
|
|
774
|
+
FAIL: ansi.red,
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
const verdictIcons = {
|
|
778
|
+
SHIP: sym.rocket,
|
|
779
|
+
LAUNCH: sym.rocket,
|
|
780
|
+
PASS: sym.check,
|
|
781
|
+
WARN: sym.warning,
|
|
782
|
+
WARNING: sym.warning,
|
|
783
|
+
BLOCK: sym.cross,
|
|
784
|
+
FAIL: sym.cross,
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
const color = verdictColors[verdict.toUpperCase()] || ansi.gray;
|
|
788
|
+
const icon = verdictIcons[verdict.toUpperCase()] || sym.bullet;
|
|
789
|
+
|
|
790
|
+
const lines = [];
|
|
791
|
+
|
|
792
|
+
lines.push(`${ansi.cyan}${sym.boxTeeR}${sym.boxH.repeat(WIDTH - 2)}${sym.boxTeeL}${ansi.reset}`);
|
|
793
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
794
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${icon} ${ansi.bold}VERDICT: ${color}${verdict}${ansi.reset}${" ".repeat(WIDTH - 16 - verdict.length)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
795
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
796
|
+
|
|
797
|
+
// Score bar
|
|
798
|
+
const bar = renderProgressBar(score, 30, { color });
|
|
799
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} Score: ${bar} ${score}/100${" ".repeat(WIDTH - 54)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
800
|
+
|
|
801
|
+
// Stats
|
|
802
|
+
const statsLine = `Blockers: ${blockers} Warnings: ${warnings} Passed: ${passed}`;
|
|
803
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${statsLine}${" ".repeat(WIDTH - 4 - statsLine.length)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
804
|
+
|
|
805
|
+
if (duration) {
|
|
806
|
+
const durationLine = `Duration: ${formatDuration(duration)}`;
|
|
807
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset} ${ansi.dim}${durationLine}${ansi.reset}${" ".repeat(WIDTH - 4 - durationLine.length)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
lines.push(`${ansi.cyan}${sym.boxV}${ansi.reset}${" ".repeat(WIDTH - 2)}${ansi.cyan}${sym.boxV}${ansi.reset}`);
|
|
811
|
+
|
|
812
|
+
return lines.join("\n");
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
816
|
+
// SECTION HEADER
|
|
817
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Render a section header within the box
|
|
821
|
+
*/
|
|
822
|
+
function renderSectionHeader(title, icon = sym.bullet) {
|
|
823
|
+
console.log(` ${ansi.cyan}${icon}${ansi.reset} ${ansi.bold}${title}${ansi.reset}`);
|
|
824
|
+
console.log(` ${ansi.dim}${sym.lineH.repeat(60)}${ansi.reset}`);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
828
|
+
// SUCCESS/ERROR/WARNING MESSAGES
|
|
829
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
830
|
+
|
|
831
|
+
function renderSuccess(message) {
|
|
832
|
+
console.log(` ${ansi.green}${sym.check}${ansi.reset} ${message}`);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
function renderError(message) {
|
|
836
|
+
console.log(` ${ansi.red}${sym.cross}${ansi.reset} ${message}`);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
function renderWarning(message) {
|
|
840
|
+
console.log(` ${ansi.yellow}${sym.warning}${ansi.reset} ${message}`);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
function renderInfo(message) {
|
|
844
|
+
console.log(` ${ansi.cyan}${sym.info}${ansi.reset} ${message}`);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
848
|
+
// SPINNER CLASS
|
|
849
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
850
|
+
|
|
851
|
+
const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
852
|
+
|
|
853
|
+
class Spinner {
|
|
854
|
+
constructor(text = "", color = ansi.cyan) {
|
|
855
|
+
this.text = text;
|
|
856
|
+
this.color = color;
|
|
857
|
+
this.timer = null;
|
|
858
|
+
this.frameIndex = 0;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
start(text) {
|
|
862
|
+
if (text) this.text = text;
|
|
863
|
+
process.stdout.write(ansi.hideCursor);
|
|
864
|
+
this.timer = setInterval(() => {
|
|
865
|
+
const frame = SPINNER_FRAMES[this.frameIndex];
|
|
866
|
+
this.frameIndex = (this.frameIndex + 1) % SPINNER_FRAMES.length;
|
|
867
|
+
process.stdout.write(`\r ${this.color}${frame}${ansi.reset} ${this.text}`);
|
|
868
|
+
}, 80);
|
|
869
|
+
return this;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
update(text) {
|
|
873
|
+
this.text = text;
|
|
874
|
+
return this;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
stop(icon = sym.check, color = ansi.green, finalText) {
|
|
878
|
+
if (this.timer) clearInterval(this.timer);
|
|
879
|
+
process.stdout.write(`\r${ansi.clearLine}`);
|
|
880
|
+
if (finalText !== null) {
|
|
881
|
+
const msg = finalText || this.text;
|
|
882
|
+
console.log(` ${color}${icon}${ansi.reset} ${msg}`);
|
|
883
|
+
}
|
|
884
|
+
process.stdout.write(ansi.showCursor);
|
|
885
|
+
return this;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
succeed(text) { return this.stop(sym.check, ansi.green, text); }
|
|
889
|
+
fail(text) { return this.stop(sym.cross, ansi.red, text); }
|
|
890
|
+
warn(text) { return this.stop(sym.warning, ansi.yellow, text); }
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
894
|
+
// EXPORTS
|
|
895
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
896
|
+
|
|
897
|
+
module.exports = {
|
|
898
|
+
// Constants
|
|
899
|
+
WIDTH,
|
|
900
|
+
INNER_WIDTH,
|
|
901
|
+
|
|
902
|
+
// ANSI & Symbols
|
|
903
|
+
ansi,
|
|
904
|
+
sym,
|
|
905
|
+
|
|
906
|
+
// Banners
|
|
907
|
+
VIBECHECK_BANNER,
|
|
908
|
+
COMMAND_BANNERS,
|
|
909
|
+
|
|
910
|
+
// Utilities
|
|
911
|
+
stripAnsi,
|
|
912
|
+
visibleLength,
|
|
913
|
+
padRight,
|
|
914
|
+
padLeft,
|
|
915
|
+
padCenter,
|
|
916
|
+
truncate,
|
|
917
|
+
formatDuration,
|
|
918
|
+
formatNumber,
|
|
919
|
+
|
|
920
|
+
// Progress & Status
|
|
921
|
+
renderProgressBar,
|
|
922
|
+
renderStatus,
|
|
923
|
+
|
|
924
|
+
// Headers
|
|
925
|
+
renderFullHeader,
|
|
926
|
+
renderMinimalHeader,
|
|
927
|
+
generateSessionId,
|
|
928
|
+
|
|
929
|
+
// Layouts
|
|
930
|
+
renderSplitColumns,
|
|
931
|
+
renderVitals,
|
|
932
|
+
renderDiagnostics,
|
|
933
|
+
renderSecurityAudit,
|
|
934
|
+
renderActionRequired,
|
|
935
|
+
renderVerdict,
|
|
936
|
+
renderFooter,
|
|
937
|
+
renderSectionHeader,
|
|
938
|
+
|
|
939
|
+
// Messages
|
|
940
|
+
renderSuccess,
|
|
941
|
+
renderError,
|
|
942
|
+
renderWarning,
|
|
943
|
+
renderInfo,
|
|
944
|
+
|
|
945
|
+
// Spinner
|
|
946
|
+
Spinner,
|
|
947
|
+
};
|