claude-mpm 3.9.9__py3-none-any.whl → 4.0.3__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/__init__.py +2 -2
- claude_mpm/__main__.py +3 -2
- claude_mpm/agents/__init__.py +85 -79
- claude_mpm/agents/agent_loader.py +464 -1003
- claude_mpm/agents/agent_loader_integration.py +45 -45
- claude_mpm/agents/agents_metadata.py +29 -30
- claude_mpm/agents/async_agent_loader.py +156 -138
- claude_mpm/agents/base_agent.json +1 -1
- claude_mpm/agents/base_agent_loader.py +179 -151
- claude_mpm/agents/frontmatter_validator.py +229 -130
- claude_mpm/agents/schema/agent_schema.json +1 -1
- claude_mpm/agents/system_agent_config.py +213 -147
- claude_mpm/agents/templates/__init__.py +13 -13
- claude_mpm/agents/templates/code_analyzer.json +2 -2
- claude_mpm/agents/templates/data_engineer.json +1 -1
- claude_mpm/agents/templates/documentation.json +23 -11
- claude_mpm/agents/templates/engineer.json +22 -6
- claude_mpm/agents/templates/memory_manager.json +155 -0
- claude_mpm/agents/templates/ops.json +2 -2
- claude_mpm/agents/templates/project_organizer.json +1 -1
- claude_mpm/agents/templates/qa.json +1 -1
- claude_mpm/agents/templates/refactoring_engineer.json +222 -0
- claude_mpm/agents/templates/research.json +20 -14
- claude_mpm/agents/templates/security.json +1 -1
- claude_mpm/agents/templates/ticketing.json +1 -1
- claude_mpm/agents/templates/version_control.json +1 -1
- claude_mpm/agents/templates/web_qa.json +3 -1
- claude_mpm/agents/templates/web_ui.json +2 -2
- claude_mpm/cli/__init__.py +90 -49
- claude_mpm/cli/__main__.py +3 -2
- claude_mpm/cli/commands/__init__.py +21 -18
- claude_mpm/cli/commands/agents.py +279 -247
- claude_mpm/cli/commands/aggregate.py +138 -157
- claude_mpm/cli/commands/cleanup.py +147 -147
- claude_mpm/cli/commands/config.py +93 -76
- claude_mpm/cli/commands/info.py +17 -16
- claude_mpm/cli/commands/mcp.py +143 -762
- claude_mpm/cli/commands/mcp_command_router.py +139 -0
- claude_mpm/cli/commands/mcp_config_commands.py +20 -0
- claude_mpm/cli/commands/mcp_install_commands.py +20 -0
- claude_mpm/cli/commands/mcp_server_commands.py +175 -0
- claude_mpm/cli/commands/mcp_tool_commands.py +34 -0
- claude_mpm/cli/commands/memory.py +239 -203
- claude_mpm/cli/commands/monitor.py +203 -81
- claude_mpm/cli/commands/run.py +380 -429
- claude_mpm/cli/commands/run_config_checker.py +160 -0
- claude_mpm/cli/commands/socketio_monitor.py +235 -0
- claude_mpm/cli/commands/tickets.py +305 -197
- claude_mpm/cli/parser.py +24 -1150
- claude_mpm/cli/parsers/__init__.py +29 -0
- claude_mpm/cli/parsers/agents_parser.py +136 -0
- claude_mpm/cli/parsers/base_parser.py +331 -0
- claude_mpm/cli/parsers/config_parser.py +85 -0
- claude_mpm/cli/parsers/mcp_parser.py +152 -0
- claude_mpm/cli/parsers/memory_parser.py +138 -0
- claude_mpm/cli/parsers/monitor_parser.py +104 -0
- claude_mpm/cli/parsers/run_parser.py +147 -0
- claude_mpm/cli/parsers/tickets_parser.py +203 -0
- claude_mpm/cli/ticket_cli.py +7 -3
- claude_mpm/cli/utils.py +55 -37
- claude_mpm/cli_module/__init__.py +6 -6
- claude_mpm/cli_module/args.py +188 -140
- claude_mpm/cli_module/commands.py +79 -70
- claude_mpm/cli_module/migration_example.py +38 -60
- claude_mpm/config/__init__.py +32 -25
- claude_mpm/config/agent_config.py +151 -119
- claude_mpm/config/experimental_features.py +217 -0
- claude_mpm/config/paths.py +94 -208
- claude_mpm/config/socketio_config.py +84 -73
- claude_mpm/constants.py +36 -18
- claude_mpm/core/__init__.py +9 -6
- claude_mpm/core/agent_name_normalizer.py +68 -71
- claude_mpm/core/agent_registry.py +372 -521
- claude_mpm/core/agent_session_manager.py +74 -63
- claude_mpm/core/base_service.py +116 -87
- claude_mpm/core/cache.py +119 -153
- claude_mpm/core/claude_runner.py +425 -1120
- claude_mpm/core/config.py +263 -168
- claude_mpm/core/config_aliases.py +69 -61
- claude_mpm/core/config_constants.py +292 -0
- claude_mpm/core/constants.py +57 -99
- claude_mpm/core/container.py +211 -178
- claude_mpm/core/exceptions.py +233 -89
- claude_mpm/core/factories.py +92 -54
- claude_mpm/core/framework_loader.py +378 -220
- claude_mpm/core/hook_manager.py +198 -83
- claude_mpm/core/hook_performance_config.py +136 -0
- claude_mpm/core/injectable_service.py +61 -55
- claude_mpm/core/interactive_session.py +165 -155
- claude_mpm/core/interfaces.py +221 -195
- claude_mpm/core/lazy.py +96 -96
- claude_mpm/core/logger.py +133 -107
- claude_mpm/core/logging_config.py +185 -157
- claude_mpm/core/minimal_framework_loader.py +20 -15
- claude_mpm/core/mixins.py +30 -29
- claude_mpm/core/oneshot_session.py +215 -181
- claude_mpm/core/optimized_agent_loader.py +134 -138
- claude_mpm/core/optimized_startup.py +159 -157
- claude_mpm/core/pm_hook_interceptor.py +85 -72
- claude_mpm/core/service_registry.py +103 -101
- claude_mpm/core/session_manager.py +97 -87
- claude_mpm/core/socketio_pool.py +212 -158
- claude_mpm/core/tool_access_control.py +58 -51
- claude_mpm/core/types.py +46 -24
- claude_mpm/core/typing_utils.py +166 -82
- claude_mpm/core/unified_agent_registry.py +721 -0
- claude_mpm/core/unified_config.py +550 -0
- claude_mpm/core/unified_paths.py +549 -0
- claude_mpm/dashboard/index.html +1 -1
- claude_mpm/dashboard/open_dashboard.py +51 -17
- claude_mpm/dashboard/static/css/dashboard.css +27 -8
- claude_mpm/dashboard/static/dist/components/agent-inference.js +2 -0
- claude_mpm/dashboard/static/dist/components/event-processor.js +2 -0
- claude_mpm/dashboard/static/dist/components/event-viewer.js +2 -0
- claude_mpm/dashboard/static/dist/components/export-manager.js +2 -0
- claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +2 -0
- claude_mpm/dashboard/static/dist/components/hud-library-loader.js +2 -0
- claude_mpm/dashboard/static/dist/components/hud-manager.js +2 -0
- claude_mpm/dashboard/static/dist/components/hud-visualizer.js +2 -0
- claude_mpm/dashboard/static/dist/components/module-viewer.js +2 -0
- claude_mpm/dashboard/static/dist/components/session-manager.js +2 -0
- claude_mpm/dashboard/static/dist/components/socket-manager.js +2 -0
- claude_mpm/dashboard/static/dist/components/ui-state-manager.js +2 -0
- claude_mpm/dashboard/static/dist/components/working-directory.js +2 -0
- claude_mpm/dashboard/static/dist/dashboard.js +2 -0
- claude_mpm/dashboard/static/dist/socket-client.js +2 -0
- claude_mpm/dashboard/static/js/components/agent-inference.js +80 -76
- claude_mpm/dashboard/static/js/components/event-processor.js +71 -67
- claude_mpm/dashboard/static/js/components/event-viewer.js +74 -70
- claude_mpm/dashboard/static/js/components/export-manager.js +31 -28
- claude_mpm/dashboard/static/js/components/file-tool-tracker.js +106 -92
- claude_mpm/dashboard/static/js/components/hud-library-loader.js +11 -11
- claude_mpm/dashboard/static/js/components/hud-manager.js +73 -73
- claude_mpm/dashboard/static/js/components/hud-visualizer.js +163 -163
- claude_mpm/dashboard/static/js/components/module-viewer.js +305 -233
- claude_mpm/dashboard/static/js/components/session-manager.js +32 -29
- claude_mpm/dashboard/static/js/components/socket-manager.js +27 -20
- claude_mpm/dashboard/static/js/components/ui-state-manager.js +21 -18
- claude_mpm/dashboard/static/js/components/working-directory.js +74 -71
- claude_mpm/dashboard/static/js/dashboard.js +178 -453
- claude_mpm/dashboard/static/js/extension-error-handler.js +164 -0
- claude_mpm/dashboard/static/js/socket-client.js +120 -54
- claude_mpm/dashboard/templates/index.html +40 -50
- claude_mpm/experimental/cli_enhancements.py +60 -58
- claude_mpm/generators/__init__.py +1 -1
- claude_mpm/generators/agent_profile_generator.py +75 -65
- claude_mpm/hooks/__init__.py +1 -1
- claude_mpm/hooks/base_hook.py +33 -28
- claude_mpm/hooks/claude_hooks/__init__.py +1 -1
- claude_mpm/hooks/claude_hooks/connection_pool.py +120 -0
- claude_mpm/hooks/claude_hooks/event_handlers.py +743 -0
- claude_mpm/hooks/claude_hooks/hook_handler.py +415 -1331
- claude_mpm/hooks/claude_hooks/hook_wrapper.sh +4 -4
- claude_mpm/hooks/claude_hooks/memory_integration.py +221 -0
- claude_mpm/hooks/claude_hooks/response_tracking.py +348 -0
- claude_mpm/hooks/claude_hooks/tool_analysis.py +230 -0
- claude_mpm/hooks/memory_integration_hook.py +140 -100
- claude_mpm/hooks/tool_call_interceptor.py +89 -76
- claude_mpm/hooks/validation_hooks.py +57 -49
- claude_mpm/init.py +145 -121
- claude_mpm/models/__init__.py +9 -9
- claude_mpm/models/agent_definition.py +33 -23
- claude_mpm/models/agent_session.py +228 -200
- claude_mpm/scripts/__init__.py +1 -1
- claude_mpm/scripts/socketio_daemon.py +192 -75
- claude_mpm/scripts/socketio_server_manager.py +328 -0
- claude_mpm/scripts/start_activity_logging.py +25 -22
- claude_mpm/services/__init__.py +68 -43
- claude_mpm/services/agent_capabilities_service.py +271 -0
- claude_mpm/services/agents/__init__.py +23 -32
- claude_mpm/services/agents/deployment/__init__.py +3 -3
- claude_mpm/services/agents/deployment/agent_config_provider.py +310 -0
- claude_mpm/services/agents/deployment/agent_configuration_manager.py +359 -0
- claude_mpm/services/agents/deployment/agent_definition_factory.py +84 -0
- claude_mpm/services/agents/deployment/agent_deployment.py +415 -2113
- claude_mpm/services/agents/deployment/agent_discovery_service.py +387 -0
- claude_mpm/services/agents/deployment/agent_environment_manager.py +293 -0
- claude_mpm/services/agents/deployment/agent_filesystem_manager.py +387 -0
- claude_mpm/services/agents/deployment/agent_format_converter.py +453 -0
- claude_mpm/services/agents/deployment/agent_frontmatter_validator.py +161 -0
- claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +345 -495
- claude_mpm/services/agents/deployment/agent_metrics_collector.py +279 -0
- claude_mpm/services/agents/deployment/agent_restore_handler.py +88 -0
- claude_mpm/services/agents/deployment/agent_template_builder.py +406 -0
- claude_mpm/services/agents/deployment/agent_validator.py +352 -0
- claude_mpm/services/agents/deployment/agent_version_manager.py +313 -0
- claude_mpm/services/agents/deployment/agent_versioning.py +6 -9
- claude_mpm/services/agents/deployment/agents_directory_resolver.py +79 -0
- claude_mpm/services/agents/deployment/async_agent_deployment.py +298 -234
- claude_mpm/services/agents/deployment/config/__init__.py +13 -0
- claude_mpm/services/agents/deployment/config/deployment_config.py +182 -0
- claude_mpm/services/agents/deployment/config/deployment_config_manager.py +200 -0
- claude_mpm/services/agents/deployment/deployment_config_loader.py +54 -0
- claude_mpm/services/agents/deployment/deployment_type_detector.py +124 -0
- claude_mpm/services/agents/deployment/facade/__init__.py +18 -0
- claude_mpm/services/agents/deployment/facade/async_deployment_executor.py +159 -0
- claude_mpm/services/agents/deployment/facade/deployment_executor.py +73 -0
- claude_mpm/services/agents/deployment/facade/deployment_facade.py +270 -0
- claude_mpm/services/agents/deployment/facade/sync_deployment_executor.py +178 -0
- claude_mpm/services/agents/deployment/interface_adapter.py +227 -0
- claude_mpm/services/agents/deployment/lifecycle_health_checker.py +85 -0
- claude_mpm/services/agents/deployment/lifecycle_performance_tracker.py +100 -0
- claude_mpm/services/agents/deployment/pipeline/__init__.py +32 -0
- claude_mpm/services/agents/deployment/pipeline/pipeline_builder.py +158 -0
- claude_mpm/services/agents/deployment/pipeline/pipeline_context.py +159 -0
- claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +169 -0
- claude_mpm/services/agents/deployment/pipeline/steps/__init__.py +19 -0
- claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +195 -0
- claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +119 -0
- claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +79 -0
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +90 -0
- claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +100 -0
- claude_mpm/services/agents/deployment/processors/__init__.py +15 -0
- claude_mpm/services/agents/deployment/processors/agent_deployment_context.py +98 -0
- claude_mpm/services/agents/deployment/processors/agent_deployment_result.py +235 -0
- claude_mpm/services/agents/deployment/processors/agent_processor.py +258 -0
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +318 -0
- claude_mpm/services/agents/deployment/results/__init__.py +13 -0
- claude_mpm/services/agents/deployment/results/deployment_metrics.py +200 -0
- claude_mpm/services/agents/deployment/results/deployment_result_builder.py +249 -0
- claude_mpm/services/agents/deployment/strategies/__init__.py +25 -0
- claude_mpm/services/agents/deployment/strategies/base_strategy.py +119 -0
- claude_mpm/services/agents/deployment/strategies/project_strategy.py +150 -0
- claude_mpm/services/agents/deployment/strategies/strategy_selector.py +117 -0
- claude_mpm/services/agents/deployment/strategies/system_strategy.py +116 -0
- claude_mpm/services/agents/deployment/strategies/user_strategy.py +137 -0
- claude_mpm/services/agents/deployment/system_instructions_deployer.py +108 -0
- claude_mpm/services/agents/deployment/validation/__init__.py +19 -0
- claude_mpm/services/agents/deployment/validation/agent_validator.py +323 -0
- claude_mpm/services/agents/deployment/validation/deployment_validator.py +238 -0
- claude_mpm/services/agents/deployment/validation/template_validator.py +299 -0
- claude_mpm/services/agents/deployment/validation/validation_result.py +226 -0
- claude_mpm/services/agents/loading/__init__.py +2 -2
- claude_mpm/services/agents/loading/agent_profile_loader.py +259 -229
- claude_mpm/services/agents/loading/base_agent_manager.py +90 -81
- claude_mpm/services/agents/loading/framework_agent_loader.py +154 -129
- claude_mpm/services/agents/management/__init__.py +2 -2
- claude_mpm/services/agents/management/agent_capabilities_generator.py +72 -58
- claude_mpm/services/agents/management/agent_management_service.py +209 -156
- claude_mpm/services/agents/memory/__init__.py +9 -6
- claude_mpm/services/agents/memory/agent_memory_manager.py +218 -1152
- claude_mpm/services/agents/memory/agent_persistence_service.py +20 -16
- claude_mpm/services/agents/memory/analyzer.py +430 -0
- claude_mpm/services/agents/memory/content_manager.py +376 -0
- claude_mpm/services/agents/memory/template_generator.py +468 -0
- claude_mpm/services/agents/registry/__init__.py +7 -10
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +122 -97
- claude_mpm/services/agents/registry/modification_tracker.py +351 -285
- claude_mpm/services/async_session_logger.py +187 -153
- claude_mpm/services/claude_session_logger.py +87 -72
- claude_mpm/services/command_handler_service.py +217 -0
- claude_mpm/services/communication/__init__.py +3 -2
- claude_mpm/services/core/__init__.py +50 -97
- claude_mpm/services/core/base.py +60 -53
- claude_mpm/services/core/interfaces/__init__.py +188 -0
- claude_mpm/services/core/interfaces/agent.py +351 -0
- claude_mpm/services/core/interfaces/communication.py +343 -0
- claude_mpm/services/core/interfaces/infrastructure.py +413 -0
- claude_mpm/services/core/interfaces/service.py +434 -0
- claude_mpm/services/core/interfaces.py +19 -944
- claude_mpm/services/event_aggregator.py +208 -170
- claude_mpm/services/exceptions.py +387 -308
- claude_mpm/services/framework_claude_md_generator/__init__.py +75 -79
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +69 -60
- claude_mpm/services/framework_claude_md_generator/content_validator.py +65 -61
- claude_mpm/services/framework_claude_md_generator/deployment_manager.py +68 -49
- claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +34 -34
- claude_mpm/services/framework_claude_md_generator/section_generators/agents.py +25 -22
- claude_mpm/services/framework_claude_md_generator/section_generators/claude_pm_init.py +10 -10
- claude_mpm/services/framework_claude_md_generator/section_generators/core_responsibilities.py +4 -3
- claude_mpm/services/framework_claude_md_generator/section_generators/delegation_constraints.py +4 -3
- claude_mpm/services/framework_claude_md_generator/section_generators/environment_config.py +4 -3
- claude_mpm/services/framework_claude_md_generator/section_generators/footer.py +6 -5
- claude_mpm/services/framework_claude_md_generator/section_generators/header.py +8 -7
- claude_mpm/services/framework_claude_md_generator/section_generators/orchestration_principles.py +4 -3
- claude_mpm/services/framework_claude_md_generator/section_generators/role_designation.py +6 -5
- claude_mpm/services/framework_claude_md_generator/section_generators/subprocess_validation.py +9 -8
- claude_mpm/services/framework_claude_md_generator/section_generators/todo_task_tools.py +4 -3
- claude_mpm/services/framework_claude_md_generator/section_generators/troubleshooting.py +5 -4
- claude_mpm/services/framework_claude_md_generator/section_manager.py +28 -27
- claude_mpm/services/framework_claude_md_generator/version_manager.py +30 -28
- claude_mpm/services/hook_service.py +106 -114
- claude_mpm/services/infrastructure/__init__.py +7 -5
- claude_mpm/services/infrastructure/context_preservation.py +571 -0
- claude_mpm/services/infrastructure/daemon_manager.py +279 -0
- claude_mpm/services/infrastructure/logging.py +83 -76
- claude_mpm/services/infrastructure/monitoring.py +547 -404
- claude_mpm/services/mcp_gateway/__init__.py +40 -23
- claude_mpm/services/mcp_gateway/config/__init__.py +2 -2
- claude_mpm/services/mcp_gateway/config/config_loader.py +61 -56
- claude_mpm/services/mcp_gateway/config/config_schema.py +50 -41
- claude_mpm/services/mcp_gateway/config/configuration.py +82 -75
- claude_mpm/services/mcp_gateway/core/__init__.py +14 -21
- claude_mpm/services/mcp_gateway/core/base.py +80 -67
- claude_mpm/services/mcp_gateway/core/exceptions.py +60 -46
- claude_mpm/services/mcp_gateway/core/interfaces.py +97 -93
- claude_mpm/services/mcp_gateway/main.py +307 -127
- claude_mpm/services/mcp_gateway/registry/__init__.py +1 -1
- claude_mpm/services/mcp_gateway/registry/service_registry.py +100 -101
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +135 -126
- claude_mpm/services/mcp_gateway/server/__init__.py +4 -4
- claude_mpm/services/mcp_gateway/server/{mcp_server.py → mcp_gateway.py} +149 -153
- claude_mpm/services/mcp_gateway/server/stdio_handler.py +105 -107
- claude_mpm/services/mcp_gateway/server/stdio_server.py +691 -0
- claude_mpm/services/mcp_gateway/tools/__init__.py +4 -2
- claude_mpm/services/mcp_gateway/tools/base_adapter.py +110 -121
- claude_mpm/services/mcp_gateway/tools/document_summarizer.py +283 -215
- claude_mpm/services/mcp_gateway/tools/hello_world.py +122 -120
- claude_mpm/services/mcp_gateway/tools/ticket_tools.py +652 -0
- claude_mpm/services/mcp_gateway/tools/unified_ticket_tool.py +606 -0
- claude_mpm/services/memory/__init__.py +2 -2
- claude_mpm/services/memory/builder.py +451 -362
- claude_mpm/services/memory/cache/__init__.py +2 -2
- claude_mpm/services/memory/cache/shared_prompt_cache.py +232 -194
- claude_mpm/services/memory/cache/simple_cache.py +107 -93
- claude_mpm/services/memory/indexed_memory.py +195 -193
- claude_mpm/services/memory/optimizer.py +267 -234
- claude_mpm/services/memory/router.py +571 -263
- claude_mpm/services/memory_hook_service.py +237 -0
- claude_mpm/services/port_manager.py +223 -0
- claude_mpm/services/project/__init__.py +3 -3
- claude_mpm/services/project/analyzer.py +451 -305
- claude_mpm/services/project/registry.py +262 -240
- claude_mpm/services/recovery_manager.py +287 -231
- claude_mpm/services/response_tracker.py +87 -67
- claude_mpm/services/runner_configuration_service.py +587 -0
- claude_mpm/services/session_management_service.py +304 -0
- claude_mpm/services/socketio/__init__.py +4 -4
- claude_mpm/services/socketio/client_proxy.py +174 -0
- claude_mpm/services/socketio/handlers/__init__.py +3 -3
- claude_mpm/services/socketio/handlers/base.py +44 -30
- claude_mpm/services/socketio/handlers/connection.py +145 -65
- claude_mpm/services/socketio/handlers/file.py +123 -108
- claude_mpm/services/socketio/handlers/git.py +607 -373
- claude_mpm/services/socketio/handlers/hook.py +170 -0
- claude_mpm/services/socketio/handlers/memory.py +4 -4
- claude_mpm/services/socketio/handlers/project.py +4 -4
- claude_mpm/services/socketio/handlers/registry.py +53 -38
- claude_mpm/services/socketio/server/__init__.py +18 -0
- claude_mpm/services/socketio/server/broadcaster.py +252 -0
- claude_mpm/services/socketio/server/core.py +399 -0
- claude_mpm/services/socketio/server/main.py +323 -0
- claude_mpm/services/socketio_client_manager.py +160 -133
- claude_mpm/services/socketio_server.py +36 -1885
- claude_mpm/services/subprocess_launcher_service.py +316 -0
- claude_mpm/services/system_instructions_service.py +258 -0
- claude_mpm/services/ticket_manager.py +20 -534
- claude_mpm/services/utility_service.py +285 -0
- claude_mpm/services/version_control/__init__.py +18 -21
- claude_mpm/services/version_control/branch_strategy.py +20 -10
- claude_mpm/services/version_control/conflict_resolution.py +37 -13
- claude_mpm/services/version_control/git_operations.py +52 -21
- claude_mpm/services/version_control/semantic_versioning.py +92 -53
- claude_mpm/services/version_control/version_parser.py +145 -125
- claude_mpm/services/version_service.py +270 -0
- claude_mpm/storage/__init__.py +9 -0
- claude_mpm/storage/state_storage.py +552 -0
- claude_mpm/ticket_wrapper.py +2 -2
- claude_mpm/utils/__init__.py +2 -2
- claude_mpm/utils/agent_dependency_loader.py +453 -243
- claude_mpm/utils/config_manager.py +157 -118
- claude_mpm/utils/console.py +1 -1
- claude_mpm/utils/dependency_cache.py +102 -107
- claude_mpm/utils/dependency_manager.py +52 -47
- claude_mpm/utils/dependency_strategies.py +131 -96
- claude_mpm/utils/environment_context.py +110 -102
- claude_mpm/utils/error_handler.py +75 -55
- claude_mpm/utils/file_utils.py +80 -67
- claude_mpm/utils/framework_detection.py +12 -11
- claude_mpm/utils/import_migration_example.py +12 -60
- claude_mpm/utils/imports.py +48 -45
- claude_mpm/utils/path_operations.py +100 -93
- claude_mpm/utils/robust_installer.py +172 -164
- claude_mpm/utils/session_logging.py +30 -23
- claude_mpm/utils/subprocess_utils.py +99 -61
- claude_mpm/validation/__init__.py +1 -1
- claude_mpm/validation/agent_validator.py +151 -111
- claude_mpm/validation/frontmatter_validator.py +92 -71
- {claude_mpm-3.9.9.dist-info → claude_mpm-4.0.3.dist-info}/METADATA +51 -2
- claude_mpm-4.0.3.dist-info/RECORD +402 -0
- {claude_mpm-3.9.9.dist-info → claude_mpm-4.0.3.dist-info}/entry_points.txt +1 -0
- {claude_mpm-3.9.9.dist-info → claude_mpm-4.0.3.dist-info}/licenses/LICENSE +1 -1
- claude_mpm/config/memory_guardian_config.py +0 -325
- claude_mpm/core/config_paths.py +0 -150
- claude_mpm/dashboard/static/js/dashboard-original.js +0 -4134
- claude_mpm/deployment_paths.py +0 -261
- claude_mpm/hooks/claude_hooks/hook_handler_fixed.py +0 -454
- claude_mpm/models/state_models.py +0 -433
- claude_mpm/services/agent/__init__.py +0 -24
- claude_mpm/services/agent/deployment.py +0 -2548
- claude_mpm/services/agent/management.py +0 -598
- claude_mpm/services/agent/registry.py +0 -813
- claude_mpm/services/agents/registry/agent_registry.py +0 -813
- claude_mpm/services/communication/socketio.py +0 -1935
- claude_mpm/services/communication/websocket.py +0 -479
- claude_mpm/services/framework_claude_md_generator.py +0 -624
- claude_mpm/services/health_monitor.py +0 -893
- claude_mpm/services/infrastructure/memory_guardian.py +0 -770
- claude_mpm/services/mcp_gateway/server/mcp_server_simple.py +0 -444
- claude_mpm/services/optimized_hook_service.py +0 -542
- claude_mpm/services/project_analyzer.py +0 -864
- claude_mpm/services/project_registry.py +0 -608
- claude_mpm/services/standalone_socketio_server.py +0 -1300
- claude_mpm/services/ticket_manager_di.py +0 -318
- claude_mpm/services/ticketing_service_original.py +0 -510
- claude_mpm/utils/paths.py +0 -395
- claude_mpm/utils/platform_memory.py +0 -524
- claude_mpm-3.9.9.dist-info/RECORD +0 -293
- {claude_mpm-3.9.9.dist-info → claude_mpm-4.0.3.dist-info}/WHEEL +0 -0
- {claude_mpm-3.9.9.dist-info → claude_mpm-4.0.3.dist-info}/top_level.txt +0 -0
| @@ -1,11 +1,10 @@ | |
| 1 1 | 
             
            """
         | 
| 2 2 | 
             
            Consolidated Agent Registry for Claude MPM.
         | 
| 3 3 |  | 
| 4 | 
            -
            This module  | 
| 5 | 
            -
             | 
| 6 | 
            -
            - agent_registry_original.py (legacy convenience functions)
         | 
| 4 | 
            +
            This module provides the primary interface for agent discovery and management.
         | 
| 5 | 
            +
            All functionality has been consolidated into the unified agent registry system.
         | 
| 7 6 |  | 
| 8 | 
            -
             | 
| 7 | 
            +
            This module provides:
         | 
| 9 8 | 
             
            - Agent discovery from the framework
         | 
| 10 9 | 
             
            - Agent listing and selection
         | 
| 11 10 | 
             
            - Compatibility with both sync and async interfaces
         | 
| @@ -14,11 +13,25 @@ Provides: | |
| 14 13 |  | 
| 15 14 | 
             
            import os
         | 
| 16 15 | 
             
            import sys
         | 
| 17 | 
            -
            from pathlib import Path
         | 
| 18 | 
            -
            from typing import Optional, Dict, Any, List, Set
         | 
| 19 | 
            -
            import importlib.util
         | 
| 20 | 
            -
            from datetime import datetime
         | 
| 21 16 | 
             
            from dataclasses import dataclass
         | 
| 17 | 
            +
            from datetime import datetime
         | 
| 18 | 
            +
            from pathlib import Path
         | 
| 19 | 
            +
            from typing import Any, Dict, List, Optional, Set
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            # Import from the unified agent registry system
         | 
| 22 | 
            +
            from .unified_agent_registry import AgentMetadata as UnifiedAgentMetadata
         | 
| 23 | 
            +
            from .unified_agent_registry import AgentTier, AgentType
         | 
| 24 | 
            +
            from .unified_agent_registry import discover_agents as unified_discover_agents
         | 
| 25 | 
            +
            from .unified_agent_registry import get_agent as unified_get_agent
         | 
| 26 | 
            +
            from .unified_agent_registry import get_agent_names as unified_get_agent_names
         | 
| 27 | 
            +
            from .unified_agent_registry import get_agent_registry
         | 
| 28 | 
            +
            from .unified_agent_registry import get_core_agents as unified_get_core_agents
         | 
| 29 | 
            +
            from .unified_agent_registry import get_project_agents as unified_get_project_agents
         | 
| 30 | 
            +
            from .unified_agent_registry import get_registry_stats as unified_get_registry_stats
         | 
| 31 | 
            +
            from .unified_agent_registry import (
         | 
| 32 | 
            +
                get_specialized_agents as unified_get_specialized_agents,
         | 
| 33 | 
            +
            )
         | 
| 34 | 
            +
            from .unified_agent_registry import list_agents as unified_list_agents
         | 
| 22 35 |  | 
| 23 36 | 
             
            try:
         | 
| 24 37 | 
             
                from ..core.logger import get_logger
         | 
| @@ -26,9 +39,19 @@ except ImportError: | |
| 26 39 | 
             
                from core.logger import get_logger
         | 
| 27 40 |  | 
| 28 41 |  | 
| 42 | 
            +
            # ============================================================================
         | 
| 43 | 
            +
            # Compatibility Classes - Delegate to Unified Agent Registry
         | 
| 44 | 
            +
            # ============================================================================
         | 
| 45 | 
            +
             | 
| 46 | 
            +
             | 
| 29 47 | 
             
            @dataclass
         | 
| 30 48 | 
             
            class AgentMetadata:
         | 
| 31 | 
            -
                """ | 
