Add CDP Connection Manager for Direct Chrome DevTools Protocol Support - #61
Add CDP Connection Manager for Direct Chrome DevTools Protocol Support#61devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Implement CDPConnectionManager class with WebSocket-based CDP communication - Add launchLocal() method to launch Chrome locally with chrome-launcher - Add connect() method to connect to remote CDP endpoints via WebSocket - Add createSession() method for CDP session management with Target domain - Add sendCommand() method with proper error handling and timeouts - Implement CDP Target domain methods: listTargets, createTarget, attachToTarget, closeTarget - Add reconnection logic for dropped connections - Add comprehensive error handling and [CDP] prefixed logging - Add ws, chrome-launcher, and @types/ws dependencies This is foundational infrastructure for replacing Playwright's browser launching and connection handling. Co-Authored-By: devin@hyperbrowser.ai <devindenggithub@gmail.com>
Original prompt from devinCreate a new CDP connection management system to replace Playwright's browser launching and connection handling. CONTEXT:
YOUR TASK: REQUIREMENTS:
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add type assertions for sendBrowserCommand return values
- Cast attachResult to { sessionId: string }
- Cast Target.getTargets result to { targetInfos: Protocol.Target.TargetInfo[] }
- Cast Target.createTarget result to Protocol.Target.CreateTargetResponse
- Build now passes successfully
Co-Authored-By: devin@hyperbrowser.ai <devindenggithub@gmail.com>
|
Closing due to inactivity for more than 7 days. Configure here. |
Add CDP Connection Manager for Direct Chrome DevTools Protocol Support
Summary
Implements a new
CDPConnectionManagerclass insrc/cdp/connection-manager.tsthat provides direct Chrome DevTools Protocol (CDP) communication without Playwright. This is foundational infrastructure for Task 1.1 of the Playwright removal effort.Key capabilities:
chrome-launcherwith configurable options[CDP]prefixed loggingDependencies added:
ws(^8.18.3) - WebSocket client for CDP communicationchrome-launcher(^1.2.1) - Chrome process management@types/ws(^8.18.1) - TypeScript types for wsNote: This PR does NOT modify any existing files - it only adds new infrastructure that will be integrated in subsequent tasks.
Review & Testing Checklist for Human
Risk Level: 🟡 Yellow (foundational infrastructure, not yet integrated)
createSession(),listTargets(), andcreateTarget(). ThesendBrowserCommand()method returnsunknownand requires casting - verify these casts are safe.handleBrowserMessage()and the session management insendBrowserCommand(). The "browser" session pattern for browser-level commands vs target-specific sessions is complex - verify it handles edge cases correctly.examples/llms/openai.ts) to ensure the new dependencies don't break anything. The build passes but integration testing is needed.Test Plan
yarn buildyarn lint(existing lint errors in other files are pre-existing)Notes
launchLocal()method have not been tested in real failure scenarios