eoka 0.15.0

Stealth browser automation for Rust. Puppeteer/Playwright alternative with anti-bot bypass.
Documentation
//! # Eoka
//!
//! Stealth browser automation for Rust — a Puppeteer/Playwright alternative that bypasses bot detection.
//!
//! Eoka is a minimal, fast headless Chrome library built from scratch. Unlike Selenium or
//! chromiumoxide, it uses a custom CDP implementation with stealth filtering to avoid detection
//! by Cloudflare, DataDome, PerimeterX, and other anti-bot systems.
//!
//! ## Features
//!
//! - **Stealth by Default** - Native-shaped JS evasions, isolated-world locators,
//!   CDP command filtering, human-like mouse/typing (binary patching is opt-in)
//! - **Puppeteer-like API** - `click()`, `type()`, `wait_for()`, `screenshot()`, etc.
//! - **Direct CDP Transport** - No separate WebDriver server or browser-driver dependency
//! - **AI-Agent Ready** - PageState introspection, element indexing, text extraction
//! - **Fast** - Lazy evasion scripts, one CDP writer task, cached isolated worlds
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use eoka::{ActionOptions, Browser, Expectation, LocatorSpec};
//!
//! #[tokio::main]
//! async fn main() -> eoka::Result<()> {
//!     // Launch browser (applies evasions)
//!     let browser = Browser::launch().await?;
//!
//!     // Create page and navigate
//!     let page = browser.new_page("data:text/html,<input id=name><button onclick=\"document.body.dataset.done=1\">Save</button>").await?;
//!
//!     // Human-like interactions
//!     page.fill("#name", "hello world").await?;
//!     let receipt = page.locator("button").click(ActionOptions::expecting(
//!         Expectation::Visible { target: LocatorSpec::css("body[data-done]") },
//!     )).await?;
//!     assert_eq!(receipt.outcome, eoka::ActionOutcome::VerifiedComplete);
//!
//!     // Screenshot
//!     let png = page.screenshot().await?;
//!     std::fs::write("screenshot.png", png)?;
//!
//!     browser.close().await?;
//!     Ok(())
//! }
//! ```
//!
//! ## Configuration
//!
//! ```rust,no_run
//! use eoka::Browser;
//!
//! # #[tokio::main]
//! # async fn main() -> eoka::Result<()> {
//! // The default launch path is stealthy and headless.
//! let browser = Browser::launch().await?;
//! browser.close().await?;
//!
//! // For one-off tweaks, mutate the default stealth config inline.
//! let browser = Browser::launch_with(|config| {
//!     config.proxy = Some(eoka::Proxy::new("http://127.0.0.1:8080"));
//! }).await?;
//! browser.close().await?;
//! # Ok(())
//! # }
//! ```

#![deny(missing_docs)]
// Every public type must be nameable from the crate's public paths.
#![deny(unnameable_types)]
// `pub` means public: items only the crate uses are `pub(crate)`.
#![deny(unreachable_pub)]

mod action;
mod browser;
pub mod cdp;
mod config;
mod download;
mod element;
pub use action::{
    Action, ActionCall, ActionDefaults, ActionOptions, ActionOutcome, ActionReceipt, ControlState,
    Destination, DispatchObserver, DispatchState, Expectation, InputMode, Locator, LocatorQuery,
    LocatorSpec, MAX_ACTION_TIMEOUT_MS,
};
mod error;
mod fetch;
mod keyboard;
mod network;
mod page;
mod recording;
mod session;
pub mod stealth;
mod util;

// Static assertions: core types are Send + Sync for use across async tasks.
const _: fn() = || {
    fn assert_send_sync<T: Send + Sync>() {}
    assert_send_sync::<browser::Browser>();
    assert_send_sync::<page::Page>();
    assert_send_sync::<ActionCall>();
};

// Re-exports
pub use browser::{Browser, TabInfo};
pub use config::{Mode, Proxy, StealthConfig};
pub use download::{
    DownloadBeginning, DownloadEvent, DownloadProgress, DownloadWatch, NativeDownloadState,
};
pub use element::{BoundingBox, Element};
pub use error::{Error, ErrorCode, Result};
pub use fetch::{
    BoundedFetchRequest, BoundedFetchResponse, BrowserFetchOutcome, BrowserFetchRequest,
    BrowserFetchResponse, MAX_TEXT_FETCH_BYTES,
};
pub use network::{
    CapturedRequest, RequestCapture, RequestCaptureOptions, RequestCaptureStats, ResponseBody,
};
pub use page::{
    CaptureBodyError, CapturedFrameResponse, FrameResponseCapture, FrameResponseCaptureOptions,
    FrameResponseCaptureReport,
};
pub use page::{FrameInfo, MouseButton, Page, PageState, ShadowClickReceipt, TextMatch};
pub use page::{ScreenshotClip, ScreenshotFormat, ScreenshotOptions};
pub use recording::{NativeRecording, NativeRecordingOptions, RecordingChunk, RecordingError};
pub use session::{BrowserSession, BrowserState, CookiePartitionKey, SessionCookie};
pub use stealth::{Fingerprint, HumanSpeed};