tools tier

tools-oauth-consent

OAuth browser-consent DRIVER: the deterministic replay of the consent clicks (classify_page + next_action + to_screen), driving browser-test for observation and xdotool for hardware actuation. Token minting is NOT this tool's job — the consent URL comes in, the driver clicks through, and completion is the tab reaching the loopback redirect; the token is minted by the existing adapters-google-gmail authorize flow (examples/authorize.rs). Design: docs/architecture/oauth-consent-tool-plan.md. Live run is operator-gated.

OAuth browser-consent DRIVER: the deterministic replay of the consent clicks (classify_page + next_action + to_screen), driving browser-test for observation and xdotool for hardware actuation. Token minting is NOT this tool's job — the consent URL comes in, the driver clicks through, and completion is the tab reaching the loopback redirect; the token is minted by the existing adapters-google-gmail authorize flow (examples/authorize.rs). Design: docs/architecture/oauth-consent-tool-plan.md. Live run is operator-gated.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/oauth-consent
Edition2021
Targetstools-oauth-consent, tools_oauth_consent
Public items17 across 0 modules
Tests15

What it is for

tools-oauth-consent — the pure perception core of the browser-consent tool.

Two functions, both I/O-free and deterministic, are the seam between the model-derived flow and the deterministic replay (design: docs/architecture/oauth-consent-tool-plan.md, §8):

geometry into a screen-device-pixel click point (§8.1). The transform was solved from three click/rect pairs captured live, not tuned by eye.

checkbox-present flag, and whether the loopback listener already has the code) into one PageState (§8.2). Exact, ordered predicates.

Everything here is observation → decision. Actuation (the click), transport (tools-browser-test, the loopback listener), and the authorize protocol live in the driver, not this crate.

Capabilities

crate root

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
fn to_screen(r : & Rect, w : & WindowGeom) ->(i64, i64)
fn classify_page(obs : & PageObservation) -> PageState
fn consent_host(url : & str) -> & str
fn tab_id_for_host(list_data : & Value, host : & str) -> Option <i64>
fn url_of_tab(list_data : & Value, tab_id : i64) -> String

Action

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
pub enum Action
fn next_action(state : PageState) -> Action

ElementRect

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
pub struct ElementRect
ElementRect :: fn rect(& self) -> Rect
fn find_button <'a>(els : & 'a ElementRect, label : & str) -> Option <& 'a ElementRect>

PageObservation

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
pub struct PageObservation<'a>

PageState

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
pub enum PageState

Rect

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
pub struct Rect
fn rect_center(r : & Rect) ->(f64, f64)
fn parse_rects(data : & Value) -> Option <(Vec <ElementRect>, WindowGeom)>

WindowGeom

tools-oauth-consent — the pure perception core of the browser-consent tool.

Item
pub struct WindowGeom
fn to_screen_point(vx : f64, vy : f64, w : & WindowGeom) ->(i64, i64)

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub struct RectAn element's viewport rectangle in CSS pixels, as reported by the element_rects browser command.
pub struct WindowGeomBrowser window geometry, reported alongside the rects
fn rect_center(r : & Rect) ->(f64, f64)Center of a rect in viewport CSS pixels.
fn to_screen_point(vx : f64, vy : f64, w : & WindowGeom) ->(i64, i64)Screen device-pixel point for a viewport CSS-pixel point, given the window geometry (design §8.1)
fn to_screen(r : & Rect, w : & WindowGeom) ->(i64, i64)Screen device-pixel click point for an element rect: its center, transformed by to_screen_point.
pub enum PageStateThe page states the consent driver distinguishes
pub struct PageObservation<'a>What the driver observes about a page: the joined visible text, whether a checkbox role is present, and whether the loopback listener has already received the authorization code (decided out of band).
fn classify_page(obs : & PageObservation) -> PageStateClassify a page from its observation (design §8.2)
pub enum ActionThe action the driver takes for a page state (design §8.2/§8.3)
fn next_action(state : PageState) -> ActionMap a classified page state to the driver's next action
pub struct ElementRectOne element from a get_element_rects response: its trimmed text and viewport rect
ElementRect :: fn rect(& self) -> RectThe rect (drops the text) for to_screen.
fn find_button <'a>(els : & 'a ElementRect, label : & str) -> Option <& 'a ElementRect>The element whose trimmed text is exactly label (case-insensitive), never the "Back to safety" decoy (design §8.3)
fn consent_host(url : & str) -> & strHost (authority) of a URL — the part between // and the next /
fn tab_id_for_host(list_data : & Value, host : & str) -> Option <i64>From a list_tabs data object, the id of the LAST tab whose url contains host (or google.com) — most recent match wins.
fn url_of_tab(list_data : & Value, tab_id : i64) -> StringFrom a list_tabs data object, the url of the tab with tab_id ("" if absent).
fn parse_rects(data : & Value) -> Option <(Vec <ElementRect>, WindowGeom)>Parse a get_element_rects data object into (elements, window geometry)

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 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)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/oauth-consent
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
serde^1derivenoalways
serde_json^1noalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Feature flags

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

Targets

KindNameSource
bintools-oauth-consent`src/main.rs`
libtools_oauth_consent`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 variablesyes

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

Configuration

VariableRead in
API_KEYsrc/main.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests15
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root1600

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1717
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 17
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files2
Source lines861
Code lines660
Public API items17
Public modules0
Tests15
Examples0
Cargo features0
Direct runtime dependencies3
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "enum" : 2
    "function" : 10
    "method" : 1
    "struct" : 4
pie showData
    title Rust source composition
    "Code" : 660
    "Blank or comment" : 201

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 tools · Manual