Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

feat: webdeploy_toolkit (#2834)

Tao Sun595834acfbb3
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 697034501..f398ad378 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -26,7 +26,7 @@ body:
attributes:
label: What version of camel are you using?
description: Run command `python3 -c 'print(__import__("camel").__version__)'` in your shell and paste the output here.
- placeholder: E.g., 0.2.72a6
+ placeholder: E.g., 0.2.72a7
validations:
required: true
diff --git a/camel/__init__.py b/camel/__init__.py
index f3dbccec0..2c06f4bfb 100644
--- a/camel/__init__.py
+++ b/camel/__init__.py
@@ -14,7 +14,7 @@
from camel.logger import disable_logging, enable_logging, set_log_level
-__version__ = '0.2.72a6'
+__version__ = '0.2.72a7'
__all__ = [
'__version__',
diff --git a/camel/toolkits/__init__.py b/camel/toolkits/__init__.py
index 0d99354f1..b1d01ab94 100644
--- a/camel/toolkits/__init__.py
+++ b/camel/toolkits/__init__.py
@@ -85,6 +85,7 @@ from .craw4ai_toolkit import Crawl4AIToolkit
from .markitdown_toolkit import MarkItDownToolkit
from .note_taking_toolkit import NoteTakingToolkit
from .message_agent_toolkit import AgentCommunicationToolkit
+from .web_deploy_toolkit import WebDeployToolkit
from .screenshot_toolkit import ScreenshotToolkit
__all__ = [
@@ -159,5 +160,6 @@ __all__ = [
'MarkItDownToolkit',
'NoteTakingToolkit',
'AgentCommunicationToolkit',
+ 'WebDeployToolkit',
'ScreenshotToolkit',
]
diff --git a/camel/toolkits/web_deploy_toolkit.py b/camel/toolkits/web_deploy_toolkit.py
new file mode 100644
index 000000000..d65ef5e02
--- /dev/null
+++ b/camel/toolkits/web_deploy_toolkit.py
@@ -0,0 +1,1024 @@
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+from __future__ import annotations
+
+import base64
+import json
+import mimetypes
+import os
+import re
+import shutil
+import socket
+import subprocess
+import tempfile
+import time
+from typing import Any, Dict, List, Optional
+
+from camel.logger import get_logger
+from camel.toolkits import FunctionTool
+from camel.toolkits.base import BaseToolkit
+
+logger = get_logger(__name__)
+
+
+class WebDeployToolkit(BaseToolkit):
+ r"""A simple toolkit for initializing React projects and deploying web.
+
+ This toolkit provides core functionality to:
+ - Initialize new React projects
+ - Build React applications
+ - Deploy HTML content to local server
+ - Serve static websites locally
+ """
+
+ def __init__(
+ self,
+ timeout: Optional[float] = None,
+ add_branding_tag: bool = True,
+ logo_path: str = "../camel/misc/favicon.png",
+ tag_text: str = "Created by CAMEL",
+ tag_url: str = "https://github.com/camel-ai/camel",
+ remote_server_ip: Optional[str] = None,
+ remote_server_port: int = 8080,
+ ):
+ r"""Initialize the WebDeployToolkit.
+
+ Args:
+ timeout (Optional[float]): Command timeout in seconds.
+ (default: :obj:`None`)
+ add_branding_tag (bool): Whether to add brand tag to deployed
+ pages. (default: :obj:`True`)
+ logo_path (str): Path to custom logo file (SVG, PNG, JPG, ICO).
+ (default: :obj:`../camel/misc/favicon.png`)
+ tag_text (str): Text to display in the tag.
+ (default: :obj:`Created by CAMEL`)
+ tag_url (str): URL to open when tag is clicked.
+ (default: :obj:`https://github.com/camel-ai/camel`)
+ remote_server_ip (Optional[str]): Remote server IP for deployment.
+ (default: :obj:`None` - use local deployment)
+ remote_server_port (int): Remote server port.
+ (default: :obj:`8080`)
+ """
+ super().__init__(timeout=timeout)
+ self.timeout = timeout
+ self.server_instances: Dict[int, Any] = {} # Track running servers
+ self.add_branding_tag = add_branding_tag
+ self.logo_path = logo_path
+ self.tag_text = self._sanitize_text(tag_text)
+ self.tag_url = self._validate_url(tag_url)
+ self.remote_server_ip = (
+ self._validate_ip(remote_server_ip) if remote_server_ip else None
+ )
+ self.remote_server_port = self._validate_port(remote_server_port)
+ self.server_registry_file = os.path.join(
+ tempfile.gettempdir(), "web_deploy_servers.json"
+ )
+ self._load_server_registry()
+
+ def _validate_ip(self, ip: str) -> str:
+ """Validate IP address format."""
+ import ipaddress
+
+ try:
+ ipaddress.ip_address(ip)
+ return ip
+ except ValueError:
+ raise ValueError(f"Invalid IP address: {ip}")
+
+ def _validate_port(self, port: int) -> int:
+ """Validate port number."""
+ if not isinstance(port, int) or port < 1 or port > 65535:
+ raise ValueError(f"Invalid port number: {port}")
+ return port
+
+ def _sanitize_text(self, text: str) -> str:
+ """Sanitize text to prevent XSS."""
+ if not isinstance(text, str):
+ return ""
+ # Remove any HTML/script tags
+ text = re.sub(r'<[^>]+>', '', text)
+ # Escape special characters
+ text = (
+ text.replace('&', '&amp;')
+ .replace('<', '&lt;')
+ .replace('>', '&gt;')
+ )
+ text = text.replace('"', '&quot;').replace("'", '&#x27;')
+ return text[:100] # Limit length
+
+ def _validate_url(self, url: str) -> str:
+ """Validate URL format."""
+ if not isinstance(url, str):
+ raise ValueError("URL must be a string")
+ # Basic URL validation
+ url_pattern = re.compile(
+ r'^https?://'
+ r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?|'
+ r'localhost|'
+ r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})'
+ r'(?::\d+)?'
+ r'(?:/?|[/?]\S+)$',
+ re.IGNORECASE,
+ )
+ if not url_pattern.match(url):
+ raise ValueError(f"Invalid URL format: {url}")
+ return url
+
+ def _validate_subdirectory(
+ self, subdirectory: Optional[str]
+ ) -> Optional[str]:
+ """Validate subdirectory to prevent path traversal."""
+ if subdirectory is None:
+ return None
+
+ # Remove any leading/trailing slashes
+ subdirectory = subdirectory.strip('/')
+
+ # Check for path traversal attempts
+ if '..' in subdirectory or subdirectory.startswith('/'):
+ raise ValueError(f"Invalid subdirectory: {subdirectory}")
+
+ # Only allow alphanumeric, dash, underscore, and forward slashes
+ if not re.match(r'^[a-zA-Z0-9_-]+(?:/[a-zA-Z0-9_-]+)*$', subdirectory):
+ raise ValueError(f"Invalid subdirectory format: {subdirectory}")
+
+ return subdirectory
+
+ def _is_port_available(self, port: int) -> bool:
+ """Check if a port is available for binding."""
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
+ try:
+ sock.bind(('127.0.0.1', port))
+ return True
+ except OSError:
+ return False
+
+ def _load_server_registry(self):
+ r"""Load server registry from persistent storage."""
+ try:
+ if os.path.exists(self.server_registry_file):
+ with open(self.server_registry_file, 'r') as f:
+ data = json.load(f)
+ # Reconstruct server instances from registry
+ for port_str, server_info in data.items():
+ port = int(port_str)
+ pid = server_info.get('pid')
+ if pid and self._is_process_running(pid):
+ # Create a mock process object for tracking
+ self.server_instances[port] = {
+ 'pid': pid,
+ 'start_time': server_info.get('start_time'),
+ 'directory': server_info.get('directory'),
+ }
+ except Exception as e:
+ logger.warning(f"Could not load server registry: {e}")
+
+ def _save_server_registry(self):
+ r"""Save server registry to persistent storage."""
+ try:
+ registry_data = {}
+ for port, server_info in self.server_instances.items():
+ if isinstance(server_info, dict):
+ registry_data[str(port)] = {
+ 'pid': server_info.get('pid'),
+ 'start_time': server_info.get('start_time'),
+ 'directory': server_info.get('directory'),
+ }
+ else:
+ # Handle subprocess.Popen objects
+ registry_data[str(port)] = {
+ 'pid': server_info.pid,
+ 'start_time': time.time(),
+ 'directory': getattr(server_info, 'directory', None),
+ }
+
+ with open(self.server_registry_file, 'w') as f:
+ json.dump(registry_data, f, indent=2)
+ except Exception as e:
+ logger.warning(f"Could not save server registry: {e}")
+
+ def _is_process_running(self, pid: int) -> bool:
+ r"""Check if a process with given PID is still running."""
+ try:
+ # Send signal 0 to check if process exists
+ os.kill(pid, 0)
+ return True
+ except (OSError, ProcessLookupError):
+ return False
+
+ def _build_custom_url(
+ self, domain: str, subdirectory: Optional[str] = None
+ ) -> str:
+ r"""Build custom URL with optional subdirectory.
+
+ Args:
+ domain (str): Custom domain
+ subdirectory (Optional[str]): Subdirectory path
+
+ Returns:
+ str: Complete custom URL
+ """
+ # Validate domain
+ if not re.match(r'^[a-zA-Z0-9.-]+$', domain):
+ raise ValueError(f"Invalid domain format: {domain}")
+ custom_url = f"http://{domain}:8080"
+ if subdirectory:
+ subdirectory = self._validate_subdirectory(subdirectory)
+ custom_url += f"/{subdirectory}"
+ return custom_url
+
+ def _load_logo_as_data_uri(self, logo_path: str) -> str:
+ r"""Load a local logo file and convert it to data URI.
+
+ Args:
+ logo_path (str): Path to the logo file
+
+ Returns:
+ str: Data URI of the logo file
+ """
+ try:
+ if not os.path.exists(logo_path):
+ logger.warning(f"Logo file not found: {logo_path}")
+ return self._get_default_logo()
+
+ # Get MIME type
+ mime_type, _ = mimetypes.guess_type(logo_path)
+ if not mime_type:
+ # Default MIME types for common formats
+ ext = os.path.splitext(logo_path)[1].lower()
+ mime_types_map = {
+ '.svg': 'image/svg+xml',
+ '.png': 'image/png',
+ '.jpg': 'image/jpeg',
+ '.jpeg': 'image/jpeg',
+ '.ico': 'image/x-icon',
+ '.gif': 'image/gif',
+ }
+ mime_type = mime_types_map.get(ext, 'image/png')
+
+ # Read file and encode to base64
+ with open(logo_path, 'rb') as f:
+ file_data = f.read()
+
+ base64_data = base64.b64encode(file_data).decode('utf-8')
+ return f"data:{mime_type};base64,{base64_data}"
+
+ except Exception as e:
+ logger.error(f"Error loading logo file {logo_path}: {e}")
+ return self._get_default_logo()
+
+ def _get_default_logo(self) -> str:
+ r"""Get the default logo as data URI.
+
+ Returns:
+ str: Default logo data URI
+ """
+ default_logo_data_uri = (
+ "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' "
+ "width='32' height='32' viewBox='0 0 32 32' fill='none'%3E%3Crect "
+ "width='32' height='32' rx='8' fill='%23333333'/%3E%3Ctext x='16' "
+ "y='22' font-family='system-ui, -apple-system, sans-serif' "
+ "font-size='12' font-weight='700' text-anchor='middle' "
+ "fill='white'%3EAI%3C/text%3E%3C/svg%3E"
+ )
+ return default_logo_data_uri
+
+ def deploy_html_content(
+ self,
+ html_content: Optional[str] = None,
+ html_file_path: Optional[str] = None,
+ file_name: str = "index.html",
+ port: int = 8000,
+ domain: Optional[str] = None,
+ subdirectory: Optional[str] = None,
+ ) -> Dict[str, Any]:
+ r"""Deploy HTML content to a local server or remote server.
+
+ Args:
+ html_content (Optional[str]): HTML content to deploy. Either this
+ or html_file_path must be provided.
+ html_file_path (Optional[str]): Path to HTML file to deploy. Either
+ this or html_content must be provided.
+ file_name (str): Name for the HTML file when using html_content.
+ (default: :obj:`index.html`)
+ port (int): Port to serve on. (default: :obj:`8000`)
+ domain (Optional[str]): Custom domain to access the content.
+ (e.g., :obj:`example.com`)
+ subdirectory (Optional[str]): Subdirectory path for multi-user
+ deployment. (e.g., :obj:`user123`)
+
+ Returns:
+ Dict[str, Any]: Deployment result with server URL and custom domain
+ info.
+ """
+ try:
+ # Validate inputs
+ if html_content is None and html_file_path is None:
+ return {
+ 'success': False,
+ 'error': (
+ 'Either html_content or html_file_path must be '
+ 'provided'
+ ),
+ }
+
+ if html_content is not None and html_file_path is not None:
+ return {
+ 'success': False,
+ 'error': (
+ 'Cannot provide both html_content and '
+ 'html_file_path'
+ ),
+ }
+
+ # Read content from file if file path is provided
+ if html_file_path:
+ if not os.path.exists(html_file_path):
+ return {
+ 'success': False,
+ 'error': f'HTML file not found: {html_file_path}',
+ }
+
+ try:
+ with open(html_file_path, 'r', encoding='utf-8') as f:
+ html_content = f.read()
+ # Use the original filename if deploying from file
+ file_name = os.path.basename(html_file_path)
+ except Exception as e:
+ return {
+ 'success': False,
+ 'error': f'Error reading HTML file: {e}',
+ }
+
+ # Check if remote deployment is configured
+ if self.remote_server_ip:
+ return self._deploy_to_remote_server(
+ html_content, # type: ignore[arg-type]
+ subdirectory,
+ domain,
+ )
+ else:
+ return self._deploy_to_local_server(
+ html_content, # type: ignore[arg-type]
+ file_name,
+ port,
+ domain,
+ subdirectory,
+ )
+
+ except Exception as e:
+ logger.error(f"Error deploying HTML content: {e}")
+ return {'success': False, 'error': str(e)}
+
+ def _deploy_to_remote_server(
+ self,
+ html_content: str,
+ subdirectory: Optional[str] = None,
+ domain: Optional[str] = None,
+ ) -> Dict[str, Any]:
+ r"""Deploy HTML content to remote server via API.
+
+ Args:
+ html_content (str): HTML content to deploy
+ subdirectory (Optional[str]): Subdirectory path for deployment
+ domain (Optional[str]): Custom domain
+
+ Returns:
+ Dict[str, Any]: Deployment result
+ """
+ try:
+ import requests
+
+ # Validate subdirectory
+ subdirectory = self._validate_subdirectory(subdirectory)
+
+ # Prepare deployment data
+ deploy_data = {
+ "html_content": html_content,
+ "subdirectory": subdirectory,
+ "domain": domain,
+ "timestamp": time.time(),
+ }
+
+ # Send to remote server API
+ api_url = f"http://{self.remote_server_ip}:{self.remote_server_port}/api/deploy"
+
+ response = requests.post(
+ api_url,
+ json=deploy_data,
+ timeout=self.timeout,
+ # Security: disable redirects to prevent SSRF
+ allow_redirects=False,
+ # Add headers for security
+ headers={'Content-Type': 'application/json'},
+ )
+
+ if response.status_code == 200:
+ response.json()
+
+ # Build URLs
+ base_url = (
+ f"http://{self.remote_server_ip}:{self.remote_server_port}"
+ )
+ deployed_url = (
+ f"{base_url}/{subdirectory}/" if subdirectory else base_url
+ )
+
+ return {
+ 'success': True,
+ 'remote_url': deployed_url,
+ 'server_ip': self.remote_server_ip,
+ 'subdirectory': subdirectory,
+ 'domain': domain,
+ 'message': f'Successfully deployed to remote server!\n • '
+ f'Access URL: {deployed_url}\n • Server: '
+ f'{self.remote_server_ip}:{self.remote_server_port}',
+ 'branding_tag_added': self.add_branding_tag,
+ }
+ else:
+ return {
+ 'success': False,
+ 'error': f'Remote deployment failed: HTTP '
+ f'{response.status_code}',
+ }
+
+ except ImportError:
+ return {
+ 'success': False,
+ 'error': 'Remote deployment requires requests library. '
+ 'Install with: pip install requests',
+ }
+ except Exception as e:
+ return {
+ 'success': False,
+ 'error': f'Remote deployment error: {e!s}',
+ }
+
+ def _deploy_to_local_server(
+ self,
+ html_content: str,
+ file_name: str,
+ port: int,
+ domain: Optional[str],
+ subdirectory: Optional[str],
+ ) -> Dict[str, Any]:
+ r"""Deploy HTML content to local server (original functionality).
+
+ Args:
+ html_content (str): HTML content to deploy
+ file_name (str): Name for the HTML file
+ port (int): Port to serve on (default: 8000)
+ domain (Optional[str]): Custom domain
+ subdirectory (Optional[str]): Subdirectory path
+
+ Returns:
+ Dict[str, Any]: Deployment result
+ """
+ temp_dir = None
+ try:
+ # Validate subdirectory
+ subdirectory = self._validate_subdirectory(subdirectory)
+
+ # Create temporary directory
+ temp_dir = tempfile.mkdtemp(prefix="web_deploy_")
+
+ # Handle subdirectory for multi-user deployment
+ if subdirectory:
+ deploy_dir = os.path.join(temp_dir, subdirectory)
+ os.makedirs(deploy_dir, exist_ok=True)
+ html_file_path = os.path.join(deploy_dir, file_name)
+ else:
+ html_file_path = os.path.join(temp_dir, file_name)
+
+ # Write enhanced HTML content to file
+ with open(html_file_path, 'w', encoding='utf-8') as f:
+ f.write(html_content)
+
+ # Start server
+ server_result = self._serve_static_files(temp_dir, port)
+
+ if server_result['success']:
+ # Build URLs with localhost fallback
+ local_url = server_result["server_url"]
+ if subdirectory:
+ local_url += f"/{subdirectory}"
+
+ # Custom domain URL (if provided)
+ custom_url = (
+ self._build_custom_url(domain, subdirectory)
+ if domain
+ else None
+ )
+
+ # Localhost fallback URL
+ localhost_url = f"http://localhost:{port}"
+ if subdirectory:
+ localhost_url += f"/{subdirectory}"
+
+ # Build message with all access options
+ message = 'HTML content deployed successfully!\n'
+ message += f' • Local access: {local_url}\n'
+ message += f' • Localhost fallback: {localhost_url}'
+
+ if custom_url:
+ message += f'\n • Custom domain: {custom_url}'
+
+ if self.add_branding_tag:
+ message += f'\n • Branding: "{self.tag_text}" tag added'
+
+ server_result.update(
+ {
+ 'html_file': html_file_path,
+ 'temp_directory': temp_dir,
+ 'local_url': local_url,
+ 'localhost_url': localhost_url,
+ 'custom_url': custom_url,
+ 'domain': domain,
+ 'subdirectory': subdirectory,
+ 'message': message,
+ 'branding_tag_added': self.add_branding_tag,
+ }
+ )
+
+ return server_result
+
+ except Exception as e:
+ # Clean up temp directory on error
+ if temp_dir and os.path.exists(temp_dir):
+ try:
+ shutil.rmtree(temp_dir)
+ except Exception:
+ pass
+ return {'success': False, 'error': str(e)}
+
+ def _serve_static_files(self, directory: str, port: int) -> Dict[str, Any]:
+ r"""Serve static files from a directory using a local HTTP server
+ (as a background process).
+
+ Args:
+ directory (str): Directory to serve files from
+ port (int): Port to serve on (default: 8000)
+
+ Returns:
+ Dict[str, Any]: Server information
+ """
+ import subprocess
+
+ try:
+ if not os.path.exists(directory):
+ return {
+ 'success': False,
+ 'error': f'Directory {directory} does not exist',
+ }
+
+ if not os.path.isdir(directory):
+ return {
+ 'success': False,
+ 'error': f'{directory} is not a directory',
+ }
+
+ # Validate port
+ port = self._validate_port(port)
+
+ # Check if port is already in use
+ if port in self.server_instances:
+ return {
+ 'success': False,
+ 'error': f'Port {port} is already in use by this toolkit',
+ }
+
+ # Check if port is available
+ if not self._is_port_available(port):
+ return {
+ 'success': False,
+ 'error': (
+ f'Port {port} is already in use by ' f'another process'
+ ),
+ }
+
+ # Start http.server as a background process with security
+ # improvements
+ process = subprocess.Popen(
+ [
+ "python3",
+ "-m",
+ "http.server",
+ str(port),
+ "--bind",
+ "127.0.0.1",
+ ],
+ cwd=directory,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ shell=False, # Prevent shell injection
+ env={**os.environ, 'PYTHONDONTWRITEBYTECODE': '1'},
+ )
+
+ # Store both process and metadata for persistence
+ self.server_instances[port] = {
+ 'process': process,
+ 'pid': process.pid,
+ 'start_time': time.time(),
+ 'directory': directory,
+ }
+ self._save_server_registry()
+
+ # Wait for server to start with timeout
+ start_time = time.time()
+ while time.time() - start_time < 5:
+ if not self._is_port_available(port):
+ # Port is now in use, server started
+ break
+ time.sleep(0.1)
+ else:
+ # Server didn't start in time
+ process.terminate()
+ del self.server_instances[port]
+ return {
+ 'success': False,
+ 'error': f'Server failed to start on port {port}',
+ }
+
+ server_url = f"http://localhost:{port}"
+
+ return {
+ 'success': True,
+ 'server_url': server_url,
+ 'port': port,
+ 'directory': directory,
+ 'message': f'Static files served from {directory} at '
+ f'{server_url} (background process)',
+ }
+
+ except Exception as e:
+ logger.error(f"Error serving static files: {e}")
+ return {'success': False, 'error': str(e)}
+
+ def deploy_folder(
+ self,
+ folder_path: str,
+ port: int = 8000,
+ domain: Optional[str] = None,
+ subdirectory: Optional[str] = None,
+ ) -> Dict[str, Any]:
+ r"""Deploy a folder containing web files.
+
+ Args:
+ folder_path (str): Path to the folder to deploy.
+ port (int): Port to serve on. (default: :obj:`8000`)
+ domain (Optional[str]): Custom domain to access the content.
+ (e.g., :obj:`example.com`)
+ subdirectory (Optional[str]): Subdirectory path for multi-user
+ deployment. (e.g., :obj:`user123`)
+
+ Returns:
+ Dict[str, Any]: Deployment result with custom domain info.
+ """
+ try:
+ if not os.path.exists(folder_path):
+ return {
+ 'success': False,
+ 'error': f'Folder {folder_path} does not exist',
+ }
+
+ if not os.path.isdir(folder_path):
+ return {
+ 'success': False,
+ 'error': f'{folder_path} is not a directory',
+ }
+
+ # Validate subdirectory
+ subdirectory = self._validate_subdirectory(subdirectory)
+
+ temp_dir = None
+ if self.add_branding_tag:
+ # Create temporary directory and copy all files
+ temp_dir = tempfile.mkdtemp(prefix="web_deploy_enhanced_")
+
+ # Handle subdirectory structure
+ if subdirectory:
+ deploy_base = os.path.join(temp_dir, subdirectory)
+ os.makedirs(deploy_base, exist_ok=True)
+ shutil.copytree(
+ folder_path,
+ deploy_base,
+ dirs_exist_ok=True,
+ )
+ deploy_path = deploy_base
+ else:
+ shutil.copytree(
+ folder_path,
+ os.path.join(temp_dir, "site"),
+ dirs_exist_ok=True,
+ )
+ deploy_path = os.path.join(temp_dir, "site")
+
+ # Enhance HTML files with branding tag
+ html_files_enhanced = []
+ for root, _, files in os.walk(deploy_path):
+ for file in files:
+ if file.endswith('.html'):
+ html_file_path = os.path.join(root, file)
+ try:
+ with open(
+ html_file_path, 'r', encoding='utf-8'
+ ) as f:
+ original_content = f.read()
+
+ with open(
+ html_file_path, 'w', encoding='utf-8'
+ ) as f:
+ f.write(original_content)
+
+ html_files_enhanced.append(
+ os.path.relpath(
+ html_file_path, deploy_path
+ )
+ )
+ except Exception as e:
+ logger.warning(
+ f"Failed to enhance {html_file_path}: {e}"
+ )
+
+ # Serve the enhanced folder
+ server_result = self._serve_static_files(temp_dir, port)
+
+ if server_result['success']:
+ # Build URLs with localhost fallback
+ local_url = server_result["server_url"]
+ if subdirectory:
+ local_url += f"/{subdirectory}"
+
+ # Custom domain URL (if provided)
+ custom_url = (
+ self._build_custom_url(domain, subdirectory)
+ if domain
+ else None
+ )
+
+ # Localhost fallback URL
+ localhost_url = f"http://localhost:{port}"
+ if subdirectory:
+ localhost_url += f"/{subdirectory}"
+
+ # Build message with all access options
+ message = 'Folder deployed successfully!\n'
+ message += f' • Local access: {local_url}\n'
+ message += f' • Localhost fallback: {localhost_url}'
+
+ if custom_url:
+ message += f'\n • Custom domain: {custom_url}'
+
+ if self.add_branding_tag:
+ message += f'\n • Branding: "{self.tag_text}" tag '
+ message += (
+ f'added to {len(html_files_enhanced)} HTML files'
+ )
+
+ server_result.update(
+ {
+ 'original_folder': folder_path,
+ 'enhanced_folder': deploy_path,
+ 'html_files_enhanced': html_files_enhanced,
+ 'local_url': local_url,
+ 'localhost_url': localhost_url,
+ 'custom_url': custom_url,
+ 'domain': domain,
+ 'subdirectory': subdirectory,
+ 'branding_tag_added': True,
+ 'message': message,
+ }
+ )
+
+ return server_result
+ else:
+ # Check for index.html
+ index_html = os.path.join(folder_path, 'index.html')
+ if not os.path.exists(index_html):
+ logger.warning(f'No index.html found in {folder_path}')
+
+ # Handle subdirectory for original folder deployment
+ if subdirectory:
+ temp_dir = tempfile.mkdtemp(prefix="web_deploy_")
+ deploy_base = os.path.join(temp_dir, subdirectory)
+ shutil.copytree(
+ folder_path, deploy_base, dirs_exist_ok=True
+ )
+ deploy_path = temp_dir
+ else:
+ deploy_path = folder_path
+
+ # Serve the folder
+ server_result = self._serve_static_files(deploy_path, port)
+
+ if server_result['success']:
+ # Build URLs with localhost fallback
+ local_url = server_result["server_url"]
+ if subdirectory:
+ local_url += f"/{subdirectory}"
+
+ # Custom domain URL (if provided)
+ custom_url = (
+ self._build_custom_url(domain, subdirectory)
+ if domain
+ else None
+ )
+
+ # Localhost fallback URL
+ localhost_url = f"http://localhost:{port}"
+ if subdirectory:
+ localhost_url += f"/{subdirectory}"
+
+ # Build message with all access options
+ message = 'Folder deployed successfully!\n'
+ message += f' • Local access: {local_url}\n'
+ message += f' • Localhost fallback: {localhost_url}'
+
+ if custom_url:
+ message += f'\n • Custom domain: {custom_url}'
+
+ server_result.update(
+ {
+ 'local_url': local_url,
+ 'localhost_url': localhost_url,
+ 'custom_url': custom_url,
+ 'domain': domain,
+ 'subdirectory': subdirectory,
+ 'message': message,
+ 'branding_tag_added': False,
+ }
+ )
+
+ return server_result
+
+ except Exception as e:
+ # Clean up temp directory on error
+ if (
+ 'temp_dir' in locals()
+ and temp_dir
+ and os.path.exists(temp_dir)
+ ):
+ try:
+ shutil.rmtree(temp_dir)
+ except Exception:
+ pass
+ logger.error(f"Error deploying folder: {e}")
+ return {'success': False, 'error': str(e)}
+
+ def stop_server(self, port: int) -> Dict[str, Any]:
+ r"""Stop a running server on the specified port.
+
+ Args:
+ port (int): Port of the server to stop.
+
+ Returns:
+ Dict[str, Any]: Result of stopping the server.
+ """
+ try:
+ # Validate port
+ port = self._validate_port(port)
+ # First check persistent registry for servers
+ self._load_server_registry()
+
+ if port not in self.server_instances:
+ # Check if there's a process running on this port by PID
+ if os.path.exists(self.server_registry_file):
+ with open(self.server_registry_file, 'r') as f:
+ data = json.load(f)
+ port_str = str(port)
+ if port_str in data:
+ pid = data[port_str].get('pid')
+ if pid and self._is_process_running(pid):
+ try:
+ os.kill(pid, 15) # SIGTERM
+ # Remove from registry
+ del data[port_str]
+ with open(
+ self.server_registry_file, 'w'
+ ) as f:
+ json.dump(data, f, indent=2)
+ return {
+ 'success': True,
+ 'port': port,
+ 'message': (
+ f'Server on port {port} stopped '
+ f'successfully (from registry)'
+ ),
+ }
+ except Exception as e:
+ logger.error(
+ f"Error stopping server by PID: {e}"
+ )
+
+ return {
+ 'success': False,
+ 'error': f'No server running on port {port}',
+ }
+
+ server_info = self.server_instances[port]
+ if isinstance(server_info, dict):
+ process = server_info.get('process')
+ pid = server_info.get('pid')
+
+ # Stop the main server process
+ if process:
+ process.terminate()
+ process.wait(
+ timeout=5
+ ) # Wait for process to terminate gracefully
+ elif pid and self._is_process_running(pid):
+ os.kill(pid, 15) # SIGTERM
+
+ else:
+ # Handle old-style direct process objects
+ server_info.terminate()
+ server_info.wait(timeout=5)
+
+ del self.server_instances[port]
+ self._save_server_registry()
+
+ return {
+ 'success': True,
+ 'port': port,
+ 'message': f'Server on port {port} stopped successfully',
+ }
+
+ except subprocess.TimeoutExpired:
+ if isinstance(server_info, dict):
+ process = server_info.get('process')
+
+ if process:
+ process.kill()
+ process.wait(timeout=5)
+ else:
+ server_info.kill()
+ server_info.wait(timeout=5)
+ del self.server_instances[port]
+ self._save_server_registry()
+ return {
+ 'success': True,
+ 'port': port,
+ 'message': f'Server on port {port} stopped after timeout',
+ }
+ except Exception as e:
+ logger.error(f"Error stopping server: {e}")
+ return {'success': False, 'error': str(e)}
+
+ def list_running_servers(self) -> Dict[str, Any]:
+ r"""List all currently running servers.
+
+ Returns:
+ Dict[str, Any]: Information about running servers
+ """
+ try:
+ self._load_server_registry()
+
+ running_servers = []
+ current_time = time.time()
+
+ for port, server_info in self.server_instances.items():
+ if isinstance(server_info, dict):
+ start_time = server_info.get('start_time', 0)
+ running_time = current_time - start_time
+
+ running_servers.append(
+ {
+ 'port': port,
+ 'pid': server_info.get('pid'),
+ 'directory': server_info.get('directory'),
+ 'start_time': start_time,
+ 'running_time': running_time,
+ 'url': f'http://localhost:{port}',
+ }
+ )
+
+ return {
+ 'success': True,
+ 'servers': running_servers,
+ 'total_servers': len(running_servers),
+ }
+
+ except Exception as e:
+ logger.error(f"Error listing servers: {e}")
+ return {'success': False, 'error': str(e)}
+
+ def get_tools(self) -> List[FunctionTool]:
+ r"""Get all available tools from the WebDeployToolkit."""
+ return [
+ FunctionTool(self.deploy_html_content),
+ FunctionTool(self.deploy_folder),
+ FunctionTool(self.stop_server),
+ FunctionTool(self.list_running_servers),
+ ]
diff --git a/docs/conf.py b/docs/conf.py
index d7f8ce26f..c8cd932b3 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,7 +27,7 @@ sys.path.insert(0, os.path.abspath('..'))
project = 'CAMEL'
copyright = '2024, CAMEL-AI.org'
author = 'CAMEL-AI.org'
-release = '0.2.72a6'
+release = '0.2.72a7'
html_favicon = (
'https://raw.githubusercontent.com/camel-ai/camel/master/misc/favicon.png'
diff --git a/examples/toolkits/webdeploy_toolkit.py b/examples/toolkits/webdeploy_toolkit.py
new file mode 100644
index 000000000..b3f5a49e7
--- /dev/null
+++ b/examples/toolkits/webdeploy_toolkit.py
@@ -0,0 +1,61 @@
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+from camel.agents import ChatAgent
+from camel.models import ModelFactory
+from camel.toolkits import WebDeployToolkit
+from camel.types import ModelPlatformType
+from camel.types.enums import ModelType
+
+# Create a model instance
+model = ModelFactory.create(
+ model_platform=ModelPlatformType.DEFAULT,
+ model_type=ModelType.DEFAULT,
+ model_config_dict={"temperature": 0},
+)
+
+# Define system message for the agent
+sys_msg = "You are a helpful assistant that can deploy web server."
+
+# Initialize the WebDeployToolkit
+web_deploy_toolkit = WebDeployToolkit()
+# Get the tools from the toolkit
+tools_list = web_deploy_toolkit.get_tools()
+
+# Initialize a ChatAgent with the tools
+camel_agent = ChatAgent(
+ system_message=sys_msg,
+ model=model,
+ tools=tools_list,
+)
+
+# Example 1: deploy a simple web server,which can play snake game.
+query = """use toolkit writing html to deploy a
+simple web server,which can play snake game.deploy it in port 8005"""
+
+camel_agent.reset()
+response = camel_agent.step(query)
+print(response.msgs[0].content)
+print("Tool calls:", response.info['tool_calls'])
+print("\n")
+
+"""
+==========================================================================
+I have deployed a simple web server that hosts a Snake game. You can play
+the game by opening the following URL in your web browser:
+http://localhost:8000
+
+Use the arrow keys to control the snake. Enjoy the game!
+==========================================================================
+"""
diff --git a/examples/workforce/eigent.py b/examples/workforce/eigent.py
index 69d341fa9..011ffb401 100644
--- a/examples/workforce/eigent.py
+++ b/examples/workforce/eigent.py
@@ -46,6 +46,7 @@ from camel.toolkits import (
TerminalToolkit,
TwitterToolkit,
VideoDownloaderToolkit,
+ WebDeployToolkit,
WhatsAppToolkit,
)
from camel.types import ModelPlatformType, ModelType
@@ -111,6 +112,7 @@ def developer_agent_factory(
HumanToolkit().ask_human_via_console,
*TerminalToolkit(safe_mode=True, clone_current_env=False).get_tools(),
*NoteTakingToolkit(working_directory=WORKING_DIRECTORY).get_tools(),
+ *WebDeployToolkit().get_tools(),
]
system_message = f"""
@@ -155,10 +157,13 @@ terminal.
- Utilizing any Python libraries (e.g., requests, BeautifulSoup, pandas,
etc.) needed for efficient solutions. You can install missing packages
using `pip3` or `uv` in the terminal.
-- Implementing complete, production-ready code rather than theoretical
-examples.
-- Demonstrating results with proper error handling and practical
-implementation.
+- Deploying web applications and content. You can:
+ - Serve a single HTML file or a string of HTML content on a local web
+ server.
+ - Deploy an entire folder as a static website—for example, a built
+ React application.
+ - Manage your deployments by stopping servers on specific ports.
+ - List all currently running web servers to keep track of your work.
- Asking for human input via the console if you are stuck or need
clarification.
- Write and check notes from other agents to keep track of your work.
diff --git a/pyproject.toml b/pyproject.toml
index f04fee80c..e75058e0e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "camel-ai"
-version = "0.2.72a6"
+version = "0.2.72a7"
description = "Communicative Agents for AI Society Study"
authors = [{ name = "CAMEL-AI.org" }]
requires-python = ">=3.10,<3.13"
diff --git a/test/toolkits/test_web_deploy_toolkit.py b/test/toolkits/test_web_deploy_toolkit.py
new file mode 100644
index 000000000..3b454be98
--- /dev/null
+++ b/test/toolkits/test_web_deploy_toolkit.py
@@ -0,0 +1,334 @@
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
+
+import os
+import tempfile
+from unittest.mock import Mock, patch
+
+import pytest
+
+from camel.toolkits import WebDeployToolkit
+
+
+def web_deploy_toolkit():
+ r"""Create a WebDeployToolkit instance for testing."""
+ return WebDeployToolkit()
+
+
+def temp_dir():
+ r"""Create a temporary directory for testing."""
+ with tempfile.TemporaryDirectory() as temp_dir:
+ yield temp_dir
+
+
+def test_initialization():
+ r"""Test the initialization of WebDeployToolkit with default parameters."""
+ toolkit = WebDeployToolkit()
+
+ assert toolkit.timeout is None
+ assert toolkit.add_branding_tag is True
+ assert toolkit.logo_path == "../camel/misc/favicon.png"
+ assert toolkit.tag_text == "Created by CAMEL"
+ assert toolkit.tag_url == "https://github.com/camel-ai/camel"
+ assert toolkit.remote_server_ip is None
+ assert toolkit.remote_server_port == 8080
+ assert toolkit.server_instances == {}
+
+
+def test_initialization_with_custom_parameters():
+ r"""Test the initialization of WebDeployToolkit with custom parameters."""
+ toolkit = WebDeployToolkit(
+ timeout=30.0,
+ add_branding_tag=False,
+ logo_path="custom_logo.png",
+ tag_text="Custom Tag",
+ tag_url="https://custom.com",
+ remote_server_ip="192.168.1.100",
+ remote_server_port=9000,
+ )
+
+ assert toolkit.timeout == 30.0
+ assert toolkit.add_branding_tag is False
+ assert toolkit.logo_path == "custom_logo.png"
+ assert toolkit.tag_text == "Custom Tag"
+ assert toolkit.tag_url == "https://custom.com"
+ assert toolkit.remote_server_ip == "192.168.1.100"
+ assert toolkit.remote_server_port == 9000
+
+
+def test_build_custom_url(web_deploy_toolkit):
+ r"""Test the _build_custom_url helper method."""
+ # Test without subdirectory
+ url = web_deploy_toolkit._build_custom_url("example.com")
+ assert url == "http://example.com:8080"
+
+ # Test with subdirectory
+ url = web_deploy_toolkit._build_custom_url("example.com", "user123")
+ assert url == "http://example.com:8080/user123"
+
+
+def test_get_default_logo(web_deploy_toolkit):
+ r"""Test the _get_default_logo method."""
+ logo = web_deploy_toolkit._get_default_logo()
+ assert logo.startswith("data:image/svg+xml,")
+ assert "AI" in logo
+
+
+def test_load_logo_as_data_uri_file_not_found(web_deploy_toolkit):
+ r"""Test loading logo when file doesn't exist."""
+ with patch.object(
+ web_deploy_toolkit, '_get_default_logo', return_value="default_logo"
+ ):
+ result = web_deploy_toolkit._load_logo_as_data_uri("nonexistent.png")
+ assert result == "default_logo"
+
+
+def test_load_logo_as_data_uri_with_valid_file(web_deploy_toolkit, temp_dir):
+ r"""Test loading logo with a valid file."""
+ # Create a simple SVG file
+ svg_content = (
+ '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">'
+ '<rect width="32" height="32" fill="red"/></svg>'
+ )
+ svg_path = os.path.join(temp_dir, "test_logo.svg")
+ with open(svg_path, 'w') as f:
+ f.write(svg_content)
+
+ result = web_deploy_toolkit._load_logo_as_data_uri(svg_path)
+ assert result.startswith("data:image/svg+xml;base64,")
+
+
+@patch('subprocess.Popen')
+def test_serve_static_files_success(mock_popen, web_deploy_toolkit, temp_dir):
+ r"""Test successful static file serving."""
+ mock_process = Mock()
+ mock_process.pid = 12345
+ mock_popen.return_value = mock_process
+
+ with patch('time.sleep'):
+ with patch.object(
+ web_deploy_toolkit, '_is_port_available'
+ ) as mock_port:
+ # First call returns True (port available), second call returns
+ # False (server started)
+ mock_port.side_effect = [True, False]
+ result = web_deploy_toolkit._serve_static_files(temp_dir, 8000)
+
+ assert result['success'] is True
+ assert result['port'] == 8000
+ assert result['server_url'] == "http://localhost:8000"
+ assert 8000 in web_deploy_toolkit.server_instances
+
+
+def test_serve_static_files_directory_not_found(web_deploy_toolkit):
+ r"""Test serving static files when directory doesn't exist."""
+ result = web_deploy_toolkit._serve_static_files("/nonexistent", 8000)
+
+ assert result['success'] is False
+ assert 'does not exist' in result['error']
+
+
+def test_serve_static_files_port_in_use(web_deploy_toolkit, temp_dir):
+ r"""Test serving static files when port is already in use."""
+ # Simulate port already in use
+ web_deploy_toolkit.server_instances[8000] = Mock()
+
+ result = web_deploy_toolkit._serve_static_files(temp_dir, 8000)
+
+ assert result['success'] is False
+ assert 'already in use' in result['error']
+
+
+def test_deploy_html_content_local(web_deploy_toolkit):
+ r"""Test deploying HTML content locally."""
+ html_content = "<html><body><h1>Test</h1></body></html>"
+
+ with patch.object(
+ web_deploy_toolkit, '_deploy_to_local_server'
+ ) as mock_deploy:
+ mock_deploy.return_value = {'success': True}
+ result = web_deploy_toolkit.deploy_html_content(
+ html_content=html_content
+ )
+
+ assert result['success'] is True
+ mock_deploy.assert_called_once()
+
+
+def test_deploy_html_content_remote(web_deploy_toolkit):
+ r"""Test deploying HTML content to remote server."""
+ web_deploy_toolkit.remote_server_ip = "192.168.1.100"
+ html_content = "<html><body><h1>Test</h1></body></html>"
+
+ with patch.object(
+ web_deploy_toolkit, '_deploy_to_remote_server'
+ ) as mock_deploy:
+ mock_deploy.return_value = {'success': True}
+ result = web_deploy_toolkit.deploy_html_content(
+ html_content=html_content
+ )
+
+ assert result['success'] is True
+ mock_deploy.assert_called_once()
+
+
+def test_deploy_html_content_from_file(web_deploy_toolkit, temp_dir):
+ r"""Test deploying HTML content from a file path."""
+ # Create a test HTML file
+ html_content = "<html><body><h1>Test from File</h1></body></html>"
+ html_file = os.path.join(temp_dir, "test.html")
+ with open(html_file, 'w') as f:
+ f.write(html_content)
+
+ with patch.object(
+ web_deploy_toolkit, '_deploy_to_local_server'
+ ) as mock_deploy:
+ mock_deploy.return_value = {'success': True}
+ result = web_deploy_toolkit.deploy_html_content(
+ html_file_path=html_file
+ )
+
+ assert result['success'] is True
+ mock_deploy.assert_called_once()
+ # Verify the HTML content was read correctly
+ call_args = mock_deploy.call_args[0]
+ assert call_args[0] == html_content
+ assert call_args[1] == "test.html" # filename from path
+
+
+def test_deploy_html_content_file_not_found(web_deploy_toolkit):
+ r"""Test deploying HTML content with non-existent file."""
+ result = web_deploy_toolkit.deploy_html_content(
+ html_file_path="/nonexistent/file.html"
+ )
+
+ assert result['success'] is False
+ assert 'HTML file not found' in result['error']
+
+
+def test_deploy_html_content_no_input(web_deploy_toolkit):
+ r"""Test deploying HTML content without any input."""
+ result = web_deploy_toolkit.deploy_html_content()
+
+ assert result['success'] is False
+ assert (
+ 'Either html_content or html_file_path must be provided'
+ in result['error']
+ )
+
+
+def test_deploy_html_content_both_inputs(web_deploy_toolkit, temp_dir):
+ r"""Test deploying HTML content with both content and file path."""
+ html_file = os.path.join(temp_dir, "test.html")
+ with open(html_file, 'w') as f:
+ f.write("<html></html>")
+
+ result = web_deploy_toolkit.deploy_html_content(
+ html_content="<html><body></body></html>", html_file_path=html_file
+ )
+
+ assert result['success'] is False
+ assert (
+ 'Cannot provide both html_content and html_file_path'
+ in result['error']
+ )
+
+
+def test_stop_server_success(web_deploy_toolkit):
+ r"""Test successfully stopping a server."""
+ mock_process = Mock()
+ web_deploy_toolkit.server_instances[8000] = {
+ 'process': mock_process,
+ 'pid': 12345,
+ 'start_time': 1234567890,
+ 'directory': '/tmp/test',
+ }
+
+ result = web_deploy_toolkit.stop_server(8000)
+
+ assert result['success'] is True
+ assert result['port'] == 8000
+ assert 8000 not in web_deploy_toolkit.server_instances
+ mock_process.terminate.assert_called_once()
+
+
+def test_stop_server_not_found(web_deploy_toolkit):
+ r"""Test stopping a server that doesn't exist."""
+ result = web_deploy_toolkit.stop_server(8000)
+
+ assert result['success'] is False
+ assert 'No server running' in result['error']
+
+
+def test_deploy_folder_success(web_deploy_toolkit, temp_dir):
+ r"""Test deploying a folder successfully."""
+ # Create a test folder with an HTML file
+ test_folder = os.path.join(temp_dir, "test_site")
+ os.makedirs(test_folder)
+
+ html_file = os.path.join(test_folder, "index.html")
+ with open(html_file, 'w') as f:
+ f.write("<html><body><h1>Test Site</h1></body></html>")
+
+ with patch.object(web_deploy_toolkit, '_serve_static_files') as mock_serve:
+ mock_serve.return_value = {
+ 'success': True,
+ 'server_url': 'http://localhost:8000',
+ }
+ result = web_deploy_toolkit.deploy_folder(test_folder)
+
+ assert result['success'] is True
+ mock_serve.assert_called_once()
+
+
+def test_deploy_folder_not_found(web_deploy_toolkit):
+ r"""Test deploying a folder that doesn't exist."""
+ result = web_deploy_toolkit.deploy_folder("/nonexistent/folder")
+
+ assert result['success'] is False
+ assert 'does not exist' in result['error']
+
+
+def test_deploy_folder_not_directory(web_deploy_toolkit, temp_dir):
+ r"""Test deploying a path that is not a directory."""
+ file_path = os.path.join(temp_dir, "not_a_directory.txt")
+ with open(file_path, 'w') as f:
+ f.write("test")
+
+ result = web_deploy_toolkit.deploy_folder(file_path)
+
+ assert result['success'] is False
+ assert 'is not a directory' in result['error']
+
+
+def test_get_tools(web_deploy_toolkit):
+ r"""Test that get_tools returns the correct function tools."""
+ tools = web_deploy_toolkit.get_tools()
+
+ # Check that we have the expected number of tools
+ assert len(tools) == 4
+
+ # Check that the tools have the correct function names
+ tool_names = [tool.get_function_name() for tool in tools]
+ expected_names = [
+ 'deploy_html_content',
+ 'deploy_folder',
+ 'stop_server',
+ 'list_running_servers',
+ ]
+
+ for expected_name in expected_names:
+ assert expected_name in tool_names
diff --git a/uv.lock b/uv.lock
index 384c159a9..90e90b6fc 100644
--- a/uv.lock
+++ b/uv.lock
@@ -460,7 +460,7 @@ wheels = [
[[package]]
name = "azure-storage-blob"
-version = "12.25.1"
+version = "12.26.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "azure-core" },
@@ -468,9 +468,9 @@ dependencies = [
{ name = "isodate" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/8b/f3/f764536c25cc3829d36857167f03933ce9aee2262293179075439f3cd3ad/azure_storage_blob-12.25.1.tar.gz", hash = "sha256:4f294ddc9bc47909ac66b8934bd26b50d2000278b10ad82cc109764fdc6e0e3b", size = 570541, upload-time = "2025-03-27T17:13:05.424Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/96/95/3e3414491ce45025a1cde107b6ae72bf72049e6021597c201cd6a3029b9a/azure_storage_blob-12.26.0.tar.gz", hash = "sha256:5dd7d7824224f7de00bfeb032753601c982655173061e242f13be6e26d78d71f", size = 583332, upload-time = "2025-07-16T21:34:07.644Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/57/33/085d9352d416e617993821b9d9488222fbb559bc15c3641d6cbd6d16d236/azure_storage_blob-12.25.1-py3-none-any.whl", hash = "sha256:1f337aab12e918ec3f1b638baada97550673911c4ceed892acc8e4e891b74167", size = 406990, upload-time = "2025-03-27T17:13:06.879Z" },
+ { url = "https://files.pythonhosted.org/packages/5b/64/63dbfdd83b31200ac58820a7951ddfdeed1fbee9285b0f3eae12d1357155/azure_storage_blob-12.26.0-py3-none-any.whl", hash = "sha256:8c5631b8b22b4f53ec5fff2f3bededf34cfef111e2af613ad42c9e6de00a77fe", size = 412907, upload-time = "2025-07-16T21:34:09.367Z" },
]
[[package]]
@@ -594,30 +594,30 @@ wheels = [
[[package]]
name = "boto3"
-version = "1.39.6"
+version = "1.39.8"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore" },
{ name = "jmespath" },
{ name = "s3transfer" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/47/aa/7eb200f3037ba2887d711171b9b55f56935bb820dc43b54cecf110159ac7/boto3-1.39.6.tar.gz", hash = "sha256:e75bfcd444e199767642f28ef8dc4f972846dc3118e48a7e09f9c458dae2021e", size = 111835, upload-time = "2025-07-16T01:46:28.154Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/d1/ef/f8dbe6482bdf9eb0230f2639483cdd40ef5aaa89c2fb651f2edeee9c248a/boto3-1.39.8.tar.gz", hash = "sha256:456ea6baef037eb6205d64e012259d14f0c9300c9b30603890746c1a0882fa01", size = 111829, upload-time = "2025-07-17T19:19:14.828Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/9b/c2/4add264ee1c960de599db830eb4be7e5f48fe1dc146416acd29158e8c850/boto3-1.39.6-py3-none-any.whl", hash = "sha256:db965dc9019df7b1d20e8d8ab7a653956f275865175a8652419ebfd03de03d83", size = 139881, upload-time = "2025-07-16T01:46:26.354Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/f0/f3701472b2e6192e62d80e703186ae9c789b3d607ba22943702c500897d2/boto3-1.39.8-py3-none-any.whl", hash = "sha256:dcea5270ccced0b4b962eb5874cb71b6232ccfc6203e05bf834a314442e4a79c", size = 139886, upload-time = "2025-07-17T19:19:12.634Z" },
]
[[package]]
name = "botocore"
-version = "1.39.6"
+version = "1.39.8"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "jmespath" },
{ name = "python-dateutil" },
{ name = "urllib3" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/67/a2/2774e34ddac5667a7be3953ffa49e17e22f255a06c86f3486e9d23093372/botocore-1.39.6.tar.gz", hash = "sha256:d3a6c207d233ddee3289c1d56646047bef18b21a1faebb3d83a6fca149fd0f59", size = 14158426, upload-time = "2025-07-16T01:46:17.409Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/32/57/16d3d21963975b9be180e96695abfb146695ae7db57f9a2d47e92d33ce9d/botocore-1.39.8.tar.gz", hash = "sha256:3848bd9057ea8dbc059e7764eda63bda575727ad1101dbd03636ab4a6f283fa5", size = 14205898, upload-time = "2025-07-17T19:19:03.832Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/2e/74/164490fc26788842821ab665786eb4fdcc8553131e009e23a5ea13ac164d/botocore-1.39.6-py3-none-any.whl", hash = "sha256:9c002724e9b97cec610dbbb3bb019b3248ff6bf58407835621f0461e740af90b", size = 13819020, upload-time = "2025-07-16T01:46:11.686Z" },
+ { url = "https://files.pythonhosted.org/packages/11/ac/51462dd35fc60d11cdce93ba82ccf1635a161ceadc646d89f67d666fff31/botocore-1.39.8-py3-none-any.whl", hash = "sha256:ab43f79c6893271934faba7ae1987a313d59576361c544c70a5391ade560891d", size = 13866818, upload-time = "2025-07-17T19:18:58.521Z" },
]
[[package]]
@@ -647,7 +647,7 @@ wheels = [
[[package]]
name = "camel-ai"
-version = "0.2.72a6"
+version = "0.2.72a7"
source = { editable = "." }
dependencies = [
{ name = "colorama" },
@@ -2060,11 +2060,11 @@ wheels = [
[[package]]
name = "distlib"
-version = "0.3.9"
+version = "0.4.0"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/0d/dd/1bec4c5ddb504ca60fc29472f3d27e8d4da1257a854e1d96742f15c1d02d/distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403", size = 613923, upload-time = "2024-10-09T18:35:47.551Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/91/a1/cf2472db20f7ce4a6be1253a81cfdf85ad9c7885ffbed7047fb72c24cf87/distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87", size = 468973, upload-time = "2024-10-09T18:35:44.272Z" },
+ { url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" },
]
[[package]]
@@ -2177,7 +2177,7 @@ wheels = [
[[package]]
name = "e2b"
-version = "1.5.6"
+version = "1.6.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "attrs" },
@@ -2188,9 +2188,9 @@ dependencies = [
{ name = "python-dateutil" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/f6/bb/fb741a62bd4b4a0c9c3547f2fddeb4b5cdbc68cef1f2454f9cc67d69270a/e2b-1.5.6.tar.gz", hash = "sha256:05da24b27d7a855edd374935c47a9e9faa9b4c3cc41a039a0ac3ee1cebedccf9", size = 56188, upload-time = "2025-07-10T13:45:15.763Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/36/c0/adbc6f73c69936c9bfe55afde1a13276457cf71043293e0b4ae6e9337b49/e2b-1.6.0.tar.gz", hash = "sha256:0552115ee0a18c4e5a5aa97290d4a454478c547371386cabb76e367b8e914753", size = 56083, upload-time = "2025-07-17T13:15:57.495Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/4f/3d/d0d4f109c1f5692f884da83382a120f5249daa4ce6f8d87452a613233c8e/e2b-1.5.6-py3-none-any.whl", hash = "sha256:ca567af466bb370bef01cb2211ba231dbbe743137387c2a40cecf8819d6f9535", size = 104474, upload-time = "2025-07-10T13:45:14.426Z" },
+ { url = "https://files.pythonhosted.org/packages/cf/6d/6aa9c0034e1198bbe6bcb1bd4c069dfd480baf922666f3e6c7b7d09ad591/e2b-1.6.0-py3-none-any.whl", hash = "sha256:c4606ed0a3d4e45412ce81e2e8ee224b2d81b927fd8d6519a1a81437d8d4a22a", size = 104354, upload-time = "2025-07-17T13:15:55.898Z" },
]
[[package]]
@@ -2249,7 +2249,7 @@ wheels = [
[[package]]
name = "exa-py"
-version = "1.14.16"
+version = "1.14.17"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx" },
@@ -2258,9 +2258,9 @@ dependencies = [
{ name = "requests" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/bd/68/20210185644f6cbf76e27ab5be671e70e902bc7b5350781c681d1b32af19/exa_py-1.14.16.tar.gz", hash = "sha256:6404775afe9eac83fdfb8cdf558f5206164c5550e54de90502a05fe96646c508", size = 34348, upload-time = "2025-07-10T01:47:42.384Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/cd/93/e32ef50a86db487a5a8b5de9faf362dd84fbf657c87a32059b9a639a603b/exa_py-1.14.17.tar.gz", hash = "sha256:054513e12e513feb3037701f04387e1021d1145fc42c224dbbfd77eb55ed6171", size = 34961, upload-time = "2025-07-17T04:45:08.487Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/47/96/a75209c07e5da6b3b1baed29e1482f957067d8a20096e587a40a08232d79/exa_py-1.14.16-py3-none-any.whl", hash = "sha256:9774a5fe4113d1e4fc51cea1cfb1ae633cfcaf39d388dc54bd10b731a9524587", size = 44029, upload-time = "2025-07-10T01:47:40.916Z" },
+ { url = "https://files.pythonhosted.org/packages/37/17/6e7cbc7a0e290ea939ed050b55d24a2e1d1d1fa42c547c03b6a962417401/exa_py-1.14.17-py3-none-any.whl", hash = "sha256:e6893616cb33a970415f27921c1f2215bbf5930673dc79e3546ffa31d0e6038f", size = 44612, upload-time = "2025-07-17T04:45:07.075Z" },
]
[[package]]
@@ -3508,7 +3508,7 @@ wheels = [
[[package]]
name = "jsonschema"
-version = "4.24.0"
+version = "4.24.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "attrs" },
@@ -3516,9 +3516,9 @@ dependencies = [
{ name = "referencing" },
{ name = "rpds-py" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/bf/d3/1cf5326b923a53515d8f3a2cd442e6d7e94fcc444716e879ea70a0ce3177/jsonschema-4.24.0.tar.gz", hash = "sha256:0b4e8069eb12aedfa881333004bccaec24ecef5a8a6a4b6df142b2cc9599d196", size = 353480, upload-time = "2025-05-26T18:48:10.459Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/f1/6e/35174c1d3f30560848c82d3c233c01420e047d70925c897a4d6e932b4898/jsonschema-4.24.1.tar.gz", hash = "sha256:fe45a130cc7f67cd0d67640b4e7e3e2e666919462ae355eda238296eafeb4b5d", size = 356635, upload-time = "2025-07-17T14:40:01.05Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/a2/3d/023389198f69c722d039351050738d6755376c8fd343e91dc493ea485905/jsonschema-4.24.0-py3-none-any.whl", hash = "sha256:a462455f19f5faf404a7902952b6f0e3ce868f3ee09a359b05eca6673bd8412d", size = 88709, upload-time = "2025-05-26T18:48:08.417Z" },
+ { url = "https://files.pythonhosted.org/packages/85/7f/ea48ffb58f9791f9d97ccb35e42fea1ebc81c67ce36dc4b8b2eee60e8661/jsonschema-4.24.1-py3-none-any.whl", hash = "sha256:6b916866aa0b61437785f1277aa2cbd63512e8d4b47151072ef13292049b4627", size = 89060, upload-time = "2025-07-17T14:39:59.471Z" },
]
[[package]]
@@ -3752,7 +3752,7 @@ wheels = [
[[package]]
name = "litellm"
-version = "1.74.3"
+version = "1.74.4"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "aiohttp" },
@@ -3767,9 +3767,9 @@ dependencies = [
{ name = "tiktoken" },
{ name = "tokenizers" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/cd/e3/3091066f6682016840e9a36111560656b609b95de04b2ec7b19ad2580eaa/litellm-1.74.3.tar.gz", hash = "sha256:a9e87ebe78947ceec67e75f830f1c956cc653b84563574241acea9c84e7e3ca1", size = 9256457, upload-time = "2025-07-12T20:06:06.128Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/52/49/32f0e7052309f2757885737e7eb7ce6f5ea5b48fad455b10dfd21720f04e/litellm-1.74.4.tar.gz", hash = "sha256:ace3dd8c052b57b728a2dbd38e7061cf95e3506b13a58c61da39902f6ee4a6be", size = 9405133, upload-time = "2025-07-17T02:46:11.015Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/14/6f/07735b5178f32e28daf8a30ed6ad3e2c8c06ac374dc06aecde007110470f/litellm-1.74.3-py3-none-any.whl", hash = "sha256:638ec73633c6f2cf78a7343723d8f3bc13c192558fcbaa29f3ba6bc7802e8663", size = 8618899, upload-time = "2025-07-12T20:06:03.609Z" },
+ { url = "https://files.pythonhosted.org/packages/21/0c/88df53727c28c006b2fb36616f93a036cde7fb9e37f016f60f02422f52ae/litellm-1.74.4-py3-none-any.whl", hash = "sha256:28de09c9d4cdbe322402f94236ec8dbac9edc5356e2f3b628b9bab0fb39284e4", size = 8639543, upload-time = "2025-07-17T02:46:08.052Z" },
]
[[package]]
@@ -4032,7 +4032,7 @@ wheels = [
[[package]]
name = "mcp"
-version = "1.11.0"
+version = "1.12.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -4047,9 +4047,9 @@ dependencies = [
{ name = "starlette" },
{ name = "uvicorn", marker = "sys_platform != 'emscripten'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/3a/f5/9506eb5578d5bbe9819ee8ba3198d0ad0e2fbe3bab8b257e4131ceb7dfb6/mcp-1.11.0.tar.gz", hash = "sha256:49a213df56bb9472ff83b3132a4825f5c8f5b120a90246f08b0dac6bedac44c8", size = 406907, upload-time = "2025-07-10T16:41:09.388Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/45/94/caa0f4754e2437f7033068989f13fee784856f95870c786b0b5c2c0f511e/mcp-1.12.0.tar.gz", hash = "sha256:853f6b17a3f31ea6e2f278c2ec7d3b38457bc80c7c2c675260dd7f04a6fd0e70", size = 424678, upload-time = "2025-07-17T19:46:35.522Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/92/9c/c9ca79f9c512e4113a5d07043013110bb3369fc7770040c61378c7fbcf70/mcp-1.11.0-py3-none-any.whl", hash = "sha256:58deac37f7483e4b338524b98bc949b7c2b7c33d978f5fafab5bde041c5e2595", size = 155880, upload-time = "2025-07-10T16:41:07.935Z" },
+ { url = "https://files.pythonhosted.org/packages/ed/da/c7eaab6a58f1034de115b7902141ad8f81b4f3bbf7dc0cc267594947a4d7/mcp-1.12.0-py3-none-any.whl", hash = "sha256:19a498b2bf273283e463b4dd1ed83f791fbba5c25bfa16b8b34cfd5571673e7f", size = 158470, upload-time = "2025-07-17T19:46:34.166Z" },
]
[[package]]
@@ -4403,11 +4403,11 @@ wheels = [
[[package]]
name = "narwhals"
-version = "1.47.0"
+version = "1.47.1"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/d8/8c/ba6c454ab019d1e24573c68b89a1c4edaad69d4cdf9ed107812802780742/narwhals-1.47.0.tar.gz", hash = "sha256:38238882f3ab2bbc8e7121bc9be951a8a58f1a810bdb14aa2b18792bafac01f8", size = 514799, upload-time = "2025-07-14T12:19:09.979Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/fa/97/f9072f2dd368e52a37c0f5578f5910c689d5ac9c1108f8d2ed6c84c1c8fc/narwhals-1.47.1.tar.gz", hash = "sha256:3e477a54984a141b500ebd65d0b946b7a991080939b4a3321a6b01ea97258c9a", size = 516244, upload-time = "2025-07-17T18:23:04.403Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/a7/c1/1e1109cca762087fd101064c00f576a5a8fa6889d07e70f1efe20205af46/narwhals-1.47.0-py3-none-any.whl", hash = "sha256:8b4ead8866046829de24058d1079e776806bd4aab7d38f55f17c58ce4c0994d2", size = 374667, upload-time = "2025-07-14T12:19:07.811Z" },
+ { url = "https://files.pythonhosted.org/packages/c0/15/278693412221859a0159719878e51a79812a189edceef2fe325160a8e661/narwhals-1.47.1-py3-none-any.whl", hash = "sha256:b9f2b2557aba054231361a00f6fcabc5017e338575e810e82155eb34e38ace93", size = 375506, upload-time = "2025-07-17T18:23:02.492Z" },
]
[[package]]
@@ -4683,7 +4683,7 @@ wheels = [
[[package]]
name = "openai"
-version = "1.96.1"
+version = "1.97.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -4695,9 +4695,9 @@ dependencies = [
{ name = "tqdm" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/2f/b5/18fd5e1b6b6c7dca52d60307b3637f9e9e3206a8041a9c8028985dbc6260/openai-1.96.1.tar.gz", hash = "sha256:6d505b5cc550e036bfa3fe99d6cff565b11491d12378d4c353f92ef72b0a408a", size = 489065, upload-time = "2025-07-15T21:39:37.215Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/e0/c6/b8d66e4f3b95493a8957065b24533333c927dc23817abe397f13fe589c6e/openai-1.97.0.tar.gz", hash = "sha256:0be349569ccaa4fb54f97bb808423fd29ccaeb1246ee1be762e0c81a47bae0aa", size = 493850, upload-time = "2025-07-16T16:37:35.196Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/4f/57/325bbdbdc27b47309be35cb4e0eb8980b0c1bc997194c797c3691d88ae41/openai-1.96.1-py3-none-any.whl", hash = "sha256:0afaab2019bae8e145e7a1baf6953167084f019dd15042c65edd117398c1eb1c", size = 757454, upload-time = "2025-07-15T21:39:34.517Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/91/1f1cf577f745e956b276a8b1d3d76fa7a6ee0c2b05db3b001b900f2c71db/openai-1.97.0-py3-none-any.whl", hash = "sha256:a1c24d96f4609f3f7f51c9e1c2606d97cc6e334833438659cfd687e9c972c610", size = 764953, upload-time = "2025-07-16T16:37:33.135Z" },
]
[[package]]
@@ -5278,7 +5278,7 @@ wheels = [
[[package]]
name = "posthog"
-version = "6.1.0"
+version = "6.1.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "backoff" },
@@ -5288,9 +5288,9 @@ dependencies = [
{ name = "six" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/0f/e7/027706e2ef332f7b47e8364c8ac78ef69f1d086e7b2716f8764abb54ea66/posthog-6.1.0.tar.gz", hash = "sha256:c3426841743d1f65679563df25920a7ac1e8e028391063faf0d04b8fdc5338be", size = 92650, upload-time = "2025-07-10T15:04:00.931Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/1e/ee/4b47aff4e213588facde989227fbaa9e342b36bd5ba718e8d9920ca05fb1/posthog-6.1.1.tar.gz", hash = "sha256:b453f54c4a2589da859fd575dd3bf86fcb40580727ec399535f268b1b9f318b8", size = 95949, upload-time = "2025-07-16T19:54:27.767Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/e6/54/9594816fe7597780c2a86f4c77fd9975be0aee07fe62787670a445715cd4/posthog-6.1.0-py3-none-any.whl", hash = "sha256:8d653b3c122f102e8f3d8573fca528d580dba78366e33c0c4b828ae8b2975870", size = 109733, upload-time = "2025-07-10T15:03:59.757Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/3a/8d52424fa43a242ed22b4ebbc538542724823dec3a8b37889a3e0e019f90/posthog-6.1.1-py3-none-any.whl", hash = "sha256:329fd3d06b4d54cec925f47235bd8e327c91403c2f9ec38f1deb849535934dba", size = 113293, upload-time = "2025-07-16T19:54:26.491Z" },
]
[[package]]
@@ -8129,7 +8129,7 @@ wheels = [
[[package]]
name = "unstructured-client"
-version = "0.38.1"
+version = "0.39.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "aiofiles" },
@@ -8140,9 +8140,9 @@ dependencies = [
{ name = "pypdf" },
{ name = "requests-toolbelt" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/85/60/412092671bfc4952640739f2c0c9b2f4c8af26a3c921738fd12621b4ddd8/unstructured_client-0.38.1.tar.gz", hash = "sha256:43ab0670dd8ff53d71e74f9b6dfe490a84a5303dab80a4873e118a840c6d46ca", size = 91781, upload-time = "2025-07-03T15:46:35.054Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/d7/19/af77890f5a0769c751b2d9c939bd5119a55f73c4a8184b3417c86e2606fb/unstructured_client-0.39.1.tar.gz", hash = "sha256:9ae5871a6e76c441d42579eaffc6bffb309d3206ecdfa80216c412dda7609911", size = 91725, upload-time = "2025-07-16T20:10:17.068Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/26/e0/8c249f00ba85fb4aba5c541463312befbfbf491105ff5c06e508089467be/unstructured_client-0.38.1-py3-none-any.whl", hash = "sha256:71e5467870d0a0119c788c29ec8baf5c0f7123f424affc9d6682eeeb7b8d45fa", size = 212626, upload-time = "2025-07-03T15:46:33.929Z" },
+ { url = "https://files.pythonhosted.org/packages/a0/d7/dd78a00b5604d5118a5611329929589334e1635ff04b33e1c80e57a0d045/unstructured_client-0.39.1-py3-none-any.whl", hash = "sha256:b0a179bcbbeae1f155712fd646012d2b3d426778c06eb9a3f5971563ad6fa8fa", size = 212568, upload-time = "2025-07-16T20:10:16.015Z" },
]
[[package]]
@@ -8182,27 +8182,27 @@ socks = [
[[package]]
name = "uv"
-version = "0.7.21"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/30/5f/d4356a6e9643fac913dc37b84fe1fb9e1baa34ce8dff17a214db2f4198cb/uv-0.7.21.tar.gz", hash = "sha256:9da06b797370c32f9ac9766257602258960d686e3847e102d9c293a77f8449e7", size = 3382889, upload-time = "2025-07-14T18:35:35.614Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/fc/18/9abc4463eda4151c8f4e2be82d2c6ea1b6787a79eded84a9c35a7359ea69/uv-0.7.21-py3-none-linux_armv6l.whl", hash = "sha256:dbcee21780bc9df9e328d6ec2f02e236cdf1483e570cb627945e2f1389875c85", size = 17772814, upload-time = "2025-07-14T18:34:36.344Z" },
- { url = "https://files.pythonhosted.org/packages/0e/f5/151c1272e4cf902a04345b3ad5ed3cfe91c8780bcbf0bfe25277b4effd84/uv-0.7.21-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9dd65dea88bd6ad3728aab0b176a83da794f5a7a103a9ee3f0085fb57f030d2f", size = 17904679, upload-time = "2025-07-14T18:34:41.044Z" },
- { url = "https://files.pythonhosted.org/packages/f7/07/866bebfb01ae04619b335c4981fa11914543f3dfa73bc2c1d7008cf285a3/uv-0.7.21-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a62e72cec3596e5dc78ec5077f5d0616c100fcf9758fa5d41e8b3b00335c439e", size = 16591601, upload-time = "2025-07-14T18:34:44.571Z" },
- { url = "https://files.pythonhosted.org/packages/24/4d/19913eddd03e1787be2deeb97134210c0d8b92dfb34f26409d51994e5ce1/uv-0.7.21-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:7d86149d80b69da65987d1b3f03f5285d13bcf033424d2fdad646efd36f77257", size = 17107772, upload-time = "2025-07-14T18:34:48.255Z" },
- { url = "https://files.pythonhosted.org/packages/4e/98/91e38332d4db2fe36f782e227238af0b689785cff57b169c92aacd249e21/uv-0.7.21-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:306e2b349dd41b177c2157471d99fa6deffae3098b3747ca7a90cbf0a69f44dc", size = 17504089, upload-time = "2025-07-14T18:34:51.868Z" },
- { url = "https://files.pythonhosted.org/packages/a5/ea/5b0d2dac76bdcf3f4055a46b7cb6b4271d6db96f00fb5c8eda063189ceb7/uv-0.7.21-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef23d2c2e5fa32dc91edfaea22d094a7cecf2a1bb58f5e8cf916e0a4049b9200", size = 18217722, upload-time = "2025-07-14T18:34:55.008Z" },
- { url = "https://files.pythonhosted.org/packages/38/16/39a8fdb7ec4a65800925895903bdbc2fefda0624a10f3e9f6690e74dd071/uv-0.7.21-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:48ebc0585f073c83086c1f8a21aeeb8a9f68c361a4989d1fbf24bcae83782a5d", size = 19487934, upload-time = "2025-07-14T18:34:58.367Z" },
- { url = "https://files.pythonhosted.org/packages/b5/23/eaed96f06d4fecfebcee6ea4d656e5b06fb61cab58ccc4098526bbca5e8b/uv-0.7.21-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91e3e4decfba5ac6e6c11bd9879350c1a140ec952169d4a137c5d1fceea6fb9d", size = 19228362, upload-time = "2025-07-14T18:35:01.763Z" },
- { url = "https://files.pythonhosted.org/packages/e3/a6/86b3a9efc6202a4266bbed44b4e3145f758f37b3e52f39e1de115ae1c04f/uv-0.7.21-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:45e9d63ccdd79f0d24a5e99ff6cd449439a5b1a9b84c5fa1d4a6c9e9b4419c91", size = 18722277, upload-time = "2025-07-14T18:35:05.13Z" },
- { url = "https://files.pythonhosted.org/packages/0e/8d/6613d8c04d16f4b953a5b973219e76a61f80a92a5c17b6b250e1770e4341/uv-0.7.21-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfea37104d3d06134a43fc62038d9c073f5d8ecce2f524bdb60608c43484494c", size = 18559914, upload-time = "2025-07-14T18:35:08.718Z" },
- { url = "https://files.pythonhosted.org/packages/e8/23/5ebfe6f6d0227b35dddeb5f1da621e8fe3eeb49a8bed151f45920b2f3e7e/uv-0.7.21-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:8d6a1364fe39aeed30fbf3427f6f43a27d8a113e0a9cb42386851cd365e956e4", size = 17356304, upload-time = "2025-07-14T18:35:12.177Z" },
- { url = "https://files.pythonhosted.org/packages/8e/38/536bbcd74fa5960ae395b345f7655bbd932064d457524a5e8847331ed9d8/uv-0.7.21-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:5012308754f6377f7a2522b50d6ba8bda003f15feb755adbc2ab2353c0b96523", size = 17414580, upload-time = "2025-07-14T18:35:15.382Z" },
- { url = "https://files.pythonhosted.org/packages/fa/2f/c8043de9ad200d5ccab0ab8001f460f1cb7f1f7e262320345b2bf1244bc5/uv-0.7.21-py3-none-musllinux_1_1_i686.whl", hash = "sha256:51fd21c2a10ea7a4dc535a83bd2e21650236151671946cf98ed643561648c87b", size = 17780951, upload-time = "2025-07-14T18:35:19.597Z" },
- { url = "https://files.pythonhosted.org/packages/c4/50/0681914033a438e1beb5e89a11637f97e6feb1ea4a6f2b87d5a8f1b57cac/uv-0.7.21-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:93e32169381afaf9a2c32ff10b28c8f8e86ec1e0273fb2beb186fdd214ecee32", size = 18710644, upload-time = "2025-07-14T18:35:23.062Z" },
- { url = "https://files.pythonhosted.org/packages/03/5d/7b034993b1460ef50426610eeb66126c57782e90480f013e2c5d3d8ed892/uv-0.7.21-py3-none-win32.whl", hash = "sha256:0797c1f51ee8c5db742a69b7d8c2948e8474ddbeeefcea792ab9f70a34890fca", size = 17660978, upload-time = "2025-07-14T18:35:26.177Z" },
- { url = "https://files.pythonhosted.org/packages/3d/9d/c6bb652111ff0b4cb34c4141267eaa91d8d2d9774617d2a5f424bb8ffa74/uv-0.7.21-py3-none-win_amd64.whl", hash = "sha256:6f3a5c02531deeb28fda27a6aa0184d9aaf2cd5d5875ea4e3424206545a042dd", size = 19442643, upload-time = "2025-07-14T18:35:29.966Z" },
- { url = "https://files.pythonhosted.org/packages/2b/82/a2710aa914164bf782500e233a198adc22cec48ef716e40d5681866003b3/uv-0.7.21-py3-none-win_arm64.whl", hash = "sha256:2a69a4c4d85b3edf91aeb6aa9f6bcedf423df0e4dfccae6b33410843c8b2d359", size = 18001982, upload-time = "2025-07-14T18:35:33.294Z" },
+version = "0.7.22"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/43/c5/d1defc44eea72552ee7667212359bded10ac8f7e39b62b042a3d4a9d4040/uv-0.7.22.tar.gz", hash = "sha256:f5cf159907d594e33433f14737d1ee843dc8799edfcf57b5b8c0f282d1117051", size = 3387947, upload-time = "2025-07-17T17:01:01.31Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/76/10/55d46d79d61da0ae4ca50e126b369cbce3f2ffd478df61e7e280d3d13302/uv-0.7.22-py3-none-linux_armv6l.whl", hash = "sha256:995bdc2d8ec75620544bad1bea389334c740ff4aeeb42fbee93107b0780fa1d2", size = 17824193, upload-time = "2025-07-17T17:00:02.285Z" },
+ { url = "https://files.pythonhosted.org/packages/46/31/163f836537bb3c41b7f7687e539096cc251dd7ebc7afb492cc8ef77a7243/uv-0.7.22-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:bc2d9d49b8bc83ef2a0cbfd39926e2112059b9ddddb7e3baa31726cce33c707b", size = 17908564, upload-time = "2025-07-17T17:00:06.768Z" },
+ { url = "https://files.pythonhosted.org/packages/64/f5/0ee734f5e988fd8f26aad1f150703fe8c7d664029c9c677b989b69caf104/uv-0.7.22-py3-none-macosx_11_0_arm64.whl", hash = "sha256:573edda226dc26e6fea03aa89a45af2f2a367ad1f466af15c4eb54286dae042f", size = 16615938, upload-time = "2025-07-17T17:00:10.01Z" },
+ { url = "https://files.pythonhosted.org/packages/d4/45/71eec20e6390e464885e0546037dcecf1f10afac884e701ce70cb990774f/uv-0.7.22-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:c366847fc6260c3fa101be0a99ed1ac8613537ea3ec4fa6e4aac5d1a173945ec", size = 17171889, upload-time = "2025-07-17T17:00:13.988Z" },
+ { url = "https://files.pythonhosted.org/packages/d7/86/088894e7013116e5edcce29d9e7313046289be1c50056fdc0e9a336200e3/uv-0.7.22-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:706393788882cca2581d681fcf51bcbd5b04aa695e9dad41c048219f6a2a0b0a", size = 17535032, upload-time = "2025-07-17T17:00:17.472Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/0f/216225a343659a76162a6ccef43aeacca060f1a0a5c0b56042a30e3fb7d6/uv-0.7.22-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f61c122ef8d6679dab90a24c3a2c4c688b6b3112e6e2735ae1590784520fc82b", size = 18261859, upload-time = "2025-07-17T17:00:20.513Z" },
+ { url = "https://files.pythonhosted.org/packages/35/88/a566e43a77713b0fb66e933f82752a089b5e27d820a2cc549431985259f3/uv-0.7.22-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:b4660613c1fd86f607856e21fd2700bc19ae39fedcfc5865434ddbd3b76b39ae", size = 19472386, upload-time = "2025-07-17T17:00:24.167Z" },
+ { url = "https://files.pythonhosted.org/packages/30/5f/310f4d21dc10577cc4aff3dc12f21f7108840c2025be479551143a158b98/uv-0.7.22-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e3178dd8b118d61ffbf59297417ee0a5136b3fe34bca76105ce78a2854d9e6a2", size = 19224926, upload-time = "2025-07-17T17:00:28.279Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/21/eac566208accded98ff0a74d4995e7805715c5ac4bc71ff2ff9a16cf4d39/uv-0.7.22-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75d7a4dbf219bcabefc760498b0b137a85966673ed43580f9dc339ff2bdaae73", size = 18784319, upload-time = "2025-07-17T17:00:31.492Z" },
+ { url = "https://files.pythonhosted.org/packages/88/12/11dfd036bf776a775f6972a3f9ccfa95b4817ec7a21a427f233a5d1d904b/uv-0.7.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:560b00403b9cf82e2ae7d6d680c6d54c3f5c709b3b6357e092059c5d4b682baa", size = 18676032, upload-time = "2025-07-17T17:00:34.656Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/55/8da57cdf08fa83228e78d0f882c56278021d370029a6f726d40d2fd1c17f/uv-0.7.22-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:996f50ba85a21da7bb3d6b08be952d3fe06bede3573a50fb576d2fa77d72b1ed", size = 17455515, upload-time = "2025-07-17T17:00:37.832Z" },
+ { url = "https://files.pythonhosted.org/packages/ee/7b/00f98f7aaf540537ca5261dcd2b59a81f3bc93b148e1c1ef61243c1c1708/uv-0.7.22-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:b2abb6c638afcd5fd020284a2f36b71d41277675d23732691dc92dd4376db4b8", size = 17493955, upload-time = "2025-07-17T17:00:40.841Z" },
+ { url = "https://files.pythonhosted.org/packages/3d/45/49b9dca3aac1c595a967cfb78b30675a0746c7bd15ad219f727950b7c893/uv-0.7.22-py3-none-musllinux_1_1_i686.whl", hash = "sha256:8a66db63e0220a0d05bf9836c1b35fd8562a8d28f6989b412c914dbc4be15e16", size = 17802203, upload-time = "2025-07-17T17:00:43.931Z" },
+ { url = "https://files.pythonhosted.org/packages/77/f4/e3acf80651e3650d6606109e95c56292616c423557b8503200409005a0db/uv-0.7.22-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:49a78e2703d26de1b95730a1310505debb121a178732f8dc321ed99de8eca708", size = 18772914, upload-time = "2025-07-17T17:00:47.731Z" },
+ { url = "https://files.pythonhosted.org/packages/2a/50/74062e3a7f468e7f9dafc953920a1781608a2933a1d14fa48493f8b5dca4/uv-0.7.22-py3-none-win32.whl", hash = "sha256:e6115997907151e28858c238f7af18782d3ed4c24e2c0572710e05f08895cb19", size = 17716379, upload-time = "2025-07-17T17:00:51.265Z" },
+ { url = "https://files.pythonhosted.org/packages/16/1a/dd8390675bf572b472063af0c612b0875156ea5ff7d2660ea44f7e361709/uv-0.7.22-py3-none-win_amd64.whl", hash = "sha256:d476f10783d1a9d49fa14fd9447fc694c75d3a93a7ff237a12bbc69eb9d29c27", size = 19512351, upload-time = "2025-07-17T17:00:55.347Z" },
+ { url = "https://files.pythonhosted.org/packages/f8/a1/51de664e7eeeb71b63cfe74c95cdbdc3abc20fa1443b60e78c1536ac8e64/uv-0.7.22-py3-none-win_arm64.whl", hash = "sha256:8c478034d422b99327c58914463c0841aed0bc1e8edf231ff861e191cdfea862", size = 18049309, upload-time = "2025-07-17T17:00:58.725Z" },
]
[[package]]
@@ -8359,7 +8359,7 @@ wheels = [
[[package]]
name = "weaviate-client"
-version = "4.16.0"
+version = "4.16.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "authlib" },
@@ -8370,9 +8370,9 @@ dependencies = [
{ name = "pydantic" },
{ name = "validators" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/f9/b9/119ce1d2f516bcd9bbd05018a1d4490b9085dc6d5f7c21714cdda8a95c7d/weaviate_client-4.16.0.tar.gz", hash = "sha256:a6d8801ad68a9dc6757a83f20f67412e9e7318c479caeca5838109b2b759cd03", size = 681019, upload-time = "2025-07-15T14:07:07.106Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/cb/29/bc29ea9ceb41f001e091b26a8cf2f2639aba6537d4c2a7189657099dd109/weaviate_client-4.16.1.tar.gz", hash = "sha256:031051fd299eed98ae50a3b48bc2d5c2f2956069c76cd3d7fce5320b74cc62ea", size = 681288, upload-time = "2025-07-17T14:07:02.684Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/17/ef/8925d577440153913566ced1301ab69199f1d6e2bb2286a57c9bd411cf37/weaviate_client-4.16.0-py3-none-any.whl", hash = "sha256:eb14e4777e29f2a6aa9ad3614e5404e46952c2a62a634cdafbf4b6c1dd6aba0b", size = 451480, upload-time = "2025-07-15T14:07:05.274Z" },
+ { url = "https://files.pythonhosted.org/packages/bb/01/4e17af498f06923d8aad8cc814301861587dbefb7852e1d8450c288bd8ae/weaviate_client-4.16.1-py3-none-any.whl", hash = "sha256:73694582770263cbb3c145b51aa9b35f424d75cc16fcab1ad670bde0a70602d2", size = 451481, upload-time = "2025-07-17T14:07:00.982Z" },
]
[[package]]