claude-mpm 3.9.11__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 +1 -1
- 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 +79 -51
- claude_mpm/cli/__main__.py +3 -2
- claude_mpm/cli/commands/__init__.py +20 -20
- 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 +140 -905
- 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 -1156
- 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 +71 -73
- claude_mpm/config/paths.py +94 -208
- claude_mpm/config/socketio_config.py +84 -73
- claude_mpm/constants.py +35 -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 +233 -199
- 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 +30 -13
- 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 +13 -20
- 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 +87 -84
- claude_mpm/services/mcp_gateway/main.py +287 -137
- claude_mpm/services/mcp_gateway/registry/__init__.py +1 -1
- claude_mpm/services/mcp_gateway/registry/service_registry.py +97 -94
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +135 -126
- claude_mpm/services/mcp_gateway/server/__init__.py +2 -2
- claude_mpm/services/mcp_gateway/server/mcp_gateway.py +105 -110
- 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 +109 -119
- 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 +19 -533
- 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 +2 -2
- claude_mpm/storage/state_storage.py +177 -181
- 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.11.dist-info → claude_mpm-4.0.3.dist-info}/METADATA +27 -1
- claude_mpm-4.0.3.dist-info/RECORD +402 -0
- {claude_mpm-3.9.11.dist-info → claude_mpm-4.0.3.dist-info}/entry_points.txt +1 -0
- {claude_mpm-3.9.11.dist-info → claude_mpm-4.0.3.dist-info}/licenses/LICENSE +1 -1
- claude_mpm/cli/commands/run_guarded.py +0 -511
- claude_mpm/config/memory_guardian_config.py +0 -325
- claude_mpm/config/memory_guardian_yaml.py +0 -335
- claude_mpm/core/config_paths.py +0 -150
- claude_mpm/core/memory_aware_runner.py +0 -353
- 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/graceful_degradation.py +0 -616
- claude_mpm/services/infrastructure/health_monitor.py +0 -775
- claude_mpm/services/infrastructure/memory_dashboard.py +0 -479
- claude_mpm/services/infrastructure/memory_guardian.py +0 -944
- claude_mpm/services/infrastructure/restart_protection.py +0 -642
- claude_mpm/services/infrastructure/state_manager.py +0 -774
- claude_mpm/services/mcp_gateway/manager.py +0 -334
- 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.11.dist-info/RECORD +0 -306
- {claude_mpm-3.9.11.dist-info → claude_mpm-4.0.3.dist-info}/WHEEL +0 -0
- {claude_mpm-3.9.11.dist-info → claude_mpm-4.0.3.dist-info}/top_level.txt +0 -0
| @@ -22,61 +22,59 @@ import json | |
| 22 22 | 
             
            import logging
         | 
| 23 23 | 
             
            import time
         | 
| 24 24 | 
             
            from contextlib import contextmanager
         | 
| 25 | 
            +
            from datetime import datetime
         | 
| 25 26 | 
             
            from pathlib import Path
         | 
| 26 27 | 
             
            from typing import Any, Dict, Optional, Union
         | 
| 27 | 
            -
            from datetime import datetime
         | 
| 28 28 |  | 
| 29 29 | 
             
            from claude_mpm.core.logger import (
         | 
| 30 | 
            -
                setup_logging as _setup_logging,
         | 
| 31 | 
            -
                get_logger as _get_logger,
         | 
| 32 | 
            -
                log_performance,
         | 
| 33 | 
            -
                log_async_performance,
         | 
| 34 30 | 
             
                JsonFormatter,
         | 
| 35 31 | 
             
                StreamingHandler,
         | 
| 36 | 
            -
                finalize_streaming_logs
         | 
| 32 | 
            +
                finalize_streaming_logs,
         | 
| 37 33 | 
             
            )
         | 
| 38 | 
            -
             | 
| 34 | 
            +
            from claude_mpm.core.logger import get_logger as _get_logger
         | 
| 35 | 
            +
            from claude_mpm.core.logger import log_async_performance, log_performance
         | 
| 36 | 
            +
            from claude_mpm.core.logger import setup_logging as _setup_logging
         | 
| 39 37 |  | 
| 40 38 | 
             
            # Standard log format for consistency
         | 
| 41 | 
            -
            STANDARD_FORMAT =  | 
| 42 | 
            -
            DETAILED_FORMAT =  | 
| 43 | 
            -
            SIMPLE_FORMAT =  | 
| 39 | 
            +
            STANDARD_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
         | 
| 40 | 
            +
            DETAILED_FORMAT = "%(asctime)s - %(name)s - %(levelname)s - [%(filename)s:%(lineno)d] - %(funcName)s() - %(message)s"
         | 
| 41 | 
            +
            SIMPLE_FORMAT = "%(levelname)s: %(message)s"
         | 
| 44 42 |  | 
| 45 43 | 
             
            # Log level mapping for consistent usage
         | 
