diff --git a/setup/cli/commands/update.py b/setup/cli/commands/update.py index 30150f5..e330af4 100644 --- a/setup/cli/commands/update.py +++ b/setup/cli/commands/update.py @@ -19,7 +19,7 @@ from ...utils.ui import ( ) from ...utils.environment import setup_environment_variables from ...utils.logger import get_logger -from ... import DEFAULT_INSTALL_DIR, PROJECT_ROOT +from ... import DEFAULT_INSTALL_DIR, PROJECT_ROOT, DATA_DIR from . import OperationBase @@ -275,7 +275,7 @@ def display_update_plan(components: List[str], available_updates: Dict[str, Dict print() -def perform_update(components: List[str], args: argparse.Namespace) -> bool: +def perform_update(components: List[str], args: argparse.Namespace, registry: ComponentRegistry) -> bool: """Perform the actual update""" logger = get_logger() start_time = time.time() @@ -284,10 +284,6 @@ def perform_update(components: List[str], args: argparse.Namespace) -> bool: # Create installer installer = Installer(args.install_dir, dry_run=args.dry_run) - # Create component registry - registry = ComponentRegistry(PROJECT_ROOT / "setup" / "components") - registry.discover_components() - # Create component instances component_instances = registry.create_component_instances(components, args.install_dir) @@ -384,6 +380,9 @@ def run(args: argparse.Namespace) -> int: operation = UpdateOperation() operation.setup_operation_logging(args) logger = get_logger() + + from setup.cli.base import __version__ + # ✅ Inserted validation code expected_home = Path.home().resolve() actual_dir = args.install_dir.resolve() @@ -457,7 +456,7 @@ def run(args: argparse.Namespace) -> int: return 0 # Perform update - success = perform_update(components, args) + success = perform_update(components, args, registry) if success: if not args.quiet: diff --git a/setup/components/mcp.py b/setup/components/mcp.py index dfe0011..e4646f8 100644 --- a/setup/components/mcp.py +++ b/setup/components/mcp.py @@ -229,7 +229,7 @@ class MCPComponent(Component): ["claude", "mcp", "list"], capture_output=True, text=True, - timeout=30, + timeout=60, shell=(sys.platform == "win32") ) @@ -382,7 +382,7 @@ class MCPComponent(Component): ["claude", "mcp", "list"], capture_output=True, text=True, - timeout=15, + timeout=60, shell=(sys.platform == "win32") ) @@ -542,7 +542,7 @@ class MCPComponent(Component): ["claude", "mcp", "list"], capture_output=True, text=True, - timeout=30, + timeout=60, shell=(sys.platform == "win32") ) diff --git a/setup/core/installer.py b/setup/core/installer.py index 240b7fd..9dc0dfb 100644 --- a/setup/core/installer.py +++ b/setup/core/installer.py @@ -28,7 +28,9 @@ class Installer: self.install_dir = install_dir or DEFAULT_INSTALL_DIR self.dry_run = dry_run self.components: Dict[str, Component] = {} - self.installed_components: Set[str] = set() + from ..services.settings import SettingsService + settings_manager = SettingsService(self.install_dir) + self.installed_components: Set[str] = set(settings_manager.get_installed_components().keys()) self.updated_components: Set[str] = set() self.failed_components: Set[str] = set() @@ -202,8 +204,8 @@ class Installer: component = self.components[component_name] - # Skip if already installed - if component_name in self.installed_components: + # Skip if already installed and not in update mode + if component_name in self.installed_components and not config.get("update_mode"): return True # Check prerequisites @@ -309,8 +311,10 @@ class Installer: self.logger.info("All components validated successfully!") else: self.logger.error("Some components failed validation. Check errors above.") + def update_components(self, component_names: List[str], config: Dict[str, Any]) -> bool: """Alias for update operation (uses install logic)""" + config["update_mode"] = True return self.install_components(component_names, config)