claude-mpm 3.7.4__py3-none-any.whl → 3.8.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/BASE_PM.md +0 -106
- claude_mpm/agents/INSTRUCTIONS.md +0 -78
- claude_mpm/agents/MEMORY.md +88 -0
- claude_mpm/agents/WORKFLOW.md +86 -0
- claude_mpm/agents/schema/agent_schema.json +1 -1
- claude_mpm/agents/templates/code_analyzer.json +26 -11
- claude_mpm/agents/templates/data_engineer.json +4 -7
- claude_mpm/agents/templates/documentation.json +2 -2
- claude_mpm/agents/templates/engineer.json +2 -2
- claude_mpm/agents/templates/ops.json +3 -8
- claude_mpm/agents/templates/qa.json +2 -3
- claude_mpm/agents/templates/research.json +2 -3
- claude_mpm/agents/templates/security.json +3 -6
- claude_mpm/agents/templates/ticketing.json +4 -9
- claude_mpm/agents/templates/version_control.json +3 -3
- claude_mpm/agents/templates/web_qa.json +4 -4
- claude_mpm/agents/templates/web_ui.json +4 -4
- claude_mpm/cli/__init__.py +2 -2
- claude_mpm/cli/commands/__init__.py +2 -1
- claude_mpm/cli/commands/agents.py +118 -1
- claude_mpm/cli/commands/tickets.py +596 -19
- claude_mpm/cli/parser.py +228 -5
- claude_mpm/config/__init__.py +30 -39
- claude_mpm/config/socketio_config.py +8 -5
- claude_mpm/constants.py +13 -0
- claude_mpm/core/__init__.py +8 -18
- claude_mpm/core/cache.py +596 -0
- claude_mpm/core/claude_runner.py +166 -622
- claude_mpm/core/config.py +5 -1
- claude_mpm/core/constants.py +339 -0
- claude_mpm/core/container.py +461 -22
- claude_mpm/core/exceptions.py +392 -0
- claude_mpm/core/framework_loader.py +208 -93
- claude_mpm/core/interactive_session.py +432 -0
- claude_mpm/core/interfaces.py +424 -0
- claude_mpm/core/lazy.py +467 -0
- claude_mpm/core/logging_config.py +444 -0
- claude_mpm/core/oneshot_session.py +465 -0
- claude_mpm/core/optimized_agent_loader.py +485 -0
- claude_mpm/core/optimized_startup.py +490 -0
- claude_mpm/core/service_registry.py +52 -26
- claude_mpm/core/socketio_pool.py +162 -5
- claude_mpm/core/types.py +292 -0
- claude_mpm/core/typing_utils.py +477 -0
- claude_mpm/dashboard/static/js/components/file-tool-tracker.js +46 -2
- claude_mpm/dashboard/templates/index.html +5 -5
- claude_mpm/hooks/claude_hooks/hook_handler.py +213 -99
- claude_mpm/init.py +2 -1
- claude_mpm/services/__init__.py +78 -14
- claude_mpm/services/agent/__init__.py +24 -0
- claude_mpm/services/agent/deployment.py +2548 -0
- claude_mpm/services/agent/management.py +598 -0
- claude_mpm/services/agent/registry.py +813 -0
- claude_mpm/services/agents/deployment/agent_deployment.py +592 -269
- claude_mpm/services/agents/deployment/async_agent_deployment.py +5 -1
- claude_mpm/services/agents/management/agent_capabilities_generator.py +21 -11
- claude_mpm/services/agents/memory/agent_memory_manager.py +156 -1
- claude_mpm/services/async_session_logger.py +8 -3
- claude_mpm/services/communication/__init__.py +21 -0
- claude_mpm/services/communication/socketio.py +1933 -0
- claude_mpm/services/communication/websocket.py +479 -0
- claude_mpm/services/core/__init__.py +123 -0
- claude_mpm/services/core/base.py +247 -0
- claude_mpm/services/core/interfaces.py +951 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/todo_task_tools.py +23 -23
- claude_mpm/services/framework_claude_md_generator.py +3 -2
- claude_mpm/services/health_monitor.py +4 -3
- claude_mpm/services/hook_service.py +64 -4
- claude_mpm/services/infrastructure/__init__.py +21 -0
- claude_mpm/services/infrastructure/logging.py +202 -0
- claude_mpm/services/infrastructure/monitoring.py +893 -0
- claude_mpm/services/memory/indexed_memory.py +648 -0
- claude_mpm/services/project/__init__.py +21 -0
- claude_mpm/services/project/analyzer.py +864 -0
- claude_mpm/services/project/registry.py +608 -0
- claude_mpm/services/project_analyzer.py +95 -2
- claude_mpm/services/recovery_manager.py +15 -9
- claude_mpm/services/socketio/__init__.py +25 -0
- claude_mpm/services/socketio/handlers/__init__.py +25 -0
- claude_mpm/services/socketio/handlers/base.py +121 -0
- claude_mpm/services/socketio/handlers/connection.py +198 -0
- claude_mpm/services/socketio/handlers/file.py +213 -0
- claude_mpm/services/socketio/handlers/git.py +723 -0
- claude_mpm/services/socketio/handlers/memory.py +27 -0
- claude_mpm/services/socketio/handlers/project.py +25 -0
- claude_mpm/services/socketio/handlers/registry.py +145 -0
- claude_mpm/services/socketio_client_manager.py +12 -7
- claude_mpm/services/socketio_server.py +156 -30
- claude_mpm/services/ticket_manager.py +377 -51
- claude_mpm/utils/agent_dependency_loader.py +66 -15
- claude_mpm/utils/error_handler.py +1 -1
- claude_mpm/utils/robust_installer.py +587 -0
- claude_mpm/validation/agent_validator.py +27 -14
- claude_mpm/validation/frontmatter_validator.py +231 -0
- {claude_mpm-3.7.4.dist-info → claude_mpm-3.8.1.dist-info}/METADATA +74 -41
- {claude_mpm-3.7.4.dist-info → claude_mpm-3.8.1.dist-info}/RECORD +101 -76
- claude_mpm/.claude-mpm/logs/hooks_20250728.log +0 -10
- claude_mpm/agents/agent-template.yaml +0 -83
- claude_mpm/cli/README.md +0 -108
- claude_mpm/cli_module/refactoring_guide.md +0 -253
- claude_mpm/config/async_logging_config.yaml +0 -145
- claude_mpm/core/.claude-mpm/logs/hooks_20250730.log +0 -34
- claude_mpm/dashboard/.claude-mpm/memories/README.md +0 -36
- claude_mpm/dashboard/README.md +0 -121
- claude_mpm/dashboard/static/js/dashboard.js.backup +0 -1973
- claude_mpm/dashboard/templates/.claude-mpm/memories/README.md +0 -36
- claude_mpm/dashboard/templates/.claude-mpm/memories/engineer_agent.md +0 -39
- claude_mpm/dashboard/templates/.claude-mpm/memories/version_control_agent.md +0 -38
- claude_mpm/hooks/README.md +0 -96
- claude_mpm/schemas/agent_schema.json +0 -435
- claude_mpm/services/framework_claude_md_generator/README.md +0 -92
- claude_mpm/services/version_control/VERSION +0 -1
- {claude_mpm-3.7.4.dist-info → claude_mpm-3.8.1.dist-info}/WHEEL +0 -0
- {claude_mpm-3.7.4.dist-info → claude_mpm-3.8.1.dist-info}/entry_points.txt +0 -0
- {claude_mpm-3.7.4.dist-info → claude_mpm-3.8.1.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-3.7.4.dist-info → claude_mpm-3.8.1.dist-info}/top_level.txt +0 -0
| @@ -0,0 +1,247 @@ | |
| 1 | 
            +
            """
         | 
| 2 | 
            +
            Base Service Classes for Claude MPM Framework
         | 
| 3 | 
            +
            ============================================
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            This module provides the base service classes that all services should inherit from.
         | 
| 6 | 
            +
            These base classes provide common functionality like logging, configuration access,
         | 
| 7 | 
            +
            and lifecycle management.
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            Part of TSK-0046: Service Layer Architecture Reorganization
         | 
| 10 | 
            +
            """
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            from abc import ABC, abstractmethod
         | 