| 46 44 | 
             
            LOG_LEVELS = {
         | 
| 47 | 
            -
                 | 
| 48 | 
            -
                 | 
| 49 | 
            -
                 | 
| 50 | 
            -
                 | 
| 51 | 
            -
                 | 
| 45 | 
            +
                "DEBUG": logging.DEBUG,  # Detailed diagnostic information
         | 
| 46 | 
            +
                "INFO": logging.INFO,  # Normal operations, significant events
         | 
| 47 | 
            +
                "WARNING": logging.WARNING,  # Potentially harmful situations
         | 
| 48 | 
            +
                "ERROR": logging.ERROR,  # Error events allowing continued operation
         | 
| 49 | 
            +
                "CRITICAL": logging.CRITICAL,  # Events that may cause abort
         | 
| 52 50 | 
             
            }
         | 
| 53 51 |  | 
| 54 52 |  | 
| 55 53 | 
             
            class LogContext:
         | 
| 56 54 | 
             
                """
         | 
| 57 55 | 
             
                Context manager for adding contextual information to log messages.
         | 
| 58 | 
            -
             | 
| 56 | 
            +
             | 
| 59 57 | 
             
                WHY: Provides consistent way to add context like operation IDs, user info,
         | 
| 60 58 | 
             
                or request IDs to all logs within a scope without modifying every log call.
         | 
| 61 59 | 
             
                """
         | 
| 62 | 
            -
             | 
| 60 | 
            +
             | 
| 63 61 | 
             
                _context: Dict[str, Any] = {}
         | 
| 64 | 
            -
             | 
| 62 | 
            +
             | 
| 65 63 | 
             
                @classmethod
         | 
| 66 64 | 
             
                def set(cls, **kwargs):
         | 
| 67 65 | 
             
                    """Set context values."""
         | 
| 68 66 | 
             
                    cls._context.update(kwargs)
         | 
| 69 | 
            -
             | 
| 67 | 
            +
             | 
| 70 68 | 
             
                @classmethod
         | 
| 71 69 | 
             
                def get(cls) -> Dict[str, Any]:
         | 
| 72 70 | 
             
                    """Get current context."""
         | 
| 73 71 | 
             
                    return cls._context.copy()
         | 
| 74 | 
            -
             | 
| 72 | 
            +
             | 
| 75 73 | 
             
                @classmethod
         | 
| 76 74 | 
             
                def clear(cls):
         | 
| 77 75 | 
             
                    """Clear all context."""
         | 
| 78 76 | 
             
                    cls._context.clear()
         | 
| 79 | 
            -
             | 
| 77 | 
            +
             | 
| 80 78 | 
             
                @classmethod
         | 
| 81 79 | 
             
                @contextmanager
         | 
| 82 80 | 
             
                def context(cls, **kwargs):
         | 
| @@ -92,80 +90,82 @@ class LogContext: | |
| 92 90 | 
             
            class ContextualLogger:
         | 
| 93 91 | 
             
                """
         | 
| 94 92 | 
             
                Logger wrapper that automatically includes context in all messages.
         | 
| 95 | 
            -
             | 
| 93 | 
            +
             | 
| 96 94 | 
             
                WHY: Ensures all log messages from a component include relevant context
         | 
| 97 95 | 
             
                without requiring manual addition to each log call.
         | 
| 98 96 | 
             
                """
         | 
| 99 | 
            -
             | 
| 97 | 
            +
             | 
| 100 98 | 
             
                def __init__(self, logger: logging.Logger):
         | 
| 101 99 | 
             
                    self._logger = logger
         | 
| 102 | 
            -
             | 
| 100 | 
            +
             | 
| 103 101 | 
             
                def _log_with_context(self, level: int, msg: str, *args, **kwargs):
         | 
| 104 102 | 
             
                    """Add context to log message."""
         | 
| 105 103 | 
             
                    context = LogContext.get()
         | 
| 106 104 | 
             
                    if context:
         | 
| 107 105 | 
             
                        # Add context as extra fields for structured logging
         | 
