Gemini adapter via Chrome DevTools Protocol: the composer is found by an ordered, ratified candidate list and a miss is a typed refusal naming what was tried; prompts go in as trusted input (Input.insertText, Input.dispatchMouseEvent), never Runtime.enable. B-086 step 2.
| Tier | infrastructure |
| Role | adapter |
| Path | crates/infrastructure/gemini-cdp |
| Edition | 2021 |
| Targets | gemini-cdp, infrastructure_gemini_cdp |
| Public items | 9 across 1 module |
| Tests | 13 |
What it is for
Gemini adapter via Chrome DevTools Protocol (B-086 step 2).
The composer is found by an ordered, ratified candidate list (candidates::COMPOSER_CANDIDATES), tried in order inside one Runtime.evaluate; the outcome names the candidate that matched, or is a typed refusal carrying every candidate tried. Nothing here guesses.
Input is trusted: text goes in through Input.insertText after the matched element is focused, and the send button is clicked with Input.dispatchMouseEvent at its bounding-box centre. The CDP safety policy in docs/research/PRIVACY_RESEARCH_SYSTEM.md holds: no Runtime.enable, no Page.addScriptToEvaluateOnNewDocument, no user-agent override.
Requires Chrome running with --remote-debugging-port and a logged-in Gemini tab open.
Capabilities
Candidate
The ordered, ratified candidate lists and the probe that tries them.
| Item |
|---|
pub struct Candidate |
pub const COMPOSER_CANDIDATES: & Candidate |
pub const SEND_CANDIDATES: & Candidate |
fn probe_js(cands : & Candidate) -> String |
ComposerMatch
The ordered, ratified candidate lists and the probe that tries them.
| Item |
|---|
pub struct ComposerMatch |
ProbeOutcome
The ordered, ratified candidate lists and the probe that tries them.
| Item |
|---|
pub enum ProbeOutcome |
fn parse_probe(raw : & str) -> Result <ProbeOutcome, String> |
Rect
The ordered, ratified candidate lists and the probe that tries them.
| Item |
|---|
pub struct Rect |
Rect :: fn centre(& self) ->(f64, f64) |
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
infrastructure_gemini_cdp
candidates
Public surface
`candidates`
| Item | What it is |
|---|---|
pub struct Candidate | One thing to try, by name, with the CSS that tries it. |
pub const COMPOSER_CANDIDATES: & Candidate | Composer candidates, in ratified order. |
pub const SEND_CANDIDATES: & Candidate | Send-button candidates, in ratified order. |
pub struct Rect | Bounding box of the matched element, viewport CSS pixels. |
Rect :: fn centre(& self) ->(f64, f64) | Where a trusted click lands. |
pub struct ComposerMatch | The candidate that matched, with what the page said about the element. |
pub enum ProbeOutcome | What the probe found. |
fn probe_js(cands : & Candidate) -> String | Build the one expression that tries cands in order and returns JSON |
fn parse_probe(raw : & str) -> Result <ProbeOutcome, String> | Parse what the page returned from probe_js. |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
GeminiError | error::GeminiError |
GeminiSession | session::GeminiSession |
{probe_js,Candidate,ComposerMatch,ProbeOutcome,Rect,COMPOSER_CANDIDATES,SEND_CANDIDATES,} | candidates::{probe_js,Candidate,ComposerMatch,ProbeOutcome,Rect,COMPOSER_CANDIDATES,SEND_CANDIDATES,} |
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) | adapter |
| Location | crates/infrastructure/gemini-cdp |
| Vocabulary in force (lexicon) | current |
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `infrastructure-browser-cdp` | infrastructure | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
tracing | ^0.1 | — | no | always |
Development. None.
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["infrastructure-gemini-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
| Kind | Name | Source |
|---|---|---|
| bin | gemini-cdp | `src/bin/gemini-cdp.rs` |
| lib | infrastructure_gemini_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
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | none detected |
| database access | none detected |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none 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.
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 13 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
candidates | 8 | 0 | 0 |
What the tests establish, by name:
a_second_subcommand_is_a_usage_error—src/bin/gemini-cdp.rsask_needs_stdin_marker_and_probe_refuses_it—src/bin/gemini-cdp.rsflags_take_values_and_a_missing_value_is_a_usage_error—src/bin/gemini-cdp.rsa_match_carries_name_css_tag_hash_and_rect—src/candidates.rsa_miss_names_every_candidate_tried—src/candidates.rsgarbage_from_the_page_is_an_error_not_a_miss—src/candidates.rsrect_centre_is_the_midpoint—src/candidates.rsselectors_with_quotes_are_embedded_as_valid_js_string_literals—src/candidates.rssend_candidates_try_the_test_id_first—src/candidates.rsthe_probe_tries_every_candidate_in_ratified_order—src/candidates.rsfocus_uses_the_literal_it_was_given—src/selectors.rsthe_completion_check_requires_the_action_bar—src/selectors.rscheck_result_deserializes_done_and_not_done—src/session.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 9 | 9 |
Public modules with a //! block | 1 | 1 |
pie showData
title Public items with rustdoc
"Documented" : 9
"No rustdoc detected" : 0
Metrics
| Metric | Value |
|---|---|
| Rust source files | 6 |
| Source lines | 769 |
| Code lines | 577 |
| Public API items | 9 |
| Public modules | 1 |
| Tests | 13 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 5 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"constant" : 2
"enum" : 1
"function" : 2
"method" : 1
"struct" : 3
pie showData
title Rust source composition
"Code" : 577
"Blank or comment" : 192
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.