cadi_core/atomizer/
mod.rs

1//! Smart Atomizer - Language-aware code parsing
2//!
3//! This module uses Tree-sitter for AST-based code analysis to extract
4//! properly bounded code atoms with correct dependency tracking.
5//!
6//! ## Key Features
7//!
8//! - **Language-Aware Parsing**: Uses Tree-sitter grammars for accurate parsing
9//! - **Symbol Resolution**: Resolves imports to content-addressed chunk IDs
10//! - **Boundary Detection**: Never cuts functions in half
11//! - **Dependency Tracking**: Tracks what each atom imports/exports
12//!
13//! ## Supported Languages (Phase 1)
14//!
15//! - Rust
16//! - TypeScript/JavaScript
17//! - Python
18//!
19//! ## Example
20//!
21//! ```rust,ignore
22//! use cadi_core::atomizer::{Atomizer, AtomizerConfig};
23//!
24//! let atomizer = Atomizer::new(AtomizerConfig::default());
25//!
26//! // Parse a file into atoms
27//! let atoms = atomizer.atomize_file(path, content)?;
28//!
29//! for atom in atoms {
30//!     println!("Atom: {} ({:?})", atom.name, atom.kind);
31//!     println!("  Defines: {:?}", atom.defines);
32//!     println!("  References: {:?}", atom.references);
33//! }
34//! ```
35
36pub mod config;
37pub mod parser;
38pub mod extractor;
39pub mod resolver;
40pub mod languages;
41
42pub use config::{AtomizerConfig, LanguageConfig};
43pub use parser::AstParser;
44pub use extractor::{AtomExtractor, ExtractedAtom, AtomKind};
45pub use resolver::{SymbolResolver, ResolvedImport, ImportedSymbol};