| 13 | 
            +
            from typing import Any, Dict, Optional
         | 
| 14 | 
            +
            import logging
         | 
| 15 | 
            +
            from pathlib import Path
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            from claude_mpm.core.logger import get_logger
         | 
| 18 | 
            +
             | 
| 19 | 
            +
             | 
| 20 | 
            +
            class BaseService(ABC):
         | 
| 21 | 
            +
                """
         | 
| 22 | 
            +
                Base class for all services in the Claude MPM framework.
         | 
| 23 | 
            +
                
         | 
| 24 | 
            +
                Provides:
         | 
| 25 | 
            +
                - Logging setup
         | 
| 26 | 
            +
                - Configuration access
         | 
| 27 | 
            +
                - Lifecycle management
         | 
| 28 | 
            +
                - Common error handling patterns
         | 
| 29 | 
            +
                """
         | 
| 30 | 
            +
                
         | 
| 31 | 
            +
                def __init__(self, service_name: Optional[str] = None, config: Optional[Dict[str, Any]] = None):
         | 
| 32 | 
            +
                    """
         | 
| 33 | 
            +
                    Initialize base service.
         | 
| 34 | 
            +
                    
         | 
| 35 | 
            +
                    Args:
         | 
| 36 | 
            +
                        service_name: Name of the service for logging
         | 
| 37 | 
            +
                        config: Service-specific configuration
         | 
| 38 | 
            +
                    """
         | 
