claude-mpm 4.4.3__py3-none-any.whl → 4.4.5__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.
Files changed (118) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/agent_loader.py +3 -2
  3. claude_mpm/agents/agent_loader_integration.py +2 -1
  4. claude_mpm/agents/async_agent_loader.py +2 -2
  5. claude_mpm/agents/base_agent_loader.py +2 -2
  6. claude_mpm/agents/frontmatter_validator.py +1 -0
  7. claude_mpm/agents/system_agent_config.py +2 -1
  8. claude_mpm/cli/commands/doctor.py +44 -5
  9. claude_mpm/cli/commands/mpm_init.py +116 -62
  10. claude_mpm/cli/parsers/configure_parser.py +3 -1
  11. claude_mpm/cli/startup_logging.py +1 -3
  12. claude_mpm/config/agent_config.py +1 -1
  13. claude_mpm/config/paths.py +2 -1
  14. claude_mpm/core/agent_name_normalizer.py +1 -0
  15. claude_mpm/core/config.py +2 -1
  16. claude_mpm/core/config_aliases.py +2 -1
  17. claude_mpm/core/file_utils.py +0 -1
  18. claude_mpm/core/framework/__init__.py +6 -6
  19. claude_mpm/core/framework/formatters/__init__.py +2 -2
  20. claude_mpm/core/framework/formatters/capability_generator.py +19 -8
  21. claude_mpm/core/framework/formatters/content_formatter.py +8 -3
  22. claude_mpm/core/framework/formatters/context_generator.py +7 -3
  23. claude_mpm/core/framework/loaders/__init__.py +3 -3
  24. claude_mpm/core/framework/loaders/agent_loader.py +7 -3
  25. claude_mpm/core/framework/loaders/file_loader.py +16 -6
  26. claude_mpm/core/framework/loaders/instruction_loader.py +16 -6
  27. claude_mpm/core/framework/loaders/packaged_loader.py +36 -12
  28. claude_mpm/core/framework/processors/__init__.py +2 -2
  29. claude_mpm/core/framework/processors/memory_processor.py +14 -6
  30. claude_mpm/core/framework/processors/metadata_processor.py +5 -5
  31. claude_mpm/core/framework/processors/template_processor.py +12 -6
  32. claude_mpm/core/framework_loader.py +44 -20
  33. claude_mpm/core/log_manager.py +2 -1
  34. claude_mpm/core/tool_access_control.py +1 -0
  35. claude_mpm/core/unified_agent_registry.py +2 -1
  36. claude_mpm/core/unified_paths.py +1 -0
  37. claude_mpm/experimental/cli_enhancements.py +1 -0
  38. claude_mpm/hooks/base_hook.py +1 -0
  39. claude_mpm/hooks/instruction_reinforcement.py +1 -0
  40. claude_mpm/hooks/kuzu_memory_hook.py +20 -13
  41. claude_mpm/hooks/validation_hooks.py +1 -1
  42. claude_mpm/scripts/mpm_doctor.py +1 -0
  43. claude_mpm/services/agents/loading/agent_profile_loader.py +1 -1
  44. claude_mpm/services/agents/loading/base_agent_manager.py +1 -1
  45. claude_mpm/services/agents/loading/framework_agent_loader.py +1 -1
  46. claude_mpm/services/agents/management/agent_capabilities_generator.py +1 -0
  47. claude_mpm/services/agents/management/agent_management_service.py +1 -1
  48. claude_mpm/services/agents/memory/memory_categorization_service.py +0 -1
  49. claude_mpm/services/agents/memory/memory_file_service.py +6 -2
  50. claude_mpm/services/agents/memory/memory_format_service.py +0 -1
  51. claude_mpm/services/agents/registry/deployed_agent_discovery.py +1 -1
  52. claude_mpm/services/async_session_logger.py +1 -1
  53. claude_mpm/services/claude_session_logger.py +1 -0
  54. claude_mpm/services/core/path_resolver.py +1 -0
  55. claude_mpm/services/diagnostics/checks/__init__.py +2 -0
  56. claude_mpm/services/diagnostics/checks/installation_check.py +126 -25
  57. claude_mpm/services/diagnostics/checks/mcp_services_check.py +451 -0
  58. claude_mpm/services/diagnostics/diagnostic_runner.py +3 -0
  59. claude_mpm/services/diagnostics/doctor_reporter.py +259 -32
  60. claude_mpm/services/event_bus/direct_relay.py +2 -1
  61. claude_mpm/services/event_bus/event_bus.py +1 -0
  62. claude_mpm/services/event_bus/relay.py +3 -2
  63. claude_mpm/services/framework_claude_md_generator/content_assembler.py +1 -1
  64. claude_mpm/services/infrastructure/daemon_manager.py +1 -1
  65. claude_mpm/services/mcp_config_manager.py +301 -54
  66. claude_mpm/services/mcp_gateway/core/process_pool.py +62 -23
  67. claude_mpm/services/mcp_gateway/tools/__init__.py +6 -5
  68. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +3 -1
  69. claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +16 -31
  70. claude_mpm/services/memory/cache/simple_cache.py +1 -1
  71. claude_mpm/services/project/archive_manager.py +159 -96
  72. claude_mpm/services/project/documentation_manager.py +64 -45
  73. claude_mpm/services/project/enhanced_analyzer.py +132 -89
  74. claude_mpm/services/project/project_organizer.py +225 -131
  75. claude_mpm/services/response_tracker.py +1 -1
  76. claude_mpm/services/socketio/server/eventbus_integration.py +1 -1
  77. claude_mpm/services/unified/__init__.py +1 -1
  78. claude_mpm/services/unified/analyzer_strategies/__init__.py +3 -3
  79. claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +97 -53
  80. claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +81 -40
  81. claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +277 -178
  82. claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +196 -112
  83. claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +83 -49
  84. claude_mpm/services/unified/config_strategies/__init__.py +111 -126
  85. claude_mpm/services/unified/config_strategies/config_schema.py +157 -111
  86. claude_mpm/services/unified/config_strategies/context_strategy.py +91 -89
  87. claude_mpm/services/unified/config_strategies/error_handling_strategy.py +183 -173
  88. claude_mpm/services/unified/config_strategies/file_loader_strategy.py +160 -152
  89. claude_mpm/services/unified/config_strategies/unified_config_service.py +124 -112
  90. claude_mpm/services/unified/config_strategies/validation_strategy.py +298 -259
  91. claude_mpm/services/unified/deployment_strategies/__init__.py +7 -7
  92. claude_mpm/services/unified/deployment_strategies/base.py +24 -28
  93. claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +168 -88
  94. claude_mpm/services/unified/deployment_strategies/local.py +49 -34
  95. claude_mpm/services/unified/deployment_strategies/utils.py +39 -43
  96. claude_mpm/services/unified/deployment_strategies/vercel.py +30 -24
  97. claude_mpm/services/unified/interfaces.py +0 -26
  98. claude_mpm/services/unified/migration.py +17 -40
  99. claude_mpm/services/unified/strategies.py +9 -26
  100. claude_mpm/services/unified/unified_analyzer.py +48 -44
  101. claude_mpm/services/unified/unified_config.py +21 -19
  102. claude_mpm/services/unified/unified_deployment.py +21 -26
  103. claude_mpm/storage/state_storage.py +1 -0
  104. claude_mpm/utils/agent_dependency_loader.py +18 -6
  105. claude_mpm/utils/common.py +14 -12
  106. claude_mpm/utils/database_connector.py +15 -12
  107. claude_mpm/utils/error_handler.py +1 -0
  108. claude_mpm/utils/log_cleanup.py +1 -0
  109. claude_mpm/utils/path_operations.py +1 -0
  110. claude_mpm/utils/session_logging.py +1 -1
  111. claude_mpm/utils/subprocess_utils.py +1 -0
  112. claude_mpm/validation/agent_validator.py +1 -1
  113. {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.5.dist-info}/METADATA +35 -15
  114. {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.5.dist-info}/RECORD +118 -117
  115. {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.5.dist-info}/WHEEL +0 -0
  116. {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.5.dist-info}/entry_points.txt +0 -0
  117. {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.5.dist-info}/licenses/LICENSE +0 -0
  118. {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.5.dist-info}/top_level.txt +0 -0
