UNPKG

ubon

Version:

Security scanner for AI-generated apps (Cursor, Lovable, Windsurf, v0). Catches hardcoded secrets, prompt injection, hallucinated imports, Server Actions / Edge runtime mistakes, and the vibe-coded vulnerabilities traditional linters miss.

77 lines 2.54 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Logger = void 0; const colors_1 = __importDefault(require("./colors")); class Logger { verbose; silent; quiet; useColor; /** * `quiet` is a softer form of `silent`: it suppresses chatty progress * (info/success/title/separator/debug) but still allows warnings & errors * to surface. Used by --quiet for CI runs that want JSON-friendly output * without noisy prefixes. */ constructor(verbose = false, silent = false, colorMode = 'auto', quiet = false) { this.verbose = verbose; this.silent = silent; this.quiet = quiet; this.useColor = this.shouldUseColor(colorMode); } shouldUseColor(mode) { if (mode === 'always') return true; if (mode === 'never') return false; // auto: check if we're in a terminal that supports color return process.stdout.isTTY && !process.env.NO_COLOR; } colorize(fn, text) { return this.useColor ? fn(text) : text; } brand(text) { return this.useColor ? colors_1.default.hex('#c99cb3')(text) : text; } info(message) { if (!this.silent && !this.quiet) { console.log(this.brand('🪷'), message); } } success(message) { if (!this.silent && !this.quiet) { console.log(this.colorize(colors_1.default.green, '✓'), message); } } warning(message) { if (!this.silent) { console.log(this.colorize(colors_1.default.yellow, '⚠'), message); } } error(message) { if (!this.silent) { console.log(this.colorize(colors_1.default.red, '✗'), message); } } debug(message) { if (this.verbose && !this.silent && !this.quiet) { console.log(this.brand('🪷'), this.colorize(colors_1.default.gray, message)); } } title(message) { if (!this.silent && !this.quiet) { const titleText = this.useColor ? this.brand(colors_1.default.bold('🪷 ' + message)) : '🪷 ' + message; console.log('\n' + titleText); } } separator() { if (!this.silent && !this.quiet) { console.log(this.brand('─'.repeat(50))); } } } exports.Logger = Logger; //# sourceMappingURL=logger.js.map