| 39 | 
            +
                    self.service_name = service_name or self.__class__.__name__
         | 
| 40 | 
            +
                    self.logger = get_logger(self.service_name)
         | 
| 41 | 
            +
                    self._config = config or {}
         | 
| 42 | 
            +
                    self._initialized = False
         | 
| 43 | 
            +
                    self._shutdown = False
         | 
| 44 | 
            +
                
         | 
| 45 | 
            +
                @abstractmethod
         | 
| 46 | 
            +
                async def initialize(self) -> bool:
         | 
| 47 | 
            +
                    """
         | 
| 48 | 
            +
                    Initialize the service.
         | 
| 49 | 
            +
                    
         | 
| 50 | 
            +
                    This method should be called before the service is used.
         | 
| 51 | 
            +
                    Implementations should set up any required resources.
         | 
| 52 | 
            +
                    
         | 
| 53 | 
            +
                    Returns:
         | 
| 54 | 
            +
                        True if initialization successful, False otherwise
         | 
| 55 | 
            +
                    """
         | 
| 56 | 
            +
                    pass
         | 
| 57 | 
            +
                
         | 
| 58 | 
            +
                @abstractmethod
         | 
| 59 | 
            +
                async def shutdown(self) -> None:
         | 
| 60 | 
            +
                    """
         | 
| 61 | 
            +
                    Shutdown the service gracefully.
         | 
| 62 | 
            +
                    
         | 
| 63 | 
            +
                    This method should clean up any resources held by the service.
         | 
| 64 | 
            +
                    """
         | 
| 65 | 
            +
                    pass
         | 
| 66 | 
            +
                
         | 
| 67 | 
            +
                def get_config(self, key: str, default: Any = None) -> Any:
         | 
| 68 | 
            +
                    """
         | 
| 69 | 
            +
                    Get configuration value.
         | 
| 70 | 
            +
                    
         | 
| 71 | 
            +
                    Args:
         | 
| 72 | 
            +
                        key: Configuration key
         | 
| 73 | 
            +
                        default: Default value if key not found
         | 
| 74 | 
            +
                        
         | 
| 75 | 
            +
                    Returns:
         | 
| 76 | 
            +
                        Configuration value or default
         | 
| 77 | 
            +
                    """
         | 
| 78 | 
            +
                    return self._config.get(key, default)
         | 
| 79 | 
            +
                
         | 
| 80 | 
            +
                def set_config(self, key: str, value: Any) -> None:
         | 
| 81 | 
            +
                    """
         | 
| 82 | 
            +
                    Set configuration value.
         | 
| 83 | 
            +
                    
         | 
| 84 | 
            +
                    Args:
         | 
| 85 | 
            +
                        key: Configuration key
         | 
| 86 | 
            +
                        value: Configuration value
         | 
| 87 | 
            +
                    """
         | 
| 88 | 
            +
                    self._config[key] = value
         | 
| 89 | 
            +
                
         | 
| 90 | 
            +
                @property
         | 
| 91 | 
            +
                def is_initialized(self) -> bool:
         | 
| 92 | 
            +
                    """Check if service is initialized."""
         | 
| 93 | 
            +
                    return self._initialized
         | 
| 94 | 
            +
                
         | 
| 95 | 
            +
                @property
         | 
| 96 | 
            +
                def is_shutdown(self) -> bool:
         | 
| 97 | 
            +
                    """Check if service is shutdown."""
         | 
| 98 | 
            +
                    return self._shutdown
         | 
| 99 | 
            +
                
         | 
| 100 | 
            +
                def log_debug(self, message: str, **kwargs) -> None:
         | 
| 101 | 
            +
                    """Log debug message."""
         | 
| 102 | 
            +
                    self.logger.debug(f"[{self.service_name}] {message}", **kwargs)
         | 
| 103 | 
            +
                
         | 
| 104 | 
            +
                def log_info(self, message: str, **kwargs) -> None:
         | 
| 105 | 
            +
                    """Log info message."""
         | 
