-
Notifications
You must be signed in to change notification settings - Fork 20
Async CDP monitors #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
alex-w-99
wants to merge
59
commits into
main
Choose a base branch
from
cdp-monitors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add StartRoutineDiscoveryJobCreationParams Pydantic model for tool schema - Add data_models/guide_agent/ with conversation state and message types - Add data_models/websockets/ with base WS types and guide-specific commands/responses - Update GuideAgent with callback pattern, tool confirmation flow, state management - Business logic stubs marked with NotImplementedError for subsequent PR Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move all WebSocket types (base, browser, guide) into one consolidated websockets.py file. Also move test_websockets.py from servers repo. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace Pydantic model + constants with a simple function stub that colleague will implement. Guide agent now uses register_tool_from_function and calls the function directly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add tool_utils.py with extract_description_from_docstring and generate_parameters_schema for converting Python functions to LLM tool definitions using pydantic TypeAdapter - Add register_tool_from_function method to LLMClient that extracts name, description, and parameters schema from a function - Add unit tests for tool_utils Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Merge GuideWebSocketClientCommandType into WebSocketClientCommandType - Merge ParsedGuideWebSocketClientCommand into ParsedWebSocketClientCommand - Remove Guide- prefix from response types (WebSocketMessageResponse, etc.) - Consolidate response type enums (MESSAGE, STATE, TOOL_INVOCATION_RESULT) - Add tests for all previously untested models and commands - Increase test coverage from ~50% to 100% of websockets module Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…LLM API - Add Chat and ChatThread models extending ResourceBase with bidirectional linking - Rename duplicate ChatMessage to EmittedChatMessage for callback messages - Add LLMToolCall and LLMChatResponse models for tool calling support - Implement GuideAgent with conversation logic, persistence callbacks, and self-aware system prompt for web automation routine creation - Update all LLM client methods to accept messages array instead of single prompt (get_text_sync/async, get_structured_response_sync/async, chat_sync) - Add run_guide_agent.py terminal chat script Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replaces stub script with full terminal interface featuring ANSI colors, ASCII banner, tool invocation confirmation flow, and conversation commands. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update welcome message to describe CDP capture analysis workflow - Add links to Vectorly docs and console - Change banner color to purple - Fix OpenAI client to use max_completion_tokens for GPT-5 models Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GPT-5 models only support temperature=1 (default), so we omit the parameter entirely to avoid API errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add chat_stream_sync method to abstract, OpenAI, and Anthropic clients - Add stream_chunk_callable parameter to GuideAgent - Update terminal CLI to print chunks as they arrive for typewriter effect Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add STREAM_CHUNK and STREAM_END to WebSocketStreamResponseType - Add WebSocketStreamChunkResponse for text deltas during streaming - Add WebSocketStreamEndResponse with full accumulated content - Update WebSocketServerResponse union to include new types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update tests to use thread_id instead of guide_chat_id to match the WebSocketStateResponse model change. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Include message IDs in emitted chat responses so WebSocket clients can track and reference individual messages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update callback signatures from Callable[[T], None] to Callable[[T], T] so the persistence layer can assign IDs and return them to GuideAgent. This allows servers to use ResourceBase-generated IDs while keeping web_hacker's models decoupled from ResourceBase. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Guide agent scaffolding
…ness-logic Guide agent context docs business logic
Initial copy of async CDP session, event broadcaster, and monitors from the servers repo. These files will be refactored in subsequent commits to remove AWS-specific dependencies (Firehose, S3, etc.) and use callback patterns instead. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename cdp/async to cdp/async_cdp to avoid Python keyword conflict - Create local data_models.py with CDP event models: - BaseCDPEvent, NetworkTransactionEvent, StorageEvent - WindowPropertyChange, WindowPropertyEvent - Rewrite EventBroadcaster to use pure callbacks instead of AWS Firehose/S3 - Update all imports to use web_hacker paths - Remove all AWS-specific code and references from docstrings The async CDP monitors now use a callback pattern where callers can inject their own event handlers for storage and streaming purposes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged
- Add AsyncInteractionMonitor: tracks mouse/keyboard events via JS injection - Monitors click, mousedown, mouseup, dblclick, contextmenu, mouseover - Monitors keydown, keyup, keypress, input, change, focus, blur - Uses Runtime.addBinding for CDP communication - Emits UiInteractionEvent-compatible events via callback - Includes consolidate_interactions() for JSONL aggregation - Integrate into AsyncCDPSession: - Setup interaction monitoring in setup_cdp() - Handle interaction messages and command replies - Include interactions in monitoring summary - Update FileEventWriter: - Add AsyncInteractionMonitor category handling - Create interaction/ directory in output structure - Update browser_monitor.py and SDK monitor.py: - Add interaction directory and events path - Include interaction stats in session summary - Clean up: Remove sync CDP monitors (now using async versions) - Delete cdp_session.py, network_monitor.py, storage_monitor.py - Delete window_property_monitor.py, event_broadcaster.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Flattens the directory structure by moving all files from web_hacker/cdp/async_cdp/ to web_hacker/cdp/. Updates all import paths accordingly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues resolved: