claude-mpm 4.5.11__py3-none-any.whl → 4.5.12__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.
Potentially problematic release.
This version of claude-mpm might be problematic. Click here for more details.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/frontmatter_validator.py +4 -4
- claude_mpm/cli/commands/agent_manager.py +3 -3
- claude_mpm/cli/commands/agents.py +6 -6
- claude_mpm/cli/commands/aggregate.py +4 -4
- claude_mpm/cli/commands/analyze.py +2 -2
- claude_mpm/cli/commands/analyze_code.py +1 -1
- claude_mpm/cli/commands/cleanup.py +3 -3
- claude_mpm/cli/commands/config.py +2 -2
- claude_mpm/cli/commands/configure.py +14 -14
- claude_mpm/cli/commands/dashboard.py +1 -1
- claude_mpm/cli/commands/debug.py +3 -3
- claude_mpm/cli/commands/doctor.py +1 -1
- claude_mpm/cli/commands/mcp.py +7 -7
- claude_mpm/cli/commands/mcp_command_router.py +1 -1
- claude_mpm/cli/commands/mcp_config.py +2 -2
- claude_mpm/cli/commands/mcp_external_commands.py +2 -2
- claude_mpm/cli/commands/mcp_install_commands.py +3 -3
- claude_mpm/cli/commands/mcp_pipx_config.py +2 -2
- claude_mpm/cli/commands/mcp_setup_external.py +3 -3
- claude_mpm/cli/commands/monitor.py +1 -1
- claude_mpm/cli/commands/mpm_init_handler.py +1 -1
- claude_mpm/cli/interactive/agent_wizard.py +1 -1
- claude_mpm/cli/parsers/search_parser.py +1 -1
- claude_mpm/cli/shared/argument_patterns.py +2 -2
- claude_mpm/cli/shared/base_command.py +1 -1
- claude_mpm/cli/startup_logging.py +4 -4
- claude_mpm/config/experimental_features.py +4 -4
- claude_mpm/config/socketio_config.py +2 -2
- claude_mpm/core/agent_session_manager.py +2 -2
- claude_mpm/core/api_validator.py +3 -3
- claude_mpm/core/base_service.py +10 -1
- claude_mpm/core/cache.py +2 -2
- claude_mpm/core/config.py +4 -4
- claude_mpm/core/config_aliases.py +4 -4
- claude_mpm/core/config_constants.py +1 -1
- claude_mpm/core/error_handler.py +1 -1
- claude_mpm/core/file_utils.py +5 -5
- claude_mpm/core/framework/formatters/capability_generator.py +5 -5
- claude_mpm/core/framework/loaders/agent_loader.py +1 -1
- claude_mpm/core/framework/processors/metadata_processor.py +1 -1
- claude_mpm/core/framework/processors/template_processor.py +3 -3
- claude_mpm/core/framework_loader.py +2 -2
- claude_mpm/core/log_manager.py +4 -4
- claude_mpm/core/logger.py +2 -2
- claude_mpm/core/optimized_startup.py +1 -1
- claude_mpm/core/output_style_manager.py +1 -1
- claude_mpm/core/service_registry.py +2 -2
- claude_mpm/core/session_manager.py +3 -3
- claude_mpm/core/shared/config_loader.py +1 -1
- claude_mpm/core/socketio_pool.py +2 -2
- claude_mpm/core/unified_agent_registry.py +2 -2
- claude_mpm/core/unified_config.py +6 -6
- claude_mpm/core/unified_paths.py +2 -2
- claude_mpm/dashboard/api/simple_directory.py +1 -1
- claude_mpm/generators/agent_profile_generator.py +1 -1
- claude_mpm/hooks/claude_hooks/event_handlers.py +2 -2
- claude_mpm/hooks/claude_hooks/installer.py +9 -9
- claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +7 -2
- claude_mpm/hooks/claude_hooks/tool_analysis.py +2 -2
- claude_mpm/hooks/memory_integration_hook.py +1 -1
- claude_mpm/hooks/validation_hooks.py +1 -1
- claude_mpm/init.py +4 -4
- claude_mpm/models/agent_session.py +1 -1
- claude_mpm/scripts/socketio_daemon.py +5 -5
- claude_mpm/services/__init__.py +2 -2
- claude_mpm/services/agent_capabilities_service.py +1 -1
- claude_mpm/services/agents/agent_builder.py +4 -4
- claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +1 -1
- claude_mpm/services/agents/deployment/agent_metrics_collector.py +1 -1
- claude_mpm/services/agents/deployment/agent_record_service.py +3 -3
- claude_mpm/services/agents/deployment/deployment_wrapper.py +1 -1
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +2 -2
- claude_mpm/services/agents/loading/agent_profile_loader.py +2 -2
- claude_mpm/services/agents/local_template_manager.py +5 -5
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +1 -1
- claude_mpm/services/agents/registry/modification_tracker.py +19 -11
- claude_mpm/services/async_session_logger.py +1 -1
- claude_mpm/services/claude_session_logger.py +1 -1
- claude_mpm/services/cli/agent_listing_service.py +3 -3
- claude_mpm/services/cli/agent_validation_service.py +1 -1
- claude_mpm/services/cli/session_manager.py +2 -2
- claude_mpm/services/core/path_resolver.py +1 -1
- claude_mpm/services/diagnostics/checks/agent_check.py +1 -1
- claude_mpm/services/diagnostics/checks/claude_code_check.py +2 -2
- claude_mpm/services/diagnostics/checks/common_issues_check.py +3 -3
- claude_mpm/services/diagnostics/checks/configuration_check.py +2 -2
- claude_mpm/services/diagnostics/checks/installation_check.py +1 -1
- claude_mpm/services/diagnostics/checks/mcp_check.py +1 -1
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +9 -9
- claude_mpm/services/diagnostics/checks/monitor_check.py +1 -1
- claude_mpm/services/diagnostics/doctor_reporter.py +1 -1
- claude_mpm/services/event_aggregator.py +1 -1
- claude_mpm/services/event_bus/event_bus.py +7 -2
- claude_mpm/services/events/consumers/dead_letter.py +2 -2
- claude_mpm/services/framework_claude_md_generator/__init__.py +1 -1
- claude_mpm/services/framework_claude_md_generator/deployment_manager.py +3 -3
- claude_mpm/services/framework_claude_md_generator/version_manager.py +1 -1
- claude_mpm/services/hook_installer_service.py +7 -7
- claude_mpm/services/infrastructure/context_preservation.py +7 -7
- claude_mpm/services/infrastructure/daemon_manager.py +5 -5
- claude_mpm/services/mcp_config_manager.py +10 -10
- claude_mpm/services/mcp_gateway/auto_configure.py +5 -5
- claude_mpm/services/mcp_gateway/config/config_loader.py +2 -2
- claude_mpm/services/mcp_gateway/config/configuration.py +3 -3
- claude_mpm/services/mcp_gateway/core/process_pool.py +3 -3
- claude_mpm/services/mcp_gateway/core/singleton_manager.py +2 -2
- claude_mpm/services/mcp_gateway/core/startup_verification.py +1 -1
- claude_mpm/services/mcp_gateway/main.py +1 -1
- claude_mpm/services/mcp_gateway/registry/service_registry.py +4 -2
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +2 -1
- claude_mpm/services/mcp_gateway/server/stdio_handler.py +1 -1
- claude_mpm/services/mcp_gateway/tools/document_summarizer.py +1 -1
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +1 -1
- claude_mpm/services/mcp_gateway/tools/hello_world.py +1 -1
- claude_mpm/services/mcp_gateway/utils/package_version_checker.py +5 -5
- claude_mpm/services/mcp_gateway/utils/update_preferences.py +2 -2
- claude_mpm/services/mcp_service_verifier.py +1 -1
- claude_mpm/services/memory/builder.py +1 -1
- claude_mpm/services/memory/cache/shared_prompt_cache.py +2 -1
- claude_mpm/services/memory/indexed_memory.py +3 -3
- claude_mpm/services/monitor/daemon.py +1 -1
- claude_mpm/services/monitor/daemon_manager.py +9 -9
- claude_mpm/services/monitor/handlers/file.py +1 -1
- claude_mpm/services/monitor/handlers/hooks.py +3 -3
- claude_mpm/services/monitor/management/lifecycle.py +7 -7
- claude_mpm/services/monitor/server.py +2 -2
- claude_mpm/services/orphan_detection.py +13 -16
- claude_mpm/services/port_manager.py +2 -2
- claude_mpm/services/project/analyzer.py +3 -3
- claude_mpm/services/project/archive_manager.py +13 -13
- claude_mpm/services/project/dependency_analyzer.py +4 -4
- claude_mpm/services/project/documentation_manager.py +4 -4
- claude_mpm/services/project/enhanced_analyzer.py +8 -8
- claude_mpm/services/project/registry.py +4 -4
- claude_mpm/services/project_port_allocator.py +7 -11
- claude_mpm/services/session_management_service.py +1 -1
- claude_mpm/services/socketio/event_normalizer.py +1 -1
- claude_mpm/services/socketio/handlers/code_analysis.py +14 -12
- claude_mpm/services/socketio/handlers/file.py +1 -1
- claude_mpm/services/socketio/migration_utils.py +1 -1
- claude_mpm/services/socketio/server/core.py +1 -1
- claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +1 -1
- claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +4 -4
- claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +1 -1
- claude_mpm/services/unified/config_strategies/config_schema.py +4 -4
- claude_mpm/services/unified/config_strategies/context_strategy.py +6 -6
- claude_mpm/services/unified/config_strategies/error_handling_strategy.py +10 -10
- claude_mpm/services/unified/config_strategies/file_loader_strategy.py +5 -5
- claude_mpm/services/unified/config_strategies/unified_config_service.py +8 -8
- claude_mpm/services/unified/config_strategies/validation_strategy.py +15 -15
- claude_mpm/services/unified/deployment_strategies/base.py +4 -4
- claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +15 -15
- claude_mpm/services/unified/deployment_strategies/local.py +9 -9
- claude_mpm/services/unified/deployment_strategies/utils.py +9 -9
- claude_mpm/services/unified/deployment_strategies/vercel.py +7 -7
- claude_mpm/services/unified/unified_config.py +5 -5
- claude_mpm/services/unified/unified_deployment.py +2 -2
- claude_mpm/services/utility_service.py +1 -1
- claude_mpm/services/version_control/conflict_resolution.py +2 -2
- claude_mpm/services/version_control/git_operations.py +3 -3
- claude_mpm/services/version_control/semantic_versioning.py +13 -13
- claude_mpm/services/version_control/version_parser.py +1 -1
- claude_mpm/storage/state_storage.py +12 -13
- claude_mpm/tools/code_tree_analyzer.py +5 -5
- claude_mpm/tools/code_tree_builder.py +4 -4
- claude_mpm/tools/socketio_debug.py +1 -1
- claude_mpm/utils/agent_dependency_loader.py +4 -4
- claude_mpm/utils/common.py +2 -2
- claude_mpm/utils/config_manager.py +3 -3
- claude_mpm/utils/dependency_cache.py +2 -2
- claude_mpm/utils/dependency_strategies.py +6 -6
- claude_mpm/utils/file_utils.py +11 -11
- claude_mpm/utils/log_cleanup.py +1 -1
- claude_mpm/utils/path_operations.py +1 -1
- claude_mpm/validation/agent_validator.py +2 -2
- claude_mpm/validation/frontmatter_validator.py +1 -1
- {claude_mpm-4.5.11.dist-info → claude_mpm-4.5.12.dist-info}/METADATA +1 -1
- {claude_mpm-4.5.11.dist-info → claude_mpm-4.5.12.dist-info}/RECORD +183 -183
- {claude_mpm-4.5.11.dist-info → claude_mpm-4.5.12.dist-info}/WHEEL +0 -0
- {claude_mpm-4.5.11.dist-info → claude_mpm-4.5.12.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.5.11.dist-info → claude_mpm-4.5.12.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.5.11.dist-info → claude_mpm-4.5.12.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.5.
|
|
1
|
+
4.5.12
|
|
@@ -140,7 +140,7 @@ class FrontmatterValidator:
|
|
|
140
140
|
)
|
|
141
141
|
if schema_path.exists():
|
|
142
142
|
try:
|
|
143
|
-
with open(
|
|
143
|
+
with schema_path.open() as f:
|
|
144
144
|
return json.load(f)
|
|
145
145
|
except Exception as e:
|
|
146
146
|
logger.warning(f"Failed to load frontmatter schema: {e}")
|
|
@@ -519,7 +519,7 @@ class FrontmatterValidator:
|
|
|
519
519
|
ValidationResult with validation status
|
|
520
520
|
"""
|
|
521
521
|
try:
|
|
522
|
-
with open(
|
|
522
|
+
with file_path.open() as f:
|
|
523
523
|
content = f.read()
|
|
524
524
|
|
|
525
525
|
# Extract frontmatter
|
|
@@ -583,7 +583,7 @@ class FrontmatterValidator:
|
|
|
583
583
|
|
|
584
584
|
if result.field_corrections and not dry_run:
|
|
585
585
|
try:
|
|
586
|
-
with open(
|
|
586
|
+
with file_path.open() as f:
|
|
587
587
|
content = f.read()
|
|
588
588
|
|
|
589
589
|
# Find frontmatter boundaries
|
|
@@ -602,7 +602,7 @@ class FrontmatterValidator:
|
|
|
602
602
|
if corrected_content != frontmatter_content:
|
|
603
603
|
new_content = f"---\n{corrected_content}\n---\n{content[end_marker + 5:]}"
|
|
604
604
|
|
|
605
|
-
with open(
|
|
605
|
+
with file_path.open("w") as f:
|
|
606
606
|
f.write(new_content)
|
|
607
607
|
|
|
608
608
|
logger.info(f"Corrected frontmatter in {file_path}")
|
|
@@ -620,7 +620,7 @@ class AgentManagerCommand(AgentCommand):
|
|
|
620
620
|
|
|
621
621
|
# Save JSON configuration
|
|
622
622
|
json_file = template_dir / f"{agent_id}.json"
|
|
623
|
-
with open(
|
|
623
|
+
with json_file.open("w") as f:
|
|
624
624
|
json.dump(config, f, indent=2)
|
|
625
625
|
|
|
626
626
|
# Save instructions
|
|
@@ -1074,7 +1074,7 @@ class AgentManagerCommand(AgentCommand):
|
|
|
1074
1074
|
except Exception as e:
|
|
1075
1075
|
return CommandResult.error_result(f"Interactive edit failed: {e}")
|
|
1076
1076
|
|
|
1077
|
-
def _test_local_agent(self, args) -> CommandResult:
|
|
1077
|
+
def _test_local_agent(self, args) -> CommandResult:
|
|
1078
1078
|
"""Test a local agent with sample task."""
|
|
1079
1079
|
try:
|
|
1080
1080
|
from ...services.agents.local_template_manager import (
|
|
@@ -1144,7 +1144,7 @@ class AgentManagerCommand(AgentCommand):
|
|
|
1144
1144
|
except Exception as e:
|
|
1145
1145
|
return CommandResult.error_result(f"Local agent test failed: {e}")
|
|
1146
1146
|
|
|
1147
|
-
def _delete_local_agents(self, args) -> CommandResult:
|
|
1147
|
+
def _delete_local_agents(self, args) -> CommandResult:
|
|
1148
1148
|
"""Delete local agent templates with comprehensive options."""
|
|
1149
1149
|
try:
|
|
1150
1150
|
from ...services.agents.local_template_manager import (
|
|
@@ -938,7 +938,7 @@ class AgentsCommand(AgentCommand):
|
|
|
938
938
|
self.logger.error(f"Error creating local agent: {e}", exc_info=True)
|
|
939
939
|
return CommandResult.error_result(f"Error creating local agent: {e}")
|
|
940
940
|
|
|
941
|
-
def _edit_local_agent(self, args) -> CommandResult:
|
|
941
|
+
def _edit_local_agent(self, args) -> CommandResult:
|
|
942
942
|
"""Edit a local agent template."""
|
|
943
943
|
try:
|
|
944
944
|
agent_id = getattr(args, "agent_id", None)
|
|
@@ -993,7 +993,7 @@ class AgentsCommand(AgentCommand):
|
|
|
993
993
|
self.logger.error(f"Error editing local agent: {e}", exc_info=True)
|
|
994
994
|
return CommandResult.error_result(f"Error editing local agent: {e}")
|
|
995
995
|
|
|
996
|
-
def _delete_local_agent(self, args) -> CommandResult:
|
|
996
|
+
def _delete_local_agent(self, args) -> CommandResult:
|
|
997
997
|
"""Delete local agent templates."""
|
|
998
998
|
try:
|
|
999
999
|
agent_ids = getattr(args, "agent_ids", [])
|
|
@@ -1140,7 +1140,7 @@ class AgentsCommand(AgentCommand):
|
|
|
1140
1140
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
1141
1141
|
config_data = {}
|
|
1142
1142
|
else:
|
|
1143
|
-
with open(
|
|
1143
|
+
with config_path.open() as f:
|
|
1144
1144
|
config_data = yaml.safe_load(f) or {}
|
|
1145
1145
|
|
|
1146
1146
|
# Ensure agent_deployment section exists
|
|
@@ -1204,7 +1204,7 @@ class AgentsCommand(AgentCommand):
|
|
|
1204
1204
|
|
|
1205
1205
|
# Save configuration if modified
|
|
1206
1206
|
if modified:
|
|
1207
|
-
with open(
|
|
1207
|
+
with config_path.open("w") as f:
|
|
1208
1208
|
yaml.dump(config_data, f, default_flow_style=False, sort_keys=False)
|
|
1209
1209
|
print(f"\n💾 Configuration saved to {config_path}")
|
|
1210
1210
|
return CommandResult.success_result("Deployment configuration updated")
|
|
@@ -1231,7 +1231,7 @@ class AgentsCommand(AgentCommand):
|
|
|
1231
1231
|
|
|
1232
1232
|
# Load current configuration
|
|
1233
1233
|
if config_path.exists():
|
|
1234
|
-
with open(
|
|
1234
|
+
with config_path.open() as f:
|
|
1235
1235
|
config_data = yaml.safe_load(f) or {}
|
|
1236
1236
|
else:
|
|
1237
1237
|
config_data = {}
|
|
@@ -1326,7 +1326,7 @@ class AgentsCommand(AgentCommand):
|
|
|
1326
1326
|
# Ensure parent directory exists
|
|
1327
1327
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
1328
1328
|
|
|
1329
|
-
with open(
|
|
1329
|
+
with config_path.open("w") as f:
|
|
1330
1330
|
yaml.dump(config_data, f, default_flow_style=False, sort_keys=False)
|
|
1331
1331
|
|
|
1332
1332
|
print(f"\n✅ Configuration saved to {config_path}")
|
|
@@ -116,7 +116,7 @@ def aggregate_command(args):
|
|
|
116
116
|
return result.exit_code
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
def aggregate_command_legacy(args):
|
|
119
|
+
def aggregate_command_legacy(args):
|
|
120
120
|
"""Legacy aggregate command dispatcher.
|
|
121
121
|
|
|
122
122
|
WHY: This contains the original aggregate_command logic, preserved during migration
|
|
@@ -409,7 +409,7 @@ def export_command_legacy(args):
|
|
|
409
409
|
# Export based on format
|
|
410
410
|
if args.format == "json":
|
|
411
411
|
# Full JSON export
|
|
412
|
-
with open(
|
|
412
|
+
with output_path.open("w") as f:
|
|
413
413
|
json.dump(session.to_dict(), f, indent=2)
|
|
414
414
|
print(f"✅ Exported session to {output_path}")
|
|
415
415
|
|
|
@@ -436,7 +436,7 @@ def export_command_legacy(args):
|
|
|
436
436
|
],
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
with open(
|
|
439
|
+
with output_path.open("w") as f:
|
|
440
440
|
json.dump(summary, f, indent=2)
|
|
441
441
|
print(f"✅ Exported session summary to {output_path}")
|
|
442
442
|
|
|
@@ -444,7 +444,7 @@ def export_command_legacy(args):
|
|
|
444
444
|
# Events-only export
|
|
445
445
|
events_data = [e.to_dict() for e in session.events]
|
|
446
446
|
|
|
447
|
-
with open(
|
|
447
|
+
with output_path.open("w") as f:
|
|
448
448
|
json.dump(events_data, f, indent=2)
|
|
449
449
|
print(f"✅ Exported {len(events_data)} events to {output_path}")
|
|
450
450
|
|
|
@@ -379,7 +379,7 @@ class AnalyzeCommand(BaseCommand):
|
|
|
379
379
|
filepath = diagram_dir / filename
|
|
380
380
|
|
|
381
381
|
try:
|
|
382
|
-
with open(
|
|
382
|
+
with filepath.open("w") as f:
|
|
383
383
|
# Write mermaid header comment
|
|
384
384
|
f.write("// Generated by Claude MPM Code Analyzer\n")
|
|
385
385
|
f.write(f"// Timestamp: {timestamp}\n")
|
|
@@ -478,7 +478,7 @@ class AnalyzeCommand(BaseCommand):
|
|
|
478
478
|
"""
|
|
479
479
|
try:
|
|
480
480
|
filepath.parent.mkdir(parents=True, exist_ok=True)
|
|
481
|
-
with open(
|
|
481
|
+
with filepath.open("w") as f:
|
|
482
482
|
f.write(content)
|
|
483
483
|
self.logger.info(f"Saved output to {filepath}")
|
|
484
484
|
except Exception as e:
|
|
@@ -136,7 +136,7 @@ class AnalyzeCodeCommand(BaseCommand):
|
|
|
136
136
|
# Save to file if specified
|
|
137
137
|
if args.save:
|
|
138
138
|
save_path = Path(args.save)
|
|
139
|
-
with open(
|
|
139
|
+
with save_path.open("w") as f:
|
|
140
140
|
json.dump(analysis_result, f, indent=2, default=str)
|
|
141
141
|
self.logger.info(f"Analysis saved to {save_path}")
|
|
142
142
|
|
|
@@ -154,12 +154,12 @@ def analyze_claude_json(file_path: Path) -> Tuple[Dict[str, Any], List[str]]:
|
|
|
154
154
|
stats["file_size"] = file_stat.st_size
|
|
155
155
|
|
|
156
156
|
# Count lines
|
|
157
|
-
with open(
|
|
157
|
+
with file_path.open() as f:
|
|
158
158
|
stats["line_count"] = sum(1 for _ in f)
|
|
159
159
|
|
|
160
160
|
# Try to parse JSON structure
|
|
161
161
|
try:
|
|
162
|
-
with open(
|
|
162
|
+
with file_path.open() as f:
|
|
163
163
|
data = json.load(f)
|
|
164
164
|
|
|
165
165
|
# Analyze conversation structure
|
|
@@ -220,7 +220,7 @@ def create_archive(source_path: Path, archive_dir: Path) -> Path:
|
|
|
220
220
|
import gzip
|
|
221
221
|
|
|
222
222
|
compressed_path = archive_path.with_suffix(".json.gz")
|
|
223
|
-
with open(
|
|
223
|
+
with archive_path.open("rb") as f_in:
|
|
224
224
|
with gzip.open(compressed_path, "wb") as f_out:
|
|
225
225
|
shutil.copyfileobj(f_in, f_out)
|
|
226
226
|
archive_path.unlink() # Remove uncompressed version
|
|
@@ -58,7 +58,7 @@ class ConfigCommand(BaseCommand):
|
|
|
58
58
|
f"Unknown config command: {args.config_command}"
|
|
59
59
|
)
|
|
60
60
|
|
|
61
|
-
def _validate_config(self, args) -> CommandResult:
|
|
61
|
+
def _validate_config(self, args) -> CommandResult:
|
|
62
62
|
"""Validate configuration file."""
|
|
63
63
|
config_file = getattr(args, "config_file", None) or Path(
|
|
64
64
|
".claude-mpm/configuration.yaml"
|
|
@@ -168,7 +168,7 @@ class ConfigCommand(BaseCommand):
|
|
|
168
168
|
console.print(f"[red]Failed to validate configuration: {e}[/red]")
|
|
169
169
|
return CommandResult.error_result(f"Failed to validate configuration: {e}")
|
|
170
170
|
|
|
171
|
-
def _view_config(self, args) -> CommandResult:
|
|
171
|
+
def _view_config(self, args) -> CommandResult:
|
|
172
172
|
"""View current configuration."""
|
|
173
173
|
try:
|
|
174
174
|
# Load configuration
|
|
@@ -64,14 +64,14 @@ class SimpleAgentManager:
|
|
|
64
64
|
def _load_states(self):
|
|
65
65
|
"""Load agent states from file."""
|
|
66
66
|
if self.config_file.exists():
|
|
67
|
-
with
|
|
67
|
+
with self.config_file.open() as f:
|
|
68
68
|
self.states = json.load(f)
|
|
69
69
|
else:
|
|
70
70
|
self.states = {}
|
|
71
71
|
|
|
72
72
|
def _save_states(self):
|
|
73
73
|
"""Save agent states to file."""
|
|
74
|
-
with
|
|
74
|
+
with self.config_file.open("w") as f:
|
|
75
75
|
json.dump(self.states, f, indent=2)
|
|
76
76
|
|
|
77
77
|
def is_agent_enabled(self, agent_name: str) -> bool:
|
|
@@ -105,7 +105,7 @@ class SimpleAgentManager:
|
|
|
105
105
|
continue
|
|
106
106
|
|
|
107
107
|
try:
|
|
108
|
-
with open(
|
|
108
|
+
with template_file.open() as f:
|
|
109
109
|
template_data = json.load(f)
|
|
110
110
|
|
|
111
111
|
# Extract agent information from template
|
|
@@ -205,7 +205,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
205
205
|
|
|
206
206
|
return None
|
|
207
207
|
|
|
208
|
-
def run(self, args) -> CommandResult:
|
|
208
|
+
def run(self, args) -> CommandResult:
|
|
209
209
|
"""Execute the configure command."""
|
|
210
210
|
# Set configuration scope
|
|
211
211
|
self.current_scope = getattr(args, "scope", "project")
|
|
@@ -447,7 +447,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
447
447
|
try:
|
|
448
448
|
template_path = self._get_agent_template_path(agent.name)
|
|
449
449
|
if template_path.exists():
|
|
450
|
-
with open(
|
|
450
|
+
with template_path.open() as f:
|
|
451
451
|
template = json.load(f)
|
|
452
452
|
model = template.get("capabilities", {}).get("model", "default")
|
|
453
453
|
tools_display = f"Model: {model}"
|
|
@@ -542,7 +542,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
542
542
|
template_path = self._get_agent_template_path(agent.name)
|
|
543
543
|
|
|
544
544
|
if template_path.exists():
|
|
545
|
-
with open(
|
|
545
|
+
with template_path.open() as f:
|
|
546
546
|
template = json.load(f)
|
|
547
547
|
is_system = str(template_path).startswith(
|
|
548
548
|
str(self.agent_manager.templates_dir)
|
|
@@ -693,11 +693,11 @@ class ConfigureCommand(BaseCommand):
|
|
|
693
693
|
subprocess.call([editor, temp_path])
|
|
694
694
|
|
|
695
695
|
# Read back the edited content
|
|
696
|
-
with open(
|
|
696
|
+
with temp_path.open() as f:
|
|
697
697
|
new_template = json.load(f)
|
|
698
698
|
|
|
699
699
|
# Save to actual template path
|
|
700
|
-
with open(
|
|
700
|
+
with template_path.open("w") as f:
|
|
701
701
|
json.dump(new_template, f, indent=2)
|
|
702
702
|
|
|
703
703
|
self.console.print("[green]Template updated successfully![/green]")
|
|
@@ -732,7 +732,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
732
732
|
current[parts[-1]] = value
|
|
733
733
|
|
|
734
734
|
# Save the template
|
|
735
|
-
with open(
|
|
735
|
+
with template_path.open("w") as f:
|
|
736
736
|
json.dump(template, f, indent=2)
|
|
737
737
|
|
|
738
738
|
self.console.print(
|
|
@@ -765,7 +765,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
765
765
|
del current[parts[-1]]
|
|
766
766
|
|
|
767
767
|
# Save the template
|
|
768
|
-
with open(
|
|
768
|
+
with template_path.open("w") as f:
|
|
769
769
|
json.dump(template, f, indent=2)
|
|
770
770
|
|
|
771
771
|
self.console.print(
|
|
@@ -802,7 +802,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
802
802
|
return
|
|
803
803
|
|
|
804
804
|
# Save the template copy
|
|
805
|
-
with open(
|
|
805
|
+
with custom_path.open("w") as f:
|
|
806
806
|
json.dump(template, f, indent=2)
|
|
807
807
|
|
|
808
808
|
self.console.print(f"[green]Created custom template at: {custom_path}[/green]")
|
|
@@ -839,7 +839,7 @@ class ConfigureCommand(BaseCommand):
|
|
|
839
839
|
|
|
840
840
|
if template_path.exists():
|
|
841
841
|
try:
|
|
842
|
-
with open(
|
|
842
|
+
with template_path.open() as f:
|
|
843
843
|
template = json.load(f)
|
|
844
844
|
|
|
845
845
|
# Extract additional information
|
|
@@ -1675,7 +1675,7 @@ Directory: {self.project_dir}
|
|
|
1675
1675
|
|
|
1676
1676
|
# Write to file
|
|
1677
1677
|
output_path = Path(file_path)
|
|
1678
|
-
with open(
|
|
1678
|
+
with output_path.open("w") as f:
|
|
1679
1679
|
json.dump(config_data, f, indent=2)
|
|
1680
1680
|
|
|
1681
1681
|
return CommandResult.success_result(
|
|
@@ -1692,7 +1692,7 @@ Directory: {self.project_dir}
|
|
|
1692
1692
|
if not input_path.exists():
|
|
1693
1693
|
return CommandResult.error_result(f"File not found: {file_path}")
|
|
1694
1694
|
|
|
1695
|
-
with open(
|
|
1695
|
+
with input_path.open() as f:
|
|
1696
1696
|
config_data = json.load(f)
|
|
1697
1697
|
|
|
1698
1698
|
# Apply agent states
|
|
@@ -65,7 +65,7 @@ class DashboardCommand(BaseCommand):
|
|
|
65
65
|
self.logger.error(f"Error executing dashboard command: {e}", exc_info=True)
|
|
66
66
|
return CommandResult.error_result(f"Error executing dashboard command: {e}")
|
|
67
67
|
|
|
68
|
-
def _start_dashboard(self, args) -> CommandResult:
|
|
68
|
+
def _start_dashboard(self, args) -> CommandResult:
|
|
69
69
|
"""Start the dashboard server."""
|
|
70
70
|
port = getattr(args, "port", 8765)
|
|
71
71
|
host = getattr(args, "host", "localhost")
|
claude_mpm/cli/commands/debug.py
CHANGED
|
@@ -21,7 +21,7 @@ from typing import Any, Dict
|
|
|
21
21
|
from ...core.logger import get_logger
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def manage_debug(args):
|
|
24
|
+
def manage_debug(args):
|
|
25
25
|
"""
|
|
26
26
|
Main entry point for debug commands.
|
|
27
27
|
|
|
@@ -446,7 +446,7 @@ def debug_agents(args, logger):
|
|
|
446
446
|
|
|
447
447
|
# Try to load and analyze memory
|
|
448
448
|
try:
|
|
449
|
-
with open(
|
|
449
|
+
with mem_file.open() as f:
|
|
450
450
|
memory_data = json.load(f)
|
|
451
451
|
|
|
452
452
|
entry_count = (
|
|
@@ -509,7 +509,7 @@ def debug_agents(args, logger):
|
|
|
509
509
|
print(f" Size: {agent_file.stat().st_size:,} bytes")
|
|
510
510
|
|
|
511
511
|
# Read first few lines for type detection
|
|
512
|
-
with open(
|
|
512
|
+
with agent_file.open() as f:
|
|
513
513
|
lines = f.readlines()[:10]
|
|
514
514
|
for line in lines:
|
|
515
515
|
if "role:" in line.lower():
|
|
@@ -181,7 +181,7 @@ def doctor_command(args):
|
|
|
181
181
|
import sys
|
|
182
182
|
|
|
183
183
|
original_stdout = sys.stdout
|
|
184
|
-
with open(
|
|
184
|
+
with output_file.open("w") as f:
|
|
185
185
|
sys.stdout = f
|
|
186
186
|
reporter.report(summary, format=output_format)
|
|
187
187
|
sys.stdout = original_stdout
|
claude_mpm/cli/commands/mcp.py
CHANGED
|
@@ -61,10 +61,10 @@ def manage_mcp(args):
|
|
|
61
61
|
|
|
62
62
|
# Allow install command to proceed
|
|
63
63
|
if args.mcp_command == MCPCommands.INSTALL.value:
|
|
64
|
-
MCPConfiguration = None
|
|
65
|
-
MCPServiceRegistry = None
|
|
66
|
-
ToolRegistry = None
|
|
67
|
-
MCPGateway = None
|
|
64
|
+
MCPConfiguration = None
|
|
65
|
+
MCPServiceRegistry = None
|
|
66
|
+
ToolRegistry = None
|
|
67
|
+
MCPGateway = None
|
|
68
68
|
else:
|
|
69
69
|
print(
|
|
70
70
|
"\nError: MCP Gateway services not fully available",
|
|
@@ -120,7 +120,7 @@ def _show_status(
|
|
|
120
120
|
MCPConfiguration,
|
|
121
121
|
MCPServiceRegistry,
|
|
122
122
|
ToolRegistry,
|
|
123
|
-
MCPGateway,
|
|
123
|
+
MCPGateway,
|
|
124
124
|
):
|
|
125
125
|
"""
|
|
126
126
|
Show MCP Gateway status when no subcommand is provided.
|
|
@@ -151,7 +151,7 @@ def _show_status(
|
|
|
151
151
|
if config_path.exists():
|
|
152
152
|
print(f" Config file: {config_path}")
|
|
153
153
|
try:
|
|
154
|
-
with open(
|
|
154
|
+
with config_path.open() as f:
|
|
155
155
|
config = json.load(f)
|
|
156
156
|
if "servers" in config:
|
|
157
157
|
print(f" Configured servers: {len(config.get('servers', {}))}")
|
|
@@ -171,7 +171,7 @@ def _show_status(
|
|
|
171
171
|
if claude_config.exists():
|
|
172
172
|
print(f"\n🖥️ Claude Code Config: {claude_config}")
|
|
173
173
|
try:
|
|
174
|
-
with open(
|
|
174
|
+
with claude_config.open() as f:
|
|
175
175
|
config = json.load(f)
|
|
176
176
|
mcp_servers = config.get("mcpServers", {})
|
|
177
177
|
if "claude-mpm" in mcp_servers:
|
|
@@ -16,7 +16,7 @@ class MCPCommandRouter:
|
|
|
16
16
|
"""Initialize the command router."""
|
|
17
17
|
self.logger = logger
|
|
18
18
|
|
|
19
|
-
def route_command(self, args) -> int:
|
|
19
|
+
def route_command(self, args) -> int:
|
|
20
20
|
"""Route command to appropriate handler."""
|
|
21
21
|
if args.mcp_command == MCPCommands.START.value:
|
|
22
22
|
return asyncio.run(self._start_server(args))
|
|
@@ -62,7 +62,7 @@ class MCPConfigCommand(BaseCommand):
|
|
|
62
62
|
# Show the updated configuration
|
|
63
63
|
config_path = Path.cwd() / ".mcp.json"
|
|
64
64
|
if config_path.exists():
|
|
65
|
-
with open(
|
|
65
|
+
with config_path.open() as f:
|
|
66
66
|
config = json.load(f)
|
|
67
67
|
return CommandResult(
|
|
68
68
|
success=True,
|
|
@@ -120,7 +120,7 @@ class MCPConfigCommand(BaseCommand):
|
|
|
120
120
|
current_config = {}
|
|
121
121
|
if config_path.exists():
|
|
122
122
|
try:
|
|
123
|
-
with open(
|
|
123
|
+
with config_path.open() as f:
|
|
124
124
|
current_config = json.load(f)
|
|
125
125
|
except Exception:
|
|
126
126
|
pass
|
|
@@ -12,7 +12,7 @@ class MCPExternalCommands:
|
|
|
12
12
|
"""Initialize the MCP external commands handler."""
|
|
13
13
|
self.logger = logger
|
|
14
14
|
|
|
15
|
-
def manage_external(self, args):
|
|
15
|
+
def manage_external(self, args):
|
|
16
16
|
"""Manage external MCP services.
|
|
17
17
|
|
|
18
18
|
Args:
|
|
@@ -135,7 +135,7 @@ class MCPExternalCommands:
|
|
|
135
135
|
print(f"\n📄 Found config: {config_path}")
|
|
136
136
|
|
|
137
137
|
try:
|
|
138
|
-
with open(
|
|
138
|
+
with config_path.open() as f:
|
|
139
139
|
config = json.load(f)
|
|
140
140
|
|
|
141
141
|
mcp_servers = config.get("mcpServers", {})
|
|
@@ -270,7 +270,7 @@ class MCPInstallCommands:
|
|
|
270
270
|
if not force:
|
|
271
271
|
# Check if claude-mpm-gateway already exists
|
|
272
272
|
try:
|
|
273
|
-
with open(
|
|
273
|
+
with config_path.open() as f:
|
|
274
274
|
existing_config = json.load(f)
|
|
275
275
|
|
|
276
276
|
if (
|
|
@@ -305,7 +305,7 @@ class MCPInstallCommands:
|
|
|
305
305
|
else:
|
|
306
306
|
# Force mode - create backup but proceed
|
|
307
307
|
try:
|
|
308
|
-
with open(
|
|
308
|
+
with config_path.open() as f:
|
|
309
309
|
existing_config = json.load(f)
|
|
310
310
|
config = existing_config
|
|
311
311
|
print(" Force mode: Overwriting existing configuration")
|
|
@@ -335,7 +335,7 @@ class MCPInstallCommands:
|
|
|
335
335
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
|
336
336
|
|
|
337
337
|
# Write configuration with nice formatting
|
|
338
|
-
with open(
|
|
338
|
+
with config_path.open("w") as f:
|
|
339
339
|
json.dump(config, f, indent=2)
|
|
340
340
|
|
|
341
341
|
print(f"\n✅ Configuration saved to {config_path}")
|
|
@@ -110,7 +110,7 @@ def configure_mcp_for_pipx(args) -> int:
|
|
|
110
110
|
existing_config = {}
|
|
111
111
|
if config_path.exists():
|
|
112
112
|
try:
|
|
113
|
-
with open(
|
|
113
|
+
with config_path.open() as f:
|
|
114
114
|
existing_config = json.load(f)
|
|
115
115
|
print("✅ Existing config loaded")
|
|
116
116
|
except json.JSONDecodeError:
|
|
@@ -145,7 +145,7 @@ def configure_mcp_for_pipx(args) -> int:
|
|
|
145
145
|
# Write config
|
|
146
146
|
if not args.dry_run:
|
|
147
147
|
try:
|
|
148
|
-
with open(
|
|
148
|
+
with config_path.open("w") as f:
|
|
149
149
|
json.dump(existing_config, f, indent=2)
|
|
150
150
|
print(f"\n✅ Configuration written to: {config_path}")
|
|
151
151
|
except Exception as e:
|
|
@@ -621,7 +621,7 @@ class MCPExternalServicesSetup:
|
|
|
621
621
|
"""
|
|
622
622
|
try:
|
|
623
623
|
if config_path.exists():
|
|
624
|
-
with open(
|
|
624
|
+
with config_path.open() as f:
|
|
625
625
|
config = json.load(f)
|
|
626
626
|
# Ensure mcpServers key exists
|
|
627
627
|
if "mcpServers" not in config:
|
|
@@ -664,7 +664,7 @@ class MCPExternalServicesSetup:
|
|
|
664
664
|
print(f" 📁 Created backup: {backup_path}")
|
|
665
665
|
|
|
666
666
|
# Write configuration with proper formatting
|
|
667
|
-
with open(
|
|
667
|
+
with config_path.open("w") as f:
|
|
668
668
|
json.dump(config, f, indent=2)
|
|
669
669
|
f.write("\n") # Add newline at end of file
|
|
670
670
|
|
|
@@ -830,7 +830,7 @@ class MCPExternalServicesSetup:
|
|
|
830
830
|
|
|
831
831
|
if mcp_config_path.exists():
|
|
832
832
|
try:
|
|
833
|
-
with open(
|
|
833
|
+
with mcp_config_path.open() as f:
|
|
834
834
|
mcp_config = json.load(f)
|
|
835
835
|
print(f"\n📁 Project MCP config: {mcp_config_path}")
|
|
836
836
|
except Exception:
|
|
@@ -37,7 +37,7 @@ class MonitorCommand(BaseCommand):
|
|
|
37
37
|
|
|
38
38
|
return None
|
|
39
39
|
|
|
40
|
-
def run(self, args) -> CommandResult:
|
|
40
|
+
def run(self, args) -> CommandResult:
|
|
41
41
|
"""Execute the monitor command using unified monitoring daemon."""
|
|
42
42
|
try:
|
|
43
43
|
self.logger.info("Monitor command using unified monitoring daemon")
|
|
@@ -769,7 +769,7 @@ class AgentWizard:
|
|
|
769
769
|
|
|
770
770
|
output_file = output_dir / f"{template.agent_id}.json"
|
|
771
771
|
|
|
772
|
-
with open(
|
|
772
|
+
with output_file.open("w") as f:
|
|
773
773
|
json.dump(template.to_json(), f, indent=2)
|
|
774
774
|
|
|
775
775
|
return True, f"Agent exported to {output_file}"
|
|
@@ -190,7 +190,7 @@ Examples:
|
|
|
190
190
|
return search_parser
|
|
191
191
|
|
|
192
192
|
|
|
193
|
-
def validate_search_args(args: argparse.Namespace) -> Optional[str]:
|
|
193
|
+
def validate_search_args(args: argparse.Namespace) -> Optional[str]:
|
|
194
194
|
"""
|
|
195
195
|
Validate search command arguments.
|
|
196
196
|
|
|
@@ -7,14 +7,14 @@ across multiple CLI commands.
|
|
|
7
7
|
|
|
8
8
|
import argparse
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
from typing import Any, Dict, List, Optional
|
|
10
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class CommonArguments:
|
|
14
14
|
"""Registry of common argument patterns used across CLI commands."""
|
|
15
15
|
|
|
16
16
|
# Logging arguments
|
|
17
|
-
VERBOSE = {
|
|
17
|
+
VERBOSE: ClassVar[Dict[str, Any]] = {
|
|
18
18
|
"flags": ["-v", "--verbose"],
|
|
19
19
|
"action": "store_true",
|
|
20
20
|
"help": "Enable verbose output",
|
|
@@ -183,7 +183,7 @@ class BaseCommand(ABC):
|
|
|
183
183
|
|
|
184
184
|
if hasattr(args, "output") and args.output:
|
|
185
185
|
# Write to file
|
|
186
|
-
with
|
|
186
|
+
with args.output.open("w") as f:
|
|
187
187
|
f.write(formatted_output)
|
|
188
188
|
self.logger.info(f"Output written to {args.output}")
|
|
189
189
|
else:
|
|
@@ -303,7 +303,7 @@ class StartupStatusLogger:
|
|
|
303
303
|
|
|
304
304
|
import json
|
|
305
305
|
|
|
306
|
-
with open(
|
|
306
|
+
with claude_json_path.open() as f:
|
|
307
307
|
config = json.load(f)
|
|
308
308
|
|
|
309
309
|
result["found"] = True
|
|
@@ -716,9 +716,9 @@ def start_vector_search_indexing(project_root: Optional[Path] = None) -> None:
|
|
|
716
716
|
try:
|
|
717
717
|
# Try to get the current event loop
|
|
718
718
|
loop = asyncio.get_running_loop()
|
|
719
|
-
# If we're in an event loop, create a task
|
|
720
|
-
|
|
721
|
-
|
|
719
|
+
# If we're in an event loop, create a task (fire-and-forget)
|
|
720
|
+
_task = loop.create_task(trigger_vector_search_indexing(project_root)) # noqa: RUF006
|
|
721
|
+
# Fire-and-forget: task will complete in background
|
|
722
722
|
except RuntimeError:
|
|
723
723
|
# No event loop running - use subprocess directly to avoid event loop lifecycle issues
|
|
724
724
|
# The async approach with asyncio.run() creates and closes a loop which causes
|