| 106 | 
            +
                    self.logger.info(f"[{self.service_name}] {message}", **kwargs)
         | 
| 107 | 
            +
                
         | 
| 108 | 
            +
                def log_warning(self, message: str, **kwargs) -> None:
         | 
| 109 | 
            +
                    """Log warning message."""
         | 
| 110 | 
            +
                    self.logger.warning(f"[{self.service_name}] {message}", **kwargs)
         | 
| 111 | 
            +
                
         | 
| 112 | 
            +
                def log_error(self, message: str, **kwargs) -> None:
         | 
| 113 | 
            +
                    """Log error message."""
         | 
| 114 | 
            +
                    self.logger.error(f"[{self.service_name}] {message}", **kwargs)
         | 
| 115 | 
            +
                
         | 
| 116 | 
            +
                def log_critical(self, message: str, **kwargs) -> None:
         | 
| 117 | 
            +
                    """Log critical message."""
         | 
| 118 | 
            +
                    self.logger.critical(f"[{self.service_name}] {message}", **kwargs)
         | 
| 119 | 
            +
             | 
| 120 | 
            +
             | 
| 121 | 
            +
            class SyncBaseService(ABC):
         | 
| 122 | 
            +
                """
         | 
| 123 | 
            +
                Base class for synchronous services in the Claude MPM framework.
         | 
| 124 | 
            +
                
         | 
| 125 | 
            +
                Similar to BaseService but for services that don't require async operations.
         | 
| 126 | 
            +
                """
         | 
| 127 | 
            +
                
         | 
| 128 | 
            +
                def __init__(self, service_name: Optional[str] = None, config: Optional[Dict[str, Any]] = None):
         | 
| 129 | 
            +
                    """
         | 
| 130 | 
            +
                    Initialize base service.
         | 
| 131 | 
            +
                    
         | 
| 132 | 
            +
                    Args:
         | 
| 133 | 
            +
                        service_name: Name of the service for logging
         | 
| 134 | 
            +
                        config: Service-specific configuration
         | 
| 135 | 
            +
                    """
         | 
| 136 | 
            +
                    self.service_name = service_name or self.__class__.__name__
         | 
| 137 | 
            +
                    self.logger = get_logger(self.service_name)
         | 
| 138 | 
            +
                    self._config = config or {}
         | 
| 139 | 
            +
                    self._initialized = False
         | 
| 140 | 
            +
                    self._shutdown = False
         | 
| 141 | 
            +
                
         | 
| 142 | 
            +
                @abstractmethod
         | 
| 143 | 
            +
                def initialize(self) -> bool:
         | 
| 144 | 
            +
                    """
         | 
| 145 | 
            +
                    Initialize the service.
         | 
| 146 | 
            +
                    
         | 
| 147 | 
            +
                    This method should be called before the service is used.
         | 
| 148 | 
            +
                    Implementations should set up any required resources.
         | 
| 149 | 
            +
                    
         | 
| 150 | 
            +
                    Returns:
         | 
| 151 | 
            +
                        True if initialization successful, False otherwise
         | 
| 152 | 
            +
                    """
         | 
| 153 | 
            +
                    pass
         | 
| 154 | 
            +
                
         | 
| 155 | 
            +
                @abstractmethod
         | 
| 156 | 
            +
                def shutdown(self) -> None:
         | 
| 157 | 
            +
                    """
         | 
| 158 | 
            +
                    Shutdown the service gracefully.
         | 
| 159 | 
            +
                    
         | 
| 160 | 
            +
                    This method should clean up any resources held by the service.
         | 
| 161 | 
            +
                    """
         | 
| 162 | 
            +
                    pass
         | 
| 163 | 
            +
                
         | 
| 164 | 
            +
                def get_config(self, key: str, default: Any = None) -> Any:
         | 
| 165 | 
            +
                    """
         | 
| 166 | 
            +
                    Get configuration value.
         | 
| 167 | 
            +
                    
         | 
| 168 | 
            +
                    Args:
         | 
| 169 | 
            +
                        key: Configuration key
         | 
| 170 | 
            +
                        default: Default value if key not found
         | 
| 171 | 
            +
                        
         | 
| 172 | 
            +
                    Returns:
         | 
| 173 | 
            +
                        Configuration value or default
         | 
| 174 | 
            +
                    """
         | 
| 175 | 
            +
                    return self._config.get(key, default)
         | 
| 176 | 
            +
                
         | 
| 177 | 
            +
                def set_config(self, key: str, value: Any) -> None:
         | 
