/**
 * Type definitions for mp-sentinel CLI
 */
type ReviewMode = "commit" | "range" | "staged" | "files";
type ReviewFormat = "console" | "json" | "markdown" | "sarif";
interface ReviewTarget {
    mode: ReviewMode;
    value?: string;
    files?: string[];
}
interface ReviewInputFile {
    path: string;
    patch: string;
    additions: number;
    deletions: number;
    changedLines: number;
    truncated?: boolean;
}
interface ReviewSkippedItem {
    path: string;
    reason: string;
}
interface ReviewSummary {
    totalFiles: number;
    auditedFiles: number;
    passedFiles: number;
    failedFiles: number;
    criticalIssues: number;
    warningIssues: number;
    infoIssues: number;
    durationMs: number;
    totalChangedLines: number;
    /**
     * Aggregate token usage across all AI calls in this review (Phase 1.1).
     * Absent when no AI calls were made (dry-run / deterministic / all-cached).
     */
    tokenUsage?: {
        inputTokens: number;
        outputTokens: number;
        /** Number of AI calls that contributed usage data (may be < auditedFiles when some calls were cached) */
        callCount: number;
        /** Best-effort USD cost estimate. Absent when the model has no entry in the pricing table. */
        estimatedCostUsd?: number;
    };
}
interface ReviewReport {
    schemaVersion: "1.0";
    status: "PASS" | "FAIL" | "ERROR";
    target: ReviewTarget;
    /**
     * Human-readable target description for report/summary display, e.g.
     * `branch-diff (feature/x vs origin/main)`. Additive and optional: the
     * machine-readable `target` (mode/value) is unchanged. Formatters prefer
     * `targetLabel` when present, falling back to `target`. (v3.2.5+)
     */
    targetLabel?: string;
    aiEnabled: boolean;
    promptVersion: string;
    summary: ReviewSummary;
    results: FileAuditResult[];
    skipped: ReviewSkippedItem[];
    errors: string[];
    generatedAt: string;
    /** MCP runtime observability (only when MCP is enabled) */
    mcp?: MCPContextSummary;
    /**
     * Commits covered by the reviewed range, in CHRONOLOGICAL order
     * (index 0 = oldest). Optional and additive (schema-compatible). Lets
     * report consumers reason about "fixed in a later commit" without
     * re-deriving — and without misreading `git log`'s newest-first order.
     * (v3.1.1+)
     */
    commits?: CommitInfo[];
}
/**
 * Commit pattern configuration for local review mode
 * Allows defining valid commit message patterns that will be reviewed
 */
interface CommitPattern {
    /** Pattern name/type (e.g., 'feat', 'fix', 'chore') */
    type: string;
    /** Regex pattern to match commit messages */
    pattern: string;
    /** Description of this pattern */
    description?: string;
    /** Whether to require this pattern for all commits */
    required?: boolean;
}
/**
 * Local review mode configuration
 * For running reviews directly on branches without CI/CD
 */
interface LocalReviewConfig {
    /** Enable local review mode */
    enabled?: boolean;
    /** Number of recent commits to review (default: 1) */
    commitCount?: number;
    /** Commit patterns to match for review */
    commitPatterns?: CommitPattern[];
    /** Only review commits matching these patterns */
    filterByPattern?: boolean;
    /** Skip review for these commit message prefixes */
    skipPatterns?: string[];
    /**
     * Exclude patterns — commits whose messages match ANY of these regex strings
     * are excluded from review even if they match commitPatterns.
     * Example: ["^Merge", "^Revert", "^chore\\(release\\)"]
     */
    excludePatterns?: string[];
    /** Include merge commits in review */
    includeMergeCommits?: boolean;
    /**
     * Enable branch diff mode - get commits that differ from target branch
     * When enabled, ignores commitCount and gets all commits since branching from compareBranch
     */
    branchDiffMode?: boolean;
    /**
     * Target branch to compare against (default: 'origin/main')
     * Used when branchDiffMode is enabled
     */
    compareBranch?: string;
    /**
     * Match mode for patterns:
     * - 'any': Match if any pattern matches (default)
     * - 'all': Match only if all required patterns match
     * - 'exclude-first': Apply excludePatterns first, then match remaining with 'any'
     */
    patternMatchMode?: "any" | "all" | "exclude-first";
    /**
     * Show detailed pattern matching info in output
     */
    verbosePatternMatching?: boolean;
}
/**
 * Commit info for local review
 */
interface CommitInfo {
    hash: string;
    message: string;
    author: string;
    date: string;
    files: string[];
}
interface ProjectConfig {
    techStack?: string;
    rules?: string[];
    /** File paths (relative to project root) to load additional rules from */
    ruleFiles?: string[];
    bypassKeyword?: string;
    commitFormat?: string;
    maxConcurrency?: number;
    cacheEnabled?: boolean;
    gitProvider?: "github" | "gitlab";
    repoUrl?: string;
    projectId?: string;
    /** Local review mode configuration */
    localReview?: LocalReviewConfig;
    /** Enable local skills fetch for enhanced prompts */
    enableSkillsFetch?: boolean;
    /** Timeout for skills fetch in milliseconds (default: 3000) */
    skillsFetchTimeout?: number;
    ai?: AIReviewConfig;
    /** Source indexing configuration */
    indexing?: Partial<IndexingConfig>;
    /** Create-skills AI enrichment configuration */
    createSkills?: CreateSkillsConfig;
    /** MCP (Model Context Protocol) external context configuration */
    mcp?: MCPConfig;
    /** Review pass/fail decision controls (Phase 1.5) */
    review?: ReviewSettings;
    /** Security service tuning (Phase 2.1) — entropy detection + custom patterns */
    security?: SecuritySettings;
    /** Cache backend selection (Phase 3.3) — fs (default) or http */
    cache?: CacheSettings;
    /** ESLint adapter — merge the reviewed project's own ESLint findings (opt-in) */
    eslint?: ESLintAdapterConfig;
}
/**
 * ESLint adapter settings. The adapter runs the reviewed project's own
 * ESLint installation and merges its findings into the review report.
 * Fail-open: if ESLint or its config is missing, the review proceeds
 * without ESLint findings (a warning is logged).
 */
