infrastructure tier

infrastructure-whatsapp-cdp

WhatsApp Web adapter via Chrome DevTools Protocol — read and send messages

WhatsApp Web adapter via Chrome DevTools Protocol — read and send messages

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/whatsapp-cdp
Edition2021
Targetsdeep_analysis, read_chats, infrastructure_whatsapp_cdp
Public items7 across 1 module
Tests2

What it is for

WhatsApp Web adapter via Chrome DevTools Protocol.

Connects to a WhatsApp Web tab in Chrome and provides an API for listing chats, reading messages, and sending messages.

Uses runtime selector discovery to handle WhatsApp DOM changes.

Capabilities

ComposeProbe

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

Item
pub struct ComposeProbe

ContentEditable

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

Item
pub struct ContentEditable

MessagesProbe

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

Item
pub struct MessagesProbe

RoleCount

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

Item
pub struct RoleCount

SelectorProbe

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

Item
fn probe_selectors(session : & CdpSession) -> Result <SelectorProbe, String>
pub struct SelectorProbe

SidebarProbe

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

Item
pub struct SidebarProbe

How to use it

From `examples/deep_analysis.rs`:

use infrastructure_browser_cdp::commands::runtime;
use infrastructure_browser_cdp::{BrowserEndpoint, DEFAULT_PORT};

fn main() {
    let ep = BrowserEndpoint::connect(&format!("http://localhost:{}", DEFAULT_PORT)).unwrap();
    let target = ep
        .find_target(|t| t.url.contains("whatsapp") && t.websocket_url.is_some())
        .unwrap()
        .expect("No WhatsApp tab");

    let session = ep.open_session(&target).unwrap();

    let deep_js = r#"(async function() {
        var report = {};

        var encrypted = 0, readable = 0, totalSize = 0;
        var suspiciousKeys = [];
        for (var i = 0; i < localStorage.length; i++) {

From `examples/read_chats.rs`:

use infrastructure_whatsapp_cdp::WhatsAppSession;

fn main() {
    let session = match WhatsAppSession::connect() {
        Ok(s) => s,
        Err(e) => {
            eprintln!("Failed to connect: {e}");
            std::process::exit(1);
        }
    };

    let probe = session.probe();
    println!("=== WhatsApp Web DOM Probe ===");
    println!("Sidebar: {:?}", probe.sidebar);
    println!("Compose: {:?}", probe.compose);
    println!("Messages: {:?}", probe.messages);
    println!("data-testid count: {}", probe.data_testids.len());
    println!();

Module structure

infrastructure_whatsapp_cdp

Public surface

`probe`

ItemWhat it is
fn probe_selectors(session : & CdpSession) -> Result <SelectorProbe, String>Probe the WhatsApp Web DOM to discover current selectors
pub struct SelectorProbe
pub struct SidebarProbe
pub struct ComposeProbe
pub struct MessagesProbe
pub struct RoleCount
pub struct ContentEditable

Re-exports. Exported here, defined elsewhere.

ExportDefined in
SelectorProbeprobe::SelectorProbe
WhatsAppErrorerror::WhatsAppError
{Chat,Message,MessageDirection,WhatsAppSession}session::{Chat,Message,MessageDirection,WhatsAppSession}

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/whatsapp-cdp
Vocabulary in force (lexicon)current

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`infrastructure-browser-cdp`infrastructurenoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways
tracing^0.1noalways

Development. None.

Build. None.

Depended on by. 1 workspace crate.

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

flowchart LR
  n_application_whatsapp_cdp["application-whatsapp-cdp"] -->|uses| SELF
  SELF["infrastructure-whatsapp-cdp"]
  SELF -->|runtime| n_infrastructure_browser_cdp["infrastructure-browser-cdp"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
exampledeep_analysis`examples/deep_analysis.rs`
exampleread_chats`examples/read_chats.rs`
libinfrastructure_whatsapp_cdp`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

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.

1 workspace crate depends on this one: application-whatsapp-cdp.

Verification

KindCount
Unit tests2
Integration tests0
Examples2
Doctests0

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

ModuleTestsExamplesConsumers
probe700

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc17
Public modules with a //! block01
pie showData
    title Public items with rustdoc
    "Documented" : 1
    "No rustdoc detected" : 6

Metrics

MetricValue
Rust source files4
Source lines540
Code lines421
Public API items7
Public modules1
Tests2
Examples2
Cargo features0
Direct runtime dependencies5
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "function" : 1
    "struct" : 6
pie showData
    title Rust source composition
    "Code" : 421
    "Blank or comment" : 119

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