import type { EmbeddingConfig } from "../../config/schema/magic-context";
import type { Database } from "../../shared/sqlite";
import type { EmbeddingProvider } from "./memory/embedding-provider";
export interface EmbeddingFeatures {
    memoryEnabled: boolean;
    gitCommitEnabled: boolean;
}
export interface ProjectEmbeddingRegistrationSnapshot {
    projectIdentity: string;
    sourceDirectory: string;
    providerIdentity: string;
    runtimeFingerprint: string;
    generation: number;
    features: EmbeddingFeatures;
    enabled: boolean;
    gitCommitEnabled: boolean;
    modelId: string;
    chunkModelId: string;
}
export declare function registerProjectEmbeddingAndMaybeWipe(db: Database, projectIdentity: string, config: EmbeddingConfig, features: EmbeddingFeatures, sourceDirectory: string): ProjectEmbeddingRegistrationSnapshot;
export declare function registerProjectInObservationMode(db: Database, projectIdentity: string, sourceDirectory: string, failedConfig: EmbeddingConfig, failureSummary: string): ProjectEmbeddingRegistrationSnapshot;
export declare function unregisterProjectEmbedding(projectIdentity: string): void;
export declare function getProjectEmbeddingSnapshot(projectIdentity: string): ProjectEmbeddingRegistrationSnapshot | null;
export declare function getProjectChunkEmbeddingModelId(projectIdentity: string): string;
export declare function getProjectEmbeddingMaxInputTokens(projectIdentity: string): number;
export declare function embedTextForProject(projectIdentity: string, text: string, signal?: AbortSignal): Promise<{
    vector: Float32Array;
    modelId: string;
    generation: number;
} | null>;
export declare function embedBatchForProject(projectIdentity: string, texts: string[], signal?: AbortSignal): Promise<{
    vectors: (Float32Array | null)[];
    modelId: string;
    generation: number;
} | null>;
export declare function embedUnembeddedMemoriesForProject(db: Database, projectIdentity: string, batchSize?: number): Promise<number>;
export declare function embedUnembeddedCompartmentChunksForProject(db: Database, projectIdentity: string): Promise<number>;
export interface SessionChunkBackfillProgress {
    /** Compartments fully embedded so far this run. */
    embedded: number;
    /** Total compartments that needed embedding when the run started. */
    total: number;
}
export type SessionChunkBackfillOutcome = {
    status: "done";
    embedded: number;
    total: number;
} | {
    status: "nothing";
    embedded: 0;
    total: 0;
} | {
    status: "disabled";
    embedded: 0;
    total: 0;
} | {
    status: "busy";
    embedded: 0;
    total: number;
} | {
    status: "aborted";
    embedded: number;
    total: number;
} | {
    status: "stalled";
    embedded: number;
    total: number;
    remaining: number;
};
/**
 * Backfill ALL un-embedded compartment chunks for ONE session in a single run
 * (the `/ctx-embed-history` command path), oldest-first so progress fills
 * chronologically. Unlike the passive project drain this has no per-sweep cap —
 * the user asked for the whole session — but it still runs under the per-project
 * embedding coordinator lease (mutual exclusion with the passive sweep + sibling
 * processes) and yields between batches so an 8-core MiniLM burst stays
 * interruptible. Idempotent + resumable via chunk_hash; re-running embeds only
 * what's still missing.
 */
export declare function embedSessionCompartmentChunks(db: Database, projectIdentity: string, sessionId: string, options?: {
    signal?: AbortSignal;
    onProgress?: (p: SessionChunkBackfillProgress) => void;
    batchSize?: number;
}): Promise<SessionChunkBackfillOutcome>;
export declare function sweepAllRegisteredProjects(db: Database, batchSize?: number): Promise<{
    memoriesEmbedded: number;
    commitsEmbedded: number;
    chunksEmbedded: number;
    perProject: Map<string, {
        memories: number;
        commits: number;
        chunks: number;
    }>;
}>;
export declare function _setTestProviderFactoryForProject(factory: ((config: EmbeddingConfig) => EmbeddingProvider | null) | null): void;
export declare function _resetProjectEmbeddingRegistryForTests(): void;
//# sourceMappingURL=project-embedding-registry.d.ts.map