interface ESLintAdapterConfig {
    /** Run the project's ESLint and merge findings (default: false). */
    enabled?: boolean;
    /**
     * Per-ruleId severity overrides, e.g. { "no-console": "INFO" }.
     * Overrides win over the built-in CRITICAL whitelist and the default
     * ESLint level mapping (2 → WARNING, 1 → INFO).
     */
    severityOverrides?: Record<string, "CRITICAL" | "WARNING" | "INFO">;
    /** Timeout for each spawned ESLint process in ms (default: 60000). */
    timeoutMs?: number;
}
/**
 * Cache backend settings (Phase 3.3). Choose where audit-result cache
 * entries are stored:
 *   - `fs` (default): local `.mp-sentinel-cache/` directory
 *   - `http`: shared HTTP key-value store (e.g. for CI runners)
 *
 * The fs and http backends share the same SHA-256 key derivation, so an
 * entry written by one is readable by the other if both point at the
 * same logical store.
 */
interface CacheSettings {
    /** Which backend to use. Defaults to `fs`. */
    backend?: "fs" | "http";
    /** Filesystem backend options (cwd-relative). */
    fs?: {
        /** Override the default `.mp-sentinel-cache/` directory. */
        cacheDir?: string;
    };
    /** HTTP backend options. */
    http?: {
        /** Required. Base URL — joined with `/<key>` per entry. */
        baseUrl?: string;
        /** Extra headers (e.g. Authorization). */
        headers?: Record<string, string>;
        /** Per-request timeout in milliseconds (default 5000). */
        timeoutMs?: number;
    };
}
interface SecurityCustomPattern {
    /** Display name used in logs (e.g. "Internal Webhook Secret"). */
    name: string;
    /** Source string for the RegExp body — must be a valid regular expression. */
    pattern: string;
    /** Regex flags (default: "g"). */
    flags?: string;
}
interface SecuritySettings {
    /** Turn on the Shannon-entropy secret detector (Phase 2.1). Default: false. */
    entropyEnabled?: boolean;
    /** Minimum length for entropy candidates (default: 24). */
    entropyMinLength?: number;
    /** Minimum bits/char for entropy candidates (default: 4.5). */
    entropyMinBitsPerChar?: number;
    /** Exact values never flagged — useful for publishable keys, fixtures. */
    allowValues?: string[];
    /** Globs of files where the security service is skipped entirely. */
    allowPaths?: string[];
    /** Project-specific extra regex patterns appended after the defaults. */
    customPatterns?: SecurityCustomPattern[];
}
/**
 * Severity levels used by the review pass/fail decision (Phase 1.5).
 * `CRITICAL` is the strictest (only CRITICAL fails), `INFO` is the loosest
 * (any finding at INFO or higher fails).
 */
type SeverityThreshold = "CRITICAL" | "WARNING" | "INFO";
interface ReviewSettings {
    /**
     * Minimum severity that causes the review to FAIL (default: CRITICAL).
     * Examples:
     *   - "CRITICAL" — only CRITICAL findings fail the review
     *   - "WARNING"  — CRITICAL or WARNING findings fail the review
     *   - "INFO"     — any finding fails the review
     */
    severityThreshold?: SeverityThreshold;
    /**
     * Per-branch overrides keyed by branch name. When the current branch
     * matches a key (exact match against `getCurrentBranch()`), the override
     * supersedes `severityThreshold`.
     */
    protectedBranches?: Record<string, SeverityThreshold>;
    /**
     * Noise budget: cap the number of non-CRITICAL findings reported per file.
     * CRITICAL findings are never capped. When a file exceeds the cap, the
     * lowest-severity / least-informative WARNING and INFO findings are dropped
     * and a single summary finding records how many were hidden. 0 / unset =
     * no cap. (v3.2.0+)
     */
    maxFindingsPerFile?: number;
}
interface CreateSkillsAIConfig {
    enabled?: boolean;
    provider?: string;
    model?: string;
    temperature?: number;
    maxTokens?: number;
}
interface CreateSkillsPolicies {
    maxFileLines: number;
    warnFileLines: number;
    maxFunctionLines: number;
    /**
     * Max lines for a React component's *logic* body (hooks, handlers, derived
     * state) — the JSX return is excluded from this count. Components legitimately
     * concentrate more lines than a plain helper, so this is higher than
     * `maxFunctionLines`. Used by the React `long-function` evaluator.
     */
    maxComponentLines: number;
    maxParams: number;
    maxCyclomaticHint: number;
    forbidDefaultExports: boolean;
}
interface RulePackOverrideDef {
    from: string;
    override?: Array<{
        id: string;
        severity?: "must" | "should" | "avoid";
    }>;
    disable?: string[];
}
interface CreateSkillsRulePacksConfig {
    include?: string[];
    exclude?: string[];
    extends?: RulePackOverrideDef[];
}
interface CreateSkillsConfig {
    ai?: CreateSkillsAIConfig;
    policies?: CreateSkillsPolicies;
    rulePacks?: CreateSkillsRulePacksConfig;
    /**
     * Rule ids to omit from generated SKILL.md output (Phase 4.3). Format
     * is `<packId>/<ruleId>`, matching the same convention used by file
     * evaluators. Rules without an `id` field can't be targeted.
     *
     * Example:
     *   { "createSkills": { "disableRules": ["next/image-optimization"] } }
     */
    disableRules?: string[];
}
/** A single tool invocation against an MCP server */
interface MCPCall {
    /** Tool name to invoke */
    tool: string;
    /** JSON input passed to the tool. String values support template vars: ${repo.owner}, etc. */
    input: Record<string, unknown>;
    /** Per-call character limit override (defaults to mcp.maxContextChars) */
    maxChars?: number;
}
/** Definition of a single MCP server (stdio transport only for MVP) */
interface MCPServer {
    /** Unique identifier for this server within the config */
    id: string;
    /** Transport type — only "stdio" is supported */
    transport: "stdio";
    /** Command to spawn (e.g., "npx", "node", "python") */
    command: string;
    /** Arguments passed to the command */
    args: string[];
    /**
     * Environment variables to forward to the child process.
     * Keys are the env var names in the child process.
     * Values are the names of process.env variables to copy from.
     * Only explicitly named variables are forwarded.
     */
    env?: Record<string, string>;
    /** Ordered list of tool calls to make against this server */
    calls: MCPCall[];
}
/**
 * Pre-configured MCP server preset. Each preset expands to a full
 * `MCPServer` definition with a known command + default env mapping.
 * Phase 4.4 added: filesystem, git, slack, linear, postgres.
 */
