1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! # blz-core
//!
//! Core functionality for blz - a fast, local search cache for llms.txt documentation.
//!
//! This crate provides the foundational components for parsing, storing, and searching
//! llms.txt documentation files locally. It's designed for speed (sub-10ms search latency),
//! offline-first usage, and exact line citations.
//!
//! ## Architecture
//!
//! The crate is organized around several key components:
//!
//! - **Configuration**: Global and per-source settings management
//! - **Parsing**: Tree-sitter based markdown parsing with structured output
//! - **Types**: Core data structures representing sources, search results, and metadata
//! - **Error Handling**: Comprehensive error types with categorization and recovery hints
//!
//! ## Quick Start
//!
//! ```rust
//! use blz_core::{Config, MarkdownParser, Result};
//!
//! // Load global configuration
//! let config = Config::load()?;
//!
//! // Parse markdown content
//! let mut parser = MarkdownParser::new()?;
//! let result = parser.parse("# Hello World\n\nThis is content.")?;
//!
//! println!("Found {} heading blocks", result.heading_blocks.len());
//! println!("Generated TOC with {} entries", result.toc.len());
//! # Ok::<(), blz_core::Error>(())
//! ```
//!
//! ## Performance Characteristics
//!
//! - **Parse time**: < 150ms per MB of markdown content
//! - **Memory usage**: < 2x source document size during parsing
//! - **Thread safety**: All types are `Send + Sync` where appropriate
//!
//! ## Error Handling
//!
//! All operations return [`Result<T, Error>`] with structured error information:
//!
//! ```rust
//! use blz_core::{Error, MarkdownParser};
//!
//! let mut parser = MarkdownParser::new()?;
//! match parser.parse("malformed content") {
//! Ok(result) => println!("Parsed successfully"),
//! Err(Error::Parse(msg)) => eprintln!("Parse error: {}", msg),
//! Err(e) if e.is_recoverable() => eprintln!("Recoverable error: {}", e),
//! Err(e) => eprintln!("Fatal error: {}", e),
//! }
//! # Ok::<(), blz_core::Error>(())
//! ```
/// Configuration management for global and per-source settings
/// Error types and result aliases
/// HTTP fetching with conditional requests support
/// Heading sanitization and normalization helpers
/// Search index implementation using Tantivy
/// JSON builder helpers for llms.json structures
/// Language filtering for multilingual llms.txt files
/// Anchor remapping utilities between versions
/// Tree-sitter based markdown parser
/// Application profile detection helpers
/// Performance profiling utilities
/// Refresh helpers shared across CLI and MCP
/// Built-in registry of known documentation sources
/// Local filesystem storage for cached documentation
/// Core data types and structures
/// URL resolver for llms.txt variants
// Re-export commonly used types
pub use ;
pub use ;
pub use ;
pub use ;
pub use SearchIndex;
pub use build_llms_json;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Registry;
pub use Storage;
pub use *;