import type { Ocorrencia } from '../common/occurrences.js';
export interface ServidorAppOptions {
    appId: string;
    privateKey: string;
    webhookSecret: string;
    port: number;
}
export interface GitHubContentFile {
    name: string;
    path: string;
    type: string;
}
export interface RepositoryBase {
    owner: {
        login: string;
    };
    name: string;
}
export interface CheckSuitePayload {
    repository: RepositoryBase;
    check_suite: {
        head_sha: string;
    };
    installation: {
        id: number;
    };
}
export interface PullRequestPayload {
    repository: RepositoryBase;
    pull_request: {
        head: {
            sha: string;
            ref: string;
        };
        base: {
            sha: string;
            ref: string;
        };
        number: number;
        title: string;
    };
    installation: {
        id: number;
    };
    action: string;
}
export interface PushPayload {
    repository: RepositoryBase & {
        full_name: string;
    };
    head_commit: {
        id: string;
        message: string;
    };
    ref: string;
    before?: string;
    after?: string;
    installation: {
        id: number;
    };
}
export interface PullRequestReviewPayload {
    repository: RepositoryBase;
    pull_request: {
        head: {
            sha: string;
        };
        number: number;
    };
    review: {
        state: string;
        body: string | null;
    };
    installation: {
        id: number;
    };
    action: string;
}
export interface IssuesPayload {
    repository: RepositoryBase;
    issue: {
        number: number;
        body: string | null;
    };
    installation: {
        id: number;
    };
    action: string;
}
export interface WebhookEvent {
    id: string;
    event: string;
    action?: string;
    repository: string;
    installation: number;
    status: 'success' | 'error';
    error?: string;
    timestamp: number;
    durationMs: number;
}
export interface AnalysisResult {
    id: string;
    repository: string;
    event: string;
    score: number;
    workflowsCount: number;
    occurrencesCount: number;
    timestamp: number;
}
export interface FullAnalysisJob {
    id: string;
    status: 'pendente' | 'baixando' | 'analisando' | 'completo' | 'erro';
    criadoEm: number;
    finalizadoEm?: number;
    owner: string;
    repo: string;
    installationId: number;
    ref: string;
    options: FullAnalysisOptions;
    resultado?: FullAnalysisResult;
    erro?: string;
}
export interface FullAnalysisOptions {
    fast?: boolean;
    analistas?: string[];
    autoFix?: boolean;
    autoFixMode?: 'conservative' | 'balanced';
}
export interface FullAnalysisResult {
    totalArquivos: number;
    totalOcorrencias: number;
    duracaoMs: number;
    arquivosAnalisados: string[];
    ocorrencias: Array<{
        mensagem: string;
        relPath: string;
        tipo?: string;
        nivel?: string;
        linha?: number;
        coluna?: number;
        sugestao?: string;
    }>;
    scoreGeral: number;
    resumoPorTipo: Record<string, number>;
    resumoPorSeveridade: Record<string, number>;
    autoFixResultado?: FullAnalysisAutoFixResult;
}
export interface FullAnalysisAutoFixResult {
    arquivosModificados: number;
    correcoesAplicadas: number;
    prUrl?: string;
    prNumero?: number;
    branchName?: string;
}
export interface AnaliseInternaResult {
    totalArquivos: number;
    arquivosAnalisados: string[];
    todasOcorrencias: Array<{
        mensagem: string;
        relPath: string;
        tipo?: string;
        nivel?: string;
        linha?: number;
        coluna?: number;
        sugestao?: string;
    }>;
    fileEntriesComAst: Array<{
        relPath: string;
        content: string | null;
    }>;
}
export interface RepoDownloadResult {
    tempDir: string;
    repoDir: string;
    cleanup: () => void;
}
export interface InstallationConfig {
    installationId: number;
    accountLogin?: string;
    targetType?: string;
    repositorySelection?: string;
    pushAnalysisEnabled: boolean;
    pullRequestAnalysisEnabled: boolean;
    fast: boolean;
    incrementalOnPush: boolean;
    updatedAt: number;
}
export interface AnalysisReportContext {
    branch: string;
    headSha: string;
    commitMessage: string;
    owner: string;
    repo: string;
    arquivosAlterados?: string[];
    escopoIncremental: boolean;
    origem: 'push' | 'pull_request';
    baseRef?: string;
    prNumber?: number;
}
export interface RodarAnaliseParams {
    installationId: number;
    owner: string;
    repo: string;
    headSha: string;
    branch: string;
    commitMessage: string;
    baseSha?: string;
    incremental?: boolean;
    fast?: boolean;
}
export interface RodarAnaliseResult {
    resultado: FullAnalysisResult;
    ctx: AnalysisReportContext;
    cleanup: () => void;
}
export interface PushAnalysisParams {
    installationId: number;
    owner: string;
    repo: string;
    branch: string;
    headSha: string;
    beforeSha?: string;
    commitMessage: string;
}
export interface PullRequestAnalysisParams {
    installationId: number;
    owner: string;
    repo: string;
    prNumber: number;
    headSha: string;
    headRef: string;
    baseSha: string;
    baseRef: string;
    prTitle: string;
}
export interface CheckRunAnnotation {
    path: string;
    start_line: number;
    end_line: number;
    annotation_level: 'failure' | 'warning' | 'notice';
    message: string;
}
export interface CompletarCheckRunOptions {
    status?: 'success' | 'failure';
}
export interface WorkflowSummary {
    name: string;
    path: string;
}
export interface AnaliseWorkflowsResult {
    ocorrencias: Ocorrencia[];
    scoreGeral: number;
    workflowsInfo: Array<{
        nome: string;
        score: number;
        ocorrencias: number;
    }>;
}
export interface OcorrenciaAgrupada {
    relPath: string;
    count: number;
    erros: number;
    avisos: number;
}
export interface SugestaoExtraida {
    mensagem: string;
    relPath: string;
    linha?: number;
    sugestao: string;
    nivel?: string;
}
export interface SugestoesAgrupadas {
    tipo: string;
    count: number;
    sugestoes: SugestaoExtraida[];
}
export interface SessionData {
    token: string;
    createdAt: number;
    expiresAt: number;
    ip: string;
}
//# sourceMappingURL=app.d.ts.map