Stealth browser automation for AI agents over MCP and the Chrome DevTools Protocol: navigation, network hooks, DOM extraction, and pixel-accurate UI cloning.
Python ai-agent-toolsai-toolsanthropicanti-bot-bypassautomation-toolsbrowser-automationchrome-devtoolsclaude-mcpcloudflare-bypassdeveloper-toolsfastmcpmcp-servermodel-context-protocolnetwork-interceptionnodriverpythonstealth-browserundetectable-browserweb-automationweb-scraping
fix(startup): align clone paths and dependencies
Vibhek Soni50a6e7404059
diff --git a/pyproject.toml b/pyproject.tomlindex e8c2eaa..79684e3 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -21,6 +21,7 @@ dependencies = ["strbuilder==1.1.3","psutil==7.0.0","pillow==11.3.0",+ "requests==2.33.1","uvicorn[standard]==0.35.0",]@@ -53,4 +54,4 @@ line_length = 100[tool.mypy]python_version = "3.10"warn_return_any = true-warn_unused_configs = true\ No newline at end of file+warn_unused_configs = truediff --git a/requirements.txt b/requirements.txtindex eb5fb62..f571a25 100644--- a/requirements.txt+++ b/requirements.txt@@ -9,4 +9,4 @@ strbuilder==1.1.3uvicorn[standard]==0.35.0psutil==7.0.0pillow==11.3.0-requests>=2.31.0+requests==2.33.1diff --git a/src/file_based_element_cloner.py b/src/file_based_element_cloner.pyindex ade5d38..a3c2406 100644--- a/src/file_based_element_cloner.py+++ b/src/file_based_element_cloner.py@@ -1,18 +1,17 @@import asyncioimport json-import osimport sysimport uuidfrom datetime import datetimefrom pathlib import Path-from typing import Dict, List, Any, Optional+from typing import Any, Dict, List, Optionaltry:from .debug_logger import debug_loggerexcept ImportError:from debug_logger import debug_logger-project_root = Path(__file__).parent.parent+project_root = Path(__file__).resolve().parent.parentsys.path.append(str(project_root))from comprehensive_element_cloner import ComprehensiveElementCloner@@ -26,9 +25,9 @@ class FileBasedElementCloner:Initialize with output directory for clone files.Args:- output_dir (str | None): Directory to save clone files.+ output_dir (Optional[str]): Directory to save clone files.Defaults to <project_root>/element_clones (absolute path,- avoids cwd-dependent failures when launched from Claude Desktop).+ avoids startup failures when the host process uses a read-only cwd)."""if output_dir is None:self.output_dir = Path(__file__).resolve().parent.parent / "element_clones"@@ -635,4 +634,4 @@ class FileBasedElementCloner:debug_logger.log_warning("file_element_cloner", "cleanup", f"Error deleting {file_path}: {e}")return deleted_count-file_based_element_cloner = FileBasedElementCloner()\ No newline at end of file+file_based_element_cloner = FileBasedElementCloner()diff --git a/src/response_handler.py b/src/response_handler.pyindex 9edd9fe..097e2a9 100644--- a/src/response_handler.py+++ b/src/response_handler.py@@ -1,27 +1,26 @@"""Response handler for managing large responses and automatic file-based fallbacks."""import json-import osimport uuidfrom datetime import datetimefrom pathlib import Path-from typing import Any, Dict, Union+from typing import Any, Dict, Optionalclass ResponseHandler:"""Handle large responses by automatically falling back to file-based storage."""- def __init__(self, max_tokens: int = 20000, clone_dir: str = None):+ def __init__(self, max_tokens: int = 20000, clone_dir: Optional[str] = None):"""Initialize the response handler.-+Args:- max_tokens: Maximum tokens before falling back to file storage- clone_dir: Directory to store large response files+ max_tokens (int): Maximum token estimate before falling back to file storage.+ clone_dir (Optional[str]): Directory to store large response files."""self.max_tokens = max_tokensif clone_dir is None:- self.clone_dir = Path(__file__).parent.parent / "element_clones"+ self.clone_dir = Path(__file__).resolve().parent.parent / "element_clones"else:self.clone_dir = Path(clone_dir)self.clone_dir.mkdir(parents=True, exist_ok=True)