infrastructure tier

infrastructure-browser-automation

Browser automation DSL with humanized interactions, locators, and auto-waiting

Browser automation DSL with humanized interactions, locators, and auto-waiting

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/browser-automation
Edition2021
Targetsfirst_party_xray, human_browse, mouse_path, privacy_xray, scan_site, infrastructure_browser_automation
Public items183 across 17 modules
Tests141

What it is for

This crate does not document itself. No //! block on its entry point. The facts below are complete; the reason this crate exists is not written down anywhere, and belongs in src/lib.rs rather than here.

Capabilities

ActionEngine

_No module-level documentation is present in the source._

Item
pub struct ActionEngine<'a>

ActionEngine<'a>:click

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn click(& mut self, locator : & Locator) -> Result <(), AutomationError>
ActionEngine<'a> :: fn click_with_options(& mut self, locator : & Locator, opts : & ActionOptions,) -> Result <(), AutomationError>

ActionEngine<'a>:detect

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn detect_bot_detectors(& self) -> Result <Vec <BotDetectorInfo>, AutomationError>

ActionEngine<'a>:navigate

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn navigate(& mut self, url : & str) -> Result <(), AutomationError>

ActionEngine<'a>:new

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn new(session : & 'a CdpSession, humanizer : Humanizer) -> Self

ActionEngine<'a>:policy

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn policy(& self) -> & SessionPolicy

ActionEngine<'a>:read

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn read_text(& mut self, locator : & Locator) -> Result <String, AutomationError>
ActionEngine<'a> :: fn read_text_with_options(& mut self, locator : & Locator, opts : & ActionOptions,) -> Result <String, AutomationError>

ActionEngine<'a>:refresh

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn refresh_state(& mut self) -> Result <(), AutomationError>

ActionEngine<'a>:screenshot

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn screenshot(& self) -> Result <String, AutomationError>

ActionEngine<'a>:state

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn state(& self) -> & PageState

ActionEngine<'a>:type

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn type_text(& mut self, locator : & Locator, text : & str) -> Result <(), AutomationError>
ActionEngine<'a> :: fn type_text_with_options(& mut self, locator : & Locator, text : & str, opts : & ActionOptions,) -> Result <(), AutomationError>

ActionEngine<'a>:with

_No module-level documentation is present in the source._

Item
ActionEngine<'a> :: fn with_options(session : & 'a CdpSession, humanizer : Humanizer, wait : WaitOptions, policy : SessionPolicy,) -> Self

BotDetectorInfo

_No module-level documentation is present in the source._

Item
pub struct BotDetectorInfo

SessionPolicy

_No module-level documentation is present in the source._

Item
pub struct SessionPolicy
SessionPolicy :: fn default() -> Self
SessionPolicy :: fn permissive() -> Self

action_monitor (other)

_No module-level documentation is present in the source._

Item
fn diff(before : & ActionCheckpoint, after : & ActionCheckpoint) -> ActionImpact

ActionCheckpoint

_No module-level documentation is present in the source._

Item
pub struct ActionCheckpoint
fn checkpoint(session : & infrastructure_browser_cdp::CdpSession,) -> Result <ActionCheckpoint, crate::error::AutomationError>

ActionImpact

_No module-level documentation is present in the source._

Item
pub struct ActionImpact
ActionImpact :: fn is_clean(& self) -> bool
ActionImpact :: fn summary(& self) -> String

ImpactSeverity

_No module-level documentation is present in the source._

Item
pub enum ImpactSeverity
ImpactSeverity :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

ArtifactKind

_No module-level documentation is present in the source._

Item
pub enum ArtifactKind

CookieClaim

_No module-level documentation is present in the source._

Item
pub struct CookieClaim

CookieDecodeResult

_No module-level documentation is present in the source._

Item
pub struct CookieDecodeResult
fn decode_cookie(name : & str, value : & str) -> CookieDecodeResult

DecodeStatus

_No module-level documentation is present in the source._

Item
pub enum DecodeStatus

DecodedArtifact

_No module-level documentation is present in the source._

Item
pub struct DecodedArtifact

PiiClass

_No module-level documentation is present in the source._

Item
pub enum PiiClass

Detection

Detection engine — evaluates rules against collected page evidence.

Item
pub struct Detection

DetectionCategory

Detection engine — evaluates rules against collected page evidence.

Item
pub enum DetectionCategory
DetectionCategory :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

DetectionCondition

Detection engine — evaluates rules against collected page evidence.

Item
pub struct DetectionCondition

DetectionEmission

Detection engine — evaluates rules against collected page evidence.

Item
pub struct DetectionEmission

DetectionEngine

Detection engine — evaluates rules against collected page evidence.

Item
pub struct DetectionEngine
DetectionEngine :: fn with_defaults() -> Self
DetectionEngine :: fn from_toml_file(path : & str) -> Self
DetectionEngine :: fn from_toml(content : & str) -> Result <Self, String>
DetectionEngine :: fn new(rules : Vec <DetectionRule>) -> Self
DetectionEngine :: fn add_rules(& mut self, rules : Vec <DetectionRule>)
DetectionEngine :: fn rule_count(& self) -> usize
DetectionEngine :: fn evaluate(& self, evidence : & PageEvidence) -> DetectionResult

DetectionResult

Detection engine — evaluates rules against collected page evidence.