@@ -10,13 +10,17 @@ Created: 2025-01-26
10
10
  """
11
11
 
12
12
  import fnmatch
13
- import os
14
13
  from pathlib import Path
15
- from typing import Any, Dict, List, Optional, Set, Tuple
14
+ from typing import Any, Dict, List, Optional, Tuple
16
15
 
17
16
  from claude_mpm.core.logging_utils import get_logger
18
17
 
19
- from ..strategies import AnalyzerStrategy, StrategyContext, StrategyMetadata, StrategyPriority
18
+ from ..strategies import (
19
+ AnalyzerStrategy,
20
+ StrategyContext,
21
+ StrategyMetadata,
22
+ StrategyPriority,
23
+ )
20
24
 
21
25
  logger = get_logger(__name__)
22
26
 
@@ -87,11 +91,26 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
87
91
 
88
92
  # Common ignore patterns
89
93
  IGNORE_PATTERNS = [
90
- "*.pyc", "__pycache__", ".git", ".svn", ".hg",
91
- "node_modules", "venv", ".venv", "env",
92
- "dist", "build", "target", "bin", "obj",
93
- ".idea", ".vscode", "*.egg-info",
94
- ".pytest_cache", ".coverage", ".tox",
94
+ "*.pyc",
95
+ "__pycache__",
96
+ ".git",
97
+ ".svn",
98
+ ".hg",
99
+ "node_modules",
100
+ "venv",
101
+ ".venv",
102
+ "env",
103
+ "dist",
104
+ "build",
105
+ "target",
106
+ "bin",
107
+ "obj",
108
+ ".idea",
109
+ ".vscode",
110
+ "*.egg-info",
111
+ ".pytest_cache",
112
+ ".coverage",
113
+ ".tox",
95
114
  ]
96
115
 
97
116
  def __init__(self):
@@ -166,7 +185,9 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
166
185
  "message": f"Unsupported target type: {type(target).__name__}",
167
186
  }
168
187
 
169
- def _analyze_structure(self, root_path: Path, options: Dict[str, Any]) -> Dict[str, Any]:
188
+ def _analyze_structure(
189
+ self, root_path: Path, options: Dict[str, Any]
190
+ ) -> Dict[str, Any]:
170
191
  """Analyze the structure of a project directory."""
171
192
  results = {
172
193
  "status": "success",
@@ -264,7 +285,9 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
264
285
  # Track file types
265
286
  ext = item.suffix.lower()
266
287
  if ext:
267
- statistics["file_types"][ext] = statistics["file_types"].get(ext, 0) + 1
288
+ statistics["file_types"][ext] = (
289
+ statistics["file_types"].get(ext, 0) + 1
290
+ )
268
291
 
269
292
  # Get file info
270
293
  try:
@@ -321,8 +344,9 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
321
344
  config_files = {
322
345
  child["name"].lower()
323
346
  for child in tree.get("children", [])
324
- if child["type"] == "file"
325
- and child["name"].startswith(".") or child["name"].endswith(".config.js")
347
+ if (child["type"] == "file"
348
+ and child["name"].startswith("."))
349
+ or child["name"].endswith(".config.js")
326
350
  }
327
351
  patterns["has_config"] = len(config_files) > 0
328
352
 
@@ -338,7 +362,11 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
338
362
  def collect_names(node: Dict[str, Any]) -> None:
339
363
  """Collect all file and directory names."""
340
364
  if node["type"] == "file":
341
- name = node["name"].rsplit(".", 1)[0] if "." in node["name"] else node["name"]
365
+ name = (
366
+ node["name"].rsplit(".", 1)[0]
367
+ if "." in node["name"]
368
+ else node["name"]
369
+ )
342
370
  file_names.append(name)
343
371
  elif node["type"] == "directory":
344
372
  file_names.append(node["name"])
@@ -353,8 +381,12 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
353
381
  # Count naming patterns
354
382
  snake_case = sum(1 for n in file_names if "_" in n and n.islower())
355
383
  kebab_case = sum(1 for n in file_names if "-" in n)
356
- camel_case = sum(1 for n in file_names if n[0].islower() and any(c.isupper() for c in n))
357
- pascal_case = sum(1 for n in file_names if n[0].isupper() and any(c.islower() for c in n))
384
+ camel_case = sum(
385
+ 1 for n in file_names if n[0].islower() and any(c.isupper() for c in n)
386
+ )
387
+ pascal_case = sum(
388
+ 1 for n in file_names if n[0].isupper() and any(c.islower() for c in n)
389
+ )
358
390
 
359
391
  # Determine dominant pattern
360
392
  patterns = {
@@ -411,9 +443,7 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
411
443
  )
412
444
 
413
445
  # Check file distribution
414
- avg_files_per_dir = (
415
- stats["total_files"] / max(stats["total_dirs"], 1)
416
- )
446
+ avg_files_per_dir = stats["total_files"] / max(stats["total_dirs"], 1)
417
447
  if avg_files_per_dir > 20:
418
448
  score -= 10
419
449
  organization["recommendations"].append(
@@ -472,17 +502,18 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
472
502
  found_dirs = required_dirs & dir_names
473
503
 
474
504
  if len(found_dirs) >= len(required_dirs) * pattern_info["confidence"]:
475
- architecture["detected_patterns"].append({
476
- "name": pattern_name,
477
- "confidence": len(found_dirs) / len(required_dirs),
478
- "matched_dirs": list(found_dirs),
479
- })
505
+ architecture["detected_patterns"].append(
506
+ {
507
+ "name": pattern_name,
508
+ "confidence": len(found_dirs) / len(required_dirs),
509
+ "matched_dirs": list(found_dirs),
510
+ }
511
+ )
480
512
 
481
513
  # Select the pattern with highest confidence
482
514
  if architecture["detected_patterns"]:
483
515
  best_pattern = max(
484
- architecture["detected_patterns"],
485
- key=lambda x: x["confidence"]
516
+ architecture["detected_patterns"], key=lambda x: x["confidence"]
486
517
  )
487
518
  architecture["pattern"] = best_pattern["name"]
488
519
  architecture["confidence"] = best_pattern["confidence"]
@@ -502,14 +533,12 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
502
533
 
503
534
  # Structural complexity based on file and directory count
504
535
  total_nodes = stats["total_files"] + stats["total_dirs"]
505
- complexity["structural_complexity"] = (
506
- (total_nodes / 100) * (stats["max_depth"] / 3)
536
+ complexity["structural_complexity"] = (total_nodes / 100) * (
537
+ stats["max_depth"] / 3
507
538
  )
508
539
 
509
540
  # Nesting complexity
510
- complexity["nesting_complexity"] = min(
511
- 100, (stats["max_depth"] / 7) * 100
512
- )
541
+ complexity["nesting_complexity"] = min(100, (stats["max_depth"] / 7) * 100)
513
542
 
514
543
  # File dispersion (how spread out files are)
515
544
  if stats["total_dirs"] > 0:
@@ -562,10 +591,7 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
562
591
 
563
592
  file_counts = {}
564
593
  for language, extensions in language_extensions.items():
565
- count = sum(
566
- len(list(root_path.rglob(f"*{ext}")))
567
- for ext in extensions
568
- )
594
+ count = sum(len(list(root_path.rglob(f"*{ext}"))) for ext in extensions)
569
595
  if count > 0:
570
596
  file_counts[language] = count
571
597
 
@@ -621,12 +647,14 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
621
647
  # Extract structure statistics
622
648
  if "statistics" in analysis_result:
623
649
  stats = analysis_result["statistics"]
624
- metrics.update({
625
- "total_files": stats.get("total_files", 0),
626
- "total_directories": stats.get("total_dirs", 0),
627
- "max_depth": stats.get("max_depth", 0),
628
- "unique_file_types": len(stats.get("file_types", {})),
629
- })
650
+ metrics.update(
651
+ {
652
+ "total_files": stats.get("total_files", 0),
653
+ "total_directories": stats.get("total_dirs", 0),
654
+ "max_depth": stats.get("max_depth", 0),
655
+ "unique_file_types": len(stats.get("file_types", {})),
656
+ }
657
+ )
630
658
 
631
659
  # Extract organization metrics
632
660
  if "organization" in analysis_result:
@@ -636,12 +664,14 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
636
664
  # Extract complexity metrics
637
665
  if "complexity" in analysis_result:
638
666
  complexity = analysis_result["complexity"]
639
- metrics.update({
640
- "structural_complexity": complexity.get("structural_complexity", 0),
641
- "nesting_complexity": complexity.get("nesting_complexity", 0),
642
- "file_dispersion": complexity.get("file_dispersion", 0),
643
- "coupling_indicator": complexity.get("coupling_indicator", 0),
644
- })
667
+ metrics.update(
668
+ {
669
+ "structural_complexity": complexity.get("structural_complexity", 0),
670
+ "nesting_complexity": complexity.get("nesting_complexity", 0),
671
+ "file_dispersion": complexity.get("file_dispersion", 0),
672
+ "coupling_indicator": complexity.get("coupling_indicator", 0),
673
+ }
674
+ )
645
675
 
646
676
  return metrics
647
677
 
@@ -668,7 +698,8 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
668
698
  "change": diff,
669
699
  "percent_change": (
670
700
  (diff / baseline_metrics[key] * 100)
671
- if baseline_metrics[key] else 0
701
+ if baseline_metrics[key]
702
+ else 0
672
703
  ),
673
704
  }
674
705
 
@@ -687,10 +718,13 @@ class StructureAnalyzerStrategy(AnalyzerStrategy):
687
718
 
688
719
  # Compare architecture
689
720
  if "architecture" in baseline and "architecture" in current:
690
- if baseline["architecture"]["pattern"] != current["architecture"]["pattern"]:
721
+ if (
722
+ baseline["architecture"]["pattern"]
723
+ != current["architecture"]["pattern"]
724
+ ):
691
725
  comparison["architecture_change"] = {
692
726
  "baseline": baseline["architecture"]["pattern"],
693
727
  "current": current["architecture"]["pattern"],
694
728
  }
695
729
 
696
- return comparison
730
+ return comparison
@@ -11,85 +11,80 @@ This package consolidates:
11
11
  Target: 10,000-11,000 line reduction with 20-30% performance improvement
12
12
  """