type MCPPreset = MCPGitHubPreset | MCPFetchPreset | MCPFilesystemPreset | MCPGitPreset | MCPSlackPreset | MCPLinearPreset | MCPPostgresPreset;
/** GitHub MCP server preset */
interface MCPGitHubPreset {
    preset: "github";
    calls: MCPCall[];
    /** Env var mapping: { "CHILD_NAME": "PROCESS_ENV_NAME" }. Defaults to { "GITHUB_TOKEN": "GITHUB_TOKEN" }. */
    env?: Record<string, string>;
}
/** Fetch MCP server preset (urls[] expand to individual fetch tool calls) */
interface MCPFetchPreset {
    preset: "fetch";
    calls?: MCPCall[];
    urls?: string[];
    /** Env var mapping: { "CHILD_NAME": "PROCESS_ENV_NAME" }. */
    env?: Record<string, string>;
}
/**
 * Filesystem MCP server (Phase 4.4). Read-only access to project files
 * via `@modelcontextprotocol/server-filesystem`. The official server
 * already enforces a sandboxed root path; `rootPaths` (defaults to the
 * project cwd) determines which directories are visible.
 */
interface MCPFilesystemPreset {
    preset: "filesystem";
    /** Directories the MCP server may read from. Defaults to `${cwd}`. */
    rootPaths?: string[];
    /** Tool calls to make. Typically `read_file` / `list_directory`. */
    calls: MCPCall[];
}
/**
 * Git MCP server (Phase 4.4). Read-only git operations via `uvx
 * mcp-server-git`. Used for `git_log`, `git_show`, `git_diff_unstaged`,
 * etc. -- read-only verbs only; mutating tools are rejected at the
 * MCPCallSchema layer.
 */
interface MCPGitPreset {
    preset: "git";
    /** Repository root the MCP server reads from. Defaults to `${cwd}`. */
    repository?: string;
    calls: MCPCall[];
}
/**
 * Slack MCP server (Phase 4.4). Gated on `SLACK_BOT_TOKEN` (and optionally
 * `SLACK_TEAM_ID`). Read-only verbs (`channels_list`, `channels_history`,
 * `users_list`) are typical; mutating tools (`chat_postMessage`, etc.)
 * are rejected by the global MCPCallSchema mutating-prefix guard.
 */
interface MCPSlackPreset {
    preset: "slack";
    calls: MCPCall[];
    /** Defaults to { SLACK_BOT_TOKEN: "SLACK_BOT_TOKEN", SLACK_TEAM_ID: "SLACK_TEAM_ID" }. */
    env?: Record<string, string>;
}
/**
 * Linear MCP server (Phase 4.4). Gated on `LINEAR_API_KEY`. Read verbs
 * like `list_issues`, `get_issue`, `list_projects`.
 *
 * Note: this preset spawns the **community stdio server**
 * (`@tacticlaunch/mcp-linear` via `npx`) -- it is *not* Linear's hosted
 * remote MCP server (`https://mcp.linear.app/...`), which uses a remote
 * transport and OAuth. To use a different package or transport, define
 * an explicit entry in `mcp.servers[]` instead of this preset.
 */
interface MCPLinearPreset {
    preset: "linear";
    calls: MCPCall[];
    /** Defaults to { LINEAR_API_KEY: "LINEAR_API_KEY" }. */
    env?: Record<string, string>;
}
/**
 * Postgres MCP server (Phase 4.4). Read-only -- the reference Postgres MCP
 * server (`@modelcontextprotocol/server-postgres`) only exposes read
 * tools and **requires the connection URL as a CLI argument**, not an
 * env var. The standard mutating-tool guard still blocks anything with
 * a `create/update/delete/...` prefix.
 */