Item
pub struct DetectionResult

DetectionRule

Detection engine — evaluates rules against collected page evidence.

Item
pub struct DetectionRule

EvidenceItem

Detection engine — evaluates rules against collected page evidence.

Item
pub struct EvidenceItem

MatchPolicy

Detection engine — evaluates rules against collected page evidence.

Item
pub enum MatchPolicy

MatchedEvidence

Detection engine — evaluates rules against collected page evidence.

Item
pub struct MatchedEvidence

PageEvidence

Detection engine — evaluates rules against collected page evidence.

Item
pub struct PageEvidence

PatternKind

Detection engine — evaluates rules against collected page evidence.

Item
pub enum PatternKind

RuleSource

Detection engine — evaluates rules against collected page evidence.

Item
pub enum RuleSource

SourceType

Detection engine — evaluates rules against collected page evidence.

Item
pub enum SourceType

BrowserState

_No module-level documentation is present in the source._

Item
pub struct BrowserState

DetectionReport

_No module-level documentation is present in the source._

Item
fn scan_page(session : & CdpSession) -> Result <DetectionReport, AutomationError>
pub struct DetectionReport
DetectionReport :: fn threat_level(& self) -> ThreatLevel
DetectionReport :: fn summary(& self) -> String

EndpointMatch

_No module-level documentation is present in the source._

Item
pub struct EndpointMatch

ScriptMatch

_No module-level documentation is present in the source._

Item
pub struct ScriptMatch

ThreatLevel

_No module-level documentation is present in the source._

Item
pub enum ThreatLevel
ThreatLevel :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

AutomationError

_No module-level documentation is present in the source._

Item
pub enum AutomationError

fingerprint (other)

_No module-level documentation is present in the source._

Item
fn canvas_hash_fnv1a(data_url : & str) -> i64
pub const COLLECTOR_JS: & str

FingerprintAudit

_No module-level documentation is present in the source._

Item
fn audit_fingerprint(session : & CdpSession) -> Result <FingerprintAudit, AutomationError>
pub struct FingerprintAudit
FingerprintAudit :: fn red_flags(& self) -> Vec <String>

StealthReport

_No module-level documentation is present in the source._

Item
fn apply_stealth(session : & CdpSession) -> Result <StealthReport, AutomationError>
pub struct StealthReport
StealthReport :: fn all_applied(& self) -> bool

BehavioralTracking

_No module-level documentation is present in the source._

Item
pub struct BehavioralTracking

BotDetectionInfo

_No module-level documentation is present in the source._

Item
pub struct BotDetectionInfo

FirstPartyReport

_No module-level documentation is present in the source._

Item
fn audit_first_party(session : & CdpSession) -> Result <FirstPartyReport, AutomationError>
pub struct FirstPartyReport
FirstPartyReport :: fn grade(& self) -> & 'static str
FirstPartyReport :: fn summary(& self) -> String

FirstPartyScore

_No module-level documentation is present in the source._

Item
pub struct FirstPartyScore

PersistenceInfo

_No module-level documentation is present in the source._

Item
pub struct PersistenceInfo

StorageFootprint

_No module-level documentation is present in the source._

Item
pub struct StorageFootprint

TelemetryInfo

_No module-level documentation is present in the source._

Item
pub struct TelemetryInfo

TrackingKey

_No module-level documentation is present in the source._

Item
pub struct TrackingKey

TransparencyInfo

_No module-level documentation is present in the source._

Item
pub struct TransparencyInfo

FormField

_No module-level documentation is present in the source._

Item
pub struct FormField

FormInfo

_No module-level documentation is present in the source._

Item
pub struct FormInfo

FormReport

_No module-level documentation is present in the source._

Item
fn scan_forms(session : & CdpSession) -> Result <FormReport, AutomationError>
pub struct FormReport

HumanProfile

_No module-level documentation is present in the source._

Item
pub struct HumanProfile
HumanProfile :: fn default_profile() -> Self
HumanProfile :: fn fast_typist() -> Self
HumanProfile :: fn careful() -> Self

Humanizer:Humanizer

_No module-level documentation is present in the source._

Item
pub struct Humanizer

Humanizer:action

_No module-level documentation is present in the source._

Item
Humanizer :: fn action_delay(& mut self) -> Duration

Humanizer:click

_No module-level documentation is present in the source._

Item
Humanizer :: fn click_hold(& mut self) -> Duration

Humanizer:dwell

_No module-level documentation is present in the source._

Item
Humanizer :: fn dwell_short(& mut self) -> Duration
Humanizer :: fn dwell_long(& mut self) -> Duration

Humanizer:keystroke

_No module-level documentation is present in the source._

Item
Humanizer :: fn keystroke_delay(& mut self) -> Duration

Humanizer:mouse

_No module-level documentation is present in the source._

Item
Humanizer :: fn mouse_path(& mut self, from : Point, to : Point) -> Vec <Point>
Humanizer :: fn mouse_step_delay(& mut self, total_distance : f64, steps : usize) -> Duration

Humanizer:new

_No module-level documentation is present in the source._

Item
Humanizer :: fn new(profile : HumanProfile) -> Self

Humanizer:plan

_No module-level documentation is present in the source._