13
13
 
14
- from .unified_config_service import (
15
- UnifiedConfigService,
16
- ConfigFormat,
17
- ConfigContext,
18
- ConfigMetadata,
19
- IConfigStrategy
20
- )
21
-
22
- from .file_loader_strategy import (
23
- FileLoaderStrategy,
24
- LoaderType,
25
- FileLoadContext,
26
- StructuredFileLoader,
27
- EnvironmentFileLoader,
28
- ProgrammaticFileLoader,
29
- LegacyFileLoader,
30
- CompositeFileLoader
14
+ from .config_schema import (
15
+ ConfigMigration,
16
+ ConfigSchema,
17
+ SchemaBuilder,
18
+ SchemaFormat,
19
+ SchemaProperty,
20
+ SchemaRegistry,
21
+ SchemaType,
22
+ SchemaValidator,
23
+ TypedConfig,
24
+ create_api_schema,
25
+ create_database_schema,
26
+ create_logging_schema,
31
27
  )
32
-
33
- from .validation_strategy import (
34
- ValidationStrategy,
35
- ValidationRule,
36
- ValidationResult,
37
- ValidationType,
38
- TypeValidator,
39
- RequiredValidator,
40
- RangeValidator,
41
- LengthValidator,
42
- PatternValidator,
43
- EnumValidator,
44
- FormatValidator,
45
- DependencyValidator,
46
- UniqueValidator,
47
- CustomValidator,
48
- ConditionalValidator,
49
- RecursiveValidator,
50
- CrossFieldValidator,
51
- CompositeValidator,
52
- SchemaValidator
28
+ from .context_strategy import (
29
+ CachingContextManager,
30
+ ContextLifecycle,
31
+ ContextScope,
32
+ ContextStrategy,
33
+ HierarchicalContextManager,
34
+ IsolatedContextManager,
35
+ ScopedConfigManager,
36
+ ThreadLocalContextManager,
53
37
  )
54
-
55
38
  from .error_handling_strategy import (
56
- ErrorHandlingStrategy,
39
+ CompositeErrorHandler,
40
+ ErrorCategory,
57
41
  ErrorContext,
58
42
  ErrorHandlingResult,
59
- ErrorCategory,
43
+ ErrorHandlingStrategy,
60
44
  ErrorSeverity,
61
45
  FileIOErrorHandler,
62
- ParsingErrorHandler,
63
- ValidationErrorHandler,
64
46
  NetworkErrorHandler,
47
+ ParsingErrorHandler,
65
48
  TypeConversionErrorHandler,
66
- CompositeErrorHandler
49
+ ValidationErrorHandler,
67
50
  )
68
-
69
- from .context_strategy import (
70
- ContextStrategy,
71
- ContextScope,
72
- ContextLifecycle,
73
- HierarchicalContextManager,
74
- ScopedConfigManager,
75
- IsolatedContextManager,
76
- ThreadLocalContextManager,
77
- CachingContextManager
51
+ from .file_loader_strategy import (
52
+ CompositeFileLoader,
53
+ EnvironmentFileLoader,
54
+ FileLoadContext,
55
+ FileLoaderStrategy,
56
+ LegacyFileLoader,
57
+ LoaderType,
58
+ ProgrammaticFileLoader,
59
+ StructuredFileLoader,
78
60
  )
79
-
80
- from .config_schema import (
81
- ConfigSchema,
82
- SchemaProperty,
83
- SchemaBuilder,
61
+ from .unified_config_service import (
62
+ ConfigContext,
63
+ ConfigFormat,
64
+ ConfigMetadata,
65
+ IConfigStrategy,
66
+ UnifiedConfigService,
67
+ )
68
+ from .validation_strategy import (
69
+ CompositeValidator,
70
+ ConditionalValidator,
71
+ CrossFieldValidator,
72
+ CustomValidator,
73
+ DependencyValidator,
74
+ EnumValidator,
75
+ FormatValidator,
76
+ LengthValidator,
77
+ PatternValidator,
78
+ RangeValidator,
79
+ RecursiveValidator,
80
+ RequiredValidator,
84
81
  SchemaValidator,
85
- SchemaRegistry,
86
- ConfigMigration,
87
- TypedConfig,
88
- SchemaType,
89
- SchemaFormat,
90
- create_database_schema,
91
- create_api_schema,
92
- create_logging_schema
82
+ TypeValidator,
83
+ UniqueValidator,
84
+ ValidationResult,
85
+ ValidationRule,
86
+ ValidationStrategy,
87
+ ValidationType,
93
88
  )
94
89
 
95
90
  # Create singleton instance for global use
@@ -103,88 +98,78 @@ ConfigLoader = UnifiedConfigService
103
98
  # Export all public APIs
104
99
  __all__ = [
105
100
  # Main service
106
- 'UnifiedConfigService',
107
- 'unified_config',
108
-
101
+ "UnifiedConfigService",
102
+ "unified_config",
109
103
  # Strategies
110
- 'FileLoaderStrategy',
111
- 'ValidationStrategy',
112
- 'ErrorHandlingStrategy',
113
- 'ContextStrategy',
114
-
104
+ "FileLoaderStrategy",
105
+ "ValidationStrategy",
106
+ "ErrorHandlingStrategy",
107
+ "ContextStrategy",
115
108
  # Core types
116
- 'ConfigFormat',
117
- 'ConfigContext',
118
- 'ConfigMetadata',
119
- 'IConfigStrategy',
120
-
109
+ "ConfigFormat",
110
+ "ConfigContext",
111
+ "ConfigMetadata",
112
+ "IConfigStrategy",
121
113
  # File loading
122
- 'LoaderType',
123
- 'FileLoadContext',
124
- 'StructuredFileLoader',
125
- 'EnvironmentFileLoader',
126
- 'ProgrammaticFileLoader',
127
- 'LegacyFileLoader',
128
- 'CompositeFileLoader',
129
-
114
+ "LoaderType",
115
+ "FileLoadContext",
116
+ "StructuredFileLoader",
117
+ "EnvironmentFileLoader",
118
+ "ProgrammaticFileLoader",
119
+ "LegacyFileLoader",
120
+ "CompositeFileLoader",
130
121
  # Validation
131
- 'ValidationRule',
132
- 'ValidationResult',
133
- 'ValidationType',
134
-
122
+ "ValidationRule",
123
+ "ValidationResult",
124
+ "ValidationType",
135
125
  # Error handling
136
- 'ErrorContext',
137
- 'ErrorHandlingResult',
138
- 'ErrorCategory',
139
- 'ErrorSeverity',
140
-
126
+ "ErrorContext",
127
+ "ErrorHandlingResult",
128
+ "ErrorCategory",
129
+ "ErrorSeverity",
141
130
  # Context management
142
- 'ContextScope',
143
- 'ContextLifecycle',
144
- 'HierarchicalContextManager',
145
- 'ScopedConfigManager',
146
-
131
+ "ContextScope",
132
+ "ContextLifecycle",
133
+ "HierarchicalContextManager",
134
+ "ScopedConfigManager",
147
135
  # Schema
148
- 'ConfigSchema',
149
- 'SchemaProperty',
150
- 'SchemaBuilder',
151
- 'SchemaValidator',
152
- 'SchemaRegistry',
153
- 'ConfigMigration',
154
- 'TypedConfig',
155
- 'SchemaType',
156
- 'SchemaFormat',
157
-
136
+ "ConfigSchema",
137
+ "SchemaProperty",
138
+ "SchemaBuilder",
139
+ "SchemaValidator",
140
+ "SchemaRegistry",
141
+ "ConfigMigration",
142
+ "TypedConfig",
143
+ "SchemaType",
144
+ "SchemaFormat",
158
145
  # Backward compatibility
159
- 'ConfigService',
160
- 'ConfigManager',
161
- 'ConfigLoader',
146
+ "ConfigService",
147
+ "ConfigManager",
148
+ "ConfigLoader",
162
149
  ]
163
150
 
151
+
164
152
  # Module initialization
165
153
  def initialize():
166
154
  """Initialize the unified configuration system"""
167
155
  # Register default strategies
168
- unified_config.register_strategy('file', FileLoaderStrategy())
169
- unified_config.register_strategy('validation', ValidationStrategy())
170
- unified_config.register_strategy('error', ErrorHandlingStrategy())
171
- unified_config.register_strategy('context', ContextStrategy())
156
+ unified_config.register_strategy("file", FileLoaderStrategy())
157
+ unified_config.register_strategy("validation", ValidationStrategy())
158
+ unified_config.register_strategy("error", ErrorHandlingStrategy())
159
+ unified_config.register_strategy("context", ContextStrategy())
172
160
 
173
161
  # Set up default error handlers
174
162
  error_strategy = ErrorHandlingStrategy()
175
163
 
176
164
  # Register recovery strategies
177
165
  error_strategy.register_recovery_strategy(
178
- 'default_fallback',
179
- lambda ctx: ctx.metadata.get('default_config', {})
166
+ "default_fallback", lambda ctx: ctx.metadata.get("default_config", {})
180
167
  )
181
168
 
182
- error_strategy.register_recovery_strategy(
183
- 'empty_fallback',
184
- lambda ctx: {}
185
- )
169
+ error_strategy.register_recovery_strategy("empty_fallback", lambda ctx: {})
186
170
 
187
171
  return unified_config
188
172
 
173
+
189
174
  # Auto-initialize on import
190
- _unified_instance = initialize()
175
+ _unified_instance = initialize()