""" Configuration Command Classes This module implements commands for configuration management. """ from typing import Optional, Dict, Any from dataclasses import dataclass, field from .base import TrixyCommand, CommandResponse, ValidationError @dataclass class ConfigUpdateCommand(TrixyCommand): """Command to update configuration settings.""" config_section: str = field(default="") config_changes: Dict[str, Any] = field(default_factory=dict) def validate(self) -> bool: if not self.config_section: raise ValidationError("ConfigUpdateCommand must have a config_section") return True def get_command_name(self) -> str: return "ConfigUpdateCommand" @dataclass class ConfigRequestCommand(TrixyCommand): """Command to request configuration data.""" config_section: str = field(default="all") def validate(self) -> bool: return True def get_command_name(self) -> str: return "ConfigRequestCommand" @dataclass class ConfigValidateCommand(TrixyCommand): """Command to validate configuration.""" config_data: Dict[str, Any] = field(default_factory=dict) def validate(self) -> bool: return True def get_command_name(self) -> str: return "ConfigValidateCommand" @dataclass class ConfigUpdateResponse(CommandResponse): """Response to config update command.""" update_applied: bool = field(default=False) def validate(self) -> bool: return True def get_response_name(self) -> str: return "ConfigUpdateResponse" @dataclass class ConfigRequestResponse(CommandResponse): """Response to config request command.""" config_data: Dict[str, Any] = field(default_factory=dict) def validate(self) -> bool: return True def get_response_name(self) -> str: return "ConfigRequestResponse" @dataclass class ConfigValidateResponse(CommandResponse): """Response to config validate command.""" is_valid: bool = field(default=False) def validate(self) -> bool: return True def get_response_name(self) -> str: return "ConfigValidateResponse" __all__ = [ "ConfigUpdateCommand", "ConfigRequestCommand", "ConfigValidateCommand", "ConfigUpdateResponse", "ConfigRequestResponse", "ConfigValidateResponse" ]