import { type SemanticScoreBreakdown } from './semantic-ranking.js';
export interface RagCollectionSource {
    sourceId: string;
    kind: 'file' | 'url' | 'text';
    label: string;
    location?: string;
    addedAt: number;
    bytes: number;
}
export interface RagChunk {
    chunkId: string;
    sourceId: string;
    text: string;
    tokens: number;
    tags: string[];
    embedding?: number[];
    score?: number;
}
export interface RagCollection {
    collectionId: string;
    name: string;
    description?: string;
    createdAt: number;
    updatedAt: number;
    tags: string[];
    scope: 'session' | 'project';
    attachedRuntimeIds: string[];
    attachedSessionIds: string[];
    sources: RagCollectionSource[];
    chunks: RagChunk[];
}
export interface RagCollectionSummary {
    collectionId: string;
    name: string;
    description?: string;
    createdAt: number;
    updatedAt: number;
    tags: string[];
    scope: 'session' | 'project';
    attachedRuntimeIds: string[];
    attachedSessionIds: string[];
    sourceCount: number;
    chunkCount: number;
}
export interface RagCollectionInput {
    name: string;
    description?: string;
    tags?: string[];
    scope?: 'session' | 'project';
}
export interface RagIngestInput {
    filePath?: string;
    folderPath?: string;
    folderGlob?: string;
    url?: string;
    text?: string;
    label?: string;
    tags?: string[];
}
export interface RagRetrievalHit {
    collectionId: string;
    collectionName: string;
    chunkId: string;
    sourceId: string;
    label: string;
    text: string;
    tokens: number;
    tags: string[];
    score: number;
    scoreBreakdown?: SemanticScoreBreakdown;
}
export interface RagCollectionStoreOptions {
    requestTimeoutMs?: number;
}
export declare class RagCollectionStore {
    private readonly rootDir;
    private readonly requestTimeoutMs;
    private readonly embedder;
    private readonly embeddingDimensions;
    constructor(stateRoot?: string, options?: RagCollectionStoreOptions);
    listCollections(): RagCollectionSummary[];
    getCollection(collectionId: string): RagCollection | undefined;
    createCollection(input: RagCollectionInput): RagCollection;
    ingestCollection(collectionId: string, inputs: RagIngestInput[]): Promise<{
        collection: RagCollection;
        sourcesAdded: number;
        chunksAdded: number;
    }>;
    attachCollection(collectionId: string, runtimeId: string, sessionId?: string): RagCollection;
    detachCollection(collectionId: string, runtimeId?: string, sessionId?: string): RagCollection;
    deleteCollection(collectionId: string): boolean;
    retrieve(query: string, options?: {
        runtimeId?: string;
        sessionId?: string;
        limit?: number;
        collectionIds?: string[];
    }): RagRetrievalHit[];
    private getRequiredCollection;
    private toSummary;
    private persist;
    private collectionPath;
    private sanitizeCollectionId;
    private readInputContent;
    private embedChunks;
    private backfillCollectionEmbeddings;
    private ensureChunkEmbedding;
}