interface MCPPostgresPreset {
    preset: "postgres";
    /**
     * Name of the process.env variable holding the Postgres connection URL
     * (e.g. `postgresql://user:pass@host:5432/db`). The value is appended
     * as the connection-URL argument the server expects. Default:
     * `DATABASE_URL`. Expansion fails with a clear error when the variable
     * is unset.
     */
    connectionUrlEnv?: string;
    /** Extra env vars to forward to the child process (optional). */
    env?: Record<string, string>;
    calls: MCPCall[];
}
/** Top-level MCP configuration */
interface MCPConfig {
    /** Enable MCP external context gathering (default: false) */
    enabled?: boolean;
    /** Timeout in milliseconds for MCP server connection + tool calls (default: 3000) */
    timeoutMs?: number;
    /** Maximum total characters of MCP context to inject into the system prompt (default: 6000) */
    maxContextChars?: number;
    /** Cache MCP results to avoid re-fetching on every review (default: true) */
    cacheEnabled?: boolean;
    /** TTL for MCP cache entries in milliseconds (default: 3600000 = 1 hour) */
    cacheTtlMs?: number;
    /** MCP server definitions */
    servers?: MCPServer[];
    /** Preset shortcuts that expand into full server definitions */
    presets?: MCPPreset[];
}
/** Diagnostic status for a single MCP server */
type MCPDiagnosticStatus = "disabled" | "ready" | "missing_env" | "missing_command";
/** Per-server diagnostic information */
interface MCPDiagnosticServer {
    id: string;
    command: string;
    status: MCPDiagnosticStatus;
    toolCount: number;
    /** Origin of this server: "preset" (expanded) or "explicit" (user-defined) */
    source: "preset" | "explicit";
    missingVars?: string[];
    /** Human-readable suggested actions (e.g., "Set GITHUB_TOKEN env var") */
    recommendedActions?: string[];
}
/** MCP cache settings surfaced in diagnostics */
interface MCPCacheSettings {
    enabled: boolean;
    ttlMs: number;
}
/** MCP diagnostics summary — read-only, no spawn */
interface MCPDiagnostics {
    enabled: boolean;
    serverCount: number;
    servers: MCPDiagnosticServer[];
    cacheSettings?: MCPCacheSettings;
}
/** Per-call cache status */
type MCPCacheStatus = "hit" | "miss" | "disabled";
/** Per-call execution status */
type MCPCallStatus = "ok" | "failed" | "skipped";
/** Per-call metadata recorded during MCP context gathering (no secret values) */
interface MCPCallDetail {
    serverId: string;
    tool: string;
    cacheStatus: MCPCacheStatus;
    status: MCPCallStatus;
}
/** MCP runtime summary surfaced in review output and diagnostics */
interface MCPContextSummary {
    enabled: boolean;
    serverCount: number;
    attemptedCallCount: number;
    cachedCallCount: number;
    freshCallCount: number;
    failedCallCount: number;
    contextChars: number;
    truncated: boolean;
    warnings: string[];
    calls: MCPCallDetail[];
}
interface AuditIssue {
    line: number;
    severity: "CRITICAL" | "WARNING" | "INFO";
    message: string;
    suggestion?: string;
    /** Categorization rubric: security, runtime-crash, architecture, dependency-version, test-gap, performance, maintainability (v1.34.0+) */
    category?: string;
    /** Confidence level: low | medium | high (v1.34.0+) */
    confidence?: "low" | "medium" | "high";
    /** Supporting evidence for the issue (v1.34.0+) */
    evidence?: string;
    /**
     * Reconciliation status against the current working tree (v3.1.1+).
     * Only set in historical-commit review mode (`--commit <sha>`):
     * - "resolved-at-head": the quoted evidence no longer exists at HEAD and
     *   git history shows a commit that changed it — the issue was fixed by a
     *   later commit. Excluded from pass/fail and severity counts.
     * - "unverified": the evidence appears in neither the working tree nor
     *   git history — likely paraphrased or hallucinated.
     * Absent = active finding (or reconciliation not applicable).
     */
    resolution?: "resolved-at-head" | "unverified";
    /** Short SHA of the commit that resolved this issue (when resolution = "resolved-at-head"). */
    resolvedBy?: string;
    /**
     * Structured, ready-to-apply code replacement for the single flagged line.
     * Pure code (no prose), small, and matching the file's style. Rendered as a
     * provider code-suggestion block ONLY when it passes safety checks. Distinct
     * from `suggestion`, which is a free-text recommendation.
     */
    codeSuggestion?: string;
}
interface AuditResult {
    status: "PASS" | "FAIL" | "ERROR";
    issues?: AuditIssue[];
    message?: string;
    suggestion?: string;
    /**
     * Token usage reported by the provider for this single audit call (Phase 1.1).
     * Absent for cached, deterministic, or commit-message audits — anything that
     * did not consume provider tokens.
     */
    usage?: {
        inputTokens: number;
        outputTokens: number;
    };
}
interface FileAuditResult {
    filePath: string;
    result: AuditResult;
    duration: number;
    cached?: boolean;
}
interface CLIOptions {
    files?: string[];
    commit?: boolean;
    bypass?: boolean;
    verbose?: boolean;
    maxConcurrency?: number;
    targetBranch?: string;
}
interface AIReviewConfig {
    enabled?: boolean;
    maxFiles?: number;
    maxDiffLines?: number;
    maxCharsPerFile?: number;
    promptVersion?: string;
    /**
     * Severity overrides for rule-pack evaluator findings.
     * Key is `<packId>/<ruleId>` (e.g. "svelte/imports-inside-script").
     * Value is the severity to assign when the evaluator finds a violation.
     */
    rulePackSeverity?: Record<string, "CRITICAL" | "WARNING" | "INFO">;
    /**
     * Per-category severity ceilings applied to AI findings AFTER parsing.
     * Key is a rubric category (e.g. "architecture"), value is the maximum
     * severity findings of that category may carry. Merged over the defaults
     * (architecture/performance/maintainability/test-gap → WARNING); map a
     * category to "CRITICAL" to disable its default clamp. (v3.1.1+)
     */
    severityCeilings?: Record<string, "CRITICAL" | "WARNING" | "INFO">;
    /**
     * Comma-separated list of provider names to try in order when the primary fails.
     * Example: "gemini,openai" — tries Gemini first, falls back to OpenAI.
     */
    fallbackProvider?: string;
    /**
     * Provider-specific context-window token limit override.
     * Defaults are: gemini=1_000_000, openai=128_000, anthropic=200_000.
     */
    tokenLimit?: number;
    /**
     * Model tier selector — controls which model from the provider's tier
     * catalog is used when no explicit AI_MODEL is set.
     * - premium: best / newest models for hard reviews (security, architecture)
     * - balanced: default / stable models for everyday CI
     * - budget: cheap / fast models for bulk review
     *
     * Precedence: AI_MODEL > AI_MODEL_TIER > ai.modelTier > provider default
     */
    modelTier?: "premium" | "balanced" | "budget";
}
declare const DEFAULT_CONFIG: Required<Omit<ProjectConfig, "gitProvider" | "repoUrl" | "projectId" | "localReview" | "enableSkillsFetch" | "skillsFetchTimeout" | "ai" | "indexing" | "createSkills" | "mcp" | "ruleFiles" | "review" | "security" | "cache" | "eslint">> & {
    localReview: LocalReviewConfig;
    enableSkillsFetch: boolean;
    skillsFetchTimeout: number;
    ai: AIReviewConfig;
    indexing: Required<Pick<IndexingConfig, "enabled" | "languages" | "cachePath" | "maxFileSize" | "maxRelatedFiles">>;
    createSkills: Required<CreateSkillsConfig>;
    mcp: Required<MCPConfig>;
};
/**
 * Supported languages for tree-sitter parsing
 */
type IndexableLanguage = "typescript" | "tsx" | "javascript" | "jsx";
/**
 * Indexing configuration schema
 */
interface IndexingConfig {
    enabled: boolean;
    languages: IndexableLanguage[];
    cachePath: string;
    maxFileSize: number;
    maxRelatedFiles: number;
    /**
     * Cache layout (schema 1.5+). "light" (default) keeps the core
     * source-index.json compact and moves codeSearch/calls payloads to
     * JSONL sidecars; "full" inlines everything (debug/compat).
     */
    cacheMode?: "light" | "full";
    /**
     * Incremental cache validation strategy. "fast" (default) compares
     * size+mtime first and hashes only changed candidates; "strict"
     * hashes every file (pre-1.5 behavior).
     */
    validationMode?: "fast" | "strict";
}
/**
 * Skill profile for review context (same as in skills-generator)
 */
type SkillProfile = "cli-tooling" | "node-service" | "react-next" | "react-spa" | "library";
/**
 * Unified tech profile carrying both the high-level SkillProfile
 * and the specific technologies detected, along with the signal source.
 */
interface TechProfile {
    /** High-level project classification */
    profile: SkillProfile;
    /** Lowercase technology/package keywords, e.g. ["typescript", "react", "vitest", "express"] */
    technologies: string[];
    /** Which source provided the primary signal for this profile */
    source: "config" | "package-json" | "generic";
}

/**
 * Configuration loader with caching and strict Zod validation
 */

/**
 * Load and validate project configuration using Zod.
 * Throws UserError with detailed field-level messages on invalid configs.
 */
declare const loadProjectConfig: (cwd?: string) => Promise<ProjectConfig>;
/**
 * Clear config cache (useful for testing)
 */
declare const clearConfigCache: () => void;
/**
 * Validate configuration schema (legacy shim — prefer loadProjectConfig).
 * Returns true/false; does NOT throw.
 */
declare const validateConfig: (config: unknown) => config is ProjectConfig;

/**
 * Git utilities with async support and better error handling
 */