| 178 | 
            +
                    """
         | 
| 179 | 
            +
                    Set configuration value.
         | 
| 180 | 
            +
                    
         | 
| 181 | 
            +
                    Args:
         | 
| 182 | 
            +
                        key: Configuration key
         | 
| 183 | 
            +
                        value: Configuration value
         | 
| 184 | 
            +
                    """
         | 
| 185 | 
            +
                    self._config[key] = value
         | 
| 186 | 
            +
                
         | 
| 187 | 
            +
                @property
         | 
| 188 | 
            +
                def is_initialized(self) -> bool:
         | 
| 189 | 
            +
                    """Check if service is initialized."""
         | 
| 190 | 
            +
                    return self._initialized
         | 
| 191 | 
            +
                
         | 
| 192 | 
            +
                @property
         | 
| 193 | 
            +
                def is_shutdown(self) -> bool:
         | 
| 194 | 
            +
                    """Check if service is shutdown."""
         | 
| 195 | 
            +
                    return self._shutdown
         | 
| 196 | 
            +
                
         | 
| 197 | 
            +
                def log_debug(self, message: str, **kwargs) -> None:
         | 
| 198 | 
            +
                    """Log debug message."""
         | 
| 199 | 
            +
                    self.logger.debug(f"[{self.service_name}] {message}", **kwargs)
         | 
| 200 | 
            +
                
         | 
| 201 | 
            +
                def log_info(self, message: str, **kwargs) -> None:
         | 
| 202 | 
            +
                    """Log info message."""
         | 
| 203 | 
            +
                    self.logger.info(f"[{self.service_name}] {message}", **kwargs)
         | 
| 204 | 
            +
                
         | 
| 205 | 
            +
                def log_warning(self, message: str, **kwargs) -> None:
         | 
| 206 | 
            +
                    """Log warning message."""
         | 
| 207 | 
            +
                    self.logger.warning(f"[{self.service_name}] {message}", **kwargs)
         | 
| 208 | 
            +
                
         | 
| 209 | 
            +
                def log_error(self, message: str, **kwargs) -> None:
         | 
| 210 | 
            +
                    """Log error message."""
         | 
| 211 | 
            +
                    self.logger.error(f"[{self.service_name}] {message}", **kwargs)
         | 
| 212 | 
            +
                
         | 
| 213 | 
            +
                def log_critical(self, message: str, **kwargs) -> None:
         | 
| 214 | 
            +
                    """Log critical message."""
         | 
| 215 | 
            +
                    self.logger.critical(f"[{self.service_name}] {message}", **kwargs)
         | 
| 216 | 
            +
             | 
| 217 | 
            +
             | 
| 218 | 
            +
            class SingletonService(SyncBaseService):
         | 
| 219 | 
            +
                """
         | 
| 220 | 
            +
                Base class for singleton services.
         | 
| 221 | 
            +
                
         | 
| 222 | 
            +
                Ensures only one instance of the service exists.
         | 
| 223 | 
            +
                """
         | 
| 224 | 
            +
                
         | 
| 225 | 
            +
                _instances: Dict[type, 'SingletonService'] = {}
         | 
| 226 | 
            +
                
         | 
| 227 | 
            +
                def __new__(cls, *args, **kwargs):
         | 
| 228 | 
            +
                    """Ensure only one instance exists."""
         | 
| 229 | 
            +
                    if cls not in cls._instances:
         | 
| 230 | 
            +
                        cls._instances[cls] = super().__new__(cls)
         | 
| 231 | 
            +
                    return cls._instances[cls]
         | 
| 232 | 
            +
                
         | 
| 233 | 
            +
                @classmethod
         | 
| 234 | 
            +
                def get_instance(cls) -> 'SingletonService':
         | 
| 235 | 
            +
                    """Get the singleton instance."""
         | 
| 236 | 
            +
                    if cls not in cls._instances:
         | 
| 237 | 
            +
                        cls._instances[cls] = cls()
         | 
| 238 | 
            +
                    return cls._instances[cls]
         | 
| 239 | 
            +
                
         | 
| 240 | 
            +
                @classmethod
         | 
| 241 | 
            +
                def clear_instance(cls) -> None:
         | 
| 242 | 
            +
                    """Clear the singleton instance (useful for testing)."""
         | 
| 243 | 
            +
                    if cls in cls._instances:
         | 
| 244 | 
            +
                        instance = cls._instances[cls]
         | 
| 245 | 
            +
                        if hasattr(instance, 'shutdown') and not instance.is_shutdown:
         | 
| 246 | 
            +
                            instance.shutdown()
         | 
| 247 | 
            +
                        del cls._instances[cls]
         |