feat(connect): relay translation core (envelope <-> raw CDP + Target emulation)
Pure, unit-tested core of the daemon-side relay that bridges the ab-connect extension to the existing CdpClient. The extension exposes per-tab chrome.debugger + synthesized Target events; CdpClient expects a browser-level endpoint. So RelayState: - answers Target.getTargets / attachToTarget / setDiscoverTargets LOCALLY from targets learned via the extension's forwardCDPEvent(Target.attachedToTarget), returning the extension's cb-tab-N sessionId (consumes those synth events rather than double-forwarding them); - forwards every other command as a forwardCDPCommand envelope (carrying method/params/sessionId); - maps forwardCDPCommand responses and forwardCDPEvent events back to raw CDP; - validates the connect-handshake token; emits challenge/ping. Keeps CdpClient and browser.rs unchanged. 8 unit tests; clippy clean. Still inert — the tokio WS server + `connect` command wire it next.
This commit is contained in:
@@ -27,6 +27,8 @@ pub mod policy;
|
||||
#[allow(dead_code)]
|
||||
pub mod providers;
|
||||
#[allow(dead_code)]
|
||||
pub mod relay;
|
||||
#[allow(dead_code)]
|
||||
pub mod react;
|
||||
#[allow(dead_code)]
|
||||
pub mod recording;
|
||||
|
||||
Reference in New Issue
Block a user