/**
 * 임베딩 맵(UMAP + K-Means) 응답 생성 (014-embedding-map-dashboard)
 */
import type Database from 'better-sqlite3';
export interface EmbeddingPoint {
    id: string;
    x: number;
    y: number;
    cluster: number;
    type: 'episodic' | 'semantic' | 'procedural' | 'working';
    content: string;
    tags: string[];
    importance: number;
    created_at: string;
}
export interface EmbeddingMapResponse {
    points: EmbeddingPoint[];
    meta: {
        total: number;
        provider: string;
        k: number;
        requested_k: number;
        limit: number;
        /** LRU 캐시 히트 여부 */
        cached: boolean;
        /**
         * 다른 요청이 이미 시작한 in-flight 계산을 await만 한 경우 true.
         * `cached===false`이면서 본 요청이 UMAP을 새로 돌리지 않았음을 구분할 때 사용(모니터링).
         */
        waited_for_in_flight: boolean;
        computed_at: string;
    };
}
export interface EmbeddingMapParams {
    provider: 'tfidf' | 'minilm' | 'openai' | 'gemini';
    limit: number;
    k: number;
}
export declare class EmbeddingMapBuildError extends Error {
    readonly code: 'NO_EMBEDDINGS' | 'INSUFFICIENT_DATA' | 'CORRUPTED_EMBEDDINGS';
    readonly payload: {
        provider?: string;
        count?: number;
    };
    constructor(message: string, code: 'NO_EMBEDDINGS' | 'INSUFFICIENT_DATA' | 'CORRUPTED_EMBEDDINGS', payload: {
        provider?: string;
        count?: number;
    });
}
export declare function clearEmbeddingMapCacheForTests(): void;
/**
 * Lloyd's K-Means (max 100 iter).
 * `rng`이 있으면 초기/빈 군집 재시드가 결정적이라 캐시 만료 후에도 같은 입력에 대해 색 라벨이 안정적입니다.
 */
export declare function kMeans(points: number[][], k: number, maxIter?: number, rng?: () => number): number[];
export declare function buildEmbeddingMapResponse(db: Database.Database, params: EmbeddingMapParams): Promise<EmbeddingMapResponse>;
//# sourceMappingURL=admin-embedding-map-response.d.ts.map