Item
Humanizer :: fn plan_typing(& mut self, text : & str) -> Vec <TypingEvent>
Humanizer :: fn plan_scroll(& mut self, current_y : f64, target_y : f64) -> Vec <ScrollEvent>
Humanizer :: fn plan_mouse_move(& mut self, from : Point, to : Point) -> Vec <MouseMoveEvent>

Humanizer:pre

_No module-level documentation is present in the source._

Item
Humanizer :: fn pre_click_pause(& mut self) -> Duration

Humanizer:profile

_No module-level documentation is present in the source._

Item
Humanizer :: fn profile(& self) -> & HumanProfile

Humanizer:scan

_No module-level documentation is present in the source._

Item
Humanizer :: fn scan_points_near(& mut self, target : Point, radius : f64) -> Vec <Point>
Humanizer :: fn scan_pause(& mut self) -> Duration

Humanizer:should

_No module-level documentation is present in the source._

Item
Humanizer :: fn should_typo(& mut self) -> bool
Humanizer :: fn should_trackpad_bump(& mut self) -> bool
Humanizer :: fn should_scan_before_click(& mut self) -> bool

Humanizer:trackpad

_No module-level documentation is present in the source._

Item
Humanizer :: fn trackpad_bump(& mut self) -> Point

Humanizer:typo

_No module-level documentation is present in the source._

Item
Humanizer :: fn typo_char(& mut self, intended : char) -> char
Humanizer :: fn typo_reaction_delay(& mut self) -> Duration

Humanizer:with

_No module-level documentation is present in the source._

Item
Humanizer :: fn with_seed(profile : HumanProfile, seed : u64) -> Self

Humanizer:word

_No module-level documentation is present in the source._

Item
Humanizer :: fn word_pause(& mut self) -> Duration

MouseMoveEvent

_No module-level documentation is present in the source._

Item
pub struct MouseMoveEvent

Point

_No module-level documentation is present in the source._

Item
pub struct Point
Point :: fn new(x : f64, y : f64) -> Self
Point :: fn distance_to(& self, other : & Point) -> f64

ScrollEvent

_No module-level documentation is present in the source._

Item
pub enum ScrollEvent

TypingEvent

_No module-level documentation is present in the source._

Item
pub enum TypingEvent

JsLibrary

_No module-level documentation is present in the source._

Item
pub struct JsLibrary

JsLibraryReport

_No module-level documentation is present in the source._

Item
fn detect_js_libraries(session : & CdpSession) -> Result <JsLibraryReport, AutomationError>
pub struct JsLibraryReport

Filter

_No module-level documentation is present in the source._

Item
pub enum Filter
Filter :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

Locator

_No module-level documentation is present in the source._

Item
pub struct Locator
Locator :: fn css(selector : & str) -> Self
Locator :: fn xpath(expr : & str) -> Self
Locator :: fn text(text : & str) -> Self
Locator :: fn with_fallbacks(strategies : Vec <SelectorStrategy>) -> Self
Locator :: fn within(self, parent : Locator) -> Self
Locator :: fn filter(mut self, f : Filter) -> Self
Locator :: fn strategies_ordered(& self) -> Vec <(usize, & SelectorStrategy)>

ResolvedElement

_No module-level documentation is present in the source._

Item
pub struct ResolvedElement

SelectorStrategy

_No module-level documentation is present in the source._

Item
pub enum SelectorStrategy
SelectorStrategy :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

HeadingInfo

_No module-level documentation is present in the source._

Item
pub struct HeadingInfo

HreflangLink

_No module-level documentation is present in the source._

Item
pub struct HreflangLink

MetaSeoReport

_No module-level documentation is present in the source._

Item
fn extract_meta_seo(session : & CdpSession) -> Result <MetaSeoReport, AutomationError>
pub struct MetaSeoReport

MetaTag

_No module-level documentation is present in the source._

Item
pub struct MetaTag

SeoInfo

_No module-level documentation is present in the source._

Item
pub struct SeoInfo

StructuredDataBlock

_No module-level documentation is present in the source._

Item
pub struct StructuredDataBlock

PageState

_No module-level documentation is present in the source._

Item
pub struct PageState
PageState :: fn new() -> Self
PageState :: fn default() -> Self

ApiAccess

_No module-level documentation is present in the source._

Item
pub struct ApiAccess

BehavioralSection

_No module-level documentation is present in the source._

Item
pub struct BehavioralSection

CookieInfo

_No module-level documentation is present in the source._

Item
pub struct CookieInfo

FingerprintingSection

_No module-level documentation is present in the source._

Item
pub struct FingerprintingSection

NetworkSection

_No module-level documentation is present in the source._

Item
pub struct NetworkSection

PrivacyReport

_No module-level documentation is present in the source._

Item
fn audit_privacy(session : & CdpSession) -> Result <PrivacyReport, AutomationError>
pub struct PrivacyReport
PrivacyReport :: fn grade(& self) -> & 'static str
PrivacyReport :: fn summary(& self) -> String

PrivacyScore

_No module-level documentation is present in the source._

Item
pub struct PrivacyScore

ServiceWorkerInfo

_No module-level documentation is present in the source._

Item
pub struct ServiceWorkerInfo

SessionStorageKey

_No module-level documentation is present in the source._

Item
pub struct SessionStorageKey

StorageKeyInfo

_No module-level documentation is present in the source._

Item
pub struct StorageKeyInfo

StorageSection

_No module-level documentation is present in the source._

