/** Type of document stored in the vector store. */
export type VectorEntryType = 'spec' | 'pattern' | 'knowledge' | 'decision';
/** A single document with its embedding vector. */
export interface VectorEntry {
    id: string;
    type: VectorEntryType;
    content: string;
    embedding: number[];
    metadata: Record<string, unknown>;
    createdAt: string;
    updatedAt: string;
}
/** A search result with its similarity score. */
export interface VectorSearchResult {
    entry: VectorEntry;
    similarity: number;
}
/** Configuration for the TF-IDF engine. */
export interface TFIDFConfig {
    maxDimensions: number;
    minDocFrequency: number;
    stopWords: Set<string>;
}
/** Configuration for the HNSW index. */
export interface HNSWConfig {
    M: number;
    efConstruction: number;
    efSearch: number;
    flatSearchThreshold: number;
}
/** Abstract storage backend interface (SQLite or JSON fallback). */
export interface StorageBackend {
    insert(entry: VectorEntry): Promise<void>;
    update(id: string, entry: Partial<VectorEntry>): Promise<void>;
    delete(id: string): Promise<void>;
    getById(id: string): Promise<VectorEntry | undefined>;
    getAll(type?: VectorEntryType): Promise<VectorEntry[]>;
    searchSimilar(embedding: number[], topK: number, threshold: number, type?: VectorEntryType): Promise<VectorSearchResult[]>;
    close?(): void;
}
/** Result of a JSON-to-SQLite migration. */
export interface MigrationResult {
    documentsProcessed: number;
    durationMs: number;
    errors: string[];
}
/** Scope parameter for semantic_search tool. */
export type VectorSearchScope = VectorEntryType | 'all';
/** Input args for semantic_search tool handler. */
export interface SemanticSearchArgs {
    projectId: string;
    query: string;
    scope?: VectorSearchScope;
    topK?: number;
    threshold?: number;
}
/** Internal JSON storage shape for vector store data. */
export interface VectorStoreData {
    entries: VectorEntry[];
}
/** Row shape from the SQLite vectors table. */
export interface VectorRow {
    id: string;
    type: string;
    content: string;
    embedding: Buffer;
    metadata: string;
    createdAt: string;
    updatedAt: string;
}
/** Dynamic import type for better-sqlite3 database. */
export interface BetterSqlite3Database {
    pragma(pragma: string): unknown;
    prepare(sql: string): BetterSqlite3Statement;
    exec(sql: string): void;
    close(): void;
}
/** Prepared statement from better-sqlite3. */
export interface BetterSqlite3Statement {
    run(...params: unknown[]): {
        changes: number;
    };
    get(...params: unknown[]): unknown;
    all(...params: unknown[]): unknown[];
}
/** Constructor type for better-sqlite3. */
export type BetterSqlite3Constructor = (filename: string) => BetterSqlite3Database;
/** Warning emitted when a semantically similar pattern already exists. */
export interface DedupWarning {
    existingPatternId: string;
    existingPattern: string;
    similarity: number;
    threshold: number;
}
/** Legacy pattern shape for migration. */
export interface LegacyPattern {
    pattern: string;
    category?: string;
    usageCount?: number;
    [key: string]: unknown;
}
/** Legacy knowledge shape for migration. */
export interface LegacyKnowledge {
    key: string;
    value: string;
    source?: string;
    [key: string]: unknown;
}
/** Collected text item ready for embedding during migration. */
export interface MigrationTextItem {
    type: VectorEntryType;
    id: string;
    text: string;
    meta: Record<string, unknown>;
}
/** Legacy decision shape for migration. */
export interface LegacyDecision {
    decision: string;
    rationale?: string;
    specId?: string;
    [key: string]: unknown;
}
/** Internal node in the HNSW graph. */
export interface HNSWNode {
    id: string;
    vector: number[];
    layers: Map<string, number>[];
}
/** Candidate returned from HNSW search. */
export interface HNSWSearchCandidate {
    id: string;
    similarity: number;
}
/** Serialized HNSW state for persistence. */
export interface HNSWSerializedState {
    nodes: {
        id: string;
        vector: number[];
        layers: [string, number][][];
    }[];
    entryPoint: string | null;
    maxLayer: number;
}
//# sourceMappingURL=vector-store.d.ts.map