interface GitDiffOptions {
    targetBranch?: string;
    extensions?: RegExp;
}
interface CollectReviewInputOptions {
    target: ReviewTarget;
    maxFiles: number;
    maxDiffLines: number;
    maxCharsPerFile: number;
    contextLines?: number;
    filePaths?: string[];
    /** Working directory for git operations (default: process.cwd()) */
    cwd?: string;
}
interface CollectReviewInputResult {
    files: ReviewInputFile[];
    skipped: ReviewSkippedItem[];
    totalChangedLines: number;
}
/**
 * Get last commit message asynchronously
 */
declare const getLastCommitMessage: () => Promise<string>;
/**
 * Get changed files against target branch with parallel execution
 */
declare const getChangedFiles: (options?: GitDiffOptions) => Promise<string[]>;
/**
 * Check if current directory is a git repository
 */
declare const isGitRepository: (cwd?: string) => Promise<boolean>;
/**
 * Get current branch name
 */
declare const getCurrentBranch: () => Promise<string>;
declare const listFilesForTarget: (target: ReviewTarget, cwd?: string) => Promise<string[]>;
declare const collectReviewInput: (options: CollectReviewInputOptions) => Promise<CollectReviewInputResult>;

/**
 * Parsing utilities for AI responses
 */

/**
 * Clean JSON from markdown code blocks
 */
declare const cleanJSON: (text: string) => string;
/**
 * Parse AI response to AuditResult with layered, tolerant error recovery.
 *
 * Order: strict parse → trailing-comma repair → first balanced object →
 * salvage `issues[]` from a truncated response → ERROR. Genuine non-JSON
 * (no object, no salvageable issues) still resolves to status "ERROR".
 */
declare const parseAuditResponse: (responseText: string) => AuditResult;
/**
 * Format file size for display
 */
declare const formatBytes: (bytes: number) => string;

/**
 * Console output utilities with colors.
 *
 * Styling goes through the shared terminal UI theme (`paint`), which
 * honors the NO_COLOR convention — no ANSI escapes are emitted when
 * NO_COLOR is set to a non-empty value.
 */
declare const setLogQuietMode: (value: boolean) => void;
declare const log: {
    info: (msg: string) => void;
    success: (msg: string) => void;
    infoStderr: (msg: string) => void;
    successStderr: (msg: string) => void;
    warningStderr: (msg: string) => void;
    errorStderr: (msg: string) => void;
    warning: (msg: string) => void;
    error: (msg: string) => void;
    critical: (msg: string) => void;
    audit: (msg: string) => void;
    skip: (msg: string) => void;
    file: (msg: string) => void;
    plain: (msg: string) => void;
    debug: (msg: string) => void;
    issue: (severity: string, line: number, message: string) => void;
    progress: (current: number, total: number, label: string) => void;
    progressEnd: () => void;
    divider: () => void;
    header: (title: string) => void;
};
/**
 * Format duration for display
 */
declare const formatDuration: (ms: number) => string;

/**
 * Typed errors for CLI exit-code mapping.
 */
declare class UserError extends Error {
    readonly name = "UserError";
}
declare class SystemError extends Error {
    readonly name = "SystemError";
}
declare class ProviderError extends Error {
    readonly name = "ProviderError";
}

/**
 * AI Provider types and interfaces
 */
type AIProvider = "gemini" | "openai" | "anthropic" | "grok" | "openrouter";
/**
 * Model tier selector — controls which model from the provider's tier
 * catalog is used when no explicit AI_MODEL is set.
 * - premium: best / newest models for hard reviews (security, architecture)
 * - balanced: default / stable models for everyday CI
 * - budget: cheap / fast models for bulk review
 */
type ModelTier = "premium" | "balanced" | "budget";

/**
 * Core AI service with multi-provider support
 * Supports: Google Gemini, OpenAI GPT, Anthropic Claude
 * Features: retry with exponential backoff, fallback provider chain, auto-chunking
 */

/**
 * Audit commit message
 */
declare const auditCommit: (message: string, config: ProjectConfig) => Promise<AuditResult>;
/**
 * Audit single file with retry and optional fallback provider chain.
 * CRITICAL: Never throws - always returns a result (even on error)
 */
declare const auditFile: (filePath: string, content: string, systemPrompt: string, fallbackChain?: AIProvider[], modelTier?: ModelTier) => Promise<AuditResult>;
/**
 * Audit multiple files with concurrency control
 * PERFORMANCE: Uses a shared concurrency limiter so that individual chunk audits
 *              within a file also respect maxConcurrency (not just at the file level).
 * ERROR HANDLING: Failed files are tracked and reported, but don't stop the process
 * RETRY: Each file audit uses withRetry internally (via auditFile)
 * FALLBACK: Falls back to config.ai.fallbackProvider chain on retryable errors
 */
declare const auditFilesWithConcurrency: (files: Array<{
    path: string;
    content: string;
}>, config: ProjectConfig, maxConcurrency?: number, indexContext?: string, mcpContext?: string) => Promise<FileAuditResult[]>;
/**
 * Clear provider cache (useful for testing). Also resets the default
 * circuit breaker so that breaker state from a prior test cannot leak
 * into the next one — tests that fail providers on purpose would
 * otherwise trip the breaker and short-circuit subsequent tests.
 */
declare const clearProviderCache: (modelTier?: ModelTier) => void;

/**
 * File service with streaming support and memory optimization
 */

interface FileContent {
    path: string;
    content: string;
    size: number;
}
interface FileReadResult {
    success: FileContent[];
    skipped: Array<{
        path: string;
        reason: string;
    }>;
}
/**
 * Read multiple files efficiently with size limits
 * PERFORMANCE: Uses Promise.allSettled for true parallel processing
 * ERROR HANDLING: Failed files don't stop the entire process
 */
declare const readFilesForAudit: (filePaths: string[]) => Promise<FileReadResult>;
/**
 * Get file extension without dot
 */
declare const getFileExtension: (filePath: string) => string;
/**
 * Check if file is a code file
 */
declare const isCodeFile: (filePath: string) => boolean;

/**
 * Prompt templates for AI-powered code auditing
 */

