blz_cli/generate/mod.rs
1//! Generate command orchestration for creating llms-full.txt files.
2//!
3//! This module provides the orchestration layer for the `blz generate` command,
4//! which scrapes discovered URLs via Firecrawl and assembles them into a
5//! complete llms-full.txt file.
6//!
7//! ## Key Components
8//!
9//! - [`GenerateOrchestrator`]: Coordinates parallel scraping with adaptive concurrency
10//! - [`UrlWithLastmod`]: URL with optional lastmod for change detection
11//! - [`ScrapeResults`]: Aggregated results from scraping operations
12//!
13//! ## Example
14//!
15//! ```rust,no_run
16//! use blz_cli::generate::{GenerateOrchestrator, UrlWithLastmod, ScrapeResults};
17//!
18//! # async fn example() -> anyhow::Result<()> {
19//! // URLs would come from sitemap discovery
20//! let urls = vec![
21//! UrlWithLastmod::new("https://example.com/docs/intro".to_string()),
22//! UrlWithLastmod::new("https://example.com/docs/api".to_string()),
23//! ];
24//!
25//! // Create orchestrator (would use real FirecrawlCli)
26//! // let cli = FirecrawlCli::detect().await?;
27//! // let orchestrator = GenerateOrchestrator::new(cli, 5)
28//! // .with_progress(|completed, total| {
29//! // println!("Progress: {}/{}", completed, total);
30//! // });
31//! //
32//! // let results = orchestrator.scrape_all(&urls).await;
33//! // println!("Successful: {}, Failed: {}", results.successful.len(), results.failed.len());
34//! # Ok(())
35//! # }
36//! ```
37
38mod orchestrator;
39
40pub use orchestrator::{
41 GenerateOrchestrator, ProgressCallback, ScrapeError, ScrapeResult, ScrapeResults, Scraper,
42 UrlWithLastmod,
43};