import type { VectorStoreExpiresAfter } from '../../schemas/vector-stores.js'; export interface VectorStoreMeta { id: string; createdAt: number; name: string | null; metadata: Record; expiresAfter: VectorStoreExpiresAfter | null; expiresAt: number | null; lastActiveAt: number; /** * Embedding alias the store was first ingested with. Null until the first * successful attach records it. Used to reject silent-mismatch searches * if the operator swaps the default embedding mid-flight. */ embeddingAlias: string | null; } export interface CreateVectorStoreInput { id?: string; name?: string | null; metadata?: Record; expiresAfter?: VectorStoreExpiresAfter | null; } export interface UpdateVectorStoreInput { name?: string | null; metadata?: Record | null; expiresAfter?: VectorStoreExpiresAfter | null; } export interface VectorStoresStore { create: (input?: CreateVectorStoreInput) => VectorStoreMeta; get: (id: string) => VectorStoreMeta | null; update: (id: string, input: UpdateVectorStoreInput) => VectorStoreMeta | null; delete: (id: string) => boolean; list: () => VectorStoreMeta[]; touch: (id: string) => void; /** * Record the embedding alias used at first attach. No-op if id is unknown * or if an alias is already recorded (idempotent: never overwrites). */ setEmbedding: (id: string, alias: string) => void; } export type InvalidVectorStoreIdKind = 'invalid' | 'duplicate'; export declare class InvalidVectorStoreIdError extends Error { readonly kind: InvalidVectorStoreIdKind; constructor(id: string, reason: string, kind?: InvalidVectorStoreIdKind); } export declare function generateVectorStoreId(): string; export declare function idToWorkspace(id: string): string; export declare function createVectorStoresStore(now?: () => number): VectorStoresStore; interface OpenAIVectorStoreObject { id: string; object: 'vector_store'; created_at: number; name: string | null; usage_bytes: number; file_counts: { in_progress: number; completed: number; failed: number; cancelled: number; total: number; }; status: 'completed' | 'in_progress' | 'expired'; expires_after: VectorStoreExpiresAfter | null; expires_at: number | null; last_active_at: number; metadata: Record; } export interface VectorStoreRagInfo { exists: boolean; open?: boolean; } export declare function vectorStoreToOpenAI(meta: VectorStoreMeta, ragInfo?: VectorStoreRagInfo): OpenAIVectorStoreObject; interface OpenAISearchResultItem { file_id: string; filename: string; score: number; attributes: Record; content: Array<{ type: 'text'; text: string; }>; } interface OpenAISearchResultsPage { object: 'vector_store.search_results.page'; search_query: string; data: OpenAISearchResultItem[]; has_more: false; next_page: null; } export interface RagSearchResultLike { id: string; content: string; score: number; } export type ChunkAttributionLookup = (chunkId: string) => { fileId: string; fileName: string; } | null; export declare function searchResultsToOpenAI(results: RagSearchResultLike[], query: string, lookup?: ChunkAttributionLookup): OpenAISearchResultsPage; export {}; //# sourceMappingURL=vector-stores-store.d.ts.map