import type { EmbedProvider } from '../providers/embed-provider.js'; export interface SimilarResult { url: string; score: number; } /** * Index shim exposed by `getIndex()` for callers that still need * lightweight size/membership checks. Kept narrow so future stores can * implement it without dragging in extra surface area. */ export interface IndexView { size(): number; has(url: string): boolean; } export declare class EmbeddingService { private provider; private store; private knownUrls; private available; private providerVerified; private readyPromise; private loadAttempts; private lastFailureAt; private latchedOff; constructor(provider?: EmbedProvider); /** * Boot init: provisions the vector store, runs the legacy-embedding * migration, and surfaces sqlite-vec init failures — WITHOUT touching the * ONNX runtime. The provider is probed lazily on first use via * ensureProviderReady(); this is the ~150-200MB idle-footprint win. */ init(): Promise; /** * Load the embedding provider on first use. Memoized: concurrent callers * share one in-flight probe, and a verified provider never re-probes. * A failed load memoizes for RETRY_MEMO_MS (immediate retries are cheap); * after MAX_LOAD_ATTEMPTS failures the provider latches off for the process. * Returns true when the provider is ready to embed. */ ensureProviderReady(): Promise; private loadProvider; isAvailable(): boolean; setAvailable(value: boolean): void; /** Backwards-compat alias preserved for callers that gated on subprocess readiness. */ isSubprocessReady(): boolean; /** * Lightweight index view. Returns `size` from the backing VectorStore and * `has` from a local URL-cache populated by embedAndStore. Callers that * need richer access should consume the VectorStore directly via * `getVectorStore()`. */ getIndex(): IndexView; /** * Cached size from the store, refreshed after upserts. Reads from a * VectorStore would be async; getIndex().size() callers expect a * synchronous return so we maintain this counter. */ private cachedSize; embedAndStore(url: string, markdown: string): Promise; embedAsync(url: string, markdown: string): void; findSimilar(queryText: string, topK: number, excludeUrls?: Set): Promise; shutdown(): void; private migrateLegacyEmbeddings; } export declare function getEmbeddingService(): EmbeddingService; export declare function resetEmbeddingService(): void; //# sourceMappingURL=embed.d.ts.map