| 49 | 
            +
                """
         | 
| 50 | 
            +
                COMPATIBILITY WRAPPER for agent metadata.
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                This class now delegates to the UnifiedAgentRegistry system.
         | 
| 53 | 
            +
                """
         | 
| 54 | 
            +
             | 
| 32 55 | 
             
                name: str
         | 
| 33 56 | 
             
                type: str
         | 
| 34 57 | 
             
                path: str
         | 
| @@ -36,454 +59,331 @@ class AgentMetadata: | |
| 36 59 | 
             
                last_modified: float = 0.0
         | 
| 37 60 | 
             
                specializations: List[str] = None
         | 
| 38 61 | 
             
                description: str = ""
         | 
| 39 | 
            -
             | 
| 62 | 
            +
             | 
| 40 63 | 
             
                def __post_init__(self):
         | 
| 41 64 | 
             
                    if self.specializations is None:
         | 
| 42 65 | 
             
                        self.specializations = []
         | 
| 43 66 |  | 
| 67 | 
            +
                @classmethod
         | 
| 68 | 
            +
                def from_unified(cls, unified_metadata: UnifiedAgentMetadata) -> "AgentMetadata":
         | 
| 69 | 
            +
                    """Create compatibility metadata from unified metadata."""
         | 
| 70 | 
            +
                    return cls(
         | 
| 71 | 
            +
                        name=unified_metadata.name,
         | 
| 72 | 
            +
                        type=unified_metadata.agent_type.value,
         | 
| 73 | 
            +
                        path=unified_metadata.path,
         | 
| 74 | 
            +
                        tier=unified_metadata.tier.value,
         | 
| 75 | 
            +
                        last_modified=unified_metadata.last_modified,
         | 
| 76 | 
            +
                        specializations=unified_metadata.specializations,
         | 
| 77 | 
            +
                        description=unified_metadata.description,
         | 
| 78 | 
            +
                    )
         | 
