import { ErrorReportAttachment, ErrorReportPayload } from '../types/error-report';
type ErrorAutoFixLogModel = Record<string, any>;
export interface ErrorAutoFixManagerDependencies {
    Clients?: any;
    ErrorAutoFixLogs: any;
    AICoderApps?: any;
    AIDashboardJobs?: any;
}
export declare function registerErrorAutoFixManagerDependencies(dependencies: ErrorAutoFixManagerDependencies): void;
interface ErrorEmail {
    key: string;
    subject: string;
    body: string;
    from?: string;
    messageId?: string;
    hash?: string;
    rawHash?: string;
    issueHash?: string;
    logId?: string;
    raw: string;
    fromAddress?: string;
    id_client?: string;
    client_name?: string;
    source_type?: 'app' | 'infrastructure' | 'noise';
    classification_reason?: string;
    openai_environment?: string;
    sourceApp?: string;
    sourceEnvironment?: string;
    severity?: string;
    reportedBy?: string;
    reportMetadata?: Record<string, any>;
    reportContext?: Record<string, any>;
    attachments?: ErrorReportAttachment[];
    reportedAt?: Date;
}
interface AutoFixResult {
    status: 'skipped' | 'failed' | 'success' | 'in_progress';
    email: ErrorEmail;
    error?: string;
    branchName?: string;
    prUrl?: string;
    log?: ErrorAutoFixLogModel;
    reason?: string;
    summary?: string;
    notes?: string;
}
interface ErrorReportIngestResult {
    status: 'queued' | 'skipped' | 'duplicate' | 'ignored' | 'success' | 'failed' | 'in_progress';
    reason?: string;
    log?: ErrorAutoFixLogModel;
}
export interface DevErrorReportOptions {
    subject: string;
    body?: string;
    sourceApp?: string;
    environment?: string;
    severity?: string;
    fingerprint?: string;
    idempotencyKey?: string;
    metadata?: Record<string, any>;
    clientId?: string;
    clientName?: string;
    clientSlug?: string;
}
export declare class ErrorAutoFixManager {
    private config;
    private _serverConfig;
    private readonly githubApiBase;
    private readonly dashboardMonitors;
    private static readonly APP_SETTINGS_CACHE_TTL_MS;
    private appSettingsAutoOptimizeCacheExpiresAt;
    private appSettingsAutoOptimizeCacheValue;
    private ready;
    constructor(serverConfig: any, dependencies?: Partial<ErrorAutoFixManagerDependencies>);
    isReady(): boolean;
    validateIngestKey(candidate?: string): boolean;
    private debugLog;
    private resolveConfig;
    private extractEmailAddress;
    private escapeRegex;
    private resolveClientForEnvironment;
    private extractHostFromUrl;
    private resolveClientForReport;
    private determineOpenAIEnvironment;
    private resolveEnvironmentForTask;
    private buildEmailFromReport;
    private classifyEmail;
    private isMongoOriginError;
    private generateRawEmailHash;
    private generateIssueHash;
    private normalizeTextForHash;
    private normalizeBodyForHash;
    private parseRepoTarget;
    private buildWorkBranch;
    private normalizeEmailText;
    private buildContextMarkdown;
    private buildOpenAIComment;
    private formatGithubError;
    private buildGithubAuthHeader;
    private githubRequest;
    private resolveBaseBranch;
    private getBranchSha;
    private ensureBranch;
    private upsertContextFile;
    private findOpenPullRequest;
    private createPullRequest;
    private commentOnPullRequest;
    private parseBooleanEnv;
    private resolveAutoOptimizeEnabled;
    private reserveLog;
    private markDuplicate;
    private updateLog;
    private getEscalationRecipients;
    private sendEscalationNotice;
    private collectLibraryIssueSignalText;
    private evaluateLibraryIssueGate;
    private sendLibraryIssueNotice;
    private blockLibraryOwnedIssue;
    private shouldNotifySkip;
    private isGeneratedAICoderClient;
    private buildAICoderWorkflowSummary;
    private buildResolveIOProjectWorkflowDetails;
    private buildLocalInternalUserCriteria;
    private buildLocalAdminUserCriteria;
    private resolveLocalNotificationUserIds;
    private notifyCustomerWorkflowStatus;
    private delay;
    reportDevError(options: DevErrorReportOptions): Promise<void>;
    ingestErrorReport(report: ErrorReportPayload): Promise<ErrorReportIngestResult>;
    runLog(logId: string): Promise<AutoFixResult>;
    private buildEmailFromLog;
    private processEmail;
    private shouldFallbackDashboardMethod;
    private createDashboardJob;
    private waitForDashboardJobStop;
    private isDashboardJobRunning;
    private resolveAutoFixApp;
    private buildDashboardAutoFixTitle;
    private buildDashboardAutoFixDescription;
    private evaluateDashboardPublishOutcome;
    private queueDashboardMonitor;
    private monitorDashboardAutoFixJob;
    private dispatchDashboardWorkflow;
    private dispatchGithubWorkflow;
    private notify;
}
export declare function ensureErrorAutoFixManager(serverConfig?: any): ErrorAutoFixManager | null;
export declare function reportDevError(options: DevErrorReportOptions): Promise<void>;
export {};
