claude-mpm 4.1.0__py3-none-any.whl → 4.1.2__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/BUILD_NUMBER +1 -1
- claude_mpm/VERSION +1 -1
- claude_mpm/__main__.py +1 -1
- claude_mpm/agents/BASE_PM.md +74 -46
- claude_mpm/agents/INSTRUCTIONS.md +11 -153
- claude_mpm/agents/WORKFLOW.md +61 -321
- claude_mpm/agents/__init__.py +11 -11
- claude_mpm/agents/agent_loader.py +23 -20
- claude_mpm/agents/agent_loader_integration.py +1 -1
- claude_mpm/agents/agents_metadata.py +27 -0
- claude_mpm/agents/async_agent_loader.py +5 -8
- claude_mpm/agents/base_agent_loader.py +36 -25
- claude_mpm/agents/frontmatter_validator.py +6 -6
- claude_mpm/agents/schema/agent_schema.json +1 -1
- claude_mpm/agents/system_agent_config.py +9 -9
- claude_mpm/agents/templates/api_qa.json +47 -2
- claude_mpm/agents/templates/imagemagick.json +256 -0
- claude_mpm/agents/templates/qa.json +41 -2
- claude_mpm/agents/templates/ticketing.json +5 -5
- claude_mpm/agents/templates/web_qa.json +133 -58
- claude_mpm/agents/templates/web_ui.json +3 -3
- claude_mpm/cli/__init__.py +51 -46
- claude_mpm/cli/__main__.py +1 -1
- claude_mpm/cli/commands/__init__.py +10 -12
- claude_mpm/cli/commands/agent_manager.py +186 -181
- claude_mpm/cli/commands/agents.py +271 -268
- claude_mpm/cli/commands/aggregate.py +30 -29
- claude_mpm/cli/commands/cleanup.py +50 -44
- claude_mpm/cli/commands/cleanup_orphaned_agents.py +25 -25
- claude_mpm/cli/commands/config.py +162 -127
- claude_mpm/cli/commands/doctor.py +52 -62
- claude_mpm/cli/commands/info.py +37 -25
- claude_mpm/cli/commands/mcp.py +3 -7
- claude_mpm/cli/commands/mcp_command_router.py +14 -18
- claude_mpm/cli/commands/mcp_install_commands.py +28 -23
- claude_mpm/cli/commands/mcp_pipx_config.py +58 -49
- claude_mpm/cli/commands/mcp_server_commands.py +23 -17
- claude_mpm/cli/commands/memory.py +192 -141
- claude_mpm/cli/commands/monitor.py +117 -88
- claude_mpm/cli/commands/run.py +120 -84
- claude_mpm/cli/commands/run_config_checker.py +4 -5
- claude_mpm/cli/commands/socketio_monitor.py +17 -19
- claude_mpm/cli/commands/tickets.py +92 -92
- claude_mpm/cli/parser.py +1 -5
- claude_mpm/cli/parsers/__init__.py +1 -1
- claude_mpm/cli/parsers/agent_manager_parser.py +50 -98
- claude_mpm/cli/parsers/agents_parser.py +2 -3
- claude_mpm/cli/parsers/base_parser.py +7 -5
- claude_mpm/cli/parsers/mcp_parser.py +4 -2
- claude_mpm/cli/parsers/monitor_parser.py +26 -18
- claude_mpm/cli/shared/__init__.py +10 -10
- claude_mpm/cli/shared/argument_patterns.py +57 -71
- claude_mpm/cli/shared/base_command.py +61 -53
- claude_mpm/cli/shared/error_handling.py +62 -58
- claude_mpm/cli/shared/output_formatters.py +78 -77
- claude_mpm/cli/startup_logging.py +204 -172
- claude_mpm/cli/utils.py +10 -11
- claude_mpm/cli_module/__init__.py +1 -1
- claude_mpm/cli_module/args.py +1 -1
- claude_mpm/cli_module/migration_example.py +5 -5
- claude_mpm/config/__init__.py +9 -9
- claude_mpm/config/agent_config.py +15 -14
- claude_mpm/config/experimental_features.py +4 -4
- claude_mpm/config/paths.py +0 -1
- claude_mpm/config/socketio_config.py +5 -6
- claude_mpm/constants.py +1 -2
- claude_mpm/core/__init__.py +8 -8
- claude_mpm/core/agent_name_normalizer.py +1 -1
- claude_mpm/core/agent_registry.py +20 -23
- claude_mpm/core/agent_session_manager.py +3 -3
- claude_mpm/core/base_service.py +7 -15
- claude_mpm/core/cache.py +4 -6
- claude_mpm/core/claude_runner.py +85 -113
- claude_mpm/core/config.py +43 -28
- claude_mpm/core/config_aliases.py +0 -9
- claude_mpm/core/config_constants.py +52 -30
- claude_mpm/core/constants.py +0 -1
- claude_mpm/core/container.py +18 -27
- claude_mpm/core/exceptions.py +2 -2
- claude_mpm/core/factories.py +10 -12
- claude_mpm/core/framework_loader.py +581 -280
- claude_mpm/core/hook_manager.py +26 -22
- claude_mpm/core/hook_performance_config.py +58 -47
- claude_mpm/core/injectable_service.py +1 -1
- claude_mpm/core/interactive_session.py +61 -152
- claude_mpm/core/interfaces.py +1 -100
- claude_mpm/core/lazy.py +5 -5
- claude_mpm/core/log_manager.py +587 -0
- claude_mpm/core/logger.py +125 -8
- claude_mpm/core/logging_config.py +15 -15
- claude_mpm/core/minimal_framework_loader.py +5 -8
- claude_mpm/core/oneshot_session.py +15 -33
- claude_mpm/core/optimized_agent_loader.py +4 -6
- claude_mpm/core/optimized_startup.py +2 -1
- claude_mpm/core/output_style_manager.py +147 -106
- claude_mpm/core/pm_hook_interceptor.py +0 -1
- claude_mpm/core/service_registry.py +11 -8
- claude_mpm/core/session_manager.py +1 -2
- claude_mpm/core/shared/__init__.py +1 -1
- claude_mpm/core/shared/config_loader.py +101 -97
- claude_mpm/core/shared/path_resolver.py +72 -68
- claude_mpm/core/shared/singleton_manager.py +56 -50
- claude_mpm/core/socketio_pool.py +26 -6
- claude_mpm/core/tool_access_control.py +4 -5
- claude_mpm/core/typing_utils.py +50 -59
- claude_mpm/core/unified_agent_registry.py +14 -19
- claude_mpm/core/unified_config.py +4 -6
- claude_mpm/core/unified_paths.py +197 -109
- claude_mpm/dashboard/open_dashboard.py +2 -4
- claude_mpm/experimental/cli_enhancements.py +51 -36
- claude_mpm/generators/agent_profile_generator.py +2 -4
- claude_mpm/hooks/base_hook.py +1 -2
- claude_mpm/hooks/claude_hooks/connection_pool.py +72 -26
- claude_mpm/hooks/claude_hooks/event_handlers.py +93 -38
- claude_mpm/hooks/claude_hooks/hook_handler.py +130 -76
- claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +104 -77
- claude_mpm/hooks/claude_hooks/memory_integration.py +2 -4
- claude_mpm/hooks/claude_hooks/response_tracking.py +15 -11
- claude_mpm/hooks/claude_hooks/tool_analysis.py +12 -18
- claude_mpm/hooks/memory_integration_hook.py +5 -5
- claude_mpm/hooks/tool_call_interceptor.py +1 -1
- claude_mpm/hooks/validation_hooks.py +4 -4
- claude_mpm/init.py +4 -9
- claude_mpm/models/__init__.py +2 -2
- claude_mpm/models/agent_session.py +11 -14
- claude_mpm/scripts/mcp_server.py +20 -11
- claude_mpm/scripts/mcp_wrapper.py +5 -5
- claude_mpm/scripts/mpm_doctor.py +321 -0
- claude_mpm/scripts/socketio_daemon.py +28 -25
- claude_mpm/scripts/socketio_daemon_hardened.py +298 -258
- claude_mpm/scripts/socketio_server_manager.py +116 -95
- claude_mpm/services/__init__.py +49 -49
- claude_mpm/services/agent_capabilities_service.py +12 -18
- claude_mpm/services/agents/__init__.py +22 -22
- claude_mpm/services/agents/agent_builder.py +140 -119
- claude_mpm/services/agents/deployment/__init__.py +3 -3
- claude_mpm/services/agents/deployment/agent_config_provider.py +9 -9
- claude_mpm/services/agents/deployment/agent_configuration_manager.py +19 -20
- claude_mpm/services/agents/deployment/agent_definition_factory.py +1 -5
- claude_mpm/services/agents/deployment/agent_deployment.py +136 -106
- claude_mpm/services/agents/deployment/agent_discovery_service.py +4 -8
- claude_mpm/services/agents/deployment/agent_environment_manager.py +2 -7
- claude_mpm/services/agents/deployment/agent_filesystem_manager.py +6 -10
- claude_mpm/services/agents/deployment/agent_format_converter.py +11 -15
- claude_mpm/services/agents/deployment/agent_frontmatter_validator.py +2 -3
- claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +5 -5
- claude_mpm/services/agents/deployment/agent_metrics_collector.py +13 -19
- claude_mpm/services/agents/deployment/agent_restore_handler.py +0 -1
- claude_mpm/services/agents/deployment/agent_template_builder.py +26 -35
- claude_mpm/services/agents/deployment/agent_validator.py +0 -1
- claude_mpm/services/agents/deployment/agent_version_manager.py +7 -9
- claude_mpm/services/agents/deployment/agent_versioning.py +3 -3
- claude_mpm/services/agents/deployment/agents_directory_resolver.py +6 -7
- claude_mpm/services/agents/deployment/async_agent_deployment.py +51 -38
- claude_mpm/services/agents/deployment/config/__init__.py +1 -1
- claude_mpm/services/agents/deployment/config/deployment_config.py +7 -8
- claude_mpm/services/agents/deployment/deployment_type_detector.py +1 -1
- claude_mpm/services/agents/deployment/deployment_wrapper.py +18 -18
- claude_mpm/services/agents/deployment/facade/__init__.py +1 -1
- claude_mpm/services/agents/deployment/facade/deployment_executor.py +0 -3
- claude_mpm/services/agents/deployment/facade/deployment_facade.py +3 -4
- claude_mpm/services/agents/deployment/interface_adapter.py +5 -7
- claude_mpm/services/agents/deployment/multi_source_deployment_service.py +345 -276
- claude_mpm/services/agents/deployment/pipeline/__init__.py +2 -2
- claude_mpm/services/agents/deployment/pipeline/pipeline_builder.py +1 -1
- claude_mpm/services/agents/deployment/pipeline/pipeline_context.py +6 -4
- claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +3 -3
- claude_mpm/services/agents/deployment/pipeline/steps/__init__.py +2 -2
- claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +14 -13
- claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +0 -1
- claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +1 -1
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +8 -9
- claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +1 -1
- claude_mpm/services/agents/deployment/processors/__init__.py +1 -1
- claude_mpm/services/agents/deployment/processors/agent_processor.py +20 -16
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +5 -12
- claude_mpm/services/agents/deployment/results/__init__.py +1 -1
- claude_mpm/services/agents/deployment/results/deployment_result_builder.py +1 -1
- claude_mpm/services/agents/deployment/strategies/__init__.py +2 -2
- claude_mpm/services/agents/deployment/strategies/base_strategy.py +1 -7
- claude_mpm/services/agents/deployment/strategies/project_strategy.py +1 -4
- claude_mpm/services/agents/deployment/strategies/system_strategy.py +2 -3
- claude_mpm/services/agents/deployment/strategies/user_strategy.py +3 -7
- claude_mpm/services/agents/deployment/validation/__init__.py +1 -1
- claude_mpm/services/agents/deployment/validation/agent_validator.py +1 -1
- claude_mpm/services/agents/deployment/validation/template_validator.py +2 -2
- claude_mpm/services/agents/deployment/validation/validation_result.py +2 -6
- claude_mpm/services/agents/loading/__init__.py +1 -1
- claude_mpm/services/agents/loading/agent_profile_loader.py +6 -12
- claude_mpm/services/agents/loading/base_agent_manager.py +5 -5
- claude_mpm/services/agents/loading/framework_agent_loader.py +2 -4
- claude_mpm/services/agents/management/__init__.py +1 -1
- claude_mpm/services/agents/management/agent_capabilities_generator.py +1 -3
- claude_mpm/services/agents/management/agent_management_service.py +5 -9
- claude_mpm/services/agents/memory/__init__.py +4 -4
- claude_mpm/services/agents/memory/agent_memory_manager.py +280 -160
- claude_mpm/services/agents/memory/agent_persistence_service.py +0 -2
- claude_mpm/services/agents/memory/content_manager.py +44 -38
- claude_mpm/services/agents/memory/template_generator.py +4 -6
- claude_mpm/services/agents/registry/__init__.py +10 -6
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +30 -27
- claude_mpm/services/agents/registry/modification_tracker.py +3 -6
- claude_mpm/services/async_session_logger.py +1 -2
- claude_mpm/services/claude_session_logger.py +1 -2
- claude_mpm/services/command_deployment_service.py +173 -0
- claude_mpm/services/command_handler_service.py +20 -22
- claude_mpm/services/core/__init__.py +25 -25
- claude_mpm/services/core/base.py +0 -5
- claude_mpm/services/core/interfaces/__init__.py +32 -32
- claude_mpm/services/core/interfaces/agent.py +0 -21
- claude_mpm/services/core/interfaces/communication.py +0 -27
- claude_mpm/services/core/interfaces/infrastructure.py +0 -56
- claude_mpm/services/core/interfaces/service.py +0 -29
- claude_mpm/services/diagnostics/__init__.py +1 -1
- claude_mpm/services/diagnostics/checks/__init__.py +6 -6
- claude_mpm/services/diagnostics/checks/agent_check.py +89 -80
- claude_mpm/services/diagnostics/checks/base_check.py +12 -16
- claude_mpm/services/diagnostics/checks/claude_desktop_check.py +84 -81
- claude_mpm/services/diagnostics/checks/common_issues_check.py +99 -91
- claude_mpm/services/diagnostics/checks/configuration_check.py +82 -77
- claude_mpm/services/diagnostics/checks/filesystem_check.py +67 -68
- claude_mpm/services/diagnostics/checks/installation_check.py +254 -94
- claude_mpm/services/diagnostics/checks/mcp_check.py +90 -88
- claude_mpm/services/diagnostics/checks/monitor_check.py +75 -76
- claude_mpm/services/diagnostics/checks/startup_log_check.py +67 -73
- claude_mpm/services/diagnostics/diagnostic_runner.py +67 -59
- claude_mpm/services/diagnostics/doctor_reporter.py +107 -70
- claude_mpm/services/diagnostics/models.py +21 -19
- claude_mpm/services/event_aggregator.py +10 -17
- claude_mpm/services/event_bus/__init__.py +1 -1
- claude_mpm/services/event_bus/config.py +54 -35
- claude_mpm/services/event_bus/event_bus.py +76 -71
- claude_mpm/services/event_bus/relay.py +74 -64
- claude_mpm/services/events/__init__.py +11 -11
- claude_mpm/services/events/consumers/__init__.py +3 -3
- claude_mpm/services/events/consumers/dead_letter.py +71 -63
- claude_mpm/services/events/consumers/logging.py +39 -37
- claude_mpm/services/events/consumers/metrics.py +56 -57
- claude_mpm/services/events/consumers/socketio.py +82 -81
- claude_mpm/services/events/core.py +110 -99
- claude_mpm/services/events/interfaces.py +56 -72
- claude_mpm/services/events/producers/__init__.py +1 -1
- claude_mpm/services/events/producers/hook.py +38 -38
- claude_mpm/services/events/producers/system.py +46 -44
- claude_mpm/services/exceptions.py +81 -80
- claude_mpm/services/framework_claude_md_generator/__init__.py +2 -4
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +3 -5
- claude_mpm/services/framework_claude_md_generator/content_validator.py +1 -1
- claude_mpm/services/framework_claude_md_generator/deployment_manager.py +4 -4
- claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +0 -1
- claude_mpm/services/framework_claude_md_generator/section_generators/agents.py +0 -2
- claude_mpm/services/framework_claude_md_generator/version_manager.py +4 -5
- claude_mpm/services/hook_service.py +6 -9
- claude_mpm/services/infrastructure/__init__.py +1 -1
- claude_mpm/services/infrastructure/context_preservation.py +8 -12
- claude_mpm/services/infrastructure/monitoring.py +21 -23
- claude_mpm/services/mcp_gateway/__init__.py +37 -37
- claude_mpm/services/mcp_gateway/auto_configure.py +95 -103
- claude_mpm/services/mcp_gateway/config/__init__.py +1 -1
- claude_mpm/services/mcp_gateway/config/config_loader.py +23 -25
- claude_mpm/services/mcp_gateway/config/config_schema.py +5 -5
- claude_mpm/services/mcp_gateway/config/configuration.py +9 -6
- claude_mpm/services/mcp_gateway/core/__init__.py +10 -10
- claude_mpm/services/mcp_gateway/core/base.py +0 -3
- claude_mpm/services/mcp_gateway/core/interfaces.py +1 -38
- claude_mpm/services/mcp_gateway/core/process_pool.py +99 -93
- claude_mpm/services/mcp_gateway/core/singleton_manager.py +65 -62
- claude_mpm/services/mcp_gateway/core/startup_verification.py +75 -74
- claude_mpm/services/mcp_gateway/main.py +2 -1
- claude_mpm/services/mcp_gateway/registry/service_registry.py +5 -8
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +1 -1
- claude_mpm/services/mcp_gateway/server/__init__.py +1 -1
- claude_mpm/services/mcp_gateway/server/mcp_gateway.py +12 -19
- claude_mpm/services/mcp_gateway/server/stdio_handler.py +4 -3
- claude_mpm/services/mcp_gateway/server/stdio_server.py +79 -71
- claude_mpm/services/mcp_gateway/tools/__init__.py +2 -2
- claude_mpm/services/mcp_gateway/tools/base_adapter.py +5 -6
- claude_mpm/services/mcp_gateway/tools/document_summarizer.py +13 -22
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +79 -78
- claude_mpm/services/mcp_gateway/tools/hello_world.py +12 -14
- claude_mpm/services/mcp_gateway/tools/ticket_tools.py +42 -49
- claude_mpm/services/mcp_gateway/tools/unified_ticket_tool.py +51 -55
- claude_mpm/services/memory/__init__.py +3 -3
- claude_mpm/services/memory/builder.py +3 -6
- claude_mpm/services/memory/cache/__init__.py +1 -1
- claude_mpm/services/memory/cache/shared_prompt_cache.py +3 -5
- claude_mpm/services/memory/cache/simple_cache.py +1 -1
- claude_mpm/services/memory/indexed_memory.py +5 -7
- claude_mpm/services/memory/optimizer.py +7 -10
- claude_mpm/services/memory/router.py +8 -9
- claude_mpm/services/memory_hook_service.py +48 -34
- claude_mpm/services/monitor_build_service.py +77 -73
- claude_mpm/services/port_manager.py +130 -108
- claude_mpm/services/project/analyzer.py +12 -10
- claude_mpm/services/project/registry.py +11 -11
- claude_mpm/services/recovery_manager.py +10 -19
- claude_mpm/services/response_tracker.py +0 -1
- claude_mpm/services/runner_configuration_service.py +19 -20
- claude_mpm/services/session_management_service.py +7 -11
- claude_mpm/services/shared/__init__.py +1 -1
- claude_mpm/services/shared/async_service_base.py +58 -50
- claude_mpm/services/shared/config_service_base.py +73 -67
- claude_mpm/services/shared/lifecycle_service_base.py +82 -78
- claude_mpm/services/shared/manager_base.py +94 -82
- claude_mpm/services/shared/service_factory.py +96 -98
- claude_mpm/services/socketio/__init__.py +3 -3
- claude_mpm/services/socketio/client_proxy.py +5 -5
- claude_mpm/services/socketio/event_normalizer.py +199 -181
- claude_mpm/services/socketio/handlers/__init__.py +3 -3
- claude_mpm/services/socketio/handlers/base.py +5 -4
- claude_mpm/services/socketio/handlers/connection.py +163 -136
- claude_mpm/services/socketio/handlers/file.py +13 -14
- claude_mpm/services/socketio/handlers/git.py +12 -7
- claude_mpm/services/socketio/handlers/hook.py +49 -44
- claude_mpm/services/socketio/handlers/memory.py +0 -1
- claude_mpm/services/socketio/handlers/project.py +0 -1
- claude_mpm/services/socketio/handlers/registry.py +37 -19
- claude_mpm/services/socketio/migration_utils.py +98 -84
- claude_mpm/services/socketio/server/__init__.py +1 -1
- claude_mpm/services/socketio/server/broadcaster.py +81 -87
- claude_mpm/services/socketio/server/core.py +65 -54
- claude_mpm/services/socketio/server/eventbus_integration.py +95 -56
- claude_mpm/services/socketio/server/main.py +64 -38
- claude_mpm/services/socketio_client_manager.py +10 -12
- claude_mpm/services/subprocess_launcher_service.py +4 -7
- claude_mpm/services/system_instructions_service.py +13 -14
- claude_mpm/services/ticket_manager.py +2 -2
- claude_mpm/services/utility_service.py +5 -13
- claude_mpm/services/version_control/__init__.py +16 -16
- claude_mpm/services/version_control/branch_strategy.py +5 -8
- claude_mpm/services/version_control/conflict_resolution.py +9 -23
- claude_mpm/services/version_control/git_operations.py +5 -7
- claude_mpm/services/version_control/semantic_versioning.py +16 -17
- claude_mpm/services/version_control/version_parser.py +13 -18
- claude_mpm/services/version_service.py +10 -11
- claude_mpm/storage/__init__.py +1 -1
- claude_mpm/storage/state_storage.py +22 -28
- claude_mpm/utils/__init__.py +6 -6
- claude_mpm/utils/agent_dependency_loader.py +47 -33
- claude_mpm/utils/config_manager.py +11 -14
- claude_mpm/utils/dependency_cache.py +1 -1
- claude_mpm/utils/dependency_manager.py +13 -17
- claude_mpm/utils/dependency_strategies.py +8 -10
- claude_mpm/utils/environment_context.py +3 -9
- claude_mpm/utils/error_handler.py +3 -13
- claude_mpm/utils/file_utils.py +1 -1
- claude_mpm/utils/path_operations.py +8 -12
- claude_mpm/utils/robust_installer.py +110 -33
- claude_mpm/utils/subprocess_utils.py +5 -6
- claude_mpm/validation/agent_validator.py +3 -6
- claude_mpm/validation/frontmatter_validator.py +1 -1
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/METADATA +1 -1
- claude_mpm-4.1.2.dist-info/RECORD +498 -0
- claude_mpm-4.1.0.dist-info/RECORD +0 -494
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ DESIGN DECISIONS:
|
|
|
14
14
|
|
|
15
15
|
import json
|
|
16
16
|
from pathlib import Path
|
|
17
|
-
from typing import
|
|
17
|
+
from typing import Any, Dict
|
|
18
18
|
|
|
19
19
|
import yaml
|
|
20
20
|
from rich.panel import Panel
|
|
@@ -23,7 +23,10 @@ from rich.table import Table
|
|
|
23
23
|
|
|
24
24
|
from ...core.config import Config
|
|
25
25
|
from ...utils.console import console
|
|
26
|
-
from ..shared import
|
|
26
|
+
from ..shared import (
|
|
27
|
+
BaseCommand,
|
|
28
|
+
CommandResult,
|
|
29
|
+
)
|
|
27
30
|
|
|
28
31
|
|
|
29
32
|
class ConfigCommand(BaseCommand):
|
|
@@ -34,7 +37,7 @@ class ConfigCommand(BaseCommand):
|
|
|
34
37
|
|
|
35
38
|
def validate_args(self, args) -> str:
|
|
36
39
|
"""Validate command arguments."""
|
|
37
|
-
if not hasattr(args,
|
|
40
|
+
if not hasattr(args, "config_command") or not args.config_command:
|
|
38
41
|
return "No config command specified"
|
|
39
42
|
|
|
40
43
|
valid_commands = ["validate", "view", "status"]
|
|
@@ -47,31 +50,35 @@ class ConfigCommand(BaseCommand):
|
|
|
47
50
|
"""Execute the configuration command."""
|
|
48
51
|
if args.config_command == "validate":
|
|
49
52
|
return self._validate_config(args)
|
|
50
|
-
|
|
53
|
+
if args.config_command == "view":
|
|
51
54
|
return self._view_config(args)
|
|
52
|
-
|
|
55
|
+
if args.config_command == "status":
|
|
53
56
|
return self._show_config_status(args)
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
return CommandResult.error_result(
|
|
58
|
+
f"Unknown config command: {args.config_command}"
|
|
59
|
+
)
|
|
56
60
|
|
|
57
61
|
def _validate_config(self, args) -> CommandResult:
|
|
58
62
|
"""Validate configuration file."""
|
|
59
|
-
config_file = getattr(args,
|
|
63
|
+
config_file = getattr(args, "config_file", None) or Path(
|
|
64
|
+
".claude-mpm/configuration.yaml"
|
|
65
|
+
)
|
|
60
66
|
|
|
61
67
|
# Check if file exists
|
|
62
68
|
if not config_file.exists():
|
|
63
69
|
error_msg = f"Configuration file not found: {config_file}"
|
|
64
|
-
suggestion =
|
|
70
|
+
suggestion = (
|
|
71
|
+
f"Create with: mkdir -p {config_file.parent} && touch {config_file}"
|
|
72
|
+
)
|
|
65
73
|
|
|
66
|
-
if getattr(args,
|
|
74
|
+
if getattr(args, "format", "text") in ["json", "yaml"]:
|
|
67
75
|
return CommandResult.error_result(
|
|
68
76
|
error_msg,
|
|
69
|
-
data={"suggestion": suggestion, "config_file": str(config_file)}
|
|
77
|
+
data={"suggestion": suggestion, "config_file": str(config_file)},
|
|
70
78
|
)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return CommandResult.error_result(error_msg)
|
|
79
|
+
console.print(f"[red]✗ {error_msg}[/red]")
|
|
80
|
+
console.print(f"[yellow]→ {suggestion}[/yellow]")
|
|
81
|
+
return CommandResult.error_result(error_msg)
|
|
75
82
|
|
|
76
83
|
try:
|
|
77
84
|
# Load and validate configuration
|
|
@@ -90,74 +97,89 @@ class ConfigCommand(BaseCommand):
|
|
|
90
97
|
"errors": errors,
|
|
91
98
|
"warnings": warnings,
|
|
92
99
|
"error_count": len(errors),
|
|
93
|
-
"warning_count": len(warnings)
|
|
100
|
+
"warning_count": len(warnings),
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
# Handle output format
|
|
97
|
-
output_format = getattr(args,
|
|
98
|
-
if output_format in [
|
|
104
|
+
output_format = getattr(args, "format", "text")
|
|
105
|
+
if output_format in ["json", "yaml"]:
|
|
99
106
|
if is_valid and not warnings:
|
|
100
|
-
return CommandResult.success_result(
|
|
101
|
-
|
|
107
|
+
return CommandResult.success_result(
|
|
108
|
+
"Configuration is valid", data=result_data
|
|
109
|
+
)
|
|
110
|
+
if is_valid and warnings:
|
|
102
111
|
message = f"Configuration is valid with {len(warnings)} warning(s)"
|
|
103
|
-
exit_code = 2 if getattr(args,
|
|
104
|
-
return CommandResult(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
data=result_data
|
|
112
|
+
exit_code = 2 if getattr(args, "strict", False) else 0
|
|
113
|
+
return CommandResult(
|
|
114
|
+
success=True,
|
|
115
|
+
exit_code=exit_code,
|
|
116
|
+
message=message,
|
|
117
|
+
data=result_data,
|
|
109
118
|
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
119
|
+
return CommandResult.error_result(
|
|
120
|
+
f"Configuration validation failed with {len(errors)} error(s)",
|
|
121
|
+
data=result_data,
|
|
122
|
+
)
|
|
123
|
+
# Rich console output for text format
|
|
124
|
+
console.print(
|
|
125
|
+
f"\n[bold blue]Validating configuration: {config_file}[/bold blue]\n"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
if errors:
|
|
129
|
+
console.print("[bold red]ERRORS:[/bold red]")
|
|
130
|
+
for error in errors:
|
|
131
|
+
console.print(f" [red]✗ {error}[/red]")
|
|
132
|
+
|
|
133
|
+
if warnings:
|
|
134
|
+
console.print("\n[bold yellow]WARNINGS:[/bold yellow]")
|
|
135
|
+
for warning in warnings:
|
|
136
|
+
console.print(f" [yellow]⚠ {warning}[/yellow]")
|
|
137
|
+
|
|
138
|
+
# Show summary
|
|
139
|
+
if is_valid and not warnings:
|
|
140
|
+
console.print("\n[green]✓ Configuration is valid[/green]")
|
|
141
|
+
return CommandResult.success_result("Configuration is valid")
|
|
142
|
+
if is_valid and warnings:
|
|
143
|
+
console.print(
|
|
144
|
+
f"\n[green]✓ Configuration is valid with {len(warnings)} warning(s)[/green]"
|
|
145
|
+
)
|
|
146
|
+
exit_code = 2 if getattr(args, "strict", False) else 0
|
|
147
|
+
return CommandResult(
|
|
148
|
+
success=True,
|
|
149
|
+
exit_code=exit_code,
|
|
150
|
+
message="Configuration valid with warnings",
|
|
151
|
+
)
|
|
152
|
+
console.print(
|
|
153
|
+
f"\n[red]✗ Configuration validation failed with {len(errors)} error(s)[/red]"
|
|
154
|
+
)
|
|
155
|
+
console.print(
|
|
156
|
+
"\n[yellow]Run 'python scripts/validate_configuration.py' for detailed analysis[/yellow]"
|
|
157
|
+
)
|
|
158
|
+
return CommandResult.error_result("Configuration validation failed")
|
|
136
159
|
|
|
137
160
|
except Exception as e:
|
|
138
161
|
self.logger.error(f"Configuration validation error: {e}", exc_info=True)
|
|
139
162
|
|
|
140
|
-
if getattr(args,
|
|
163
|
+
if getattr(args, "format", "text") in ["json", "yaml"]:
|
|
141
164
|
return CommandResult.error_result(
|
|
142
165
|
f"Failed to validate configuration: {e}",
|
|
143
|
-
data={"config_file": str(config_file), "exception": str(e)}
|
|
166
|
+
data={"config_file": str(config_file), "exception": str(e)},
|
|
144
167
|
)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return CommandResult.error_result(f"Failed to validate configuration: {e}")
|
|
168
|
+
console.print(f"[red]Failed to validate configuration: {e}[/red]")
|
|
169
|
+
return CommandResult.error_result(f"Failed to validate configuration: {e}")
|
|
148
170
|
|
|
149
171
|
def _view_config(self, args) -> CommandResult:
|
|
150
172
|
"""View current configuration."""
|
|
151
173
|
try:
|
|
152
174
|
# Load configuration
|
|
153
|
-
config_file = getattr(args,
|
|
175
|
+
config_file = getattr(args, "config_file", None)
|
|
154
176
|
config = Config(config_file=config_file)
|
|
155
177
|
|
|
156
178
|
# Get configuration as dictionary
|
|
157
179
|
config_dict = config.to_dict()
|
|
158
180
|
|
|
159
181
|
# Filter by section if specified
|
|
160
|
-
section = getattr(args,
|
|
182
|
+
section = getattr(args, "section", None)
|
|
161
183
|
if section:
|
|
162
184
|
if section in config_dict:
|
|
163
185
|
config_dict = {section: config_dict[section]}
|
|
@@ -165,131 +187,144 @@ class ConfigCommand(BaseCommand):
|
|
|
165
187
|
error_msg = f"Section '{section}' not found in configuration"
|
|
166
188
|
available_sections = list(config_dict.keys())
|
|
167
189
|
|
|
168
|
-
if getattr(args,
|
|
190
|
+
if getattr(args, "format", "text") in ["json", "yaml"]:
|
|
169
191
|
return CommandResult.error_result(
|
|
170
|
-
error_msg,
|
|
171
|
-
data={"available_sections": available_sections}
|
|
192
|
+
error_msg, data={"available_sections": available_sections}
|
|
172
193
|
)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
194
|
+
console.print(f"[red]{error_msg}[/red]")
|
|
195
|
+
console.print(
|
|
196
|
+
f"[yellow]Available sections: {', '.join(available_sections)}[/yellow]"
|
|
197
|
+
)
|
|
198
|
+
return CommandResult.error_result(error_msg)
|
|
177
199
|
|
|
178
200
|
# Handle output format
|
|
179
|
-
output_format = getattr(args,
|
|
201
|
+
output_format = getattr(args, "format", "text")
|
|
180
202
|
|
|
181
203
|
if output_format == "json":
|
|
182
|
-
if hasattr(args,
|
|
183
|
-
# Use shared output handling
|
|
184
|
-
return CommandResult.success_result("Configuration retrieved", data=config_dict)
|
|
185
|
-
else:
|
|
186
|
-
# Direct console output with syntax highlighting
|
|
187
|
-
output = json.dumps(config_dict, indent=2)
|
|
188
|
-
syntax = Syntax(output, "json", theme="monokai", line_numbers=False)
|
|
189
|
-
console.print(syntax)
|
|
190
|
-
return CommandResult.success_result("Configuration displayed", data=config_dict)
|
|
191
|
-
|
|
192
|
-
elif output_format == "yaml":
|
|
193
|
-
if hasattr(args, 'output') and args.output:
|
|
204
|
+
if hasattr(args, "output") and args.output:
|
|
194
205
|
# Use shared output handling
|
|
195
|
-
return CommandResult.success_result(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
206
|
+
return CommandResult.success_result(
|
|
207
|
+
"Configuration retrieved", data=config_dict
|
|
208
|
+
)
|
|
209
|
+
# Direct console output with syntax highlighting
|
|
210
|
+
output = json.dumps(config_dict, indent=2)
|
|
211
|
+
syntax = Syntax(output, "json", theme="monokai", line_numbers=False)
|
|
212
|
+
console.print(syntax)
|
|
213
|
+
return CommandResult.success_result(
|
|
214
|
+
"Configuration displayed", data=config_dict
|
|
215
|
+
)
|
|
202
216
|
|
|
203
|
-
|
|
204
|
-
|
|
217
|
+
if output_format == "yaml":
|
|
218
|
+
if hasattr(args, "output") and args.output:
|
|
219
|
+
# Use shared output handling
|
|
220
|
+
return CommandResult.success_result(
|
|
221
|
+
"Configuration retrieved", data=config_dict
|
|
222
|
+
)
|
|
223
|
+
# Direct console output with syntax highlighting
|
|
224
|
+
output = yaml.dump(
|
|
225
|
+
config_dict, default_flow_style=False, sort_keys=False
|
|
226
|
+
)
|
|
227
|
+
syntax = Syntax(output, "yaml", theme="monokai", line_numbers=False)
|
|
228
|
+
console.print(syntax)
|
|
205
229
|
return CommandResult.success_result("Configuration displayed")
|
|
206
230
|
|
|
207
|
-
|
|
231
|
+
if output_format == "table":
|
|
208
232
|
self._display_config_table(config_dict)
|
|
209
233
|
return CommandResult.success_result("Configuration displayed")
|
|
210
234
|
|
|
235
|
+
# text format
|
|
236
|
+
self._display_config_table(config_dict)
|
|
237
|
+
return CommandResult.success_result("Configuration displayed")
|
|
238
|
+
|
|
211
239
|
except Exception as e:
|
|
212
240
|
self.logger.error(f"Configuration view error: {e}", exc_info=True)
|
|
213
241
|
|
|
214
|
-
if getattr(args,
|
|
242
|
+
if getattr(args, "format", "text") in ["json", "yaml"]:
|
|
215
243
|
return CommandResult.error_result(
|
|
216
|
-
f"Failed to view configuration: {e}",
|
|
217
|
-
data={"exception": str(e)}
|
|
244
|
+
f"Failed to view configuration: {e}", data={"exception": str(e)}
|
|
218
245
|
)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return CommandResult.error_result(f"Failed to view configuration: {e}")
|
|
246
|
+
console.print(f"[red]Failed to view configuration: {e}[/red]")
|
|
247
|
+
return CommandResult.error_result(f"Failed to view configuration: {e}")
|
|
222
248
|
|
|
223
249
|
def _show_config_status(self, args) -> CommandResult:
|
|
224
250
|
"""Show configuration status and health."""
|
|
225
251
|
try:
|
|
226
252
|
# Load configuration
|
|
227
|
-
config_file = getattr(args,
|
|
253
|
+
config_file = getattr(args, "config_file", None)
|
|
228
254
|
config = Config(config_file=config_file)
|
|
229
255
|
|
|
230
256
|
# Get status
|
|
231
257
|
status = config.get_configuration_status()
|
|
232
258
|
|
|
233
259
|
# Handle output format
|
|
234
|
-
output_format = getattr(args,
|
|
260
|
+
output_format = getattr(args, "format", "text")
|
|
235
261
|
|
|
236
|
-
if output_format in [
|
|
262
|
+
if output_format in ["json", "yaml"]:
|
|
237
263
|
# Structured output
|
|
238
264
|
result_data = status.copy()
|
|
239
265
|
|
|
240
266
|
# Add response logging details if requested
|
|
241
|
-
if getattr(args,
|
|
242
|
-
result_data[
|
|
267
|
+
if getattr(args, "check_response_logging", False):
|
|
268
|
+
result_data["response_logging_config"] = config.get(
|
|
269
|
+
"response_logging", {}
|
|
270
|
+
)
|
|
243
271
|
|
|
244
272
|
if status["valid"]:
|
|
245
|
-
return CommandResult.success_result(
|
|
246
|
-
|
|
247
|
-
|
|
273
|
+
return CommandResult.success_result(
|
|
274
|
+
"Configuration status retrieved", data=result_data
|
|
275
|
+
)
|
|
276
|
+
return CommandResult.error_result(
|
|
277
|
+
"Configuration has issues", data=result_data
|
|
278
|
+
)
|
|
248
279
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
self._display_status_panel(status)
|
|
280
|
+
# Rich console output for text format
|
|
281
|
+
self._display_status_panel(status)
|
|
252
282
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
283
|
+
# Show detailed errors/warnings if verbose
|
|
284
|
+
if getattr(args, "verbose", False):
|
|
285
|
+
self._display_detailed_status(status)
|
|
256
286
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
287
|
+
# Check response logging specifically
|
|
288
|
+
if getattr(args, "check_response_logging", False):
|
|
289
|
+
self._display_response_logging_config(config)
|
|
260
290
|
|
|
261
|
-
|
|
291
|
+
return (
|
|
292
|
+
CommandResult.success_result("Configuration status displayed")
|
|
293
|
+
if status["valid"]
|
|
294
|
+
else CommandResult.error_result("Configuration has issues")
|
|
295
|
+
)
|
|
262
296
|
|
|
263
297
|
except Exception as e:
|
|
264
298
|
self.logger.error(f"Configuration status error: {e}", exc_info=True)
|
|
265
299
|
|
|
266
|
-
if getattr(args,
|
|
300
|
+
if getattr(args, "format", "text") in ["json", "yaml"]:
|
|
267
301
|
return CommandResult.error_result(
|
|
268
302
|
f"Failed to get configuration status: {e}",
|
|
269
|
-
data={"exception": str(e)}
|
|
303
|
+
data={"exception": str(e)},
|
|
270
304
|
)
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
305
|
+
console.print(f"[red]Failed to get configuration status: {e}[/red]")
|
|
306
|
+
return CommandResult.error_result(
|
|
307
|
+
f"Failed to get configuration status: {e}"
|
|
308
|
+
)
|
|
274
309
|
|
|
275
310
|
def _display_status_panel(self, status: Dict[str, Any]) -> None:
|
|
276
311
|
"""Display configuration status panel."""
|
|
277
312
|
panel_content = []
|
|
278
313
|
|
|
279
314
|
# Basic info
|
|
280
|
-
panel_content.append(
|
|
315
|
+
panel_content.append("[bold]Configuration Status[/bold]")
|
|
281
316
|
panel_content.append(f"Valid: {'✓' if status.get('valid', False) else '✗'}")
|
|
282
317
|
panel_content.append(f"Loaded from: {status.get('loaded_from', 'defaults')}")
|
|
283
318
|
panel_content.append(f"Total keys: {status.get('key_count', 'unknown')}")
|
|
284
319
|
|
|
285
320
|
# Feature status (only if available)
|
|
286
|
-
if
|
|
321
|
+
if "response_logging_enabled" in status or "memory_enabled" in status:
|
|
287
322
|
panel_content.append("\n[bold]Features:[/bold]")
|
|
288
|
-
if
|
|
323
|
+
if "response_logging_enabled" in status:
|
|
289
324
|
panel_content.append(
|
|
290
325
|
f"Response Logging: {'✓ Enabled' if status['response_logging_enabled'] else '✗ Disabled'}"
|
|
291
326
|
)
|
|
292
|
-
if
|
|
327
|
+
if "memory_enabled" in status:
|
|
293
328
|
panel_content.append(
|
|
294
329
|
f"Memory System: {'✓ Enabled' if status['memory_enabled'] else '✗ Disabled'}"
|
|
295
330
|
)
|
|
@@ -298,7 +333,9 @@ class ConfigCommand(BaseCommand):
|
|
|
298
333
|
if status.get("errors"):
|
|
299
334
|
panel_content.append(f"\n[red]Errors: {len(status['errors'])}[/red]")
|
|
300
335
|
if status.get("warnings"):
|
|
301
|
-
panel_content.append(
|
|
336
|
+
panel_content.append(
|
|
337
|
+
f"\n[yellow]Warnings: {len(status['warnings'])}[/yellow]"
|
|
338
|
+
)
|
|
302
339
|
|
|
303
340
|
# Display panel
|
|
304
341
|
panel = Panel(
|
|
@@ -336,9 +373,7 @@ class ConfigCommand(BaseCommand):
|
|
|
336
373
|
"Session Directory",
|
|
337
374
|
rl_config.get("session_directory", ".claude-mpm/responses"),
|
|
338
375
|
)
|
|
339
|
-
table.add_row(
|
|
340
|
-
"Compression", str(rl_config.get("enable_compression", False))
|
|
341
|
-
)
|
|
376
|
+
table.add_row("Compression", str(rl_config.get("enable_compression", False)))
|
|
342
377
|
|
|
343
378
|
console.print(table)
|
|
344
379
|
|
|
@@ -394,7 +429,7 @@ def manage_config(args) -> int:
|
|
|
394
429
|
result = command.execute(args)
|
|
395
430
|
|
|
396
431
|
# Print result if not already handled
|
|
397
|
-
if hasattr(args,
|
|
432
|
+
if hasattr(args, "format") and args.format in ["json", "yaml"]:
|
|
398
433
|
command.print_result(result, args)
|
|
399
434
|
|
|
400
435
|
return result.exit_code
|