/** * Semantic Infrastructure Initialization (LI-001) * * Provides zero-config auto-initialization for semantic pattern matching. * If dependencies are available, semantic matching is enabled automatically. * If dependencies are missing, falls back gracefully to non-semantic matching. * * Dependencies: * - @xenova/transformers (for embeddings) * - @lancedb/lancedb (for vector search) * - better-sqlite3 (for EmbeddedStore) */ import { EmbeddingProvider } from '../utils/embedding-provider.js'; import { VectorStore } from '../utils/vector-store.js'; import { EmbeddedStore } from '../utils/embedded-store.js'; import { SemanticPatternMatcher } from './semantic-pattern-matcher.js'; /** * Semantic infrastructure components */ export interface SemanticInfrastructure { /** Embedding provider for generating embeddings */ embeddingProvider: EmbeddingProvider; /** Vector store for similarity search */ vectorStore: VectorStore; /** Embedded store for pattern data */ embeddedStore: EmbeddedStore; /** Semantic pattern matcher for finding similar patterns */ matcher: SemanticPatternMatcher; } /** * Configuration for semantic infrastructure */ export interface SemanticInfrastructureConfig { /** Path to vector database (default: ./data/vectors) */ vectorDbPath?: string; /** Path to SQLite database (default: ./data/llm-browser.db) */ sqliteDbPath?: string; /** Enable verbose logging during initialization */ verbose?: boolean; } /** * Initialization result with status information */ export interface SemanticInitResult { /** Whether initialization succeeded */ success: boolean; /** The infrastructure components (null if failed) */ infrastructure: SemanticInfrastructure | null; /** Status message explaining the result */ message: string; /** Which components were unavailable (if failed) */ unavailable?: string[]; } /** * Check if all semantic infrastructure dependencies are available */ export declare function checkSemanticDependencies(): Promise<{ available: boolean; missing: string[]; }>; /** * Initialize semantic infrastructure with automatic dependency detection. * * This is the main entry point for enabling semantic pattern matching. * Call this once during application startup (e.g., in SmartBrowser constructor). * * @param config Optional configuration * @returns Initialization result with status and infrastructure (if successful) */ export declare function initializeSemanticInfrastructure(config?: SemanticInfrastructureConfig): Promise; /** * Get the global semantic infrastructure (if initialized). * * Returns null if initialization hasn't been attempted or failed. * Use initializeSemanticInfrastructure() to ensure initialization. */ export declare function getSemanticInfrastructure(): SemanticInfrastructure | null; /** * Get the global semantic pattern matcher (if available). * * Convenience function for quick access to the matcher. * Returns null if semantic infrastructure isn't initialized. */ export declare function getSemanticMatcher(): SemanticPatternMatcher | null; /** * Check if semantic infrastructure has been initialized. */ export declare function isSemanticInitialized(): boolean; /** * Check if initialization has been attempted (even if it failed). */ export declare function wasInitializationAttempted(): boolean; /** * Reset the global semantic infrastructure. * * This closes all resources and allows re-initialization. * Primarily useful for testing. */ export declare function resetSemanticInfrastructure(): Promise; //# sourceMappingURL=semantic-init.d.ts.map