//! # Aurora Semantic
//!
//! A local, embedded semantic search engine for source code, designed to be
//! bundled directly inside desktop IDEs.
//!
//! ## Features
//!
//! - **Workspace Indexing**: Index entire codebases with progress reporting
//! - **Smart Chunking**: Extract meaningful code segments (functions, classes, etc.)
//! - **Ignore Rules**: Respect .gitignore and custom patterns
//! - **Persistent Indexes**: Save and reload indexes efficiently
//! - **Lexical Search**: Fast keyword-based search using Tantivy
//! - **Semantic Search**: ONNX-based embedding similarity search
//! - **Hybrid Search**: Combined lexical and semantic search
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use aurora_semantic::{Engine, EngineConfig, WorkspaceConfig, SearchQuery, ModelConfig};
//! use std::path::PathBuf;
//!
//! #[tokio::main]
//! async fn main() -> aurora_semantic::Result<()> {
//!     // Load your ONNX model
//!     let model = ModelConfig::from_directory("./models/jina-code").load()?;
//!
//!     // Create engine
//!     let config = EngineConfig::new(PathBuf::from(".aurora"));
//!     let engine = Engine::with_embedder(config, model)?;
//!
//!     // Index a workspace
//!     let ws_config = WorkspaceConfig::new(PathBuf::from("./my-project"));
//!     let workspace_id = engine.index_workspace(ws_config, None).await?;
//!
//!     // Search for code
//!     let results = engine.search_text(&workspace_id, "authentication")?;
//!
//!     for result in results {
//!         println!("{}: {} (score: {:.2})",
//!             result.document.relative_path.display(),
//!             result.chunk.symbol_name.as_deref().unwrap_or("unknown"),
//!             result.score
//!         );
//!     }
//!
//!     Ok(())
//! }
//! ```
//!
//! ## Using Your Own ONNX Model
//!
//! Aurora uses ONNX Runtime for embedding generation. To use semantic search:
//!
//! 1. Download an ONNX model (e.g., `jina-embeddings-v2-base-code`)
//! 2. Place `model.onnx` and `tokenizer.json` in a directory
//! 3. Point Aurora to that directory
//!
//! ```rust,ignore
//! use aurora_semantic::{ModelConfig, OnnxEmbedder};
//!
//! // Load from directory
//! let embedder = OnnxEmbedder::from_directory("./models/jina-code")?;
//!
//! // Or with custom settings
//! let embedder = ModelConfig::from_directory("./models/jina-code")
//!     .with_max_length(8192)  // Jina supports 8k context
//!     .load()?;
//! ```

#![warn(missing_docs)]

// Core modules
mod config;
mod error;
mod types;

// Feature modules
mod chunker;
mod embeddings;
mod engine;
mod ignore;
mod search;
mod storage;

// Re-export public API

// Configuration
pub use config::{
    ChunkingConfig, EmbeddingConfig, EngineConfig, IgnoreConfig, PerformanceConfig, SearchConfig,
    SearchMode, WorkspaceConfig,
};

// Types
pub use types::{
    Chunk, ChunkId, ChunkType, Document, DocumentId, Highlight, IndexPhase, IndexProgress,
    Language, LanguageStats, MatchType, SearchResult, WorkspaceId, WorkspaceStats,
};

// Error handling
pub use error::{Error, Result};

// Engine (main API)
pub use engine::Engine;

// Search
pub use search::{SearchFilter, SearchQuery};

// Chunking
pub use chunker::{Chunker, DefaultChunker};

// Embeddings
pub use embeddings::{
    Embedder, ExecutionProviderInfo, HashEmbedder, ModelConfig, OnnxEmbedder,
    // Jina Code Embeddings 1.5B support
    EmbeddingTask, JinaCodeConfig, JinaCodeEmbedder, MatryoshkaDimension,
};
pub use embeddings::pooling::PoolingStrategy;

// Storage
pub use storage::{DiskStorage, Storage, WorkspaceMetadata};

// Ignore rules
pub use ignore::{FileFilter, FileWalker};

/// Library version.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
