import type { KnowledgeStore } from '../store.js';
import type { KnowledgeSourceRecord } from '../types.js';
import type { KnowledgeObjectProfilePolicy } from '../extensions.js';
import type { KnowledgeSemanticAnswerInput, KnowledgeSemanticAnswerResult, KnowledgeSemanticEnrichmentResult, KnowledgeSemanticGapRepairer, KnowledgeSemanticLlm, KnowledgeSemanticSelfImproveInput, KnowledgeSemanticSelfImproveResult } from './types.js';
export interface KnowledgeSemanticServiceOptions {
    readonly llm?: KnowledgeSemanticLlm | null | undefined;
    readonly maxLlmSourcesPerReindex?: number | undefined;
    readonly gapRepairer?: KnowledgeSemanticGapRepairer | null | undefined;
    readonly maxReindexRunMs?: number | undefined;
    readonly backgroundRepairDelayMs?: number | undefined;
    readonly backgroundRepairLimit?: number | undefined;
    readonly objectProfiles?: readonly KnowledgeObjectProfilePolicy[] | undefined;
}
export declare class KnowledgeSemanticService {
    private readonly store;
    private options;
    private readonly activeGapRepairs;
    private readonly activeSelfImprovementRuns;
    constructor(store: KnowledgeStore, options?: KnowledgeSemanticServiceOptions);
    setGapRepairer(gapRepairer: KnowledgeSemanticGapRepairer | null | undefined): void;
    addObjectProfiles(profiles: readonly KnowledgeObjectProfilePolicy[] | null | undefined): void;
    enrichSource(sourceId: string, input?: {
        readonly force?: boolean | undefined;
        readonly knowledgeSpaceId?: string | undefined;
    }): Promise<KnowledgeSemanticEnrichmentResult | null>;
    enrichSources(sources: readonly KnowledgeSourceRecord[], input?: {
        readonly force?: boolean;
        readonly knowledgeSpaceId?: string;
        readonly limit?: number;
    }): Promise<readonly KnowledgeSemanticEnrichmentResult[]>;
    reindex(input?: {
        readonly sourceIds?: readonly string[] | undefined;
        readonly limit?: number | undefined;
        readonly maxRunMs?: number | undefined;
        readonly force?: boolean | undefined;
        readonly knowledgeSpaceId?: string | undefined;
    }): Promise<{
        readonly scanned: number;
        readonly enriched: number;
        readonly skipped: number;
        readonly failed: number;
        readonly errors: readonly {
            readonly sourceId: string;
            readonly error: string;
        }[];
        readonly selfImprovement: KnowledgeSemanticSelfImproveResult;
    }>;
    answer(input: KnowledgeSemanticAnswerInput): Promise<KnowledgeSemanticAnswerResult>;
    repairAnswerGaps(input: {
        readonly answer: KnowledgeSemanticAnswerResult;
        readonly maxRunMs?: number | undefined;
        readonly limit?: number | undefined;
    }): Promise<KnowledgeSemanticSelfImproveResult>;
    private runAnswerRefinementInBackground;
    private runSelfImprovementInBackground;
    selfImprove(input?: KnowledgeSemanticSelfImproveInput): Promise<KnowledgeSemanticSelfImproveResult>;
    private runSelfImproveUnlocked;
    private taskIdsForGaps;
    private waitForActiveAnswerGapRepairs;
}
//# sourceMappingURL=service.d.ts.map