| 108 | 
            -
                        kwargs[ | 
| 109 | 
            -
                        kwargs[ | 
| 110 | 
            -
             | 
| 106 | 
            +
                        kwargs["extra"] = kwargs.get("extra", {})
         | 
| 107 | 
            +
                        kwargs["extra"].update(context)
         | 
| 108 | 
            +
             | 
| 111 109 | 
             
                        # For human-readable logs, prepend context
         | 
| 112 110 | 
             
                        if not isinstance(self._logger.handlers[0].formatter, JsonFormatter):
         | 
| 113 | 
            -
                            context_str =  | 
| 111 | 
            +
                            context_str = " ".join(f"[{k}={v}]" for k, v in context.items())
         | 
| 114 112 | 
             
                            if context_str:
         | 
| 115 113 | 
             
                                msg = f"{context_str} {msg}"
         | 
| 116 | 
            -
             | 
| 114 | 
            +
             | 
| 117 115 | 
             
                    self._logger.log(level, msg, *args, **kwargs)
         | 
| 118 | 
            -
             | 
| 116 | 
            +
             | 
| 119 117 | 
             
                def debug(self, msg: str, *args, **kwargs):
         | 
| 120 118 | 
             
                    """Log debug message with context."""
         | 
| 121 119 | 
             
                    self._log_with_context(logging.DEBUG, msg, *args, **kwargs)
         | 
| 122 | 
            -
             | 
| 120 | 
            +
             | 
| 123 121 | 
             
                def info(self, msg: str, *args, **kwargs):
         | 
| 124 122 | 
             
                    """Log info message with context."""
         | 
| 125 123 | 
             
                    self._log_with_context(logging.INFO, msg, *args, **kwargs)
         | 
| 126 | 
            -
             | 
| 124 | 
            +
             | 
| 127 125 | 
             
                def warning(self, msg: str, *args, **kwargs):
         | 
| 128 126 | 
             
                    """Log warning message with context."""
         | 
| 129 127 | 
             
                    self._log_with_context(logging.WARNING, msg, *args, **kwargs)
         | 
| 130 | 
            -
             | 
| 128 | 
            +
             | 
| 131 129 | 
             
                def error(self, msg: str, *args, **kwargs):
         | 
| 132 130 | 
             
                    """Log error message with context."""
         | 
| 133 131 | 
             
                    self._log_with_context(logging.ERROR, msg, *args, **kwargs)
         | 
| 134 | 
            -
             | 
| 132 | 
            +
             | 
| 135 133 | 
             
                def critical(self, msg: str, *args, **kwargs):
         | 
| 136 134 | 
             
                    """Log critical message with context."""
         | 
| 137 135 | 
             
                    self._log_with_context(logging.CRITICAL, msg, *args, **kwargs)
         | 
| 138 | 
            -
             | 
| 136 | 
            +
             | 
| 139 137 | 
             
                def exception(self, msg: str, *args, **kwargs):
         | 
| 140 138 | 
             
                    """Log exception with context."""
         | 
| 141 | 
            -
                    kwargs[ | 
| 139 | 
            +
                    kwargs["exc_info"] = True
         | 
| 142 140 | 
             
                    self._log_with_context(logging.ERROR, msg, *args, **kwargs)
         | 
| 143 141 |  | 
| 144 142 |  | 
| 145 | 
            -
            def get_logger( | 
| 143 | 
            +
            def get_logger(
         | 
| 144 | 
            +
                name: str, with_context: bool = True
         | 
| 145 | 
            +
            ) -> Union[ContextualLogger, logging.Logger]:
         | 
| 146 146 | 
             
                """
         | 
| 147 147 | 
             
                Get a configured logger instance.
         | 
| 148 | 
            -
             | 
| 148 | 
            +
             | 
| 149 149 | 
             
                WHY: Centralized logger creation ensures all loggers follow the same
         | 
| 150 150 | 
             
                naming convention and configuration patterns.
         | 
| 151 | 
            -
             | 
| 151 | 
            +
             | 
| 152 152 | 
             
                Args:
         | 
| 153 153 | 
             
                    name: Logger name (typically __name__ from the calling module)
         | 
| 154 154 | 
             
                    with_context: Whether to wrap with ContextualLogger for automatic context
         | 
| 155 | 
            -
             | 
| 155 | 
            +
             | 
| 156 156 | 
             
                Returns:
         | 
| 157 157 | 
             
                    Configured logger instance
         | 
| 158 | 
            -
             | 
| 158 | 
            +
             | 
| 159 159 | 
             
                Example:
         | 
| 160 160 | 
             
                    logger = get_logger(__name__)
         | 
| 161 161 | 
             
                    logger.info("Processing request", extra={"request_id": "123"})
         | 
| 162 162 | 
             
                """
         | 
| 163 163 | 
             
                # Ensure consistent naming
         | 
| 164 | 
            -
                if not name.startswith( | 
| 165 | 
            -
                    name = f | 
| 166 | 
            -
             | 
| 164 | 
            +
                if not name.startswith("claude_mpm"):
         | 
| 165 | 
            +
                    name = f"claude_mpm.{name}"
         | 
| 166 | 
            +
             | 
| 167 167 | 
             
                logger = _get_logger(name)
         | 
| 168 | 
            -
             | 
| 168 | 
            +
             | 
| 169 169 | 
             
                if with_context:
         | 
| 170 170 | 
             
                    return ContextualLogger(logger)
         | 
| 171 171 | 
             
                return logger
         | 
| @@ -177,14 +177,14 @@ def configure_logging( | |
| 177 177 | 
             
                console_output: bool = True,
         | 
| 178 178 | 
             
                file_output: bool = True,
         | 
| 179 179 | 
             
                json_format: bool = False,
         | 
| 180 | 
            -
                use_streaming: bool = False
         | 
| 180 | 
            +
                use_streaming: bool = False,
         | 
| 181 181 | 
             
            ) -> None:
         | 
| 182 182 | 
             
                """
         | 
| 183 183 | 
             
                Configure global logging settings.
         | 
| 184 | 
            -
             | 
| 184 | 
            +
             | 
| 185 185 | 
             
                WHY: Provides single entry point for configuring all logging behavior
         | 
| 186 186 | 
             
                across the application, ensuring consistency.
         | 
| 187 | 
            -
             | 
| 187 | 
            +
             | 
| 188 188 | 
             
                Args:
         | 
| 189 189 | 
             
                    level: Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
         | 
| 190 190 | 
             
                    log_dir: Directory for log files
         | 
| @@ -201,196 +201,225 @@ def configure_logging( | |
| 201 201 | 
             
                    console_output=console_output,
         | 
| 202 202 | 
             
                    file_output=file_output,
         | 
| 203 203 | 
             
                    json_format=json_format,
         | 
| 204 | 
            -
                    use_streaming=use_streaming
         | 
| 204 | 
            +
                    use_streaming=use_streaming,
         | 
| 205 205 | 
             
                )
         | 
| 206 206 |  | 
| 207 207 |  | 
| 208 208 | 
             
            @contextmanager
         | 
| 209 | 
            -
            def log_operation( | 
| 210 | 
            -
             | 
| 211 | 
            -
             | 
| 209 | 
            +
            def log_operation(
         | 
| 210 | 
            +
                logger: Union[ContextualLogger, logging.Logger], operation: str, **context
         | 
| 211 | 
            +
            ):
         | 
| 212 212 | 
             
                """
         | 
| 213 213 | 
             
                Context manager for logging operation start/end with timing.
         | 
| 214 | 
            -
             | 
| 214 | 
            +
             | 
| 215 215 | 
             
                WHY: Provides consistent way to track operation execution including
         | 
| 216 216 | 
             
                timing, success/failure, and any relevant context.
         | 
| 217 | 
            -
             | 
| 217 | 
            +
             | 
| 218 218 | 
             
                Args:
         | 
| 219 219 | 
             
                    logger: Logger instance
         | 
| 220 220 | 
             
                    operation: Operation name/description
         | 
| 221 221 | 
             
                    **context: Additional context to include in logs
         | 
| 222 | 
            -
             | 
| 222 | 
            +
             | 
| 223 223 | 
             
                Example:
         | 
| 224 224 | 
             
                    with log_operation(logger, "database_query", query_type="select"):
         | 
| 225 225 | 
             
                        # Perform database operation
         | 
| 226 226 | 
             
                        pass
         | 
| 227 227 | 
             
                """
         | 
| 228 228 | 
             
                start_time = time.time()
         | 
| 229 | 
            -
             | 
| 229 | 
            +
             | 
| 230 230 | 
             
                # Add operation context
         | 
| 231 231 | 
             
                with LogContext.context(operation=operation, **context):
         | 
| 232 232 | 
             
                    logger.info(f"Starting {operation}")
         | 
| 233 | 
            -
             | 
| 233 | 
            +
             | 
| 234 234 | 
             
                    try:
         | 
| 235 235 | 
             
                        yield
         | 
| 236 236 | 
             
                        execution_time = time.time() - start_time
         | 
| 237 | 
            -
                        logger.info( | 
| 238 | 
            -
                            " | 
| 239 | 
            -
                            "status": "success"
         | 
| 240 | 
            -
                         | 
| 237 | 
            +
                        logger.info(
         | 
| 238 | 
            +
                            f"Completed {operation}",
         | 
| 239 | 
            +
                            extra={"execution_time": execution_time, "status": "success"},
         | 
| 240 | 
            +
                        )
         | 
| 241 241 | 
             
                    except Exception as e:
         | 
| 242 242 | 
             
                        execution_time = time.time() - start_time
         | 
| 243 | 
            -
                        logger.error( | 
| 244 | 
            -
                            " | 
| 245 | 
            -
                             | 
| 246 | 
            -
             | 
| 247 | 
            -
             | 
| 243 | 
            +
                        logger.error(
         | 
| 244 | 
            +
                            f"Failed {operation}: {e}",
         | 
| 245 | 
            +
                            extra={
         | 
| 246 | 
            +
                                "execution_time": execution_time,
         | 
| 247 | 
            +
                                "status": "failure",
         | 
| 248 | 
            +
                                "error": str(e),
         | 
| 249 | 
            +
                            },
         | 
| 250 | 
            +
                        )
         | 
| 248 251 | 
             
                        raise
         | 
| 249 252 |  | 
| 250 253 |  | 
| 251 254 | 
             
            @contextmanager
         | 
| 252 | 
            -
            def log_performance_context( | 
| 253 | 
            -
             | 
| 254 | 
            -
             | 
| 255 | 
            -
             | 
| 255 | 
            +
            def log_performance_context(
         | 
| 256 | 
            +
                logger: Union[ContextualLogger, logging.Logger],
         | 
| 257 | 
            +
                operation: str,
         | 
| 258 | 
            +
                warn_threshold: float = 1.0,
         | 
| 259 | 
            +
                error_threshold: float = 5.0,
         | 
| 260 | 
            +
            ):
         | 
| 256 261 | 
             
                """
         | 
| 257 262 | 
             
                Context manager for performance monitoring with thresholds.
         | 
| 258 | 
            -
             | 
| 263 | 
            +
             | 
| 259 264 | 
             
                WHY: Automatically warns or errors when operations exceed performance
         | 
| 260 265 | 
             
                thresholds, helping identify performance issues early.
         | 
| 261 | 
            -
             | 
| 266 | 
            +
             | 
| 262 267 | 
             
                Args:
         | 
| 263 268 | 
             
                    logger: Logger instance
         | 
| 264 269 | 
             
                    operation: Operation being monitored
         | 
| 265 270 | 
             
                    warn_threshold: Time in seconds to trigger warning
         | 
| 266 271 | 
             
                    error_threshold: Time in seconds to trigger error
         | 
| 267 | 
            -
             | 
| 272 | 
            +
             | 
| 268 273 | 
             
                Example:
         | 
| 269 274 | 
             
                    with log_performance_context(logger, "api_call", warn_threshold=0.5):
         | 
| 270 275 | 
             
                        # Make API call
         | 
| 271 276 | 
             
                        pass
         | 
| 272 277 | 
             
                """
         | 
| 273 278 | 
             
                start_time = time.time()
         | 
| 274 | 
            -
             | 
| 279 | 
            +
             | 
| 275 280 | 
             
                try:
         | 
| 276 281 | 
             
                    yield
         | 
| 277 282 | 
             
                finally:
         | 
| 278 283 | 
             
                    execution_time = time.time() - start_time
         | 
| 279 | 
            -
             | 
| 284 | 
            +
             | 
| 280 285 | 
             
                    if execution_time > error_threshold:
         | 
| 281 | 
            -
                        logger.error( | 
| 282 | 
            -
                            "execution_time | 
| 283 | 
            -
                            "threshold_exceeded": "error"
         | 
| 284 | 
            -
                         | 
| 286 | 
            +
                        logger.error(
         | 
| 287 | 
            +
                            f"{operation} took {execution_time:.3f}s (threshold: {error_threshold}s)",
         | 
| 288 | 
            +
                            extra={"execution_time": execution_time, "threshold_exceeded": "error"},
         | 
| 289 | 
            +
                        )
         | 
| 285 290 | 
             
                    elif execution_time > warn_threshold:
         | 
| 286 | 
            -
                        logger.warning( | 
| 287 | 
            -
                            "execution_time | 
| 288 | 
            -
                             | 
| 289 | 
            -
             | 
| 291 | 
            +
                        logger.warning(
         | 
| 292 | 
            +
                            f"{operation} took {execution_time:.3f}s (threshold: {warn_threshold}s)",
         | 
| 293 | 
            +
                            extra={
         | 
| 294 | 
            +
                                "execution_time": execution_time,
         | 
| 295 | 
            +
                                "threshold_exceeded": "warning",
         | 
| 296 | 
            +
                            },
         | 
| 297 | 
            +
                        )
         | 
| 290 298 | 
             
                    else:
         | 
| 291 | 
            -
                        logger.debug( | 
| 292 | 
            -
                            "execution_time" | 
| 293 | 
            -
             | 
| 299 | 
            +
                        logger.debug(
         | 
| 300 | 
            +
                            f"{operation} completed in {execution_time:.3f}s",
         | 
| 301 | 
            +
                            extra={"execution_time": execution_time},
         | 
| 302 | 
            +
                        )
         | 
| 294 303 |  | 
| 295 304 |  | 
| 296 305 | 
             
            def log_function_call(func):
         | 
| 297 306 | 
             
                """
         | 
| 298 307 | 
             
                Decorator to log function calls with arguments and results.
         | 
| 299 | 
            -
             | 
| 308 | 
            +
             | 
| 300 309 | 
             
                WHY: Provides automatic logging of function entry/exit for debugging
         | 
| 301 310 | 
             
                without modifying function implementation.
         | 
| 302 | 
            -
             | 
| 311 | 
            +
             | 
| 303 312 | 
             
                Example:
         | 
| 304 313 | 
             
                    @log_function_call
         | 
| 305 314 | 
             
                    def process_data(data: dict) -> dict:
         | 
| 306 315 | 
             
                        return {"processed": True}
         | 
| 307 316 | 
             
                """
         | 
| 317 | 
            +
             | 
| 308 318 | 
             
                @functools.wraps(func)
         | 
| 309 319 | 
             
                def wrapper(*args, **kwargs):
         | 
| 310 320 | 
             
                    logger = get_logger(func.__module__)
         | 
| 311 321 | 
             
                    func_name = func.__qualname__
         | 
| 312 | 
            -
             | 
| 322 | 
            +
             | 
| 313 323 | 
             
                    # Log function entry
         | 
| 314 | 
            -
                    logger.debug( | 
| 315 | 
            -
                        " | 
| 316 | 
            -
                         | 
| 317 | 
            -
             | 
| 318 | 
            -
             | 
| 319 | 
            -
             | 
| 324 | 
            +
                    logger.debug(
         | 
| 325 | 
            +
                        f"Calling {func_name}",
         | 
| 326 | 
            +
                        extra={
         | 
| 327 | 
            +
                            "function": func_name,
         | 
| 328 | 
            +
                            "args_count": len(args),
         | 
| 329 | 
            +
                            "kwargs_keys": list(kwargs.keys()),
         | 
| 330 | 
            +
                        },
         | 
| 331 | 
            +
                    )
         | 
| 332 | 
            +
             | 
| 320 333 | 
             
                    start_time = time.time()
         | 
| 321 334 | 
             
                    try:
         | 
| 322 335 | 
             
                        result = func(*args, **kwargs)
         | 
| 323 336 | 
             
                        execution_time = time.time() - start_time
         | 
| 324 | 
            -
             | 
| 325 | 
            -
                        logger.debug( | 
| 326 | 
            -
                            " | 
| 327 | 
            -
                             | 
| 328 | 
            -
             | 
| 329 | 
            -
             | 
| 330 | 
            -
             | 
| 337 | 
            +
             | 
| 338 | 
            +
                        logger.debug(
         | 
| 339 | 
            +
                            f"{func_name} completed",
         | 
| 340 | 
            +
                            extra={
         | 
| 341 | 
            +
                                "function": func_name,
         | 
| 342 | 
            +
                                "execution_time": execution_time,
         | 
| 343 | 
            +
                                "has_result": result is not None,
         | 
| 344 | 
            +
                            },
         | 
| 345 | 
            +
                        )
         | 
| 346 | 
            +
             | 
| 331 347 | 
             
                        return result
         | 
| 332 | 
            -
             | 
| 348 | 
            +
             | 
| 333 349 | 
             
                    except Exception as e:
         | 
| 334 350 | 
             
                        execution_time = time.time() - start_time
         | 
| 335 | 
            -
                        logger.exception( | 
| 336 | 
            -
                            " | 
| 337 | 
            -
                             | 
| 338 | 
            -
             | 
| 339 | 
            -
             | 
| 351 | 
            +
                        logger.exception(
         | 
| 352 | 
            +
                            f"{func_name} failed",
         | 
| 353 | 
            +
                            extra={
         | 
| 354 | 
            +
                                "function": func_name,
         | 
| 355 | 
            +
                                "execution_time": execution_time,
         | 
| 356 | 
            +
                                "error_type": type(e).__name__,
         | 
| 357 | 
            +
                            },
         | 
| 358 | 
            +
                        )
         | 
| 340 359 | 
             
                        raise
         | 
| 341 | 
            -
             | 
| 360 | 
            +
             | 
| 342 361 | 
             
                return wrapper
         | 
| 343 362 |  | 
| 344 363 |  | 
| 345 364 | 
             
            async def log_async_function_call(func):
         | 
| 346 365 | 
             
                """
         | 
| 347 366 | 
             
                Decorator to log async function calls with arguments and results.
         | 
| 348 | 
            -
             | 
| 367 | 
            +
             | 
| 349 368 | 
             
                WHY: Provides automatic logging for async functions, essential for
         | 
| 350 369 | 
             
                tracking async operation flow and performance.
         | 
| 351 | 
            -
             | 
| 370 | 
            +
             | 
| 352 371 | 
             
                Example:
         | 
| 353 372 | 
             
                    @log_async_function_call
         | 
| 354 373 | 
             
                    async def fetch_data(url: str) -> dict:
         | 
| 355 374 | 
             
                        return {"data": "example"}
         | 
| 356 375 | 
             
                """
         | 
| 376 | 
            +
             | 
| 357 377 | 
             
                @functools.wraps(func)
         | 
| 358 378 | 
             
                async def wrapper(*args, **kwargs):
         | 
| 359 379 | 
             
                    logger = get_logger(func.__module__)
         | 
| 360 380 | 
             
                    func_name = func.__qualname__
         | 
| 361 | 
            -
             | 
| 381 | 
            +
             | 
| 362 382 | 
             
                    # Log function entry
         | 
| 363 | 
            -
                    logger.debug( | 
| 364 | 
            -
                        " | 
| 365 | 
            -
                         | 
| 366 | 
            -
             | 
| 367 | 
            -
             | 
| 368 | 
            -
             | 
| 369 | 
            -
             | 
| 383 | 
            +
                    logger.debug(
         | 
| 384 | 
            +
                        f"Calling async {func_name}",
         | 
| 385 | 
            +
                        extra={
         | 
| 386 | 
            +
                            "function": func_name,
         | 
| 387 | 
            +
                            "args_count": len(args),
         | 
| 388 | 
            +
                            "kwargs_keys": list(kwargs.keys()),
         | 
| 389 | 
            +
                            "is_async": True,
         | 
| 390 | 
            +
                        },
         | 
| 391 | 
            +
                    )
         | 
| 392 | 
            +
             | 
| 370 393 | 
             
                    start_time = time.time()
         | 
| 371 394 | 
             
                    try:
         | 
| 372 395 | 
             
                        result = await func(*args, **kwargs)
         | 
| 373 396 | 
             
                        execution_time = time.time() - start_time
         | 
| 374 | 
            -
             | 
| 375 | 
            -
                        logger.debug( | 
| 376 | 
            -
                            " | 
| 377 | 
            -
                             | 
| 378 | 
            -
             | 
| 379 | 
            -
             | 
| 380 | 
            -
             | 
| 381 | 
            -
             | 
| 397 | 
            +
             | 
| 398 | 
            +
                        logger.debug(
         | 
| 399 | 
            +
                            f"Async {func_name} completed",
         | 
| 400 | 
            +
                            extra={
         | 
| 401 | 
            +
                                "function": func_name,
         | 
| 402 | 
            +
                                "execution_time": execution_time,
         | 
| 403 | 
            +
                                "has_result": result is not None,
         | 
| 404 | 
            +
                                "is_async": True,
         | 
| 405 | 
            +
                            },
         | 
| 406 | 
            +
                        )
         | 
| 407 | 
            +
             | 
| 382 408 | 
             
                        return result
         | 
| 383 | 
            -
             | 
| 409 | 
            +
             | 
| 384 410 | 
             
                    except Exception as e:
         | 
| 385 411 | 
             
                        execution_time = time.time() - start_time
         | 
| 386 | 
            -
                        logger.exception( | 
| 387 | 
            -
                            " | 
| 388 | 
            -
                             | 
| 389 | 
            -
             | 
| 390 | 
            -
             | 
| 391 | 
            -
             | 
| 412 | 
            +
                        logger.exception(
         | 
| 413 | 
            +
                            f"Async {func_name} failed",
         | 
| 414 | 
            +
                            extra={
         | 
| 415 | 
            +
                                "function": func_name,
         | 
| 416 | 
            +
                                "execution_time": execution_time,
         | 
| 417 | 
            +
                                "error_type": type(e).__name__,
         | 
| 418 | 
            +
                                "is_async": True,
         | 
| 419 | 
            +
                            },
         | 
| 420 | 
            +
                        )
         | 
| 392 421 | 
             
                        raise
         | 
| 393 | 
            -
             | 
| 422 | 
            +
             | 
| 394 423 | 
             
                return wrapper
         | 
| 395 424 |  | 
| 396 425 |  | 
| @@ -400,20 +429,19 @@ LOGGING_STANDARDS = { | |
| 400 429 | 
             
                "DEBUG": "Detailed diagnostic information (e.g., variable values, execution flow)",
         | 
| 401 430 | 
             
                "WARNING": "Potentially harmful situations (e.g., deprecated API usage, retry attempts)",
         | 
| 402 431 | 
             
                "ERROR": "Error events that allow continued operation (e.g., single request failure)",
         | 
| 403 | 
            -
                "CRITICAL": "Events that may cause abort (e.g., database connection lost, out of memory)"
         | 
| 432 | 
            +
                "CRITICAL": "Events that may cause abort (e.g., database connection lost, out of memory)",
         | 
| 404 433 | 
             
            }
         | 
| 405 434 |  | 
| 406 435 |  | 
| 407 | 
            -
            def log_with_level( | 
| 408 | 
            -
             | 
| 409 | 
            -
             | 
| 410 | 
            -
                              **extra):
         | 
| 436 | 
            +
            def log_with_level(
         | 
| 437 | 
            +
                logger: Union[ContextualLogger, logging.Logger], level: str, message: str, **extra
         | 
| 438 | 
            +
            ):
         | 
| 411 439 | 
             
                """
         | 
| 412 440 | 
             
                Log a message with dynamic level selection.
         | 
| 413 | 
            -
             | 
| 441 | 
            +
             | 
| 414 442 | 
             
                WHY: Allows log level to be determined at runtime, useful for
         | 
| 415 443 | 
             
                configurable logging or conditional severity.
         | 
| 416 | 
            -
             | 
| 444 | 
            +
             | 
| 417 445 | 
             
                Args:
         | 
| 418 446 | 
             
                    logger: Logger instance
         | 
| 419 447 | 
             
                    level: Log level as string
         | 
| @@ -426,19 +454,19 @@ def log_with_level(logger: Union[ContextualLogger, logging.Logger], | |
| 426 454 |  | 
| 427 455 | 
             
            # Export main functions and decorators
         | 
| 428 456 | 
             
            __all__ = [
         | 
| 429 | 
            -
                 | 
| 430 | 
            -
                 | 
| 431 | 
            -
                 | 
| 432 | 
            -
                 | 
| 433 | 
            -
                 | 
| 434 | 
            -
                 | 
| 435 | 
            -
                 | 
| 436 | 
            -
                 | 
| 437 | 
            -
                 | 
| 438 | 
            -
                 | 
| 439 | 
            -
                 | 
| 457 | 
            +
                "get_logger",
         | 
| 458 | 
            +
                "configure_logging",
         | 
| 459 | 
            +
                "log_operation",
         | 
| 460 | 
            +
                "log_performance_context",
         | 
| 461 | 
            +
                "log_function_call",
         | 
| 462 | 
            +
                "log_async_function_call",
         | 
| 463 | 
            +
                "log_with_level",
         | 
| 464 | 
            +
                "LogContext",
         | 
| 465 | 
            +
                "ContextualLogger",
         | 
| 466 | 
            +
                "LOGGING_STANDARDS",
         | 
| 467 | 
            +
                "LOG_LEVELS",
         | 
| 440 468 | 
             
                # Re-export from core.logger for backwards compatibility
         | 
| 441 | 
            -
                 | 
| 442 | 
            -
                 | 
| 443 | 
            -
                 | 
| 444 | 
            -
            ]
         | 
| 469 | 
            +
                "log_performance",
         | 
| 470 | 
            +
                "log_async_performance",
         | 
| 471 | 
            +
                "finalize_streaming_logs",
         | 
| 472 | 
            +
            ]
         | 
| @@ -1,8 +1,7 @@ | |
| 1 1 | 
             
            """Minimal framework loader for better performance."""
         | 
| 2 2 |  | 
| 3 3 | 
             
            from pathlib import Path
         | 
| 4 | 
            -
            from typing import  | 
| 5 | 
            -
            import logging
         | 
| 4 | 
            +
            from typing import Any, Dict, Optional
         | 
| 6 5 |  | 
| 7 6 | 
             
            try:
         | 
| 8 7 | 
             
                from ..core.logger import get_logger
         | 
| @@ -12,7 +11,7 @@ except ImportError: | |
| 12 11 |  | 
| 13 12 | 
             
            class MinimalFrameworkLoader:
         | 
| 14 13 | 
             
                """Load a minimal framework for non-interactive mode."""
         | 
| 15 | 
            -
             | 
| 14 | 
            +
             | 
| 16 15 | 
             
                def __init__(
         | 
| 17 16 | 
             
                    self,
         | 
| 18 17 | 
             
                    framework_path: Optional[Path] = None,
         | 
| @@ -22,7 +21,7 @@ class MinimalFrameworkLoader: | |
| 22 21 | 
             
                    self.logger = get_logger("minimal_framework_loader")
         | 
| 23 22 | 
             
                    self.framework_path = framework_path or self._detect_framework_path()
         | 
| 24 23 | 
             
                    self.agents_dir = agents_dir
         | 
| 25 | 
            -
             | 
| 24 | 
            +
             | 
| 26 25 | 
             
                def _detect_framework_path(self) -> Optional[Path]:
         | 
| 27 26 | 
             
                    """Detect the claude-mpm framework path."""
         | 
| 28 27 | 
             
                    # Same detection logic as main loader
         | 
| @@ -31,20 +30,20 @@ class MinimalFrameworkLoader: | |
| 31 30 | 
             
                        Path.cwd().parent / "claude-mpm",
         | 
| 32 31 | 
             
                        Path.home() / "Projects" / "claude-mpm",
         | 
| 33 32 | 
             
                    ]
         | 
| 34 | 
            -
             | 
| 33 | 
            +
             | 
| 35 34 | 
             
                    for candidate in candidates:
         | 
| 36 35 | 
             
                        if candidate.exists() and (candidate / "src").exists():
         | 
| 37 36 | 
             
                            return candidate
         | 
| 38 | 
            -
             | 
| 37 | 
            +
             | 
| 39 38 | 
             
                    return None
         | 
| 40 | 
            -
             | 
| 39 | 
            +
             | 
| 41 40 | 
             
                def get_framework_instructions(self) -> str:
         | 
| 42 41 | 
             
                    """Get minimal framework instructions."""
         | 
| 43 42 | 
             
                    # Load working directory INSTRUCTIONS.md (or legacy CLAUDE.md) if exists
         | 
| 44 43 | 
             
                    working_claude = ""
         | 
| 45 44 | 
             
                    working_instructions_path = Path.cwd() / "INSTRUCTIONS.md"
         | 
| 46 45 | 
             
                    working_claude_path = Path.cwd() / "CLAUDE.md"  # Legacy support
         | 
| 47 | 
            -
             | 
| 46 | 
            +
             | 
| 48 47 | 
             
                    if working_instructions_path.exists():
         | 
| 49 48 | 
             
                        try:
         | 
| 50 49 | 
             
                            working_claude = working_instructions_path.read_text()
         | 
| @@ -55,7 +54,7 @@ class MinimalFrameworkLoader: | |
| 55 54 | 
             
                            working_claude = working_claude_path.read_text()
         | 
| 56 55 | 
             
                        except:
         | 
| 57 56 | 
             
                            pass
         | 
| 58 | 
            -
             | 
| 57 | 
            +
             | 
| 59 58 | 
             
                    # Build minimal framework
         | 
| 60 59 | 
             
                    framework = f"""# Claude MPM Framework
         | 
| 61 60 |  | 
| @@ -92,16 +91,22 @@ When delegating, use this format: | |
| 92 91 | 
             
            Extract from: TODO:, BUG:, FEATURE:, ISSUE:
         | 
| 93 92 |  | 
| 94 93 | 
             
            """
         | 
| 95 | 
            -
             | 
| 94 | 
            +
             | 
| 96 95 | 
             
                    # Add working directory instructions if present
         | 
| 97 96 | 
             
                    if working_claude:
         | 
| 98 97 | 
             
                        framework += f"\n## Working Directory Instructions\n{working_claude}\n"
         | 
| 99 | 
            -
             | 
| 98 | 
            +
             | 
| 100 99 | 
             
                    return framework
         | 
| 101 | 
            -
             | 
| 100 | 
            +
             | 
| 102 101 | 
             
                def get_agent_list(self) -> list:
         | 
| 103 102 | 
             
                    """Get list of available agents."""
         | 
| 104 103 | 
             
                    return [
         | 
| 105 | 
            -
                        "engineer", | 
| 106 | 
            -
                        " | 
| 107 | 
            -
             | 
| 104 | 
            +
                        "engineer",
         | 
| 105 | 
            +
                        "qa",
         | 
| 106 | 
            +
                        "documentation",
         | 
| 107 | 
            +
                        "research",
         | 
| 108 | 
            +
                        "security",
         | 
| 109 | 
            +
                        "version_control",
         | 
| 110 | 
            +
                        "ops",
         | 
| 111 | 
            +
                        "data_engineer",
         | 
| 112 | 
            +
                    ]
         |