/**
 * Deterministic Scanner Types
 *
 * Types for the pre-pass scanner layer that runs deterministic tools
 * (Semgrep, npm audit, gitleaks, tsc) before LLM agents.
 *
 * All deterministic findings have confidence: 100 by definition.
 *
 * @module scanners/types
 */
/**
 * Default scanner options
 */
export const DEFAULT_SCANNER_OPTIONS = {
    semgrep: true,
    dependencies: true,
    secrets: true,
    typescript: true,
    eslint: false, // Optional, not enabled by default
    bandit: false, // Auto-enabled if Python detected
    gosec: false, // Auto-enabled if Go detected
    brakeman: false, // Auto-enabled if Ruby detected
    trivy: false, // Optional container/IaC scanning
    binaryAnalysis: true, // Enabled by default (checks native modules)
    memorySafety: false, // Auto-enabled if C/C++/Rust detected
    raceCondition: true, // Enabled by default
    timeout: 120000, // 2 minutes per scanner
};
/**
 * Severity mapping from scanner-specific severities to vaspera severities
 */
export const SEVERITY_MAPPINGS = {
    // npm audit / osv-scanner
    npm: {
        critical: "critical",
        high: "high",
        moderate: "medium",
        low: "low",
        info: "info",
    },
    // Semgrep
    semgrep: {
        ERROR: "high",
        WARNING: "medium",
        INFO: "low",
    },
    // gitleaks (all secrets are critical)
    gitleaks: {
        default: "critical",
    },
    // TypeScript compiler
    typescript: {
        error: "high",
        warning: "medium",
        suggestion: "low",
        message: "info",
    },
    // Bandit (Python)
    bandit: {
        HIGH: "high",
        MEDIUM: "medium",
        LOW: "low",
    },
    // gosec (Go)
    gosec: {
        HIGH: "high",
        MEDIUM: "medium",
        LOW: "low",
    },
    // Brakeman (Ruby)
    brakeman: {
        High: "high",
        Medium: "medium",
        Weak: "low",
    },
    // Trivy
    trivy: {
        CRITICAL: "critical",
        HIGH: "high",
        MEDIUM: "medium",
        LOW: "low",
        UNKNOWN: "info",
    },
};
/**
 * Convert a DeterministicFinding to a certification Finding
 */
export function toFindingId(scanner, ruleId, index) {
    const prefix = {
        semgrep: "sem",
        "npm-audit": "dep",
        gitleaks: "sec",
        tsc: "ts",
        eslint: "lint",
        bandit: "py",
        gosec: "go",
        brakeman: "rb",
        trivy: "trv",
        "binary-analysis": "bin",
        "memory-safety": "mem",
        "race-condition": "rac",
        healthcare: "hc",
        logic: "log",
        dast: "dst",
        zap: "zap",
        nuclei: "nuc",
        terraform: "tf",
        tfsec: "tfs",
        checkov: "chk",
        openapi: "api",
        spectral: "spc",
        rust: "rs",
        "cargo-audit": "cra",
        clippy: "clp",
        detection: "det",
        plugin: "plg",
    };
    return `${prefix[scanner]}-${String(index + 1).padStart(3, "0")}`;
}
//# sourceMappingURL=types.js.map