claude-mpm 4.7.4__py3-none-any.whl → 4.18.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/VERSION +1 -1
- claude_mpm/agents/BASE_AGENT_TEMPLATE.md +118 -0
- claude_mpm/agents/BASE_ENGINEER.md +286 -0
- claude_mpm/agents/BASE_PM.md +106 -1
- claude_mpm/agents/OUTPUT_STYLE.md +329 -11
- claude_mpm/agents/PM_INSTRUCTIONS.md +397 -459
- claude_mpm/agents/agent_loader.py +17 -5
- claude_mpm/agents/frontmatter_validator.py +284 -253
- claude_mpm/agents/templates/README.md +465 -0
- claude_mpm/agents/templates/agent-manager.json +4 -1
- claude_mpm/agents/templates/agentic-coder-optimizer.json +13 -3
- claude_mpm/agents/templates/api_qa.json +11 -2
- claude_mpm/agents/templates/circuit_breakers.md +638 -0
- claude_mpm/agents/templates/clerk-ops.json +12 -2
- claude_mpm/agents/templates/code_analyzer.json +8 -2
- claude_mpm/agents/templates/content-agent.json +358 -0
- claude_mpm/agents/templates/dart_engineer.json +15 -2
- claude_mpm/agents/templates/data_engineer.json +15 -2
- claude_mpm/agents/templates/documentation.json +10 -2
- claude_mpm/agents/templates/engineer.json +21 -1
- claude_mpm/agents/templates/gcp_ops_agent.json +12 -2
- claude_mpm/agents/templates/git_file_tracking.md +584 -0
- claude_mpm/agents/templates/golang_engineer.json +270 -0
- claude_mpm/agents/templates/imagemagick.json +4 -1
- claude_mpm/agents/templates/java_engineer.json +346 -0
- claude_mpm/agents/templates/local_ops_agent.json +1227 -6
- claude_mpm/agents/templates/memory_manager.json +4 -1
- claude_mpm/agents/templates/nextjs_engineer.json +141 -133
- claude_mpm/agents/templates/ops.json +12 -2
- claude_mpm/agents/templates/php-engineer.json +270 -174
- claude_mpm/agents/templates/pm_examples.md +474 -0
- claude_mpm/agents/templates/pm_red_flags.md +240 -0
- claude_mpm/agents/templates/product_owner.json +338 -0
- claude_mpm/agents/templates/project_organizer.json +14 -4
- claude_mpm/agents/templates/prompt-engineer.json +13 -2
- claude_mpm/agents/templates/python_engineer.json +174 -81
- claude_mpm/agents/templates/qa.json +11 -2
- claude_mpm/agents/templates/react_engineer.json +16 -3
- claude_mpm/agents/templates/refactoring_engineer.json +12 -2
- claude_mpm/agents/templates/research.json +34 -21
- claude_mpm/agents/templates/response_format.md +583 -0
- claude_mpm/agents/templates/ruby-engineer.json +129 -192
- claude_mpm/agents/templates/rust_engineer.json +270 -0
- claude_mpm/agents/templates/security.json +10 -2
- claude_mpm/agents/templates/svelte-engineer.json +225 -0
- claude_mpm/agents/templates/ticketing.json +10 -2
- claude_mpm/agents/templates/typescript_engineer.json +116 -125
- claude_mpm/agents/templates/validation_templates.md +312 -0
- claude_mpm/agents/templates/vercel_ops_agent.json +12 -2
- claude_mpm/agents/templates/version_control.json +12 -2
- claude_mpm/agents/templates/web_qa.json +11 -2
- claude_mpm/agents/templates/web_ui.json +15 -2
- claude_mpm/cli/__init__.py +34 -614
- claude_mpm/cli/commands/agent_manager.py +25 -12
- claude_mpm/cli/commands/agent_state_manager.py +186 -0
- claude_mpm/cli/commands/agents.py +235 -148
- claude_mpm/cli/commands/agents_detect.py +380 -0
- claude_mpm/cli/commands/agents_recommend.py +309 -0
- claude_mpm/cli/commands/aggregate.py +7 -3
- claude_mpm/cli/commands/analyze.py +9 -4
- claude_mpm/cli/commands/analyze_code.py +7 -2
- claude_mpm/cli/commands/auto_configure.py +570 -0
- claude_mpm/cli/commands/config.py +47 -13
- claude_mpm/cli/commands/configure.py +419 -1571
- claude_mpm/cli/commands/configure_agent_display.py +261 -0
- claude_mpm/cli/commands/configure_behavior_manager.py +204 -0
- claude_mpm/cli/commands/configure_hook_manager.py +225 -0
- claude_mpm/cli/commands/configure_models.py +18 -0
- claude_mpm/cli/commands/configure_navigation.py +167 -0
- claude_mpm/cli/commands/configure_paths.py +104 -0
- claude_mpm/cli/commands/configure_persistence.py +254 -0
- claude_mpm/cli/commands/configure_startup_manager.py +646 -0
- claude_mpm/cli/commands/configure_template_editor.py +497 -0
- claude_mpm/cli/commands/configure_validators.py +73 -0
- claude_mpm/cli/commands/local_deploy.py +537 -0
- claude_mpm/cli/commands/memory.py +54 -20
- claude_mpm/cli/commands/mpm_init.py +585 -196
- claude_mpm/cli/commands/mpm_init_handler.py +37 -3
- claude_mpm/cli/commands/search.py +170 -4
- claude_mpm/cli/commands/upgrade.py +152 -0
- claude_mpm/cli/executor.py +202 -0
- claude_mpm/cli/helpers.py +105 -0
- claude_mpm/cli/interactive/__init__.py +3 -0
- claude_mpm/cli/interactive/skills_wizard.py +491 -0
- claude_mpm/cli/parsers/__init__.py +7 -1
- claude_mpm/cli/parsers/agents_parser.py +9 -0
- claude_mpm/cli/parsers/auto_configure_parser.py +245 -0
- claude_mpm/cli/parsers/base_parser.py +110 -3
- claude_mpm/cli/parsers/local_deploy_parser.py +227 -0
- claude_mpm/cli/parsers/mpm_init_parser.py +65 -5
- claude_mpm/cli/shared/output_formatters.py +28 -19
- claude_mpm/cli/startup.py +481 -0
- claude_mpm/cli/utils.py +52 -1
- claude_mpm/commands/mpm-agents-detect.md +168 -0
- claude_mpm/commands/mpm-agents-recommend.md +214 -0
- claude_mpm/commands/mpm-agents.md +75 -1
- claude_mpm/commands/mpm-auto-configure.md +217 -0
- claude_mpm/commands/mpm-help.md +163 -0
- claude_mpm/commands/mpm-init.md +148 -3
- claude_mpm/commands/mpm-version.md +113 -0
- claude_mpm/commands/mpm.md +1 -0
- claude_mpm/config/agent_config.py +2 -2
- claude_mpm/config/model_config.py +428 -0
- claude_mpm/constants.py +1 -0
- claude_mpm/core/base_service.py +13 -12
- claude_mpm/core/enums.py +452 -0
- claude_mpm/core/factories.py +1 -1
- claude_mpm/core/instruction_reinforcement_hook.py +2 -1
- claude_mpm/core/interactive_session.py +9 -3
- claude_mpm/core/log_manager.py +2 -0
- claude_mpm/core/logging_config.py +6 -2
- claude_mpm/core/oneshot_session.py +8 -4
- claude_mpm/core/optimized_agent_loader.py +3 -3
- claude_mpm/core/output_style_manager.py +12 -192
- claude_mpm/core/service_registry.py +5 -1
- claude_mpm/core/types.py +2 -9
- claude_mpm/core/typing_utils.py +7 -6
- claude_mpm/dashboard/static/js/dashboard.js +0 -14
- claude_mpm/dashboard/templates/index.html +3 -41
- claude_mpm/hooks/__init__.py +20 -0
- claude_mpm/hooks/claude_hooks/event_handlers.py +4 -2
- claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
- claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +23 -2
- claude_mpm/hooks/failure_learning/__init__.py +60 -0
- claude_mpm/hooks/failure_learning/failure_detection_hook.py +235 -0
- claude_mpm/hooks/failure_learning/fix_detection_hook.py +217 -0
- claude_mpm/hooks/failure_learning/learning_extraction_hook.py +286 -0
- claude_mpm/hooks/instruction_reinforcement.py +7 -2
- claude_mpm/hooks/kuzu_enrichment_hook.py +263 -0
- claude_mpm/hooks/kuzu_memory_hook.py +37 -12
- claude_mpm/hooks/kuzu_response_hook.py +183 -0
- claude_mpm/models/resume_log.py +340 -0
- claude_mpm/services/agents/__init__.py +18 -5
- claude_mpm/services/agents/auto_config_manager.py +796 -0
- claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
- claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
- claude_mpm/services/agents/deployment/agent_validator.py +17 -1
- claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
- claude_mpm/services/agents/deployment/interface_adapter.py +3 -2
- claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
- claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +7 -6
- claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +7 -16
- claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +4 -3
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +5 -3
- claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +6 -5
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +9 -6
- claude_mpm/services/agents/deployment/validation/__init__.py +3 -1
- claude_mpm/services/agents/deployment/validation/validation_result.py +1 -9
- claude_mpm/services/agents/local_template_manager.py +1 -1
- claude_mpm/services/agents/memory/agent_memory_manager.py +5 -2
- claude_mpm/services/agents/observers.py +547 -0
- claude_mpm/services/agents/recommender.py +568 -0
- claude_mpm/services/agents/registry/modification_tracker.py +5 -2
- claude_mpm/services/command_handler_service.py +11 -5
- claude_mpm/services/core/__init__.py +33 -1
- claude_mpm/services/core/interfaces/__init__.py +90 -3
- claude_mpm/services/core/interfaces/agent.py +184 -0
- claude_mpm/services/core/interfaces/health.py +172 -0
- claude_mpm/services/core/interfaces/model.py +281 -0
- claude_mpm/services/core/interfaces/process.py +372 -0
- claude_mpm/services/core/interfaces/project.py +121 -0
- claude_mpm/services/core/interfaces/restart.py +307 -0
- claude_mpm/services/core/interfaces/stability.py +260 -0
- claude_mpm/services/core/memory_manager.py +11 -24
- claude_mpm/services/core/models/__init__.py +79 -0
- claude_mpm/services/core/models/agent_config.py +381 -0
- claude_mpm/services/core/models/health.py +162 -0
- claude_mpm/services/core/models/process.py +235 -0
- claude_mpm/services/core/models/restart.py +302 -0
- claude_mpm/services/core/models/stability.py +264 -0
- claude_mpm/services/core/models/toolchain.py +306 -0
- claude_mpm/services/core/path_resolver.py +23 -7
- claude_mpm/services/diagnostics/__init__.py +2 -2
- claude_mpm/services/diagnostics/checks/agent_check.py +25 -24
- claude_mpm/services/diagnostics/checks/claude_code_check.py +24 -23
- claude_mpm/services/diagnostics/checks/common_issues_check.py +25 -24
- claude_mpm/services/diagnostics/checks/configuration_check.py +24 -23
- claude_mpm/services/diagnostics/checks/filesystem_check.py +18 -17
- claude_mpm/services/diagnostics/checks/installation_check.py +30 -29
- claude_mpm/services/diagnostics/checks/instructions_check.py +20 -19
- claude_mpm/services/diagnostics/checks/mcp_check.py +50 -36
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +38 -33
- claude_mpm/services/diagnostics/checks/monitor_check.py +23 -22
- claude_mpm/services/diagnostics/checks/startup_log_check.py +9 -8
- claude_mpm/services/diagnostics/diagnostic_runner.py +6 -5
- claude_mpm/services/diagnostics/doctor_reporter.py +28 -25
- claude_mpm/services/diagnostics/models.py +19 -24
- claude_mpm/services/infrastructure/monitoring/__init__.py +1 -1
- claude_mpm/services/infrastructure/monitoring/aggregator.py +12 -12
- claude_mpm/services/infrastructure/monitoring/base.py +5 -13
- claude_mpm/services/infrastructure/monitoring/network.py +7 -6
- claude_mpm/services/infrastructure/monitoring/process.py +13 -12
- claude_mpm/services/infrastructure/monitoring/resources.py +7 -6
- claude_mpm/services/infrastructure/monitoring/service.py +16 -15
- claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
- claude_mpm/services/local_ops/__init__.py +163 -0
- claude_mpm/services/local_ops/crash_detector.py +257 -0
- claude_mpm/services/local_ops/health_checks/__init__.py +28 -0
- claude_mpm/services/local_ops/health_checks/http_check.py +224 -0
- claude_mpm/services/local_ops/health_checks/process_check.py +236 -0
- claude_mpm/services/local_ops/health_checks/resource_check.py +255 -0
- claude_mpm/services/local_ops/health_manager.py +430 -0
- claude_mpm/services/local_ops/log_monitor.py +396 -0
- claude_mpm/services/local_ops/memory_leak_detector.py +294 -0
- claude_mpm/services/local_ops/process_manager.py +595 -0
- claude_mpm/services/local_ops/resource_monitor.py +331 -0
- claude_mpm/services/local_ops/restart_manager.py +401 -0
- claude_mpm/services/local_ops/restart_policy.py +387 -0
- claude_mpm/services/local_ops/state_manager.py +372 -0
- claude_mpm/services/local_ops/unified_manager.py +600 -0
- claude_mpm/services/mcp_config_manager.py +9 -4
- claude_mpm/services/mcp_gateway/core/__init__.py +1 -2
- claude_mpm/services/mcp_gateway/core/base.py +18 -31
- claude_mpm/services/mcp_gateway/main.py +30 -0
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +206 -32
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +30 -28
- claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +25 -5
- claude_mpm/services/mcp_service_verifier.py +1 -1
- claude_mpm/services/memory/failure_tracker.py +563 -0
- claude_mpm/services/memory_hook_service.py +165 -4
- claude_mpm/services/model/__init__.py +147 -0
- claude_mpm/services/model/base_provider.py +365 -0
- claude_mpm/services/model/claude_provider.py +412 -0
- claude_mpm/services/model/model_router.py +453 -0
- claude_mpm/services/model/ollama_provider.py +415 -0
- claude_mpm/services/monitor/daemon_manager.py +3 -2
- claude_mpm/services/monitor/handlers/dashboard.py +2 -1
- claude_mpm/services/monitor/handlers/hooks.py +2 -1
- claude_mpm/services/monitor/management/lifecycle.py +3 -2
- claude_mpm/services/monitor/server.py +2 -1
- claude_mpm/services/project/__init__.py +23 -0
- claude_mpm/services/project/detection_strategies.py +719 -0
- claude_mpm/services/project/toolchain_analyzer.py +581 -0
- claude_mpm/services/self_upgrade_service.py +342 -0
- claude_mpm/services/session_management_service.py +3 -2
- claude_mpm/services/session_manager.py +205 -1
- claude_mpm/services/shared/async_service_base.py +16 -27
- claude_mpm/services/shared/lifecycle_service_base.py +1 -14
- claude_mpm/services/socketio/handlers/__init__.py +5 -2
- claude_mpm/services/socketio/handlers/hook.py +13 -2
- claude_mpm/services/socketio/handlers/registry.py +4 -2
- claude_mpm/services/socketio/server/main.py +10 -8
- claude_mpm/services/subprocess_launcher_service.py +14 -5
- claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +8 -7
- claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +6 -5
- claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +8 -7
- claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +7 -6
- claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +5 -4
- claude_mpm/services/unified/config_strategies/validation_strategy.py +13 -9
- claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +10 -3
- claude_mpm/services/unified/deployment_strategies/local.py +6 -5
- claude_mpm/services/unified/deployment_strategies/utils.py +6 -5
- claude_mpm/services/unified/deployment_strategies/vercel.py +7 -6
- claude_mpm/services/unified/interfaces.py +3 -1
- claude_mpm/services/unified/unified_analyzer.py +14 -10
- claude_mpm/services/unified/unified_config.py +2 -1
- claude_mpm/services/unified/unified_deployment.py +9 -4
- claude_mpm/services/version_service.py +104 -1
- claude_mpm/skills/__init__.py +21 -0
- claude_mpm/skills/bundled/__init__.py +6 -0
- claude_mpm/skills/bundled/api-documentation.md +393 -0
- claude_mpm/skills/bundled/async-testing.md +571 -0
- claude_mpm/skills/bundled/code-review.md +143 -0
- claude_mpm/skills/bundled/database-migration.md +199 -0
- claude_mpm/skills/bundled/docker-containerization.md +194 -0
- claude_mpm/skills/bundled/express-local-dev.md +1429 -0
- claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
- claude_mpm/skills/bundled/git-workflow.md +414 -0
- claude_mpm/skills/bundled/imagemagick.md +204 -0
- claude_mpm/skills/bundled/json-data-handling.md +223 -0
- claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
- claude_mpm/skills/bundled/pdf.md +141 -0
- claude_mpm/skills/bundled/performance-profiling.md +567 -0
- claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
- claude_mpm/skills/bundled/security-scanning.md +327 -0
- claude_mpm/skills/bundled/systematic-debugging.md +473 -0
- claude_mpm/skills/bundled/test-driven-development.md +378 -0
- claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
- claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
- claude_mpm/skills/bundled/xlsx.md +157 -0
- claude_mpm/skills/registry.py +286 -0
- claude_mpm/skills/skill_manager.py +310 -0
- claude_mpm/storage/state_storage.py +15 -15
- claude_mpm/tools/code_tree_analyzer.py +177 -141
- claude_mpm/tools/code_tree_events.py +4 -2
- claude_mpm/utils/agent_dependency_loader.py +40 -20
- claude_mpm/utils/display_helper.py +260 -0
- claude_mpm/utils/git_analyzer.py +407 -0
- claude_mpm/utils/robust_installer.py +73 -19
- {claude_mpm-4.7.4.dist-info → claude_mpm-4.18.2.dist-info}/METADATA +129 -12
- {claude_mpm-4.7.4.dist-info → claude_mpm-4.18.2.dist-info}/RECORD +295 -193
- claude_mpm/dashboard/static/css/code-tree.css +0 -1639
- claude_mpm/dashboard/static/index-hub-backup.html +0 -713
- claude_mpm/dashboard/static/js/components/code-tree/tree-breadcrumb.js +0 -353
- claude_mpm/dashboard/static/js/components/code-tree/tree-constants.js +0 -235
- claude_mpm/dashboard/static/js/components/code-tree/tree-search.js +0 -409
- claude_mpm/dashboard/static/js/components/code-tree/tree-utils.js +0 -435
- claude_mpm/dashboard/static/js/components/code-tree.js +0 -5869
- claude_mpm/dashboard/static/js/components/code-viewer.js +0 -1386
- claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +0 -425
- claude_mpm/hooks/claude_hooks/hook_handler_original.py +0 -1041
- claude_mpm/hooks/claude_hooks/hook_handler_refactored.py +0 -347
- claude_mpm/services/agents/deployment/agent_lifecycle_manager_refactored.py +0 -575
- claude_mpm/services/project/analyzer_refactored.py +0 -450
- {claude_mpm-4.7.4.dist-info → claude_mpm-4.18.2.dist-info}/WHEEL +0 -0
- {claude_mpm-4.7.4.dist-info → claude_mpm-4.18.2.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.7.4.dist-info → claude_mpm-4.18.2.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.7.4.dist-info → claude_mpm-4.18.2.dist-info}/top_level.txt +0 -0
|
@@ -16,7 +16,9 @@ from .interfaces import ( # Core dependency injection; Configuration management
|
|
|
16
16
|
CacheEntry,
|
|
17
17
|
HealthStatus,
|
|
18
18
|
HookServiceInterface,
|
|
19
|
+
IAgentRecommender,
|
|
19
20
|
IAgentRegistry,
|
|
21
|
+
IAutoConfigManager,
|
|
20
22
|
ICacheService,
|
|
21
23
|
IConfigurationManager,
|
|
22
24
|
IConfigurationService,
|
|
@@ -31,6 +33,7 @@ from .interfaces import ( # Core dependency injection; Configuration management
|
|
|
31
33
|
IServiceLifecycle,
|
|
32
34
|
IStructuredLogger,
|
|
33
35
|
ITemplateManager,
|
|
36
|
+
IToolchainAnalyzer,
|
|
34
37
|
MemoryServiceInterface,
|
|
35
38
|
ProjectAnalyzerInterface,
|
|
36
39
|
ServiceType,
|
|
@@ -38,8 +41,21 @@ from .interfaces import ( # Core dependency injection; Configuration management
|
|
|
38
41
|
TemplateRenderContext,
|
|
39
42
|
TicketManagerInterface,
|
|
40
43
|
)
|
|
44
|
+
from .models import ( # Data models for services
|
|
45
|
+
AgentCapabilities,
|
|
46
|
+
AgentRecommendation,
|
|
47
|
+
ConfidenceLevel,
|
|
48
|
+
ConfigurationPreview,
|
|
49
|
+
ConfigurationResult,
|
|
50
|
+
DeploymentTarget,
|
|
51
|
+
Framework,
|
|
52
|
+
LanguageDetection,
|
|
53
|
+
ToolchainAnalysis,
|
|
54
|
+
ToolchainComponent,
|
|
55
|
+
ValidationResult,
|
|
56
|
+
)
|
|
41
57
|
|
|
42
|
-
__all__ = [
|
|
58
|
+
__all__ = [ # noqa: RUF022 - Grouped by category with comments for clarity
|
|
43
59
|
# Service interfaces
|
|
44
60
|
"AgentDeploymentInterface",
|
|
45
61
|
"AgentMetadata",
|
|
@@ -48,7 +64,9 @@ __all__ = [
|
|
|
48
64
|
"CacheEntry",
|
|
49
65
|
"HealthStatus",
|
|
50
66
|
"HookServiceInterface",
|
|
67
|
+
"IAgentRecommender",
|
|
51
68
|
"IAgentRegistry",
|
|
69
|
+
"IAutoConfigManager",
|
|
52
70
|
"ICacheService",
|
|
53
71
|
"IConfigurationManager",
|
|
54
72
|
"IConfigurationService",
|
|
@@ -63,6 +81,7 @@ __all__ = [
|
|
|
63
81
|
"IServiceLifecycle",
|
|
64
82
|
"IStructuredLogger",
|
|
65
83
|
"ITemplateManager",
|
|
84
|
+
"IToolchainAnalyzer",
|
|
66
85
|
# Registry
|
|
67
86
|
"InterfaceRegistry",
|
|
68
87
|
"MemoryServiceInterface",
|
|
@@ -73,4 +92,17 @@ __all__ = [
|
|
|
73
92
|
"SyncBaseService",
|
|
74
93
|
"TemplateRenderContext",
|
|
75
94
|
"TicketManagerInterface",
|
|
95
|
+
# Data models - Toolchain
|
|
96
|
+
"ConfidenceLevel",
|
|
97
|
+
"ToolchainComponent",
|
|
98
|
+
"LanguageDetection",
|
|
99
|
+
"Framework",
|
|
100
|
+
"DeploymentTarget",
|
|
101
|
+
"ToolchainAnalysis",
|
|
102
|
+
# Data models - Agent Configuration
|
|
103
|
+
"AgentCapabilities",
|
|
104
|
+
"AgentRecommendation",
|
|
105
|
+
"ConfigurationResult",
|
|
106
|
+
"ValidationResult",
|
|
107
|
+
"ConfigurationPreview",
|
|
76
108
|
]
|
|
@@ -24,11 +24,13 @@ MODULES:
|
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
26
|
# Agent interfaces (agent management and operations)
|
|
27
|
-
from .agent import ( # Agent registry; Agent deployment; Agent capabilities; System instructions; Subprocess management; Runner configuration
|
|
27
|
+
from .agent import ( # Agent registry; Agent deployment; Agent capabilities; System instructions; Subprocess management; Runner configuration; Agent recommendation; Auto-configuration
|
|
28
28
|
AgentCapabilitiesInterface,
|
|
29
29
|
AgentDeploymentInterface,
|
|
30
30
|
AgentMetadata,
|
|
31
|
+
IAgentRecommender,
|
|
31
32
|
IAgentRegistry,
|
|
33
|
+
IAutoConfigManager,
|
|
32
34
|
RunnerConfigurationInterface,
|
|
33
35
|
SubprocessLauncherInterface,
|
|
34
36
|
SystemInstructionsInterface,
|
|
@@ -41,6 +43,12 @@ from .communication import ( # WebSocket/SocketIO; Project analysis; Ticket man
|
|
|
41
43
|
TicketManagerInterface,
|
|
42
44
|
)
|
|
43
45
|
|
|
46
|
+
# Health interfaces (health monitoring)
|
|
47
|
+
from .health import ( # Health checks; Health monitoring
|
|
48
|
+
IHealthCheck,
|
|
49
|
+
IHealthCheckManager,
|
|
50
|
+
)
|
|
51
|
+
|
|
44
52
|
# Infrastructure interfaces (core framework services)
|
|
45
53
|
from .infrastructure import ( # Type variables; Core dependency injection; Configuration management; Caching; Health monitoring; Template management; Service factory; Logging; Service lifecycle; Error handling; Performance monitoring; Event system
|
|
46
54
|
CacheEntry,
|
|
@@ -63,6 +71,33 @@ from .infrastructure import ( # Type variables; Core dependency injection; Conf
|
|
|
63
71
|
TemplateRenderContext,
|
|
64
72
|
)
|
|
65
73
|
|
|
74
|
+
# Model interfaces (content processing and model providers)
|
|
75
|
+
from .model import ( # Model providers; Routing
|
|
76
|
+
IModelProvider,
|
|
77
|
+
IModelRouter,
|
|
78
|
+
ModelCapability,
|
|
79
|
+
ModelProvider,
|
|
80
|
+
ModelResponse,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Process interfaces (local process management)
|
|
84
|
+
from .process import ( # Process lifecycle; State persistence
|
|
85
|
+
IDeploymentStateManager,
|
|
86
|
+
ILocalProcessManager,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
# Project interfaces (project analysis and toolchain detection)
|
|
90
|
+
from .project import ( # Toolchain analysis
|
|
91
|
+
IToolchainAnalyzer,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
# Restart interfaces (auto-restart management)
|
|
95
|
+
from .restart import ( # Crash detection; Restart policy; Restart orchestration
|
|
96
|
+
ICrashDetector,
|
|
97
|
+
IRestartManager,
|
|
98
|
+
IRestartPolicy,
|
|
99
|
+
)
|
|
100
|
+
|
|
66
101
|
# Service interfaces (business services)
|
|
67
102
|
from .service import ( # Version service; Command handling; Memory management; Session management; Utilities; Hook service
|
|
68
103
|
CommandHandlerInterface,
|
|
@@ -74,6 +109,13 @@ from .service import ( # Version service; Command handling; Memory management;
|
|
|
74
109
|
VersionServiceInterface,
|
|
75
110
|
)
|
|
76
111
|
|
|
112
|
+
# Stability interfaces (proactive monitoring and crash prevention)
|
|
113
|
+
from .stability import ( # Memory leak detection; Log monitoring; Resource monitoring
|
|
114
|
+
ILogMonitor,
|
|
115
|
+
IMemoryLeakDetector,
|
|
116
|
+
IResourceMonitor,
|
|
117
|
+
)
|
|
118
|
+
|
|
77
119
|
|
|
78
120
|
# Interface registry for dependency injection discovery
|
|
79
121
|
class InterfaceRegistry:
|
|
@@ -118,6 +160,27 @@ class InterfaceRegistry:
|
|
|
118
160
|
"socketio_service": SocketIOServiceInterface,
|
|
119
161
|
"project_analyzer": ProjectAnalyzerInterface,
|
|
120
162
|
"ticket_manager": TicketManagerInterface,
|
|
163
|
+
# Project interfaces
|
|
164
|
+
"toolchain_analyzer": IToolchainAnalyzer,
|
|
165
|
+
"agent_recommender": IAgentRecommender,
|
|
166
|
+
"auto_config_manager": IAutoConfigManager,
|
|
167
|
+
# Model interfaces
|
|
168
|
+
"model_provider": IModelProvider,
|
|
169
|
+
"model_router": IModelRouter,
|
|
170
|
+
# Process interfaces
|
|
171
|
+
"deployment_state_manager": IDeploymentStateManager,
|
|
172
|
+
"local_process_manager": ILocalProcessManager,
|
|
173
|
+
# Health interfaces
|
|
174
|
+
"health_check": IHealthCheck,
|
|
175
|
+
"health_check_manager": IHealthCheckManager,
|
|
176
|
+
# Restart interfaces
|
|
177
|
+
"crash_detector": ICrashDetector,
|
|
178
|
+
"restart_policy": IRestartPolicy,
|
|
179
|
+
"restart_manager": IRestartManager,
|
|
180
|
+
# Stability interfaces
|
|
181
|
+
"memory_leak_detector": IMemoryLeakDetector,
|
|
182
|
+
"log_monitor": ILogMonitor,
|
|
183
|
+
"resource_monitor": IResourceMonitor,
|
|
121
184
|
}
|
|
122
185
|
|
|
123
186
|
@classmethod
|
|
@@ -142,7 +205,7 @@ class InterfaceRegistry:
|
|
|
142
205
|
|
|
143
206
|
|
|
144
207
|
# Re-export everything for backward compatibility
|
|
145
|
-
__all__ = [
|
|
208
|
+
__all__ = [ # noqa: RUF022 - Semantic grouping by domain preferred over alphabetical
|
|
146
209
|
"AgentCapabilitiesInterface",
|
|
147
210
|
"AgentDeploymentInterface",
|
|
148
211
|
"AgentMetadata",
|
|
@@ -151,23 +214,47 @@ __all__ = [
|
|
|
151
214
|
"HealthStatus",
|
|
152
215
|
"HookServiceInterface",
|
|
153
216
|
# Agent interfaces
|
|
217
|
+
"IAgentRecommender",
|
|
154
218
|
"IAgentRegistry",
|
|
219
|
+
"IAutoConfigManager",
|
|
155
220
|
"ICacheService",
|
|
156
221
|
"IConfigurationManager",
|
|
157
222
|
"IConfigurationService",
|
|
223
|
+
# Process interfaces
|
|
224
|
+
"IDeploymentStateManager",
|
|
158
225
|
"IErrorHandler",
|
|
159
226
|
"IEventBus",
|
|
227
|
+
# Health interfaces
|
|
228
|
+
"IHealthCheck",
|
|
229
|
+
"IHealthCheckManager",
|
|
160
230
|
"IHealthMonitor",
|
|
231
|
+
# Infrastructure interfaces
|
|
232
|
+
"ILocalProcessManager",
|
|
233
|
+
# Restart interfaces
|
|
234
|
+
"ICrashDetector",
|
|
235
|
+
"IRestartManager",
|
|
236
|
+
"IRestartPolicy",
|
|
237
|
+
# Stability interfaces
|
|
238
|
+
"IMemoryLeakDetector",
|
|
239
|
+
"ILogMonitor",
|
|
240
|
+
"IResourceMonitor",
|
|
241
|
+
# Model interfaces
|
|
242
|
+
"IModelProvider",
|
|
243
|
+
"IModelRouter",
|
|
161
244
|
"IPerformanceMonitor",
|
|
162
245
|
"IPromptCache",
|
|
163
|
-
# Infrastructure interfaces
|
|
164
246
|
"IServiceContainer",
|
|
165
247
|
"IServiceFactory",
|
|
166
248
|
"IServiceLifecycle",
|
|
167
249
|
"IStructuredLogger",
|
|
168
250
|
"ITemplateManager",
|
|
251
|
+
# Project interfaces
|
|
252
|
+
"IToolchainAnalyzer",
|
|
169
253
|
# Registry
|
|
170
254
|
"InterfaceRegistry",
|
|
255
|
+
"ModelCapability",
|
|
256
|
+
"ModelProvider",
|
|
257
|
+
"ModelResponse",
|
|
171
258
|
"MemoryHookInterface",
|
|
172
259
|
"MemoryServiceInterface",
|
|
173
260
|
"ProjectAnalyzerInterface",
|
|
@@ -21,6 +21,15 @@ from dataclasses import dataclass
|
|
|
21
21
|
from pathlib import Path
|
|
22
22
|
from typing import Any, Dict, List, Optional, Tuple
|
|
23
23
|
|
|
24
|
+
from ..models.agent_config import (
|
|
25
|
+
AgentCapabilities,
|
|
26
|
+
AgentRecommendation,
|
|
27
|
+
ConfigurationPreview,
|
|
28
|
+
ConfigurationResult,
|
|
29
|
+
ValidationResult,
|
|
30
|
+
)
|
|
31
|
+
from ..models.toolchain import ToolchainAnalysis
|
|
32
|
+
|
|
24
33
|
|
|
25
34
|
# Agent registry interface
|
|
26
35
|
@dataclass
|
|
@@ -328,3 +337,178 @@ class RunnerConfigurationInterface(ABC):
|
|
|
328
337
|
Args:
|
|
329
338
|
config: Logging configuration
|
|
330
339
|
"""
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
# Agent recommender interface
|
|
343
|
+
class IAgentRecommender(ABC):
|
|
344
|
+
"""Interface for agent recommendation operations.
|
|
345
|
+
|
|
346
|
+
WHY: Automated agent recommendation is critical for the auto-configuration
|
|
347
|
+
feature. This interface abstracts the recommendation logic to enable different
|
|
348
|
+
scoring algorithms, rule-based systems, and ML-based approaches.
|
|
349
|
+
|
|
350
|
+
DESIGN DECISION: Separates recommendation from configuration to enable
|
|
351
|
+
independent testing and different recommendation strategies (rule-based,
|
|
352
|
+
ML-based, hybrid). Returns structured recommendations with confidence scores.
|
|
353
|
+
"""
|
|
354
|
+
|
|
355
|
+
@abstractmethod
|
|
356
|
+
def recommend_agents(
|
|
357
|
+
self,
|
|
358
|
+
toolchain: ToolchainAnalysis,
|
|
359
|
+
constraints: Optional[Dict[str, Any]] = None,
|
|
360
|
+
) -> List[AgentRecommendation]:
|
|
361
|
+
"""Recommend agents based on toolchain analysis.
|
|
362
|
+
|
|
363
|
+
Analyzes the toolchain and recommends agents that best match the
|
|
364
|
+
project's technical requirements. Considers:
|
|
365
|
+
- Language compatibility
|
|
366
|
+
- Framework expertise
|
|
367
|
+
- Deployment environment requirements
|
|
368
|
+
- Optional user-defined constraints (max agents, required capabilities)
|
|
369
|
+
|
|
370
|
+
Args:
|
|
371
|
+
toolchain: Complete toolchain analysis results
|
|
372
|
+
constraints: Optional constraints for recommendations:
|
|
373
|
+
- max_agents: Maximum number of agents to recommend
|
|
374
|
+
- required_capabilities: List of required agent capabilities
|
|
375
|
+
- excluded_agents: List of agent IDs to exclude
|
|
376
|
+
- min_confidence: Minimum confidence score threshold
|
|
377
|
+
|
|
378
|
+
Returns:
|
|
379
|
+
List[AgentRecommendation]: Ordered list of recommended agents
|
|
380
|
+
with confidence scores and reasoning
|
|
381
|
+
|
|
382
|
+
Raises:
|
|
383
|
+
ValueError: If constraints are invalid or contradictory
|
|
384
|
+
"""
|
|
385
|
+
|
|
386
|
+
@abstractmethod
|
|
387
|
+
def get_agent_capabilities(self, agent_id: str) -> AgentCapabilities:
|
|
388
|
+
"""Get detailed capabilities for an agent.
|
|
389
|
+
|
|
390
|
+
Retrieves comprehensive capability information for a specific agent:
|
|
391
|
+
- Supported languages and frameworks
|
|
392
|
+
- Specialization areas
|
|
393
|
+
- Required toolchain components
|
|
394
|
+
- Performance characteristics
|
|
395
|
+
|
|
396
|
+
Args:
|
|
397
|
+
agent_id: Unique identifier of the agent
|
|
398
|
+
|
|
399
|
+
Returns:
|
|
400
|
+
AgentCapabilities: Complete capability information
|
|
401
|
+
|
|
402
|
+
Raises:
|
|
403
|
+
KeyError: If agent_id does not exist
|
|
404
|
+
"""
|
|
405
|
+
|
|
406
|
+
@abstractmethod
|
|
407
|
+
def match_score(self, agent_id: str, toolchain: ToolchainAnalysis) -> float:
|
|
408
|
+
"""Calculate match score between agent and toolchain.
|
|
409
|
+
|
|
410
|
+
Computes a numerical score (0.0 to 1.0) indicating how well an agent
|
|
411
|
+
matches the project's toolchain. Higher scores indicate better matches.
|
|
412
|
+
Considers:
|
|
413
|
+
- Language compatibility
|
|
414
|
+
- Framework experience
|
|
415
|
+
- Deployment target alignment
|
|
416
|
+
- Toolchain component coverage
|
|
417
|
+
|
|
418
|
+
Args:
|
|
419
|
+
agent_id: Unique identifier of the agent
|
|
420
|
+
toolchain: Complete toolchain analysis
|
|
421
|
+
|
|
422
|
+
Returns:
|
|
423
|
+
float: Match score between 0.0 (no match) and 1.0 (perfect match)
|
|
424
|
+
|
|
425
|
+
Raises:
|
|
426
|
+
KeyError: If agent_id does not exist
|
|
427
|
+
"""
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
# Auto-configuration manager interface
|
|
431
|
+
class IAutoConfigManager(ABC):
|
|
432
|
+
"""Interface for automated configuration management.
|
|
433
|
+
|
|
434
|
+
WHY: Auto-configuration orchestrates the entire process of analyzing,
|
|
435
|
+
recommending, validating, and deploying agents. This interface abstracts
|
|
436
|
+
the orchestration logic to enable different workflows and approval processes.
|
|
437
|
+
|
|
438
|
+
DESIGN DECISION: Provides both preview and apply modes to enable user review
|
|
439
|
+
before deployment. Includes validation to catch configuration issues early.
|
|
440
|
+
Supports both interactive (confirmation required) and automated modes.
|
|
441
|
+
"""
|
|
442
|
+
|
|
443
|
+
@abstractmethod
|
|
444
|
+
async def auto_configure(
|
|
445
|
+
self, project_path: Path, confirmation_required: bool = True
|
|
446
|
+
) -> ConfigurationResult:
|
|
447
|
+
"""Perform automated agent configuration.
|
|
448
|
+
|
|
449
|
+
Complete end-to-end configuration workflow:
|
|
450
|
+
1. Analyze project toolchain
|
|
451
|
+
2. Generate agent recommendations
|
|
452
|
+
3. Validate proposed configuration
|
|
453
|
+
4. Request user confirmation (if required)
|
|
454
|
+
5. Deploy approved agents
|
|
455
|
+
6. Verify deployment success
|
|
456
|
+
|
|
457
|
+
Args:
|
|
458
|
+
project_path: Path to the project root directory
|
|
459
|
+
confirmation_required: Whether to require user approval before deployment
|
|
460
|
+
|
|
461
|
+
Returns:
|
|
462
|
+
ConfigurationResult: Complete configuration results including
|
|
463
|
+
deployed agents, validation results, and any errors
|
|
464
|
+
|
|
465
|
+
Raises:
|
|
466
|
+
FileNotFoundError: If project_path does not exist
|
|
467
|
+
PermissionError: If unable to write to project directory
|
|
468
|
+
ValidationError: If configuration validation fails critically
|
|
469
|
+
"""
|
|
470
|
+
|
|
471
|
+
@abstractmethod
|
|
472
|
+
def validate_configuration(
|
|
473
|
+
self, recommendations: List[AgentRecommendation]
|
|
474
|
+
) -> ValidationResult:
|
|
475
|
+
"""Validate proposed configuration before deployment.
|
|
476
|
+
|
|
477
|
+
Performs comprehensive validation of recommended agents:
|
|
478
|
+
- Checks for conflicting agent capabilities
|
|
479
|
+
- Verifies resource requirements are met
|
|
480
|
+
- Validates agent compatibility with project
|
|
481
|
+
- Identifies potential configuration issues
|
|
482
|
+
|
|
483
|
+
Args:
|
|
484
|
+
recommendations: List of agent recommendations to validate
|
|
485
|
+
|
|
486
|
+
Returns:
|
|
487
|
+
ValidationResult: Validation result with any warnings or errors
|
|
488
|
+
|
|
489
|
+
Raises:
|
|
490
|
+
ValueError: If recommendations list is empty or invalid
|
|
491
|
+
"""
|
|
492
|
+
|
|
493
|
+
@abstractmethod
|
|
494
|
+
def preview_configuration(self, project_path: Path) -> ConfigurationPreview:
|
|
495
|
+
"""Preview what would be configured without applying changes.
|
|
496
|
+
|
|
497
|
+
Performs analysis and recommendation without making any changes:
|
|
498
|
+
- Analyzes project toolchain
|
|
499
|
+
- Generates recommendations
|
|
500
|
+
- Validates configuration
|
|
501
|
+
- Returns preview of what would be deployed
|
|
502
|
+
|
|
503
|
+
Useful for testing and showing users what would happen before
|
|
504
|
+
committing to changes.
|
|
505
|
+
|
|
506
|
+
Args:
|
|
507
|
+
project_path: Path to the project root directory
|
|
508
|
+
|
|
509
|
+
Returns:
|
|
510
|
+
ConfigurationPreview: Preview of configuration that would be applied
|
|
511
|
+
|
|
512
|
+
Raises:
|
|
513
|
+
FileNotFoundError: If project_path does not exist
|
|
514
|
+
"""
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Health Check Interfaces for Claude MPM Framework
|
|
3
|
+
=================================================
|
|
4
|
+
|
|
5
|
+
WHY: This module defines interfaces for health monitoring operations,
|
|
6
|
+
enabling the local-ops-agent to perform comprehensive health checks on
|
|
7
|
+
deployed processes including HTTP endpoints, process status, and resource usage.
|
|
8
|
+
|
|
9
|
+
DESIGN DECISION: Health check interfaces are separated to enable modular
|
|
10
|
+
health monitoring with different check types (HTTP, process, resource).
|
|
11
|
+
|
|
12
|
+
ARCHITECTURE:
|
|
13
|
+
- IHealthCheck: Interface for individual health check implementations
|
|
14
|
+
- IHealthCheckManager: Interface for orchestrating multiple health checks
|
|
15
|
+
- Health data models defined in models/health.py
|
|
16
|
+
|
|
17
|
+
USAGE:
|
|
18
|
+
http_check = HttpHealthCheck(endpoint="http://localhost:3000/health")
|
|
19
|
+
process_check = ProcessHealthCheck(process_manager)
|
|
20
|
+
resource_check = ResourceHealthCheck(process_manager)
|
|
21
|
+
|
|
22
|
+
health_manager = HealthCheckManager(
|
|
23
|
+
process_manager=process_manager,
|
|
24
|
+
check_interval=30
|
|
25
|
+
)
|
|
26
|
+
health_manager.start_monitoring()
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
from abc import ABC, abstractmethod
|
|
30
|
+
from typing import List
|
|
31
|
+
|
|
32
|
+
from claude_mpm.services.core.models.health import (
|
|
33
|
+
DeploymentHealth,
|
|
34
|
+
HealthCheckResult,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class IHealthCheck(ABC):
|
|
39
|
+
"""
|
|
40
|
+
Interface for individual health check implementations.
|
|
41
|
+
|
|
42
|
+
WHY: Abstracts different types of health checks (HTTP, process, resource)
|
|
43
|
+
to enable flexible health monitoring strategies.
|
|
44
|
+
|
|
45
|
+
DESIGN DECISION: Each check type implements this interface to provide
|
|
46
|
+
a consistent API for executing checks and interpreting results.
|
|
47
|
+
|
|
48
|
+
Thread Safety: Implementations must be thread-safe for concurrent execution.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
@abstractmethod
|
|
52
|
+
def check(self, deployment_id: str, **kwargs) -> HealthCheckResult:
|
|
53
|
+
"""
|
|
54
|
+
Execute the health check for a deployment.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
deployment_id: Unique deployment identifier
|
|
58
|
+
**kwargs: Check-specific parameters (e.g., endpoint URL, thresholds)
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
HealthCheckResult with check status and details
|
|
62
|
+
|
|
63
|
+
Raises:
|
|
64
|
+
ValueError: If deployment_id not found
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
@abstractmethod
|
|
68
|
+
def get_check_type(self) -> str:
|
|
69
|
+
"""
|
|
70
|
+
Get the type identifier for this health check.
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Check type string (e.g., "http", "process", "resource")
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class IHealthCheckManager(ABC):
|
|
78
|
+
"""
|
|
79
|
+
Interface for coordinating health checks across deployments.
|
|
80
|
+
|
|
81
|
+
WHY: Health monitoring requires orchestrating multiple check types,
|
|
82
|
+
aggregating results, and maintaining historical data. This interface
|
|
83
|
+
provides a high-level API for comprehensive health monitoring.
|
|
84
|
+
|
|
85
|
+
DESIGN DECISION: Provides both synchronous (check_health) and asynchronous
|
|
86
|
+
(background monitoring) operations to support different use cases.
|
|
87
|
+
|
|
88
|
+
Background Monitoring:
|
|
89
|
+
- Runs health checks at regular intervals
|
|
90
|
+
- Maintains historical health data
|
|
91
|
+
- Triggers callbacks on status changes
|
|
92
|
+
- Thread-safe with proper locking
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
@abstractmethod
|
|
96
|
+
def check_health(self, deployment_id: str) -> DeploymentHealth:
|
|
97
|
+
"""
|
|
98
|
+
Execute all health checks for a deployment.
|
|
99
|
+
|
|
100
|
+
WHY: Provides a comprehensive health snapshot by running all
|
|
101
|
+
registered health checks and aggregating results.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
deployment_id: Unique deployment identifier
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
DeploymentHealth with aggregated status and check results
|
|
108
|
+
|
|
109
|
+
Raises:
|
|
110
|
+
ValueError: If deployment_id not found
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
@abstractmethod
|
|
114
|
+
def start_monitoring(self) -> None:
|
|
115
|
+
"""
|
|
116
|
+
Start background health monitoring.
|
|
117
|
+
|
|
118
|
+
WHY: Enables continuous health tracking without manual polling.
|
|
119
|
+
Monitoring runs in a separate daemon thread.
|
|
120
|
+
|
|
121
|
+
Thread Safety: Creates a daemon thread that performs periodic checks.
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
@abstractmethod
|
|
125
|
+
def stop_monitoring(self) -> None:
|
|
126
|
+
"""
|
|
127
|
+
Stop background health monitoring.
|
|
128
|
+
|
|
129
|
+
WHY: Gracefully stops the monitoring thread and releases resources.
|
|
130
|
+
"""
|
|
131
|
+
|
|
132
|
+
@abstractmethod
|
|
133
|
+
def is_monitoring(self) -> bool:
|
|
134
|
+
"""
|
|
135
|
+
Check if background monitoring is active.
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
True if monitoring thread is running
|
|
139
|
+
"""
|
|
140
|
+
|
|
141
|
+
@abstractmethod
|
|
142
|
+
def get_health_history(
|
|
143
|
+
self, deployment_id: str, limit: int = 10
|
|
144
|
+
) -> List[DeploymentHealth]:
|
|
145
|
+
"""
|
|
146
|
+
Get historical health check results for a deployment.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
deployment_id: Unique deployment identifier
|
|
150
|
+
limit: Maximum number of historical entries to return
|
|
151
|
+
|
|
152
|
+
Returns:
|
|
153
|
+
List of DeploymentHealth objects, newest first
|
|
154
|
+
"""
|
|
155
|
+
|
|
156
|
+
@abstractmethod
|
|
157
|
+
def register_status_callback(self, callback) -> None:
|
|
158
|
+
"""
|
|
159
|
+
Register a callback for health status changes.
|
|
160
|
+
|
|
161
|
+
WHY: Enables reactive behavior based on health status changes
|
|
162
|
+
(e.g., alerts, auto-recovery, logging).
|
|
163
|
+
|
|
164
|
+
Args:
|
|
165
|
+
callback: Function called with (deployment_id, old_status, new_status)
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
__all__ = [
|
|
170
|
+
"IHealthCheck",
|
|
171
|
+
"IHealthCheckManager",
|
|
172
|
+
]
|