#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
#![warn(clippy::all)]
pub mod browser;
pub mod buffer;
pub mod cors;
pub mod error;
pub mod extraction;
pub mod handlers;
pub mod mcp;
pub mod metrics;
pub mod processing;
pub mod shutdown;
pub mod stripe;
#[allow(missing_docs)] pub mod portal;
pub mod research;
#[cfg(feature = "crawler")]
pub mod crawler;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const NAME: &str = env!("CARGO_PKG_NAME");
pub fn generate_request_id() -> String {
uuid::Uuid::new_v4().to_string()
}
pub use browser::controller::BrowserController;
pub use error::Error;
pub use extraction::content::ContentExtractor;
pub use extraction::links::LinkExtractor;
pub use extraction::metadata::MetadataExtractor;
pub use handlers::orchestrator::{orchestrator_router, OrchestratorState};
pub use mcp::McpServer;
pub use research::{
ResearchConfig, ResearchResult, SourceQuality, SourceTier, TierClassifier, TriangulationEngine,
VerificationStatus, VerifiedSource,
};
pub mod config {
pub const DEFAULT_TIMEOUT_MS: u64 = 30_000;
pub const DEFAULT_VIEWPORT_WIDTH: u32 = 1920;
pub const DEFAULT_VIEWPORT_HEIGHT: u32 = 1080;
}
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
pub struct WasmBrowserConnector {
connected: bool,
url: String,
}
#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
impl WasmBrowserConnector {
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
Self {
connected: false,
url: String::new(),
}
}
#[wasm_bindgen(getter)]
pub fn connected(&self) -> bool {
self.connected
}
#[wasm_bindgen(getter)]
pub fn url(&self) -> String {
self.url.clone()
}
pub fn connect(&mut self, url: &str) -> bool {
self.url = url.to_string();
self.connected = true;
true
}
pub fn disconnect(&mut self) {
self.connected = false;
self.url.clear();
}
}
#[cfg(target_arch = "wasm32")]
impl Default for WasmBrowserConnector {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_config_defaults() {
assert_eq!(config::DEFAULT_TIMEOUT_MS, 30_000);
assert_eq!(config::DEFAULT_VIEWPORT_WIDTH, 1920);
assert_eq!(config::DEFAULT_VIEWPORT_HEIGHT, 1080);
}
}