| 79 | 
            +
             | 
| 44 80 |  | 
| 45 81 | 
             
            class SimpleAgentRegistry:
         | 
| 46 | 
            -
                """ | 
| 47 | 
            -
                
         | 
| 48 | 
            -
             | 
| 82 | 
            +
                """
         | 
| 83 | 
            +
                COMPATIBILITY WRAPPER for simple agent registry.
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                This class now delegates to the UnifiedAgentRegistry system.
         | 
| 86 | 
            +
                """
         | 
| 87 | 
            +
             | 
| 88 | 
            +
                def __init__(self, framework_path: Optional[Path] = None):
         | 
| 89 | 
            +
                    """Initialize with optional framework path (ignored in new implementation)."""
         | 
| 49 90 | 
             
                    self.framework_path = framework_path
         | 
| 91 | 
            +
                    self._unified_registry = get_agent_registry()
         | 
| 50 92 | 
             
                    self.agents = {}
         | 
| 51 93 | 
             
                    self._discover_agents()
         | 
| 52 | 
            -
             | 
| 94 | 
            +
             | 
| 53 95 | 
             
                def _discover_agents(self):
         | 
| 54 | 
            -
                    """Discover agents  | 
| 55 | 
            -
                     | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 59 | 
            -
             | 
| 60 | 
            -
                         | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 67 | 
            -
             | 