Item
pub struct StorageSection

ThirdPartyDomain

_No module-level documentation is present in the source._

Item
pub struct ThirdPartyDomain

SecurityReport

_No module-level documentation is present in the source._

Item
fn audit_security(session : & CdpSession) -> Result <SecurityReport, AutomationError>
pub struct SecurityReport
SecurityReport :: fn grade(& self) -> & 'static str

ActionMode

_No module-level documentation is present in the source._

Item
pub enum ActionMode

ActionOptions

_No module-level documentation is present in the source._

Item
pub struct ActionOptions
ActionOptions :: fn default() -> Self

ActionabilityResult

_No module-level documentation is present in the source._

Item
pub struct ActionabilityResult
ActionabilityResult :: fn is_actionable(& self) -> bool
ActionabilityResult :: fn failure_reason(& self) -> Option <String>

BoundingRect

_No module-level documentation is present in the source._

Item
pub struct BoundingRect
BoundingRect :: fn center(& self) ->(f64, f64)
BoundingRect :: fn has_area(& self) -> bool
BoundingRect :: fn approx_eq(& self, other : & BoundingRect, tolerance : f64) -> bool

ReadMode

_No module-level documentation is present in the source._

Item
pub enum ReadMode

WaitOptions

_No module-level documentation is present in the source._

Item
pub struct WaitOptions
WaitOptions :: fn default() -> Self
WaitOptions :: fn fast() -> Self
WaitOptions :: fn patient() -> Self

How to use it

From `examples/first_party_xray.rs`:

use infrastructure_browser_automation::{audit_first_party, audit_privacy};
use infrastructure_browser_cdp::{BrowserEndpoint, DEFAULT_PORT};