declare const DEFAULT_COMMIT_PROMPT = "\n### ROLE\nYou are a Strict Release Manager. You enforce \"Conventional Commits\" standards.\n### RULES\n1. Format MUST be: `<type>(<scope>): <subject>`\n   - Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.\n   - Example: \"feat(auth): add google login support\"\n2. Subject must be lowercase and imperative (e.g., \"add\" not \"added\").\n3. Message must be descriptive enough to understand the change context.\n";
declare const BASE_AUDIT_PROMPT = "\n### ROLE & OBJECTIVE\nYou are an Elite Software Architect reviewing git diff hunks.\nFocus on changed lines and nearby context only.\n\n### MANDATORY RUBRIC\nEvaluate changed code against ALL of the following categories.\nEach issue MUST include the matching category label in its JSON output:\n\n1. **security** \u2014 XSS, injection, auth bypass, secret exposure, CORS misconfiguration. Prioritize exploitability.\n2. **runtime-crash** \u2014 null pointer dereference, type errors, unhandled promise rejections, race conditions, blocking operations. Prioritize crash paths.\n3. **architecture** \u2014 contract violations, layering breaks, circular dependencies, hub-file blast radius. Prioritize codebase-specific contracts from the PROJECT SPECIFIC RULES section.\n4. **dependency-version** \u2014 use of deprecated APIs, known-vulnerable version ranges, breaking changes in semver-major upgrades.\n5. **test-gap** \u2014 changed code paths with no test coverage, especially error/edge-case handlers.\n6. **performance** \u2014 N+1 queries, O(n\u00B2) algorithms, unnecessary allocations, large bundles, blocking I/O.\n7. **maintainability** \u2014 duplicated logic, excessive complexity, unclear control flow, missing boundary validation.\n8. **refactor** \u2014 code that works but should be restructured. ALWAYS scan changed components/functions for these and propose a CONCRETE refactor (what to extract/memoize/move, not just \"consider refactoring\"):\n   - Functions/components over ~80 lines, deeply nested control flow, or god-components mixing data fetching + transformation + rendering \u2014 propose the extraction split (custom hook, child component, pure helper).\n   - React re-render pitfalls: object/array/function literals created in render and passed as props to child components (defeats memoization), context Provider `value={{...}}` rebuilt every render (re-renders every consumer), components/hooks declared INSIDE another component body (remounts on every render), state lifted higher than needed so one keystroke re-renders an entire page/list, expensive derived data computed in render without `useMemo` while large lists re-render.\n   - Note: `React.memo`/`useMemo`/`useCallback` recommendations must name the actual re-render path they break (which parent state change re-renders which expensive child); do not recommend blanket memoization.\n\n### DETERMINISTIC CHECKS ALREADY COVER THESE \u2014 DO NOT REPORT THEM\nA separate deterministic pass already flags the following with precise line numbers. Reporting them again only duplicates noise \u2014 SKIP them entirely:\n- Hardcoded hex colors in styling contexts (e.g. `#e5002c`, `color: '#fff'`).\n- Inline `style={{ ... }}` object literals.\n- Inline React Query / TanStack `queryKey` array literals (key arrays that should live in a constants file).\n- `parseInt(...)` without a radix.\n- Double type casts (`as unknown as`, `as any as`).\n- Tailwind arbitrary values that have a canonical bare form (`z-[9999]`).\n- Suppressed `react-hooks/exhaustive-deps` directives.\nFocus your attention on logic, correctness, security, and architecture findings the deterministic pass cannot catch.\n\n### PRIORITIES\n1. CRITICAL security issues and crash-causing bugs always cause FAIL.\n2. Flag version-specific risks as WARNING with evidence only \u2014 do not claim unsupported certainty.\n3. Style-only issues and subjective preferences are noise \u2014 skip them unless they impact correctness.\n\n### SEVERITY RUBRIC (STRICT)\nSeverity is determined by IMPACT, not by how strongly a rule is worded:\n- CRITICAL is reserved for \"security\" and \"runtime-crash\" findings that are demonstrably reachable, plus \"dependency-version\" findings with verified exploitable impact.\n- \"architecture\", \"performance\", \"maintainability\", \"test-gap\", and \"refactor\" findings are at most WARNING \u2014 even when they violate a PROJECT SPECIFIC RULE marked critical/mandatory. A rule violation that cannot crash, corrupt data, or be exploited is not CRITICAL.\n- Every CRITICAL issue MUST include an \"evidence\" field quoting the exact offending line(s) VERBATIM from the provided diff/context (copy the code text exactly \u2014 it is verified mechanically; paraphrased evidence is rejected and the finding downgraded).\n- Before claiming a null/undefined dereference, check the surrounding context for guard clauses (early return, optional chaining, if-checks). Before claiming an undefined identifier (ReferenceError), check the file's imports and parameters. Before claiming an API misuse dependent on configuration (e.g. a prop or option changing a callback's shape), confirm the enabling prop/option is actually present. If the context provided is insufficient to confirm, emit WARNING with \"confidence\": \"low\" instead of CRITICAL.\n\n### EVIDENCE & FALSE-POSITIVE GUARDRAILS\nYou see only diff hunks plus any context explicitly provided above. You CANNOT see the full file tree, so the absence of a file from your context is NOT evidence that it is missing from the repository.\n- NEVER raise a finding claiming that an imported module, file, or symbol \"does not exist\", is \"missing\", \"is not found\", or will \"cause a build failure\" based on an import statement alone. You cannot verify the target's existence from a diff.\n- Path aliases are valid, and their prefix is arbitrary and user-defined \u2014 do NOT assume a fixed set. Any non-relative import that is not a published package may be a project alias configured in tsconfig/jsconfig `paths`/`baseUrl`, bundler config (Vite/webpack/rollup/tsup/esbuild), or package.json `imports`. The prefix can be ANY token the author chose: `@/`, `~/`, `~`, `#`, `$lib/`, `@app/`, `@/components`, or any custom string. Never infer that a file is missing from the alias prefix or its character alone; treat such specifiers as resolving inside the project (commonly `src/`).\n- Only flag an import when the diff ITSELF supplies the evidence \u2014 e.g. the same diff deletes or renames the target, or changes the very export being imported. Cite that specific hunk in \"evidence\".\n- Do NOT assert that a third-party package's file, export, or API \"was removed\", \"no longer exists\", \"moved\", or \"changed\" in a specific version (e.g. \"antd v5 removed dist/reset.css\", \"this prop was dropped in vX\") unless the installed version appears in the provided DEPENDENCY VERSION CONTEXT and you are certain the claim matches it. Your training data lags real releases, so version-specific removals are a frequent hallucination \u2014 a file/export you believe was deleted often still ships. When unsure, omit the claim or downgrade to WARNING/INFO with \"confidence\": \"low\" and tell the author to verify against the installed version, rather than asserting a build failure.\n- When you cannot verify a claim from the provided material, omit it or downgrade to INFO with \"confidence\": \"low\". Do not manufacture certainty about repository structure, the file tree, or installed package internals you cannot see.\n- React/JSX XSS claims: JSX text interpolation (`<div>{value}</div>`, table column renderers returning `{record.title}`) auto-escapes content \u2014 it is NOT an XSS vector and \"no sanitization\" is NOT a finding there. Only claim XSS when you can quote the actual sink: `dangerouslySetInnerHTML`, manual DOM insertion (`innerHTML =`, `insertAdjacentHTML`, `document.write`), DOM-from-string conversion passed to element creation, or unvalidated `href`/`src` receiving user input. The quoted sink goes in \"evidence\".\n- Never emit a finding whose own message or suggestion concedes the code is probably fine (\"this may be acceptable\", \"if they are, this is compliant\", \"likely intentional\"). Verify first; if you cannot, omit the finding entirely.\n";
/**
 * Build system prompt with optional local skills enrichment and source index context
 * CRITICAL: This function is async now to support skills fetching and index loading
 * If skills fetch fails, it continues with default prompts (no retry)
 */
