/** * Vector Database Connection Types * * Connection-related interfaces for vector databases. */ import { VectorDBType, DistanceMetric, VectorIndexType } from './enums'; /** * Environment-specific vector database configuration */ export interface IVectorEnvConfig { /** Environment slug (e.g., 'dev', 'staging', 'prd') */ slug: string; /** API endpoint URL */ endpoint?: string; /** API key */ apiKey?: string; /** Cloud region (for managed services) */ region?: string; /** Index/collection name */ index?: string; /** Namespace for multi-tenancy */ namespace?: string; /** Whether this environment is active */ active?: boolean; } /** * Vector database configuration */ export interface IVectorConfig { /** Unique vector store tag */ tag: string; /** Human-readable name */ name: string; /** Description */ description?: string; /** Vector database type */ type: VectorDBType; /** Vector dimensions */ dimensions: number; /** Distance metric for similarity */ metric?: DistanceMetric; /** Index type */ indexType?: VectorIndexType; /** Environment configurations */ envs?: IVectorEnvConfig[]; } /** * Connection configuration for a vector database */ export interface IVectorConnectionConfig { /** Environment slug */ env: string; /** Product tag */ product?: string; /** Vector store tag */ vector: string; /** Optional namespace override */ namespace?: string; /** Connection options */ options?: IVectorConnectionOptions; } /** * Connection options */ export interface IVectorConnectionOptions { /** Connection timeout in ms */ timeout?: number; /** Enable SSL/TLS */ ssl?: boolean; /** Number of retries */ retries?: number; /** Retry delay in ms */ retryDelay?: number; /** Custom headers */ headers?: Record; } /** * Connection result */ export interface IVectorConnectionResult { /** Whether connection was successful */ connected: boolean; /** Index/collection name */ index?: string; /** Vector dimensions */ dimensions?: number; /** Number of vectors in index */ vectorCount?: number; /** Latency in ms */ latency?: number; /** Error message if failed */ error?: string; } /** * Connection context (internal state) */ export interface IVectorConnectionContext { /** Vector store tag */ vector: string; /** Environment slug */ env: string; /** Product tag */ product?: string; /** Database type */ type: VectorDBType; /** API endpoint */ endpoint: string; /** Index/collection name */ index: string; /** Namespace */ namespace?: string; /** Dimensions */ dimensions: number; /** Metric */ metric: DistanceMetric; /** Whether connected */ connected: boolean; } /** * Service configuration */ export interface IVectorServiceConfig { /** Workspace ID */ workspace_id: string; /** Public key for authentication */ public_key: string; /** User ID */ user_id: string; /** Authentication token */ token: string; /** Environment type (staging, production, local) */ env_type: string; } /** * Test connection result */ export interface IVectorTestConnectionResult { /** Whether the connection test passed */ success: boolean; /** Response time in ms */ latency: number; /** Index information */ index?: { name: string; dimensions: number; metric: string; vectorCount: number; }; /** Error message if failed */ error?: string; }