fn main() {
    let pattern = std::env::args().nth(1).unwrap_or_else(|| "whatsapp".into());
    let ep = BrowserEndpoint::connect(&format!("http://localhost:{}", DEFAULT_PORT)).unwrap();

    let target = ep
        .find_target(|t| t.url.contains(&pattern) && t.websocket_url.is_some())
        .unwrap()
        .unwrap_or_else(|| {
            eprintln!("No tab matching '{pattern}'");
            std::process::exit(1);
        });

    println!("Target: {} — {}\n", target.title, target.url);
    let session = ep.open_session(&target).unwrap();

From `examples/human_browse.rs`:

use infrastructure_browser_automation::humanizer::{HumanProfile, Humanizer, Point, ScrollEvent};
use infrastructure_browser_cdp::commands::{input, runtime};
use infrastructure_browser_cdp::{BrowserEndpoint, DEFAULT_PORT};
use std::thread;
use std::time::Duration;

fn main() {
    let pattern = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "google.com/search".into());

    let ep = BrowserEndpoint::connect(&format!("http://localhost:{}", DEFAULT_PORT)).unwrap();
    let target = ep
        .find_target(|t| t.url.contains(&pattern) && t.websocket_url.is_some())
        .unwrap()
        .unwrap_or_else(|| {
            eprintln!("No tab matching '{pattern}'");
            std::process::exit(1);

Module structure

infrastructure_browser_automation

flowchart TD
  n_infrastructure_browser_automation["infrastructure_browser_automation"]
  n_infrastructure_browser_automation --> n_action_engine["action_engine"]
  n_infrastructure_browser_automation --> n_action_monitor["action_monitor"]
  n_infrastructure_browser_automation --> n_cookie_decode["cookie_decode"]
  n_infrastructure_browser_automation --> n_detection_engine["detection_engine"]
  n_infrastructure_browser_automation --> n_detection_lab["detection_lab"]
  n_infrastructure_browser_automation --> n_error["error"]
  n_infrastructure_browser_automation --> n_fingerprint["fingerprint"]
  n_infrastructure_browser_automation --> n_first_party_audit["first_party_audit"]
  n_infrastructure_browser_automation --> n_form_scanner["form_scanner"]
  n_infrastructure_browser_automation --> n_humanizer["humanizer"]
  n_infrastructure_browser_automation --> n_js_libraries["js_libraries"]
  n_infrastructure_browser_automation --> n_locator["locator"]
  n_infrastructure_browser_automation --> n_meta_seo["meta_seo"]
  n_infrastructure_browser_automation --> n_page_state["page_state"]
  n_infrastructure_browser_automation --> n_privacy_audit["privacy_audit"]
  n_infrastructure_browser_automation --> n_security_audit["security_audit"]
  n_infrastructure_browser_automation --> n_wait["wait"]

Public surface

`action_engine`

ItemWhat it is
pub struct SessionPolicyCDP session policy — controls which domains/features are allowed
SessionPolicy :: fn default() -> Self
SessionPolicy :: fn permissive() -> SelfPermissive policy — enables all features
pub struct ActionEngine<'a>The main automation engine
ActionEngine<'a> :: fn new(session : & 'a CdpSession, humanizer : Humanizer) -> SelfCreate a new ActionEngine with default-safe policy
ActionEngine<'a> :: fn with_options(session : & 'a CdpSession, humanizer : Humanizer, wait : WaitOptions, policy : SessionPolicy,) -> SelfCreate with custom wait options and policy.
ActionEngine<'a> :: fn policy(& self) -> & SessionPolicyGet the current session policy.
ActionEngine<'a> :: fn state(& self) -> & PageStateGet the current page state.
ActionEngine<'a> :: fn refresh_state(& mut self) -> Result <(), AutomationError>Refresh page state from the browser.
ActionEngine<'a> :: fn click(& mut self, locator : & Locator) -> Result <(), AutomationError>Click an element: wait → scroll → move mouse → click.
ActionEngine<'a> :: fn click_with_options(& mut self, locator : & Locator, opts : & ActionOptions,) -> Result <(), AutomationError>Click with custom options.
ActionEngine<'a> :: fn type_text(& mut self, locator : & Locator, text : & str) -> Result <(), AutomationError>Type text into the focused element (or click first if locator given).
ActionEngine<'a> :: fn type_text_with_options(& mut self, locator : & Locator, text : & str, opts : & ActionOptions,) -> Result <(), AutomationError>Type text with options.
ActionEngine<'a> :: fn read_text(& mut self, locator : & Locator) -> Result <String, AutomationError>Read text from an element.
ActionEngine<'a> :: fn read_text_with_options(& mut self, locator : & Locator, opts : & ActionOptions,) -> Result <String, AutomationError>Read text with options (InnerText, TextContent, Html).
ActionEngine<'a> :: fn navigate(& mut self, url : & str) -> Result <(), AutomationError>Navigate to a URL
ActionEngine<'a> :: fn screenshot(& self) -> Result <String, AutomationError>Take a screenshot.
ActionEngine<'a> :: fn detect_bot_detectors(& self) -> Result <Vec <BotDetectorInfo>, AutomationError>Detect bot detection scripts on the current page
pub struct BotDetectorInfoInformation about a detected bot-detection mechanism.

`action_monitor`

ItemWhat it is
pub struct ActionCheckpointLightweight state checkpoint for before/after action diffing
pub struct ActionImpactResult of diffing two checkpoints.
ActionImpact :: fn is_clean(& self) -> bool
ActionImpact :: fn summary(& self) -> String
pub enum ImpactSeverity
ImpactSeverity :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
fn checkpoint(session : & infrastructure_browser_cdp::CdpSession,) -> Result <ActionCheckpoint, crate::error::AutomationError>Take a lightweight checkpoint of the current page state (requires CDP).
fn diff(before : & ActionCheckpoint, after : & ActionCheckpoint) -> ActionImpactDiff two checkpoints to compute the impact of an action.

`cookie_decode`

ItemWhat it is
pub struct DecodedArtifactDecoded artifact from a cookie value.
pub enum ArtifactKindKind of decoded artifact.
pub struct CookieClaimA claim extracted from a cookie value.
pub enum PiiClassPII classification.
pub enum DecodeStatusDecode status for a cookie.
pub struct CookieDecodeResultFull decode result for a single cookie.
fn decode_cookie(name : & str, value : & str) -> CookieDecodeResultDecode a cookie value through the full pipeline (greedy — tries ALL decoders).

`detection_engine`

ItemWhat it is
pub struct DetectionRuleA detection rule describing how to identify a technology or service.
pub enum DetectionCategoryCategory of detected technology.
DetectionCategory :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub enum MatchPolicyHow conditions are combined for a rule.
pub enum RuleSourceWhere a rule came from.
pub struct DetectionConditionA condition within a detection rule.
pub enum SourceTypeSource of evidence for a condition.
pub enum PatternKindHow to match the pattern.
pub struct DetectionEmissionWhat a rule emits when it matches.
pub struct PageEvidenceCollected evidence from a page for rule evaluation.
pub struct EvidenceItemA single piece of evidence.
pub struct DetectionResultResult of running the detection engine on a page.
pub struct DetectionA single detected technology or service.
pub struct MatchedEvidenceEvidence that matched a condition.
pub struct DetectionEngineThe detection engine
DetectionEngine :: fn with_defaults() -> SelfCreate engine with default shipped rules (hardcoded fallback).
DetectionEngine :: fn from_toml_file(path : & str) -> SelfLoad rules from a TOML file
DetectionEngine :: fn from_toml(content : & str) -> Result <Self, String>Parse rules from a TOML string.
DetectionEngine :: fn new(rules : Vec <DetectionRule>) -> SelfCreate engine with custom rules.
DetectionEngine :: fn add_rules(& mut self, rules : Vec <DetectionRule>)Add rules to the engine.
DetectionEngine :: fn rule_count(& self) -> usizeNumber of loaded rules.
DetectionEngine :: fn evaluate(& self, evidence : & PageEvidence) -> DetectionResultEvaluate all rules against collected evidence.

`detection_lab`

ItemWhat it is
fn scan_page(session : & CdpSession) -> Result <DetectionReport, AutomationError>Passive reconnaissance module for detecting bot-detection mechanisms on a page
pub struct DetectionReportFull detection report for a scanned page.
DetectionReport :: fn threat_level(& self) -> ThreatLevelGet a threat level assessment (informational).
DetectionReport :: fn summary(& self) -> StringHuman-readable summary.
pub struct ScriptMatch
pub struct EndpointMatch
pub struct BrowserState
pub enum ThreatLevelInformational threat level based on detection scan.
ThreatLevel :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

`error`

ItemWhat it is
pub enum AutomationError

`fingerprint`

ItemWhat it is
fn apply_stealth(session : & CdpSession) -> Result <StealthReport, AutomationError>WARNING: USE WITH CAUTION. Applies browser fingerprint masking
fn canvas_hash_fnv1a(data_url : & str) -> i64Rust mirror of the canvas-hash step inside COLLECTOR_JS
pub const COLLECTOR_JS: & strThe page-side fingerprint collector: one self-contained expression that returns a JSON string deserializable as FingerprintAudit
fn audit_fingerprint(session : & CdpSession) -> Result <FingerprintAudit, AutomationError>Audit the current page's fingerprint — returns what a bot detector would see
pub struct StealthReport
StealthReport :: fn all_applied(& self) -> bool
pub struct FingerprintAuditFingerprint audit result — what a detector would see about the browser.
FingerprintAudit :: fn red_flags(& self) -> Vec <String>Check for red flags that suggest automation.

`first_party_audit`

ItemWhat it is
fn audit_first_party(session : & CdpSession) -> Result <FirstPartyReport, AutomationError>Audit first-party data collection — what the site itself stores and tracks
pub struct FirstPartyReport
FirstPartyReport :: fn grade(& self) -> & 'static str
FirstPartyReport :: fn summary(& self) -> String
pub struct StorageFootprint
pub struct BehavioralTracking
pub struct TrackingKey
pub struct TelemetryInfo
pub struct TransparencyInfo
pub struct PersistenceInfo
pub struct BotDetectionInfo
pub struct FirstPartyScore

`form_scanner`

ItemWhat it is
fn scan_forms(session : & CdpSession) -> Result <FormReport, AutomationError>Scan all forms and input fields on the page, classifying what data they collect.
pub struct FormReport
pub struct FormInfo
pub struct FormField

`humanizer`

ItemWhat it is
pub struct HumanProfileHuman behavior profile defining typing speed, mouse behavior, and error rates.
HumanProfile :: fn default_profile() -> SelfDefault profile: moderate speed, occasional typos, natural mouse.
HumanProfile :: fn fast_typist() -> SelfFast typist profile: quicker, fewer errors.
HumanProfile :: fn careful() -> SelfCareful user profile: slower, more deliberate.
pub struct PointA point on screen.
Point :: fn new(x : f64, y : f64) -> Self
Point :: fn distance_to(& self, other : & Point) -> f64
pub struct HumanizerHumanization engine that generates realistic interaction timings and paths
Humanizer :: fn new(profile : HumanProfile) -> SelfCreate a humanizer with a random seed.
Humanizer :: fn with_seed(profile : HumanProfile, seed : u64) -> SelfCreate a humanizer with a fixed seed (deterministic, for tests).
Humanizer :: fn profile(& self) -> & HumanProfileGet a reference to the profile.
Humanizer :: fn keystroke_delay(& mut self) -> DurationGenerate a delay between keystrokes based on typing speed.
Humanizer :: fn word_pause(& mut self) -> DurationGenerate a longer pause between words.
Humanizer :: fn should_typo(& mut self) -> boolDecide whether to make a typo on this character.
Humanizer :: fn typo_char(& mut self, intended : char) -> charGenerate a random wrong character near the intended one on a QWERTY keyboard.
Humanizer :: fn typo_reaction_delay(& mut self) -> DurationGenerate the "oops" delay before correcting a typo.
Humanizer :: fn mouse_path(& mut self, from : Point, to : Point) -> Vec <Point>Generate a Bezier curve mouse path from from to to
Humanizer :: fn mouse_step_delay(& mut self, total_distance : f64, steps : usize) -> DurationGenerate delay between mouse movement steps (for velocity profile).
Humanizer :: fn pre_click_pause(& mut self) -> DurationGenerate pre-click hover pause.
Humanizer :: fn click_hold(& mut self) -> DurationGenerate click hold duration (mousedown → mouseup).
Humanizer :: fn action_delay(& mut self) -> DurationGenerate inter-action delay.
Humanizer :: fn should_trackpad_bump(& mut self) -> boolDecide whether to do a small trackpad bump (idle fidget).
Humanizer :: fn trackpad_bump(& mut self) -> PointGenerate a small random trackpad bump offset.
Humanizer :: fn plan_typing(& mut self, text : & str) -> Vec <TypingEvent>Plan typing a string, including typos and corrections
Humanizer :: fn plan_scroll(& mut self, current_y : f64, target_y : f64) -> Vec <ScrollEvent>Plan a humanized scroll sequence from current position to target Y offset
Humanizer :: fn dwell_short(& mut self) -> DurationGenerate a short dwell time (before clicking a simple element).
Humanizer :: fn dwell_long(& mut self) -> DurationGenerate a long dwell time (before interacting with content-heavy area).
Humanizer :: fn should_scan_before_click(& mut self) -> boolDecide whether to scan nearby elements before clicking.
Humanizer :: fn scan_points_near(& mut self, target : Point, radius : f64) -> Vec <Point>Generate scan points near a target — small cursor movements as if the user is visually scanning nearby elements before committing to click.
Humanizer :: fn scan_pause(& mut self) -> DurationGenerate a pause between scan points.
Humanizer :: fn plan_mouse_move(& mut self, from : Point, to : Point) -> Vec <MouseMoveEvent>Plan a pointer move as a curve with acceleration, overshoot and settle
pub struct MouseMoveEventOne step of a humanized pointer move: where to put the pointer, and how long to wait before the next step.
pub enum ScrollEventA single event in a scroll sequence.
pub enum TypingEventA single event in a typing sequence.

`js_libraries`

ItemWhat it is
fn detect_js_libraries(session : & CdpSession) -> Result <JsLibraryReport, AutomationError>Detect JavaScript libraries and their versions via global objects and script URLs.
pub struct JsLibraryReport
pub struct JsLibrary

`locator`

ItemWhat it is
pub struct LocatorA declarative, immutable element locator with fallback strategies
Locator :: fn css(selector : & str) -> SelfCreate a locator with a single CSS selector.
Locator :: fn xpath(expr : & str) -> SelfCreate a locator with a single XPath expression.
Locator :: fn text(text : & str) -> SelfCreate a locator with a text content match.
Locator :: fn with_fallbacks(strategies : Vec <SelectorStrategy>) -> SelfCreate a locator with multiple fallback strategies.
Locator :: fn within(self, parent : Locator) -> SelfScope this locator within a parent (returns new Locator).
Locator :: fn filter(mut self, f : Filter) -> SelfAdd a filter (returns new Locator).
Locator :: fn strategies_ordered(& self) -> Vec <(usize, & SelectorStrategy)>Get strategies in resolution order (last successful first, then rest).
pub enum SelectorStrategyStrategy for finding an element in the DOM.
SelectorStrategy :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub enum FilterPost-resolution filter applied after finding candidate elements.
Filter :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result
pub struct ResolvedElementA resolved element reference from the DOM.

`meta_seo`

ItemWhat it is
fn extract_meta_seo(session : & CdpSession) -> Result <MetaSeoReport, AutomationError>Extract all meta tags, SEO signals, and structured data from the page.
pub struct MetaSeoReport
pub struct MetaTag
pub struct StructuredDataBlock
pub struct SeoInfo
pub struct HreflangLink
pub struct HeadingInfo

`page_state`

ItemWhat it is
pub struct PageStateSnapshot of the current page state.
PageState :: fn new() -> Self
PageState :: fn default() -> Self

`privacy_audit`

ItemWhat it is
fn audit_privacy(session : & CdpSession) -> Result <PrivacyReport, AutomationError>
pub struct PrivacyReportComplete privacy audit report for a page.
PrivacyReport :: fn grade(& self) -> & 'static strGet a letter grade (A-F) based on the privacy score.
PrivacyReport :: fn summary(& self) -> StringHuman-readable summary.
pub struct FingerprintingSection
pub struct ApiAccess
pub struct BehavioralSection
pub struct StorageSection
pub struct CookieInfo
pub struct StorageKeyInfo
pub struct SessionStorageKey
pub struct ServiceWorkerInfo
pub struct NetworkSection
pub struct ThirdPartyDomain
pub struct PrivacyScore

`security_audit`

ItemWhat it is
fn audit_security(session : & CdpSession) -> Result <SecurityReport, AutomationError>Audit security headers and posture of the current page
pub struct SecurityReport
SecurityReport :: fn grade(& self) -> & 'static str

`wait`

ItemWhat it is
pub struct WaitOptionsConfiguration for waiting/polling behavior.
WaitOptions :: fn default() -> Self
WaitOptions :: fn fast() -> Self
WaitOptions :: fn patient() -> Self
pub struct ActionabilityResultResult of an actionability check on a resolved element.
ActionabilityResult :: fn is_actionable(& self) -> boolWhether the element is fully actionable.
ActionabilityResult :: fn failure_reason(& self) -> Option <String>Human-readable reason if not actionable.
pub struct BoundingRectBounding rect for an element (from getBoundingClientRect).
BoundingRect :: fn center(& self) ->(f64, f64)Center point of the element.
BoundingRect :: fn has_area(& self) -> boolWhether the rect has non-zero size.
BoundingRect :: fn approx_eq(& self, other : & BoundingRect, tolerance : f64) -> boolWhether this rect is approximately equal to another (within tolerance).
pub enum ReadModeHow to read text from an element.
pub enum ActionModeAction execution mode.
pub struct ActionOptionsPer-action options override.
ActionOptions :: fn default() -> Self

Re-exports. Exported here, defined elsewhere.

ExportDefined in
AutomationErrorerror::AutomationError
PageStatepage_state::PageState
checkpointaction_monitor::checkpoint
shannon_entropyinfrastructure_dlp_detect::shannon_entropy
{ActionEngine,BotDetectorInfo,SessionPolicy}action_engine::{ActionEngine,BotDetectorInfo,SessionPolicy}
{ActionMode,ActionOptions,ActionabilityResult,BoundingRect,ReadMode,WaitOptions,}wait::{ActionMode,ActionOptions,ActionabilityResult,BoundingRect,ReadMode,WaitOptions,}
{DetectionEngine,DetectionResult,PageEvidence}detection_engine::{DetectionEngine,DetectionResult,PageEvidence}
{Filter,Locator,ResolvedElement,SelectorStrategy}locator::{Filter,Locator,ResolvedElement,SelectorStrategy}
{HumanProfile,Humanizer,Point,ScrollEvent,TypingEvent}humanizer::{HumanProfile,Humanizer,Point,ScrollEvent,TypingEvent}
{apply_stealth,audit_fingerprint,FingerprintAudit,StealthReport}fingerprint::{apply_stealth,audit_fingerprint,FingerprintAudit,StealthReport}
{audit_first_party,FirstPartyReport}first_party_audit::{audit_first_party,FirstPartyReport}
{audit_privacy,PrivacyReport,PrivacyScore}privacy_audit::{audit_privacy,PrivacyReport,PrivacyScore}
{audit_security,SecurityReport}security_audit::{audit_security,SecurityReport}
{decode_cookie,CookieClaim,CookieDecodeResult,DecodeStatus,PiiClass}cookie_decode::{decode_cookie,CookieClaim,CookieDecodeResult,DecodeStatus,PiiClass}
{detect_js_libraries,JsLibraryReport}js_libraries::{detect_js_libraries,JsLibraryReport}
{diff,ActionCheckpoint,ActionImpact,ImpactSeverity}action_monitor::{diff,ActionCheckpoint,ActionImpact,ImpactSeverity}
{extract_meta_seo,MetaSeoReport}meta_seo::{extract_meta_seo,MetaSeoReport}
{scan_forms,FormReport}form_scanner::{scan_forms,FormReport}
{scan_page,DetectionReport,ThreatLevel}detection_lab::{scan_page,DetectionReport,ThreatLevel}

Boundary

Depends on no other workspace tier.

Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)infrastructure
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/infrastructure/browser-automation
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-browser-cdp`infrastructureyesalways
`infrastructure-dlp-detect`infrastructurenoalways
`infrastructure-fetcher`infrastructureyesalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
rand^0.9small_rngnoalways
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways
toml^0.8noalways
tracing^0.1noalways
url^2yesalways

Development. None.

Build. None.

Depended on by. 7 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_browser_automation["application-browser-automation"] -->|uses| SELF
  n_infrastructure_acquire["infrastructure-acquire"] -->|uses| SELF
  n_infrastructure_browser_automation_wasm["infrastructure-browser-automation-wasm"] -->|uses| SELF
  n_operations_browser_agent_worker["operations-browser-agent-worker"] -->|uses| SELF
  n_operations_e2e_harness["operations-e2e-harness"] -->|uses| SELF
  n_operations_privacy_scan_runner["operations-privacy-scan-runner"] -->|uses| SELF
  n_platform_disclosure_lab["platform-disclosure-lab"] -->|uses| SELF
  SELF["infrastructure-browser-automation"]
  SELF -->|runtime| n_infrastructure_browser_cdp["infrastructure-browser-cdp"]
  SELF -->|runtime| n_infrastructure_dlp_detect["infrastructure-dlp-detect"]
  SELF -->|runtime| n_infrastructure_fetcher["infrastructure-fetcher"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
cdpinfrastructure-browser-cdp, infrastructure-fetcher, urlyes
defaultcdpyes
infrastructure-browser-cdpdep:infrastructure-browser-cdpno
infrastructure-fetcherdep:infrastructure-fetcherno
urldep:urlno
flowchart LR
  n_cdp["cdp"] --> n_infrastructure_browser_cdp["infrastructure-browser-cdp"]
  n_cdp["cdp"] --> n_infrastructure_fetcher["infrastructure-fetcher"]
  n_cdp["cdp"] --> n_url["url"]
  n_default["default"] --> n_cdp["cdp"]
  n_infrastructure_browser_cdp["infrastructure-browser-cdp"] --> n_dep_infrastructure_browser_cdp["dep:infrastructure-browser-cdp"]
  n_infrastructure_fetcher["infrastructure-fetcher"] --> n_dep_infrastructure_fetcher["dep:infrastructure-fetcher"]
  n_url["url"] --> n_dep_url["dep:url"]

Targets

KindNameSource
examplefirst_party_xray`examples/first_party_xray.rs`
examplehuman_browse`examples/human_browse.rs`
examplemouse_path`examples/mouse_path.rs`
exampleprivacy_xray`examples/privacy_xray.rs`
examplescan_site`examples/scan_site.rs`
libinfrastructure_browser_automation`src/lib.rs`

Error model

Error typeNamed by
AutomationErrorapply_stealth, audit_fingerprint, audit_first_party, audit_privacy, audit_security, checkpoint, … (10 total)

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

7 workspace crates depend on this one: application-browser-automation, infrastructure-acquire, infrastructure-browser-automation-wasm, operations-browser-agent-worker, operations-e2e-harness, operations-privacy-scan-runner, platform-disclosure-lab.

Verification

KindCount
Unit tests141
Integration tests0
Examples5
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
action_engine303
action_monitor501
cookie_decode703
detection_engine1414
detection_lab611
error102
fingerprint611
first_party_audit1010
form_scanner401
humanizer6417
js_libraries301
locator402
meta_seo701
page_state101
privacy_audit1311
security_audit201
wait605

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc124183
Public modules with a //! block117
pie showData
    title Public items with rustdoc
    "Documented" : 124
    "No rustdoc detected" : 59

Metrics

MetricValue
Rust source files18
Source lines8211
Code lines6794
Public API items183
Public modules17
Tests141
Examples5
Cargo features5
Direct runtime dependencies10
Workspace reverse dependencies7
pie showData
    title Public API by kind
    "constant" : 1
    "enum" : 17
    "function" : 13
    "method" : 85
    "struct" : 67
pie showData
    title Rust source composition
    "Code" : 6794
    "Blank or comment" : 1417

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All infrastructure · Manual