declare const buildSystemPrompt: (config: ProjectConfig, indexContext?: string, techProfile?: TechProfile, mcpContext?: string) => Promise<string>;
declare const buildCommitPrompt: (customFormat?: string) => string;

/**
 * Security Types & Secret Patterns
 *
 * Defines all secret detection patterns and security-related types
 * used by the SecurityService for content sanitization.
 */
interface SecretPattern {
    /** Human-readable label shown in logs */
    name: string;
    /** Regex used to detect the secret */
    pattern: RegExp;
}
interface SanitizationResult {
    /** The sanitized (redacted) content */
    content: string;
    /** Number of secrets that were redacted */
    redactedCount: number;
    /** Names of the pattern categories that matched */
    matchedPatterns: string[];
}
interface SuspiciousKeyword {
    /** The keyword that was detected */
    keyword: string;
    /** 1-based line number */
    line: number;
    /** Surrounding context (trimmed) */
    context: string;
}
interface PayloadFileSummary {
    /** Relative file path */
    path: string;
    /** Character count of the file content */
    characters: number;
    /** Estimated token count (chars / 4 heuristic) */
    estimatedTokens: number;
}
interface PayloadSummary {
    /** Total number of files to be sent */
    fileCount: number;
    /** Per-file breakdown */
    files: PayloadFileSummary[];
    /** Total character count across all files */
    totalCharacters: number;
    /** Total estimated token count */
    totalEstimatedTokens: number;
    /** Formatted human-readable total size */
    formattedSize: string;
    /** Suspicious keywords found in file contents */
    warnings: SuspiciousKeyword[];
}

interface EntropyOptions {
    /** Minimum length to consider (default 24). */
    minLength?: number;
    /** Minimum Shannon entropy (bits/char) to flag (default 4.5). */
    minEntropy?: number;
    /** Exact values the user has marked safe — never flagged. */
    allowValues?: readonly string[];
}

/**
 * SecurityService - Secret Scrubbing & Transparency Layer
 *
 * Layer 2: Detects and redacts potential secrets (AWS keys, GCP keys,
 *          private key blocks, DB connection strings, bearer tokens, etc.)
 *          from file contents BEFORE they leave the machine.
 *
 * Layer 3: Generates a transparent payload summary for dry-run mode so the
 *          user can inspect exactly what will be sent to the AI provider.
 */

interface SecurityServiceOptions {
    /** Extra regex-based patterns appended after defaults. */
    extraPatterns?: SecretPattern[];
    /**
     * Phase 2.1: enable Shannon-entropy fallback detection. When true, the
     * service scans content for high-entropy assignment-style values that
     * don't match any known regex pattern and redacts them too.
     */
    entropyEnabled?: boolean;
    /** Entropy detector options (forwarded to scanEntropyMatches). */
    entropy?: EntropyOptions;
}
declare class SecurityService {
    private readonly patterns;
    private readonly entropyEnabled;
    private readonly entropyOptions;
    /**
     * Backward compatible: the legacy single-arg form `new SecurityService(extraPatterns)`
     * still works. New callers should pass an options object.
     */
    constructor(extraPatternsOrOptions?: SecretPattern[] | SecurityServiceOptions);
    /**
     * Sanitize a string by replacing all detected secrets with `<REDACTED_SECRET>`.
     */
    sanitizeContent(content: string): SanitizationResult;
    /**
     * Sanitize an array of file entries in bulk.
     */
    sanitizeFiles(files: Array<{
        path: string;
        content: string;
    }>): {
        sanitizedFiles: Array<{
            path: string;
            content: string;
        }>;
        totalRedacted: number;
        redactionReport: Array<{
            path: string;
            redactedCount: number;
            matchedPatterns: string[];
        }>;
    };
    /**
     * Generate a human-readable payload summary from file paths on disk.
     */
    generatePayloadSummary(filePaths: string[], cwd?: string): Promise<PayloadSummary>;
    /**
     * Generate a summary from already-loaded file contents (avoids re-reading).
     */
    generatePayloadSummaryFromContents(files: Array<{
        path: string;
        content: string;
    }>): PayloadSummary;
    /**
     * Pretty-print a PayloadSummary to the console for dry-run inspection.
     */
    printPayloadSummary(summary: PayloadSummary): void;
    /**
     * Scan content line-by-line for suspicious keywords.
     */
    private detectSuspiciousKeywords;
    /**
     * Build a PayloadSummary from computed data.
     */
    private buildSummary;
}
/**
 * Return a lazily-created singleton `SecurityService`.
 * Call `resetSecurityService()` to clear (useful in tests).
 */
declare const getSecurityService: () => SecurityService;
declare const resetSecurityService: () => void;

/**
 * File Handler Constants
 *
 * Defines the extension allowlist, blocked file patterns, and blocked
 * directories used by FileHandler for smart file filtering.
 */
interface FileHandlerOptions {
    /** Project root directory (default: `process.cwd()`) */
    cwd?: string;
    /** Extra extensions to allow beyond the built-in list */
    extraAllowedExtensions?: string[];
    /** Extra filenames / patterns to block (glob-style) */
    extraBlockedPatterns?: string[];
    /** Disables `.gitignore` parsing (e.g. for testing) */
    disableGitIgnore?: boolean;
    /** Disables `.archignore` parsing */
    disableArchIgnore?: boolean;
    /** Maximum file size in bytes (default: 500 KB) */
    maxFileSize?: number;
}
interface FileFilterResult {
    /** Files that passed all filters and may be sent to the AI */
    accepted: string[];
    /** Files that were rejected, with the reason */
    rejected: Array<{
        path: string;
        reason: string;
    }>;
    /** Summary stats */
    stats: {
        total: number;
        accepted: number;
        rejected: number;
        byReason: Record<string, number>;
    };
}

