import type { SolutionRecord } from '../types/solution.types.js';
import type { SolutionRepository } from '../db/repositories/solution.repository.js';
import type { ErrorRepository } from '../db/repositories/error.repository.js';
import type { SynapseManager } from '../synapses/synapse-manager.js';
import type { MatchResult } from '../matching/error-matcher.js';
export type SuggestionCategory = 'auto' | 'suggest' | 'learn';
export interface SolutionSuggestion {
    solution: SolutionRecord;
    /** Combined score factoring in match quality, confidence, and recency */
    score: number;
    /** Category: auto (≥0.85), suggest (0.5-0.85), learn (<0.5) */
    category: SuggestionCategory;
    /** Which matched error this solution originally solved */
    matchedErrorId: number;
    /** How similar the original error was to the current one */
    matchScore: number;
    /** Success rate of this solution across all attempts */
    successRate: number;
    /** Human-readable explanation of why this is suggested */
    reasoning: string;
}
export interface AutoResolutionResult {
    errorId: number;
    suggestions: SolutionSuggestion[];
    /** Best suggestion if any pass the auto-apply threshold */
    autoApply: SolutionSuggestion | null;
    /** Total solutions considered */
    totalConsidered: number;
}
export declare class AutoResolutionService {
    private solutionRepo;
    private errorRepo;
    private synapseManager;
    private logger;
    private eventBus;
    constructor(solutionRepo: SolutionRepository, errorRepo: ErrorRepository, synapseManager: SynapseManager);
    /**
     * Given an error and its matches, find and rank solutions.
     * Returns suggestions sorted by combined score.
     */
    getSuggestions(errorId: number, matches: MatchResult[], crossProjectMatches?: MatchResult[]): AutoResolutionResult;
    /**
     * Get suggestions for an existing error by re-running match + solution lookup.
     */
    getSuggestionsForError(errorId: number): AutoResolutionResult;
    /**
     * Compute a combined score for a solution suggestion.
     * Factors: match quality (40%), solution confidence (30%), success rate (30%)
     * Cross-project solutions get a 20% discount.
     */
    private computeScore;
    /**
     * Categorize a score into auto/suggest/learn.
     */
    private categorize;
    /**
     * Build a human-readable explanation of the suggestion.
     */
    private buildReasoning;
}