| 68 | 
            -
             | 
| 69 | 
            -
             | 
| 70 | 
            -
                    
         | 
| 71 | 
            -
                    for agents_dir in agent_locations:
         | 
| 72 | 
            -
                        if agents_dir.exists():
         | 
| 73 | 
            -
                            # Look for both .md and .json files
         | 
| 74 | 
            -
                            for pattern in ["*.md", "*.json"]:
         | 
| 75 | 
            -
                                for agent_file in agents_dir.glob(pattern):
         | 
| 76 | 
            -
                                    agent_id = agent_file.stem
         | 
| 77 | 
            -
                                    tier = self._determine_tier(agent_file)
         | 
| 78 | 
            -
                                    
         | 
| 79 | 
            -
                                    # Check if we already have this agent
         | 
| 80 | 
            -
                                    if agent_id in discovered_agents:
         | 
| 81 | 
            -
                                        existing_tier = discovered_agents[agent_id]['tier']
         | 
| 82 | 
            -
                                        # Skip if existing has higher precedence
         | 
| 83 | 
            -
                                        # Precedence: project > user > system
         | 
| 84 | 
            -
                                        tier_precedence = {'project': 3, 'user': 2, 'system': 1}
         | 
| 85 | 
            -
                                        if tier_precedence.get(existing_tier, 0) >= tier_precedence.get(tier, 0):
         | 
| 86 | 
            -
                                            continue
         | 
| 87 | 
            -
                                    
         | 
| 88 | 
            -
                                    discovered_agents[agent_id] = {
         | 
| 89 | 
            -
                                        'name': agent_id,
         | 
| 90 | 
            -
                                        'type': agent_id,
         | 
| 91 | 
            -
                                        'path': str(agent_file),
         | 
| 92 | 
            -
                                        'last_modified': agent_file.stat().st_mtime,
         | 
| 93 | 
            -
                                        'tier': tier,
         | 
| 94 | 
            -
                                        'specializations': self._extract_specializations(agent_id),
         | 
| 95 | 
            -
                                        'description': self._extract_description(agent_id)
         | 
| 96 | 
            -
                                    }
         | 
| 97 | 
            -
                    
         | 
| 98 | 
            -
                    # Store the final agents
         | 
| 99 | 
            -
                    self.agents = discovered_agents
         | 
| 100 | 
            -
                
         | 
| 96 | 
            +
                    """Discover agents using the unified registry."""
         | 
| 97 | 
            +
                    unified_agents = self._unified_registry.discover_agents()
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                    # Convert to old format for compatibility
         | 
| 100 | 
            +
                    self.agents = {}
         | 
| 101 | 
            +
                    for name, unified_metadata in unified_agents.items():
         | 
| 102 | 
            +
                        self.agents[name] = {
         | 
| 103 | 
            +
                            "name": unified_metadata.name,
         | 
| 104 | 
            +
                            "type": unified_metadata.agent_type.value,
         | 
| 105 | 
            +
                            "path": unified_metadata.path,
         | 
| 106 | 
            +
                            "last_modified": unified_metadata.last_modified,
         | 
| 107 | 
            +
                            "tier": unified_metadata.tier.value,
         | 
| 108 | 
            +
                            "specializations": unified_metadata.specializations,
         | 
| 109 | 
            +
                            "description": unified_metadata.description,
         | 
| 110 | 
            +
                        }
         | 
| 111 | 
            +
             | 
| 101 112 | 
             
                def _determine_tier(self, agent_path: Path) -> str:
         | 
| 102 | 
            -
                    """Determine agent tier based on path."""
         | 
| 103 | 
            -
                     | 
| 104 | 
            -
                    if  | 
| 105 | 
            -
                         | 
| 106 | 
            -
             | 
| 107 | 
            -
                         | 
| 113 | 
            +
                    """Determine agent tier based on path (compatibility method)."""
         | 
| 114 | 
            +
                    # Delegate to unified registry logic
         | 
| 115 | 
            +
                    if (
         | 
| 116 | 
            +
                        "project" in str(agent_path)
         | 
| 117 | 
            +
                        or ".claude-mpm" in str(agent_path)
         | 
| 118 | 
            +
                        or ".claude/agents" in str(agent_path)
         | 
| 119 | 
            +
                    ):
         | 
| 120 | 
            +
                        return "project"
         | 
| 121 | 
            +
                    elif "user" in str(agent_path) or str(Path.home()) in str(agent_path):
         | 
| 122 | 
            +
                        return "user"
         | 
| 108 123 | 
             
                    else:
         | 
| 109 | 
            -
                        return  | 
| 110 | 
            -
             | 
| 124 | 
            +
                        return "system"
         | 
| 125 | 
            +
             | 
| 111 126 | 
             
                def _extract_specializations(self, agent_id: str) -> List[str]:
         | 
| 112 | 
            -
                    """Extract specializations based on agent type."""
         | 
| 127 | 
            +
                    """Extract specializations based on agent type (compatibility method)."""
         | 
| 113 128 | 
             
                    specialization_map = {
         | 
| 114 | 
            -
                         | 
| 115 | 
            -
                         | 
| 116 | 
            -
                         | 
| 117 | 
            -
                         | 
| 118 | 
            -
                         | 
| 119 | 
            -
                         | 
| 120 | 
            -
                         | 
| 121 | 
            -
                         | 
| 129 | 
            +
                        "engineer": ["coding", "architecture", "implementation"],
         | 
| 130 | 
            +
                        "documentation": ["docs", "api", "guides"],
         | 
| 131 | 
            +
                        "qa": ["testing", "quality", "validation"],
         | 
| 132 | 
            +
                        "research": ["analysis", "investigation", "exploration"],
         | 
| 133 | 
            +
                        "ops": ["deployment", "monitoring", "infrastructure"],
         | 
| 134 | 
            +
                        "security": ["security", "audit", "compliance"],
         | 
| 135 | 
            +
                        "version_control": ["git", "versioning", "releases"],
         | 
| 136 | 
            +
                        "data_engineer": ["data", "etl", "analytics"],
         | 
| 122 137 | 
             
                    }
         | 
| 123 138 | 
             
                    return specialization_map.get(agent_id, [])
         | 
| 124 | 
            -
             | 
| 139 | 
            +
             | 
| 125 140 | 
             
                def _extract_description(self, agent_id: str) -> str:
         | 
| 126 | 
            -
                    """Extract description for agent."""
         | 
| 141 | 
            +
                    """Extract description for agent (compatibility method)."""
         | 
| 127 142 | 
             
                    descriptions = {
         | 
| 128 | 
            -
                         | 
| 129 | 
            -
                         | 
| 130 | 
            -
                         | 
| 131 | 
            -
                         | 
| 132 | 
            -
                         | 
| 133 | 
            -
                         | 
| 134 | 
            -
                         | 
| 135 | 
            -
                         | 
| 143 | 
            +
                        "engineer": "Software engineering and implementation",
         | 
| 144 | 
            +
                        "documentation": "Documentation creation and maintenance",
         | 
| 145 | 
            +
                        "qa": "Quality assurance and testing",
         | 
| 146 | 
            +
                        "research": "Research and investigation",
         | 
| 147 | 
            +
                        "ops": "Operations and deployment",
         | 
| 148 | 
            +
                        "security": "Security analysis and compliance",
         | 
| 149 | 
            +
                        "version_control": "Version control and release management",
         | 
| 150 | 
            +
                        "data_engineer": "Data engineering and analytics",
         | 
| 136 151 | 
             
                    }
         | 