/**
 * FileHandler - Smart File Filtering (The Ignore Layer)
 *
 * Layer 1: Determines which files are eligible to be sent to the AI provider
 * by applying three cascading filters:
 *
 *   1. **Ignore rules** – `.gitignore` + `.archignore` (project-specific)
 *   2. **Extension allowlist** – only source-code extensions pass through
 *   3. **Sensitive file blocklist** – hard-blocked regardless of other rules
 *
 * The module uses `fast-glob` for high-performance traversal and the `ignore`
 * package for gitignore-compatible pattern matching.
 */

declare class FileHandler {
    private readonly cwd;
    private readonly allowedExtensions;
    private readonly blockedPatterns;
    private readonly blockedRegexes;
    private readonly maxFileSize;
    private readonly disableGitIgnore;
    private readonly disableArchIgnore;
    private ignoreFilter;
    private ignoreFilterInitialized;
    constructor(options?: FileHandlerOptions);
    /**
     * Walk the project tree and return the filtered set of files.
     *
     * Pipeline:
     *   fast-glob (respects .gitignore dirs) →
     *   ignore filter (.gitignore + .archignore rules) →
     *   extension allowlist →
     *   sensitive file blocklist
     */
    discoverFiles(): Promise<FileFilterResult>;
    /**
     * Filter a pre-existing list of file paths (e.g. from `git diff`) through
     * the same security pipeline.
     *
     * NOTE: This sync variant does not initialize ignore files.
     * Use `filterPathsWithIgnores` in runtime paths.
     */
    filterPaths(paths: string[]): FileFilterResult;
    /**
     * Filter a pre-existing list of file paths with `.gitignore`/`.archignore`
     * initialization included.
     */
    filterPathsWithIgnores(paths: string[]): Promise<FileFilterResult>;
    /**
     * Pretty-print the filter result to the console.
     */
    printFilterResult(result: FileFilterResult): void;
    /**
     * Classify a list of file paths into accepted and rejected.
     */
    private classifyFiles;
    /**
     * Check whether the file extension is on the allowlist.
     */
    private isAllowedExtension;
    /**
     * Check whether the file matches any blocked pattern.
     * Uses pre-compiled RegExp objects for performance (fix H-04).
     */
    private isBlockedFile;
    /**
     * Check whether the file exceeds the max file size limit.
     */
    private isWithinSizeLimit;
    /**
     * Build the combined `ignore` instance from `.gitignore` + `.archignore`.
     * Guarded to run only once per FileHandler instance (fix M-05).
     */
    private initIgnoreFilter;
    /**
     * Safely read an ignore file and return its contents, or `null`.
     */
    private readIgnoreFile;
}

interface CLIValues {
    help: boolean;
    version: boolean;
    "skip-commit": boolean;
    "skip-files": boolean;
    "target-branch"?: string;
    concurrency?: string;
    verbose: boolean;
    quiet: boolean;
    local: boolean;
    interactive: boolean;
    commits?: string;
    "branch-diff": boolean;
    "compare-branch"?: string;
    fetch: boolean;
    "include-uncommitted": boolean;
    staged: boolean;
    commit?: string;
    range?: string;
    files: string[];
    format?: string;
    ai?: boolean;
    "no-skills-fetch": boolean;
    "no-cache"?: boolean;
    output?: string;
    "dry-run": boolean;
    "verbose-dry-run": boolean;
    "token-limit"?: string;
    "explain-context"?: boolean;
    "severity-threshold"?: string;
    baseline?: string | boolean;
    "update-baseline"?: boolean;
    "index-format"?: string;
    force?: boolean;
    stats?: boolean;
    explainIndex?: string;
    findSymbol?: string;
    fullIndex?: boolean;
    findImport?: string;
    findCode?: string;
    agentContext?: string;
    recovered?: boolean;
    parseErrors?: boolean;
    agent?: string;
    "all-agents": boolean;
    "create-skills-format"?: string;
    "create-skills-force": boolean;
    "skip-index-refresh": boolean;
    "create-skills-dry-run": boolean;
    "create-skills-check": boolean;
    "create-skills-no-ai-enrich": boolean;
    "create-skills-no-code-samples"?: boolean;
    "explain-agents"?: boolean;
    doctor?: boolean;
    health?: boolean;
    "init-force"?: boolean;
    "init-non-interactive"?: boolean;
    "init-format"?: "console" | "json";
}

/**
 * Stable review command implementation.
 */

interface ReviewRunOptions {
    values: CLIValues;
    commandPositionals: string[];
    config: ProjectConfig;
    targetBranch: string;
    maxConcurrency: number;
    startTime: number;
    /** When true, run deterministic non-AI review (secret redaction + risk analyzer) with token preview */
    dryRun?: boolean;
    /** When true, force per-file output during dry run */
    verboseDryRun?: boolean;
    /** Override the provider context-window token limit */
    tokenLimitOverride?: number;
}

declare const runReview: (options: ReviewRunOptions) => Promise<number>;

/**
 * MCP diagnostics — read-only checks for MCP configuration health.
 * Never spawns MCP servers. Only checks command availability and env vars.
 * Uses node:fs + node:path instead of shell exec to stay shell-free.
 */

declare const generateMCPDiagnostics: (config: MCPConfig) => MCPDiagnostics;

export { type AuditIssue, type AuditResult, BASE_AUDIT_PROMPT, type CLIOptions, DEFAULT_COMMIT_PROMPT, DEFAULT_CONFIG, type FileAuditResult, type FileContent, type FileFilterResult, FileHandler, type FileHandlerOptions, type FileReadResult, type PayloadFileSummary, type PayloadSummary, type ProjectConfig, ProviderError, type ReviewFormat, type ReviewInputFile, type ReviewMode, type ReviewReport, type ReviewSkippedItem, type ReviewSummary, type ReviewTarget, type SanitizationResult, type SecretPattern, SecurityService, type SuspiciousKeyword, SystemError, UserError, auditCommit, auditFile, auditFilesWithConcurrency, buildCommitPrompt, buildSystemPrompt, cleanJSON, clearConfigCache, clearProviderCache as clearModelCache, collectReviewInput, formatBytes, formatDuration, generateMCPDiagnostics, getChangedFiles, getCurrentBranch, getFileExtension, getLastCommitMessage, getSecurityService, isCodeFile, isGitRepository, listFilesForTarget, loadProjectConfig, log, parseAuditResponse, readFilesForAudit, resetSecurityService, runReview, setLogQuietMode, validateConfig };