| 137 | 
            -
                    return descriptions.get(agent_id, f | 
| 138 | 
            -
             | 
| 152 | 
            +
                    return descriptions.get(agent_id, f"{agent_id.title()} agent")
         | 
| 153 | 
            +
             | 
| 139 154 | 
             
                def list_agents(self, **kwargs) -> Dict[str, Any]:
         | 
| 140 | 
            -
                    """List all agents."""
         | 
| 155 | 
            +
                    """List all agents (compatibility method)."""
         | 
| 141 156 | 
             
                    return self.agents
         | 
| 142 | 
            -
             | 
| 157 | 
            +
             | 
| 143 158 | 
             
                def listAgents(self, **kwargs) -> Dict[str, Any]:
         | 
| 144 159 | 
             
                    """DEPRECATED: Use list_agents() instead. Kept for backward compatibility."""
         | 
| 145 | 
            -
                    import warnings
         | 
| 146 160 | 
             
                    warnings.warn(
         | 
| 147 161 | 
             
                        "listAgents() is deprecated, use list_agents() instead",
         | 
| 148 162 | 
             
                        DeprecationWarning,
         | 
| 149 | 
            -
                        stacklevel=2
         | 
| 163 | 
            +
                        stacklevel=2,
         | 
| 150 164 | 
             
                    )
         | 
| 151 165 | 
             
                    return self.list_agents(**kwargs)
         | 
| 152 | 
            -
             | 
| 153 | 
            -
                def list_agents_filtered( | 
| 154 | 
            -
                     | 
| 155 | 
            -
             | 
| 156 | 
            -
                     | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 159 | 
            -
             | 
| 160 | 
            -
             | 
| 161 | 
            -
             | 
| 162 | 
            -
                         | 
| 163 | 
            -
             | 
| 164 | 
            -
             | 
| 165 | 
            -
                             | 
| 166 | 
            -
             | 
| 167 | 
            -
                             | 
| 168 | 
            -
                             | 
| 169 | 
            -
             | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 166 | 
            +
             | 
| 167 | 
            +
                def list_agents_filtered(
         | 
| 168 | 
            +
                    self, agent_type: Optional[str] = None, tier: Optional[str] = None
         | 
| 169 | 
            +
                ) -> List[AgentMetadata]:
         | 
| 170 | 
            +
                    """List agents with optional filtering (compatibility method)."""
         | 
| 171 | 
            +
                    # Use unified registry for filtering
         | 
| 172 | 
            +
                    unified_tier = None
         | 
| 173 | 
            +
                    unified_agent_type = None
         | 
| 174 | 
            +
             | 
| 175 | 
            +
                    if tier:
         | 
| 176 | 
            +
                        unified_tier = AgentTier(tier)
         | 
| 177 | 
            +
                    if agent_type:
         | 
| 178 | 
            +
                        try:
         | 
| 179 | 
            +
                            unified_agent_type = AgentType(agent_type)
         | 
| 180 | 
            +
                        except ValueError:
         | 
| 181 | 
            +
                            # Handle legacy agent types
         | 
| 182 | 
            +
                            unified_agent_type = None
         | 
| 183 | 
            +
             | 
| 184 | 
            +
                    unified_agents = self._unified_registry.list_agents(
         | 
| 185 | 
            +
                        tier=unified_tier, agent_type=unified_agent_type
         | 
| 186 | 
            +
                    )
         | 
| 187 | 
            +
             | 
| 188 | 
            +
                    return [AgentMetadata.from_unified(agent) for agent in unified_agents]
         | 
| 189 | 
            +
             | 
| 173 190 | 
             
                def get_agent(self, agent_name: str) -> Optional[AgentMetadata]:
         | 
| 174 | 
            -
                    """Get a specific agent."""
         | 
| 175 | 
            -
                     | 
| 176 | 
            -
                    if  | 
| 177 | 
            -
                        return AgentMetadata(
         | 
| 178 | 
            -
                            name=metadata['name'],
         | 
| 179 | 
            -
                            type=metadata['type'],
         | 
| 180 | 
            -
                            path=metadata['path'],
         | 
| 181 | 
            -
                            tier=metadata.get('tier', 'system'),
         | 
| 182 | 
            -
                            last_modified=metadata.get('last_modified', 0),
         | 
| 183 | 
            -
                            specializations=metadata.get('specializations', []),
         | 
| 184 | 
            -
                            description=metadata.get('description', '')
         | 
| 185 | 
            -
                        )
         | 
| 191 | 
            +
                    """Get a specific agent (compatibility method)."""
         | 
| 192 | 
            +
                    unified_agent = self._unified_registry.get_agent(agent_name)
         | 
| 193 | 
            +
                    if unified_agent:
         | 
| 194 | 
            +
                        return AgentMetadata.from_unified(unified_agent)
         | 
| 186 195 | 
             
                    return None
         | 
| 187 | 
            -
             | 
| 196 | 
            +
             | 
| 188 197 | 
             
                def discover_agents(self, force_refresh: bool = False) -> Dict[str, AgentMetadata]:
         | 
| 189 | 
            -
                    """Discover agents ( | 
| 190 | 
            -
                     | 
| 191 | 
            -
                         | 
| 192 | 
            -
             | 
| 193 | 
            -
             | 
| 198 | 
            +
                    """Discover agents (compatibility method)."""
         | 
| 199 | 
            +
                    unified_agents = self._unified_registry.discover_agents(
         | 
| 200 | 
            +
                        force_refresh=force_refresh
         | 
| 201 | 
            +
                    )
         | 
| 202 | 
            +
             | 
| 203 | 
            +
                    # Update internal agents dict for compatibility
         | 
| 204 | 
            +
                    self.agents = {}
         | 
| 205 | 
            +
                    for name, unified_metadata in unified_agents.items():
         | 
| 206 | 
            +
                        self.agents[name] = {
         | 
| 207 | 
            +
                            "name": unified_metadata.name,
         | 
| 208 | 
            +
                            "type": unified_metadata.agent_type.value,
         | 
| 209 | 
            +
                            "path": unified_metadata.path,
         | 
| 210 | 
            +
                            "last_modified": unified_metadata.last_modified,
         | 
| 211 | 
            +
                            "tier": unified_metadata.tier.value,
         | 
| 212 | 
            +
                            "specializations": unified_metadata.specializations,
         | 
| 213 | 
            +
                            "description": unified_metadata.description,
         | 
| 214 | 
            +
                        }
         | 
| 215 | 
            +
             | 
| 216 | 
            +
                    # Return compatibility format
         | 
| 194 217 | 
             
                    return {
         | 
| 195 | 
            -
                         | 
| 196 | 
            -
             | 
| 197 | 
            -
                            type=metadata['type'],
         | 
| 198 | 
            -
                            path=metadata['path'],
         | 
| 199 | 
            -
                            tier=metadata.get('tier', 'system'),
         | 
| 200 | 
            -
                            last_modified=metadata.get('last_modified', 0),
         | 
| 201 | 
            -
                            specializations=metadata.get('specializations', []),
         | 
| 202 | 
            -
                            description=metadata.get('description', '')
         | 
| 203 | 
            -
                        )
         | 
| 204 | 
            -
                        for agent_id, metadata in self.agents.items()
         | 
| 218 | 
            +
                        name: AgentMetadata.from_unified(unified_metadata)
         | 
| 219 | 
            +
                        for name, unified_metadata in unified_agents.items()
         | 
| 205 220 | 
             
                    }
         | 
| 206 | 
            -
             | 
| 221 | 
            +
             | 
| 207 222 | 
             
                @property
         | 
| 208 223 | 
             
                def core_agent_types(self) -> Set[str]:
         | 
| 209 | 
            -
                    """Get core agent types."""
         | 
| 224 | 
            +
                    """Get core agent types (compatibility property)."""
         | 
| 210 225 | 
             
                    return {
         | 
| 211 | 
            -
                         | 
| 212 | 
            -
                         | 
| 213 | 
            -
                         | 
| 214 | 
            -
                         | 
| 215 | 
            -
                         | 
| 216 | 
            -
                         | 
| 217 | 
            -
                         | 
| 218 | 
            -
                         | 
| 226 | 
            +
                        "documentation",
         | 
| 227 | 
            +
                        "engineer",
         | 
| 228 | 
            +
                        "qa",
         | 
| 229 | 
            +
                        "research",
         | 
| 230 | 
            +
                        "ops",
         | 
| 231 | 
            +
                        "security",
         | 
| 232 | 
            +
                        "version_control",
         | 
| 233 | 
            +
                        "data_engineer",
         | 
| 219 234 | 
             
                    }
         | 
| 220 | 
            -
             | 
| 235 | 
            +
             | 
| 221 236 | 
             
                @property
         | 
| 222 237 | 
             
                def specialized_agent_types(self) -> Set[str]:
         | 
| 223 | 
            -
                    """Get specialized agent types beyond core."""
         | 
| 224 | 
            -
                    all_types = set(metadata[ | 
| 238 | 
            +
                    """Get specialized agent types beyond core (compatibility property)."""
         | 
| 239 | 
            +
                    all_types = set(metadata["type"] for metadata in self.agents.values())
         | 
| 225 240 | 
             
                    return all_types - self.core_agent_types
         | 
| 226 241 |  | 
| 227 242 |  | 
| 228 243 | 
             
            class AgentRegistryAdapter:
         | 
| 229 244 | 
             
                """
         | 
| 230 | 
            -
                 | 
| 231 | 
            -
             | 
| 232 | 
            -
                This adapter | 
| 233 | 
            -
                1. Locates the claude-mpm installation
         | 
| 234 | 
            -
                2. Provides a clean interface for agent operations
         | 
| 235 | 
            -
                3. Maintains backwards compatibility
         | 
| 245 | 
            +
                COMPATIBILITY WRAPPER for agent registry adapter.
         | 
| 246 | 
            +
             | 
| 247 | 
            +
                This adapter now delegates to the UnifiedAgentRegistry system.
         | 
| 236 248 | 
             
                """
         | 
| 237 | 
            -
             | 
| 249 | 
            +
             | 
| 238 250 | 
             
                def __init__(self, framework_path: Optional[Path] = None):
         | 
| 239 | 
            -
                    """
         | 
| 240 | 
            -
                    Initialize the agent registry adapter.
         | 
| 241 | 
            -
                    
         | 
| 242 | 
            -
                    Args:
         | 
| 243 | 
            -
                        framework_path: Path to claude-mpm (auto-detected if None)
         | 
| 244 | 
            -
                    """
         | 
| 251 | 
            +
                    """Initialize the agent registry adapter (framework_path ignored in new implementation)."""
         | 
| 245 252 | 
             
                    self.logger = get_logger("agent_registry")
         | 
| 246 | 
            -
                    self.framework_path = framework_path  | 
| 247 | 
            -
                    self. | 
| 248 | 
            -
                    self. | 
| 249 | 
            -
             | 
| 253 | 
            +
                    self.framework_path = framework_path  # Kept for compatibility
         | 
| 254 | 
            +
                    self._unified_registry = get_agent_registry()
         | 
| 255 | 
            +
                    self.registry = SimpleAgentRegistry(framework_path)
         | 
| 256 | 
            +
             | 
| 250 257 | 
             
                def _find_framework(self) -> Optional[Path]:
         | 
| 251 | 
            -
                    """Find claude-mpm installation.
         | 
| 252 | 
            -
                    
         | 
| 253 | 
            -
                     | 
| 254 | 
            -
             | 
| 255 | 
            -
                     | 
| 256 | 
            -
             | 
| 257 | 
            -
                    4. Common development locations
         | 
| 258 | 
            -
                    """
         | 
| 259 | 
            -
                    # Check environment variable first
         | 
| 260 | 
            -
                    env_path = os.environ.get("CLAUDE_MPM_PATH")
         | 
| 261 | 
            -
                    if env_path:
         | 
| 262 | 
            -
                        candidate = Path(env_path)
         | 
| 263 | 
            -
                        if self._is_valid_framework_path(candidate):
         | 
| 264 | 
            -
                            self.logger.info(f"Using claude-mpm from CLAUDE_MPM_PATH: {candidate}")
         | 
| 265 | 
            -
                            return candidate
         | 
| 266 | 
            -
                        else:
         | 
| 267 | 
            -
                            self.logger.warning(f"CLAUDE_MPM_PATH is set but invalid: {env_path}")
         | 
| 268 | 
            -
                    
         | 
| 269 | 
            -
                    # Check current working directory
         | 
| 270 | 
            -
                    cwd = Path.cwd()
         | 
| 271 | 
            -
                    if self._is_valid_framework_path(cwd):
         | 
| 272 | 
            -
                        return cwd
         | 
| 273 | 
            -
                        
         | 
| 274 | 
            -
                    # Check if we're running from within the installed package
         | 
| 275 | 
            -
                    current_file = Path(__file__).resolve()
         | 
| 276 | 
            -
                    for parent in current_file.parents:
         | 
| 277 | 
            -
                        if self._is_valid_framework_path(parent):
         | 
| 278 | 
            -
                            return parent
         | 
| 279 | 
            -
                        # Stop at site-packages or similar
         | 
| 280 | 
            -
                        if parent.name in ("site-packages", "dist-packages", "lib"):
         | 
| 281 | 
            -
                            break
         | 
| 282 | 
            -
                    
         | 
| 283 | 
            -
                    # Check common development locations
         | 
| 284 | 
            -
                    candidates = [
         | 
| 285 | 
            -
                        Path.home() / "Projects" / "claude-mpm",
         | 
| 286 | 
            -
                        Path.home() / "claude-mpm",
         | 
| 287 | 
            -
                    ]
         | 
| 288 | 
            -
                    
         | 
| 289 | 
            -
                    for candidate in candidates:
         | 
| 290 | 
            -
                        if self._is_valid_framework_path(candidate):
         | 
| 291 | 
            -
                            self.logger.info(f"Found claude-mpm at: {candidate}")
         | 
| 292 | 
            -
                            return candidate
         | 
| 293 | 
            -
                    
         | 
| 294 | 
            -
                    return None
         | 
| 295 | 
            -
                
         | 
| 258 | 
            +
                    """Find claude-mpm installation (compatibility method)."""
         | 
| 259 | 
            +
                    # Delegate to unified path manager
         | 
| 260 | 
            +
                    from .unified_paths import get_path_manager
         | 
| 261 | 
            +
             | 
| 262 | 
            +
                    return get_path_manager().framework_root
         | 
| 263 | 
            +
             | 
| 296 264 | 
             
                def _is_valid_framework_path(self, path: Path) -> bool:
         | 
| 297 | 
            -
                    """Check if a path is a valid claude-mpm installation."""
         | 
| 298 | 
            -
                    return (
         | 
| 299 | 
            -
             | 
| 300 | 
            -
                        (path / "src" / "claude_mpm").exists()
         | 
| 301 | 
            -
                    )
         | 
| 302 | 
            -
                
         | 
| 265 | 
            +
                    """Check if a path is a valid claude-mpm installation (compatibility method)."""
         | 
| 266 | 
            +
                    return path.exists() and (path / "src" / "claude_mpm").exists()
         | 
| 267 | 
            +
             | 
| 303 268 | 
             
                def _initialize_registry(self):
         | 
| 304 | 
            -
                    """Initialize the agent registry."""
         | 
| 305 | 
            -
                     | 
| 306 | 
            -
             | 
| 307 | 
            -
             | 
| 308 | 
            -
                    
         | 
| 309 | 
            -
                    try:
         | 
| 310 | 
            -
                        self.registry = SimpleAgentRegistry(self.framework_path)
         | 
| 311 | 
            -
                        self.logger.info("Agent registry initialized successfully")
         | 
| 312 | 
            -
                        
         | 
| 313 | 
            -
                    except Exception as e:
         | 
| 314 | 
            -
                        self.logger.error(f"Failed to initialize registry: {e}")
         | 
| 315 | 
            -
                
         | 
| 269 | 
            +
                    """Initialize the agent registry (compatibility method)."""
         | 
| 270 | 
            +
                    # Registry is already initialized in __init__
         | 
| 271 | 
            +
                    pass
         | 
| 272 | 
            +
             | 
| 316 273 | 
             
                def list_agents(self, **kwargs) -> Dict[str, Any]:
         | 
| 317 | 
            -
                    """
         | 
| 318 | 
            -
                    List available agents.
         | 
| 319 | 
            -
                    
         | 
| 320 | 
            -
                    Args:
         | 
| 321 | 
            -
                        **kwargs: Arguments to pass to registry
         | 
| 322 | 
            -
                        
         | 
| 323 | 
            -
                    Returns:
         | 
| 324 | 
            -
                        Dictionary of agents with metadata
         | 
| 325 | 
            -
                    """
         | 
| 326 | 
            -
                    if not self.registry:
         | 
| 327 | 
            -
                        return {}
         | 
| 328 | 
            -
                    
         | 
| 274 | 
            +
                    """List available agents (compatibility method)."""
         | 
| 329 275 | 
             
                    try:
         | 
| 330 276 | 
             
                        return self.registry.list_agents(**kwargs)
         | 
| 331 277 | 
             
                    except Exception as e:
         | 
| 332 278 | 
             
                        self.logger.error(f"Error listing agents: {e}")
         | 
| 333 279 | 
             
                        return {}
         | 
| 334 | 
            -
             | 
| 280 | 
            +
             | 
| 335 281 | 
             
                def get_agent_definition(self, agent_name: str) -> Optional[str]:
         | 
| 336 | 
            -
                    """
         | 
| 337 | 
            -
                    Get agent definition by name.
         | 
| 338 | 
            -
                    
         | 
| 339 | 
            -
                    Args:
         | 
| 340 | 
            -
                        agent_name: Name of the agent
         | 
| 341 | 
            -
                        
         | 
| 342 | 
            -
                    Returns:
         | 
| 343 | 
            -
                        Agent definition content or None
         | 
| 344 | 
            -
                    """
         | 
| 345 | 
            -
                    if not self.registry:
         | 
| 346 | 
            -
                        return None
         | 
| 347 | 
            -
                    
         | 
| 282 | 
            +
                    """Get agent definition by name (compatibility method)."""
         | 
| 348 283 | 
             
                    try:
         | 
| 349 | 
            -
                         | 
| 350 | 
            -
                         | 
| 351 | 
            -
             | 
| 352 | 
            -
                            if  | 
| 353 | 
            -
                                 | 
| 354 | 
            -
                                agent_path = Path(metadata['path'])
         | 
| 355 | 
            -
                                if agent_path.exists():
         | 
| 356 | 
            -
                                    return agent_path.read_text()
         | 
| 357 | 
            -
                        
         | 
| 284 | 
            +
                        unified_agent = self._unified_registry.get_agent(agent_name)
         | 
| 285 | 
            +
                        if unified_agent:
         | 
| 286 | 
            +
                            agent_path = Path(unified_agent.path)
         | 
| 287 | 
            +
                            if agent_path.exists():
         | 
| 288 | 
            +
                                return agent_path.read_text()
         | 
| 358 289 | 
             
                        return None
         | 
| 359 | 
            -
                        
         | 
| 360 290 | 
             
                    except Exception as e:
         | 
| 361 291 | 
             
                        self.logger.error(f"Error getting agent definition: {e}")
         | 
| 362 292 | 
             
                        return None
         | 
| 363 | 
            -
             | 
| 364 | 
            -
                def select_agent_for_task( | 
| 365 | 
            -
                     | 
| 366 | 
            -
                     | 
| 367 | 
            -
                    
         | 
| 368 | 
            -
             | 
| 369 | 
            -
             | 
| 370 | 
            -
                        required_specializations: Required agent specializations
         | 
| 371 | 
            -
                        
         | 
| 372 | 
            -
                    Returns:
         | 
| 373 | 
            -
                        Agent metadata or None
         | 
| 374 | 
            -
                    """
         | 
| 375 | 
            -
                    if not self.registry:
         | 
| 376 | 
            -
                        return None
         | 
| 377 | 
            -
                    
         | 
| 293 | 
            +
             | 
| 294 | 
            +
                def select_agent_for_task(
         | 
| 295 | 
            +
                    self,
         | 
| 296 | 
            +
                    task_description: str,
         | 
| 297 | 
            +
                    required_specializations: Optional[List[str]] = None,
         | 
| 298 | 
            +
                ) -> Optional[Dict[str, Any]]:
         | 
| 299 | 
            +
                    """Select optimal agent for a task (compatibility method)."""
         | 
| 378 300 | 
             
                    try:
         | 
| 379 | 
            -
                        # Get agents  | 
| 380 | 
            -
                         | 
| 381 | 
            -
             | 
| 301 | 
            +
                        # Get all agents from unified registry
         | 
| 302 | 
            +
                        unified_agents = self._unified_registry.list_agents()
         | 
| 303 | 
            +
             | 
| 382 304 | 
             
                        if required_specializations:
         | 
| 383 305 | 
             
                            # Filter by specializations
         | 
| 384 | 
            -
                            filtered =  | 
| 385 | 
            -
                            for  | 
| 386 | 
            -
                                agent_specs = set( | 
| 306 | 
            +
                            filtered = []
         | 
| 307 | 
            +
                            for agent in unified_agents:
         | 
| 308 | 
            +
                                agent_specs = set(agent.specializations)
         | 
| 387 309 | 
             
                                if any(spec in agent_specs for spec in required_specializations):
         | 
| 388 | 
            -
                                    filtered | 
| 389 | 
            -
                             | 
| 390 | 
            -
             | 
| 391 | 
            -
                        if not  | 
| 310 | 
            +
                                    filtered.append(agent)
         | 
| 311 | 
            +
                            unified_agents = filtered
         | 
| 312 | 
            +
             | 
| 313 | 
            +
                        if not unified_agents:
         | 
| 392 314 | 
             
                            return None
         | 
| 393 | 
            -
             | 
| 394 | 
            -
                        #  | 
| 395 | 
            -
                         | 
| 396 | 
            -
                        agent_id = next(iter(agents))
         | 
| 315 | 
            +
             | 
| 316 | 
            +
                        # Return the first matching agent in compatibility format
         | 
| 317 | 
            +
                        agent = unified_agents[0]
         | 
| 397 318 | 
             
                        return {
         | 
| 398 | 
            -
                             | 
| 399 | 
            -
                             | 
| 319 | 
            +
                            "id": agent.name,
         | 
| 320 | 
            +
                            "metadata": {
         | 
| 321 | 
            +
                                "name": agent.name,
         | 
| 322 | 
            +
                                "type": agent.agent_type.value,
         | 
| 323 | 
            +
                                "path": agent.path,
         | 
| 324 | 
            +
                                "tier": agent.tier.value,
         | 
| 325 | 
            +
                                "specializations": agent.specializations,
         | 
| 326 | 
            +
                                "description": agent.description,
         | 
| 327 | 
            +
                            },
         | 
| 400 328 | 
             
                        }
         | 
| 401 | 
            -
             | 
| 329 | 
            +
             | 
| 402 330 | 
             
                    except Exception as e:
         | 
| 403 331 | 
             
                        self.logger.error(f"Error selecting agent: {e}")
         | 
| 404 332 | 
             
                        return None
         | 
| 405 | 
            -
             | 
| 333 | 
            +
             | 
| 406 334 | 
             
                def get_agent_hierarchy(self) -> Dict[str, List[str]]:
         | 
| 407 | 
            -
                    """
         | 
| 408 | 
            -
                    Get agent hierarchy (project → user → system).
         | 
| 409 | 
            -
                    
         | 
| 410 | 
            -
                    Returns:
         | 
| 411 | 
            -
                        Dictionary with hierarchy levels and agent names
         | 
| 412 | 
            -
                    """
         | 
| 413 | 
            -
                    if not self.registry:
         | 
| 414 | 
            -
                        return {
         | 
| 415 | 
            -
                            'project': [],
         | 
| 416 | 
            -
                            'user': [],
         | 
| 417 | 
            -
                            'system': []
         | 
| 418 | 
            -
                        }
         | 
| 419 | 
            -
                    
         | 
| 335 | 
            +
                    """Get agent hierarchy (compatibility method)."""
         | 
| 420 336 | 
             
                    try:
         | 
| 421 | 
            -
                         | 
| 422 | 
            -
             | 
| 423 | 
            -
                        
         | 
| 424 | 
            -
                         | 
| 425 | 
            -
                             | 
| 426 | 
            -
                             | 
| 427 | 
            -
             | 
| 428 | 
            -
                        }
         | 
| 429 | 
            -
                        
         | 
| 430 | 
            -
                        # Categorize by tier
         | 
| 431 | 
            -
                        for agent_id, metadata in all_agents.items():
         | 
| 432 | 
            -
                            tier = metadata.get('tier', 'system')
         | 
| 433 | 
            -
                            hierarchy[tier].append(agent_id)
         | 
| 434 | 
            -
                        
         | 
| 337 | 
            +
                        hierarchy = {"project": [], "user": [], "system": []}
         | 
| 338 | 
            +
             | 
| 339 | 
            +
                        # Get agents by tier from unified registry
         | 
| 340 | 
            +
                        for tier in [AgentTier.PROJECT, AgentTier.USER, AgentTier.SYSTEM]:
         | 
| 341 | 
            +
                            agents = self._unified_registry.list_agents(tier=tier)
         | 
| 342 | 
            +
                            hierarchy[tier.value] = [agent.name for agent in agents]
         | 
| 343 | 
            +
             | 
| 435 344 | 
             
                        return hierarchy
         | 
| 436 | 
            -
             | 
| 345 | 
            +
             | 
| 437 346 | 
             
                    except Exception as e:
         | 
| 438 347 | 
             
                        self.logger.error(f"Error getting hierarchy: {e}")
         | 
| 439 | 
            -
                        return { | 
| 440 | 
            -
             | 
| 348 | 
            +
                        return {"project": [], "user": [], "system": []}
         | 
| 349 | 
            +
             | 
| 441 350 | 
             
                def get_core_agents(self) -> List[str]:
         | 
| 442 | 
            -
                    """
         | 
| 443 | 
            -
                     | 
| 444 | 
            -
             | 
| 445 | 
            -
             | 
| 446 | 
            -
             | 
| 447 | 
            -
             | 
| 448 | 
            -
             | 
| 449 | 
            -
             | 
| 450 | 
            -
             | 
| 451 | 
            -
             | 
| 452 | 
            -
             | 
| 453 | 
            -
             | 
| 454 | 
            -
             | 
| 455 | 
            -
             | 
| 456 | 
            -
             | 
| 457 | 
            -
             | 
| 458 | 
            -
             | 
| 459 | 
            -
                def format_agent_for_task_tool( | 
| 460 | 
            -
                    "" | 
| 461 | 
            -
             | 
| 462 | 
            -
                    
         | 
| 463 | 
            -
                    Args:
         | 
| 464 | 
            -
                        agent_name: Name of the agent
         | 
| 465 | 
            -
                        task: Task description
         | 
| 466 | 
            -
                        context: Additional context
         | 
| 467 | 
            -
                        
         | 
| 468 | 
            -
                    Returns:
         | 
| 469 | 
            -
                        Formatted Task Tool prompt
         | 
| 470 | 
            -
                    """
         | 
| 351 | 
            +
                    """Get list of core system agents (compatibility method)."""
         | 
| 352 | 
            +
                    try:
         | 
| 353 | 
            +
                        core_agents = self._unified_registry.get_core_agents()
         | 
| 354 | 
            +
                        return [agent.name for agent in core_agents]
         | 
| 355 | 
            +
                    except Exception as e:
         | 
| 356 | 
            +
                        self.logger.error(f"Error getting core agents: {e}")
         | 
| 357 | 
            +
                        return [
         | 
| 358 | 
            +
                            "documentation",
         | 
| 359 | 
            +
                            "engineer",
         | 
| 360 | 
            +
                            "qa",
         | 
| 361 | 
            +
                            "research",
         | 
| 362 | 
            +
                            "ops",
         | 
| 363 | 
            +
                            "security",
         | 
| 364 | 
            +
                            "version_control",
         | 
| 365 | 
            +
                            "data_engineer",
         | 
| 366 | 
            +
                        ]
         | 
| 367 | 
            +
             | 
| 368 | 
            +
                def format_agent_for_task_tool(
         | 
| 369 | 
            +
                    self, agent_name: str, task: str, context: str = ""
         | 
| 370 | 
            +
                ) -> str:
         | 
| 371 | 
            +
                    """Format agent delegation for Task Tool (compatibility method)."""
         | 
| 471 372 | 
             
                    # Map agent names to nicknames
         | 
| 472 373 | 
             
                    nicknames = {
         | 
| 473 | 
            -
                         | 
| 474 | 
            -
                         | 
| 475 | 
            -
                         | 
| 476 | 
            -
                         | 
| 477 | 
            -
                         | 
| 478 | 
            -
                         | 
| 479 | 
            -
                         | 
| 480 | 
            -
                         | 
| 374 | 
            +
                        "documentation": "Documenter",
         | 
| 375 | 
            +
                        "engineer": "Engineer",
         | 
| 376 | 
            +
                        "qa": "QA",
         | 
| 377 | 
            +
                        "research": "Researcher",
         | 
| 378 | 
            +
                        "ops": "Ops",
         | 
| 379 | 
            +
                        "security": "Security",
         | 
| 380 | 
            +
                        "version_control": "Versioner",
         | 
| 381 | 
            +
                        "data_engineer": "Data Engineer",
         | 
| 481 382 | 
             
                    }
         | 
| 482 | 
            -
             | 
| 383 | 
            +
             | 
| 483 384 | 
             
                    nickname = nicknames.get(agent_name, agent_name.title())
         | 
| 484 | 
            -
                    
         | 
| 485 385 | 
             
                    today = datetime.now().strftime("%Y-%m-%d")
         | 
| 486 | 
            -
             | 
| 386 | 
            +
             | 
| 487 387 | 
             
                    return f"""**{nickname}**: {task}
         | 
| 488 388 |  | 
| 489 389 | 
             
            TEMPORAL CONTEXT: Today is {today}. Apply date awareness to task execution.
         | 
| @@ -496,181 +396,132 @@ TEMPORAL CONTEXT: Today is {today}. Apply date awareness to task execution. | |
| 496 396 | 
             
            **Expected Results**: Completed task with operational insights"""
         | 
| 497 397 |  | 
| 498 398 |  | 
| 399 | 
            +
            # ============================================================================
         | 
| 400 | 
            +
            # Compatibility Functions - Delegate to Unified Agent Registry
         | 
| 401 | 
            +
            # ============================================================================
         | 
| 402 | 
            +
             | 
| 499 403 | 
             
            # Export main class as AgentRegistry for compatibility
         | 
| 500 404 | 
             
            AgentRegistry = SimpleAgentRegistry
         | 
| 501 405 |  | 
| 502 | 
            -
             | 
| 503 | 
            -
            def create_agent_registry( | 
| 504 | 
            -
                 | 
| 505 | 
            -
             | 
| 506 | 
            -
                
         | 
| 507 | 
            -
                 | 
| 508 | 
            -
             | 
| 509 | 
            -
             | 
| 510 | 
            -
                    
         | 
| 511 | 
            -
                Returns:
         | 
| 512 | 
            -
                    AgentRegistry instance
         | 
| 513 | 
            -
                """
         | 
| 514 | 
            -
                if not framework_path:
         | 
| 515 | 
            -
                    adapter = AgentRegistryAdapter()
         | 
| 516 | 
            -
                    framework_path = adapter.framework_path
         | 
| 517 | 
            -
                
         | 
| 518 | 
            -
                if framework_path:
         | 
| 519 | 
            -
                    return AgentRegistry(framework_path)
         | 
| 520 | 
            -
                else:
         | 
| 521 | 
            -
                    raise ValueError("Could not find claude-mpm framework path")
         | 
| 406 | 
            +
             | 
| 407 | 
            +
            def create_agent_registry(
         | 
| 408 | 
            +
                cache_service: Any = None, framework_path: Optional[Path] = None
         | 
| 409 | 
            +
            ) -> AgentRegistry:
         | 
| 410 | 
            +
                """Create a new AgentRegistry instance (compatibility function)."""
         | 
| 411 | 
            +
                # Ignore parameters and use unified registry
         | 
| 412 | 
            +
                return AgentRegistry(framework_path)
         | 
| 413 | 
            +
             | 
| 522 414 |  | 
| 523 415 | 
             
            def discover_agents(force_refresh: bool = False) -> Dict[str, AgentMetadata]:
         | 
| 524 | 
            -
                """
         | 
| 525 | 
            -
                 | 
| 526 | 
            -
             | 
| 527 | 
            -
                Args:
         | 
| 528 | 
            -
                    force_refresh: Force cache refresh
         | 
| 529 | 
            -
                    
         | 
| 530 | 
            -
                Returns:
         | 
| 531 | 
            -
                    Dictionary of discovered agents
         | 
| 532 | 
            -
                """
         | 
| 533 | 
            -
                adapter = AgentRegistryAdapter()
         | 
| 534 | 
            -
                if adapter.registry:
         | 
| 535 | 
            -
                    return adapter.registry.discover_agents(force_refresh=force_refresh)
         | 
| 536 | 
            -
                return {}
         | 
| 416 | 
            +
                """Convenience function for synchronous agent discovery (compatibility function)."""
         | 
| 417 | 
            +
                return unified_discover_agents()
         | 
| 418 | 
            +
             | 
| 537 419 |  | 
| 538 420 | 
             
            def get_core_agent_types() -> Set[str]:
         | 
| 539 | 
            -
                """
         | 
| 540 | 
            -
                 | 
| 541 | 
            -
                
         | 
| 542 | 
            -
             | 
| 543 | 
            -
                    Set of core agent type names
         | 
| 544 | 
            -
                """
         | 
| 545 | 
            -
                adapter = AgentRegistryAdapter()
         | 
| 546 | 
            -
                if adapter.registry:
         | 
| 547 | 
            -
                    return adapter.registry.core_agent_types
         | 
| 548 | 
            -
                return set()
         | 
| 421 | 
            +
                """Get the set of core agent types (compatibility function)."""
         | 
| 422 | 
            +
                core_agents = unified_get_core_agents()
         | 
| 423 | 
            +
                return {agent.name for agent in core_agents}
         | 
| 424 | 
            +
             | 
| 549 425 |  | 
| 550 426 | 
             
            def get_specialized_agent_types() -> Set[str]:
         | 
| 551 | 
            -
                """
         | 
| 552 | 
            -
                 | 
| 553 | 
            -
                
         | 
| 554 | 
            -
             | 
| 555 | 
            -
                    Set of specialized agent type names
         | 
| 556 | 
            -
                """
         | 
| 557 | 
            -
                adapter = AgentRegistryAdapter()
         | 
| 558 | 
            -
                if adapter.registry:
         | 
| 559 | 
            -
                    return adapter.registry.specialized_agent_types
         | 
| 560 | 
            -
                return set()
         | 
| 427 | 
            +
                """Get the set of specialized agent types (compatibility function)."""
         | 
| 428 | 
            +
                specialized_agents = unified_get_specialized_agents()
         | 
| 429 | 
            +
                return {agent.name for agent in specialized_agents}
         | 
| 430 | 
            +
             | 
| 561 431 |  | 
| 562 432 | 
             
            def list_agents_all() -> Dict[str, Dict[str, Any]]:
         | 
| 563 | 
            -
                """
         | 
| 564 | 
            -
                 | 
| 565 | 
            -
                
         | 
| 566 | 
            -
             | 
| 567 | 
            -
             | 
| 568 | 
            -
             | 
| 569 | 
            -
             | 
| 570 | 
            -
             | 
| 571 | 
            -
             | 
| 572 | 
            -
             | 
| 433 | 
            +
                """Synchronous function for listing all agents (compatibility function)."""
         | 
| 434 | 
            +
                unified_agents = unified_discover_agents()
         | 
| 435 | 
            +
                return {
         | 
| 436 | 
            +
                    name: {
         | 
| 437 | 
            +
                        "name": metadata.name,
         | 
| 438 | 
            +
                        "type": metadata.agent_type.value,
         | 
| 439 | 
            +
                        "path": metadata.path,
         | 
| 440 | 
            +
                        "tier": metadata.tier.value,
         | 
| 441 | 
            +
                        "last_modified": metadata.last_modified,
         | 
| 442 | 
            +
                        "specializations": metadata.specializations,
         | 
| 443 | 
            +
                        "description": metadata.description,
         | 
| 444 | 
            +
                    }
         | 
| 445 | 
            +
                    for name, metadata in unified_agents.items()
         | 
| 446 | 
            +
                }
         | 
| 447 | 
            +
             | 
| 573 448 |  | 
| 574 449 | 
             
            def listAgents() -> Dict[str, Dict[str, Any]]:
         | 
| 575 | 
            -
                """
         | 
| 576 | 
            -
                DEPRECATED: Use list_agents_all() instead. Kept for backward compatibility.
         | 
| 577 | 
            -
                
         | 
| 578 | 
            -
                Returns:
         | 
| 579 | 
            -
                    Dictionary of agent name -> agent metadata
         | 
| 580 | 
            -
                """
         | 
| 581 | 
            -
                import warnings
         | 
| 450 | 
            +
                """DEPRECATED: Use list_agents_all() instead (compatibility function)."""
         | 
| 582 451 | 
             
                warnings.warn(
         | 
| 583 452 | 
             
                    "listAgents() is deprecated, use list_agents_all() instead",
         | 
| 584 453 | 
             
                    DeprecationWarning,
         | 
| 585 | 
            -
                    stacklevel=2
         | 
| 454 | 
            +
                    stacklevel=2,
         | 
| 586 455 | 
             
                )
         | 
| 587 456 | 
             
                return list_agents_all()
         | 
| 588 457 |  | 
| 589 | 
            -
             | 
| 590 | 
            -
             | 
| 591 | 
            -
                 | 
| 592 | 
            -
             | 
| 593 | 
            -
                 | 
| 594 | 
            -
             | 
| 595 | 
            -
             | 
| 596 | 
            -
             | 
| 597 | 
            -
             | 
| 598 | 
            -
             | 
| 599 | 
            -
             | 
| 600 | 
            -
             | 
| 601 | 
            -
             | 
| 602 | 
            -
             | 
| 603 | 
            -
             | 
| 458 | 
            +
             | 
| 459 | 
            +
            def list_agents(
         | 
| 460 | 
            +
                agent_type: Optional[str] = None, tier: Optional[str] = None
         | 
| 461 | 
            +
            ) -> List[AgentMetadata]:
         | 
| 462 | 
            +
                """Synchronous function to list agents with optional filtering (compatibility function)."""
         | 
| 463 | 
            +
                # Convert parameters to unified types
         | 
| 464 | 
            +
                unified_tier = None
         | 
| 465 | 
            +
                unified_agent_type = None
         | 
| 466 | 
            +
             | 
| 467 | 
            +
                if tier:
         | 
| 468 | 
            +
                    try:
         | 
| 469 | 
            +
                        unified_tier = AgentTier(tier)
         | 
| 470 | 
            +
                    except ValueError:
         | 
| 471 | 
            +
                        pass
         | 
| 472 | 
            +
             | 
| 473 | 
            +
                if agent_type:
         | 
| 474 | 
            +
                    try:
         | 
| 475 | 
            +
                        unified_agent_type = AgentType(agent_type)
         | 
| 476 | 
            +
                    except ValueError:
         | 
| 477 | 
            +
                        pass
         | 
| 478 | 
            +
             | 
| 479 | 
            +
                unified_agents = unified_list_agents(
         | 
| 480 | 
            +
                    tier=unified_tier, agent_type=unified_agent_type
         | 
| 481 | 
            +
                )
         | 
| 482 | 
            +
                return [AgentMetadata.from_unified(agent) for agent in unified_agents]
         | 
| 483 | 
            +
             | 
| 604 484 |  | 
| 605 485 | 
             
            def discover_agents_sync(force_refresh: bool = False) -> Dict[str, AgentMetadata]:
         | 
| 606 | 
            -
                """
         | 
| 607 | 
            -
                Synchronous function for agent discovery
         | 
| 608 | 
            -
                
         | 
| 609 | 
            -
                Args:
         | 
| 610 | 
            -
                    force_refresh: Force cache refresh
         | 
| 611 | 
            -
                    
         | 
| 612 | 
            -
                Returns:
         | 
| 613 | 
            -
                    Dictionary of discovered agents
         | 
| 614 | 
            -
                """
         | 
| 486 | 
            +
                """Synchronous function for agent discovery (compatibility function)."""
         | 
| 615 487 | 
             
                return discover_agents(force_refresh)
         | 
| 616 488 |  | 
| 489 | 
            +
             | 
| 617 490 | 
             
            def get_agent(agent_name: str) -> Optional[Dict[str, Any]]:
         | 
| 618 | 
            -
                """
         | 
| 619 | 
            -
                 | 
| 620 | 
            -
                
         | 
| 621 | 
            -
             | 
| 622 | 
            -
             | 
| 623 | 
            -
             | 
| 624 | 
            -
             | 
| 625 | 
            -
             | 
| 626 | 
            -
             | 
| 627 | 
            -
             | 
| 628 | 
            -
             | 
| 629 | 
            -
                     | 
| 630 | 
            -
                    if agent:
         | 
| 631 | 
            -
                        return {
         | 
| 632 | 
            -
                            'name': agent.name,
         | 
| 633 | 
            -
                            'type': agent.type,
         | 
| 634 | 
            -
                            'path': agent.path,
         | 
| 635 | 
            -
                            'tier': agent.tier,
         | 
| 636 | 
            -
                            'last_modified': agent.last_modified,
         | 
| 637 | 
            -
                            'specializations': agent.specializations,
         | 
| 638 | 
            -
                            'description': agent.description
         | 
| 639 | 
            -
                        }
         | 
| 491 | 
            +
                """Synchronous function to get a specific agent (compatibility function)."""
         | 
| 492 | 
            +
                unified_agent = unified_get_agent(agent_name)
         | 
| 493 | 
            +
                if unified_agent:
         | 
| 494 | 
            +
                    return {
         | 
| 495 | 
            +
                        "name": unified_agent.name,
         | 
| 496 | 
            +
                        "type": unified_agent.agent_type.value,
         | 
| 497 | 
            +
                        "path": unified_agent.path,
         | 
| 498 | 
            +
                        "tier": unified_agent.tier.value,
         | 
| 499 | 
            +
                        "last_modified": unified_agent.last_modified,
         | 
| 500 | 
            +
                        "specializations": unified_agent.specializations,
         | 
| 501 | 
            +
                        "description": unified_agent.description,
         | 
| 502 | 
            +
                    }
         | 
| 640 503 | 
             
                return None
         | 
| 641 504 |  | 
| 505 | 
            +
             | 
| 642 506 | 
             
            def get_registry_stats() -> Dict[str, Any]:
         | 
| 643 | 
            -
                """
         | 
| 644 | 
            -
                 | 
| 645 | 
            -
                
         | 
| 646 | 
            -
                Returns:
         | 
| 647 | 
            -
                    Dictionary of registry statistics
         | 
| 648 | 
            -
                """
         | 
| 649 | 
            -
                adapter = AgentRegistryAdapter()
         | 
| 650 | 
            -
                if adapter.registry:
         | 
| 651 | 
            -
                    agents = adapter.registry.list_agents_filtered()
         | 
| 652 | 
            -
                    return {
         | 
| 653 | 
            -
                        'total_agents': len(agents),
         | 
| 654 | 
            -
                        'agent_types': len(set(a.type for a in agents)),
         | 
| 655 | 
            -
                        'tiers': list(set(a.tier for a in agents))
         | 
| 656 | 
            -
                    }
         | 
| 657 | 
            -
                return {'total_agents': 0, 'agent_types': 0, 'tiers': []}
         | 
| 507 | 
            +
                """Synchronous function to get registry statistics (compatibility function)."""
         | 
| 508 | 
            +
                return unified_get_registry_stats()
         | 
| 658 509 |  | 
| 659 510 |  | 
| 660 511 | 
             
            # Export all public symbols
         | 
| 661 512 | 
             
            __all__ = [
         | 
| 662 | 
            -
                 | 
| 663 | 
            -
                 | 
| 664 | 
            -
                 | 
| 665 | 
            -
                 | 
| 666 | 
            -
                 | 
| 667 | 
            -
                 | 
| 668 | 
            -
                 | 
| 669 | 
            -
                 | 
| 670 | 
            -
                 | 
| 671 | 
            -
                 | 
| 672 | 
            -
                 | 
| 673 | 
            -
                 | 
| 674 | 
            -
                 | 
| 675 | 
            -
                 | 
| 676 | 
            -
            ]
         | 
| 513 | 
            +
                "AgentRegistry",
         | 
| 514 | 
            +
                "AgentRegistryAdapter",
         | 
| 515 | 
            +
                "AgentMetadata",
         | 
| 516 | 
            +
                "SimpleAgentRegistry",
         | 
| 517 | 
            +
                "create_agent_registry",
         | 
| 518 | 
            +
                "discover_agents",
         | 
| 519 | 
            +
                "get_core_agent_types",
         | 
| 520 | 
            +
                "get_specialized_agent_types",
         | 
| 521 | 
            +
                "list_agents_all",
         | 
| 522 | 
            +
                "list_agents",
         | 
| 523 | 
            +
                "listAgents",  # Deprecated
         | 
| 524 | 
            +
                "discover_agents_sync",
         | 
| 525 | 
            +
                "get_agent",
         | 
| 526 | 
            +
                "get_registry_stats",
         | 
| 527 | 
            +
            ]
         |