claude-mpm 4.1.0__py3-none-any.whl → 4.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. claude_mpm/BUILD_NUMBER +1 -1
  2. claude_mpm/VERSION +1 -1
  3. claude_mpm/__main__.py +1 -1
  4. claude_mpm/agents/BASE_PM.md +74 -46
  5. claude_mpm/agents/INSTRUCTIONS.md +11 -153
  6. claude_mpm/agents/WORKFLOW.md +61 -321
  7. claude_mpm/agents/__init__.py +11 -11
  8. claude_mpm/agents/agent_loader.py +23 -20
  9. claude_mpm/agents/agent_loader_integration.py +1 -1
  10. claude_mpm/agents/agents_metadata.py +27 -0
  11. claude_mpm/agents/async_agent_loader.py +5 -8
  12. claude_mpm/agents/base_agent_loader.py +36 -25
  13. claude_mpm/agents/frontmatter_validator.py +6 -6
  14. claude_mpm/agents/schema/agent_schema.json +1 -1
  15. claude_mpm/agents/system_agent_config.py +9 -9
  16. claude_mpm/agents/templates/api_qa.json +47 -2
  17. claude_mpm/agents/templates/imagemagick.json +256 -0
  18. claude_mpm/agents/templates/qa.json +41 -2
  19. claude_mpm/agents/templates/ticketing.json +5 -5
  20. claude_mpm/agents/templates/web_qa.json +133 -58
  21. claude_mpm/agents/templates/web_ui.json +3 -3
  22. claude_mpm/cli/__init__.py +51 -46
  23. claude_mpm/cli/__main__.py +1 -1
  24. claude_mpm/cli/commands/__init__.py +10 -12
  25. claude_mpm/cli/commands/agent_manager.py +186 -181
  26. claude_mpm/cli/commands/agents.py +271 -268
  27. claude_mpm/cli/commands/aggregate.py +30 -29
  28. claude_mpm/cli/commands/cleanup.py +50 -44
  29. claude_mpm/cli/commands/cleanup_orphaned_agents.py +25 -25
  30. claude_mpm/cli/commands/config.py +162 -127
  31. claude_mpm/cli/commands/doctor.py +52 -62
  32. claude_mpm/cli/commands/info.py +37 -25
  33. claude_mpm/cli/commands/mcp.py +3 -7
  34. claude_mpm/cli/commands/mcp_command_router.py +14 -18
  35. claude_mpm/cli/commands/mcp_install_commands.py +28 -23
  36. claude_mpm/cli/commands/mcp_pipx_config.py +58 -49
  37. claude_mpm/cli/commands/mcp_server_commands.py +23 -17
  38. claude_mpm/cli/commands/memory.py +192 -141
  39. claude_mpm/cli/commands/monitor.py +117 -88
  40. claude_mpm/cli/commands/run.py +120 -84
  41. claude_mpm/cli/commands/run_config_checker.py +4 -5
  42. claude_mpm/cli/commands/socketio_monitor.py +17 -19
  43. claude_mpm/cli/commands/tickets.py +92 -92
  44. claude_mpm/cli/parser.py +1 -5
  45. claude_mpm/cli/parsers/__init__.py +1 -1
  46. claude_mpm/cli/parsers/agent_manager_parser.py +50 -98
  47. claude_mpm/cli/parsers/agents_parser.py +2 -3
  48. claude_mpm/cli/parsers/base_parser.py +7 -5
  49. claude_mpm/cli/parsers/mcp_parser.py +4 -2
  50. claude_mpm/cli/parsers/monitor_parser.py +26 -18
  51. claude_mpm/cli/shared/__init__.py +10 -10
  52. claude_mpm/cli/shared/argument_patterns.py +57 -71
  53. claude_mpm/cli/shared/base_command.py +61 -53
  54. claude_mpm/cli/shared/error_handling.py +62 -58
  55. claude_mpm/cli/shared/output_formatters.py +78 -77
  56. claude_mpm/cli/startup_logging.py +204 -172
  57. claude_mpm/cli/utils.py +10 -11
  58. claude_mpm/cli_module/__init__.py +1 -1
  59. claude_mpm/cli_module/args.py +1 -1
  60. claude_mpm/cli_module/migration_example.py +5 -5
  61. claude_mpm/config/__init__.py +9 -9
  62. claude_mpm/config/agent_config.py +15 -14
  63. claude_mpm/config/experimental_features.py +4 -4
  64. claude_mpm/config/paths.py +0 -1
  65. claude_mpm/config/socketio_config.py +5 -6
  66. claude_mpm/constants.py +1 -2
  67. claude_mpm/core/__init__.py +8 -8
  68. claude_mpm/core/agent_name_normalizer.py +1 -1
  69. claude_mpm/core/agent_registry.py +20 -23
  70. claude_mpm/core/agent_session_manager.py +3 -3
  71. claude_mpm/core/base_service.py +7 -15
  72. claude_mpm/core/cache.py +4 -6
  73. claude_mpm/core/claude_runner.py +85 -113
  74. claude_mpm/core/config.py +43 -28
  75. claude_mpm/core/config_aliases.py +0 -9
  76. claude_mpm/core/config_constants.py +52 -30
  77. claude_mpm/core/constants.py +0 -1
  78. claude_mpm/core/container.py +18 -27
  79. claude_mpm/core/exceptions.py +2 -2
  80. claude_mpm/core/factories.py +10 -12
  81. claude_mpm/core/framework_loader.py +581 -280
  82. claude_mpm/core/hook_manager.py +26 -22
  83. claude_mpm/core/hook_performance_config.py +58 -47
  84. claude_mpm/core/injectable_service.py +1 -1
  85. claude_mpm/core/interactive_session.py +61 -152
  86. claude_mpm/core/interfaces.py +1 -100
  87. claude_mpm/core/lazy.py +5 -5
  88. claude_mpm/core/log_manager.py +587 -0
  89. claude_mpm/core/logger.py +125 -8
  90. claude_mpm/core/logging_config.py +15 -15
  91. claude_mpm/core/minimal_framework_loader.py +5 -8
  92. claude_mpm/core/oneshot_session.py +15 -33
  93. claude_mpm/core/optimized_agent_loader.py +4 -6
  94. claude_mpm/core/optimized_startup.py +2 -1
  95. claude_mpm/core/output_style_manager.py +147 -106
  96. claude_mpm/core/pm_hook_interceptor.py +0 -1
  97. claude_mpm/core/service_registry.py +11 -8
  98. claude_mpm/core/session_manager.py +1 -2
  99. claude_mpm/core/shared/__init__.py +1 -1
  100. claude_mpm/core/shared/config_loader.py +101 -97
  101. claude_mpm/core/shared/path_resolver.py +72 -68
  102. claude_mpm/core/shared/singleton_manager.py +56 -50
  103. claude_mpm/core/socketio_pool.py +26 -6
  104. claude_mpm/core/tool_access_control.py +4 -5
  105. claude_mpm/core/typing_utils.py +50 -59
  106. claude_mpm/core/unified_agent_registry.py +14 -19
  107. claude_mpm/core/unified_config.py +4 -6
  108. claude_mpm/core/unified_paths.py +197 -109
  109. claude_mpm/dashboard/open_dashboard.py +2 -4
  110. claude_mpm/experimental/cli_enhancements.py +51 -36
  111. claude_mpm/generators/agent_profile_generator.py +2 -4
  112. claude_mpm/hooks/base_hook.py +1 -2
  113. claude_mpm/hooks/claude_hooks/connection_pool.py +72 -26
  114. claude_mpm/hooks/claude_hooks/event_handlers.py +93 -38
  115. claude_mpm/hooks/claude_hooks/hook_handler.py +130 -76
  116. claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +104 -77
  117. claude_mpm/hooks/claude_hooks/memory_integration.py +2 -4
  118. claude_mpm/hooks/claude_hooks/response_tracking.py +15 -11
  119. claude_mpm/hooks/claude_hooks/tool_analysis.py +12 -18
  120. claude_mpm/hooks/memory_integration_hook.py +5 -5
  121. claude_mpm/hooks/tool_call_interceptor.py +1 -1
  122. claude_mpm/hooks/validation_hooks.py +4 -4
  123. claude_mpm/init.py +4 -9
  124. claude_mpm/models/__init__.py +2 -2
  125. claude_mpm/models/agent_session.py +11 -14
  126. claude_mpm/scripts/mcp_server.py +20 -11
  127. claude_mpm/scripts/mcp_wrapper.py +5 -5
  128. claude_mpm/scripts/mpm_doctor.py +321 -0
  129. claude_mpm/scripts/socketio_daemon.py +28 -25
  130. claude_mpm/scripts/socketio_daemon_hardened.py +298 -258
  131. claude_mpm/scripts/socketio_server_manager.py +116 -95
  132. claude_mpm/services/__init__.py +49 -49
  133. claude_mpm/services/agent_capabilities_service.py +12 -18
  134. claude_mpm/services/agents/__init__.py +22 -22
  135. claude_mpm/services/agents/agent_builder.py +140 -119
  136. claude_mpm/services/agents/deployment/__init__.py +3 -3
  137. claude_mpm/services/agents/deployment/agent_config_provider.py +9 -9
  138. claude_mpm/services/agents/deployment/agent_configuration_manager.py +19 -20
  139. claude_mpm/services/agents/deployment/agent_definition_factory.py +1 -5
  140. claude_mpm/services/agents/deployment/agent_deployment.py +136 -106
  141. claude_mpm/services/agents/deployment/agent_discovery_service.py +4 -8
  142. claude_mpm/services/agents/deployment/agent_environment_manager.py +2 -7
  143. claude_mpm/services/agents/deployment/agent_filesystem_manager.py +6 -10
  144. claude_mpm/services/agents/deployment/agent_format_converter.py +11 -15
  145. claude_mpm/services/agents/deployment/agent_frontmatter_validator.py +2 -3
  146. claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +5 -5
  147. claude_mpm/services/agents/deployment/agent_metrics_collector.py +13 -19
  148. claude_mpm/services/agents/deployment/agent_restore_handler.py +0 -1
  149. claude_mpm/services/agents/deployment/agent_template_builder.py +26 -35
  150. claude_mpm/services/agents/deployment/agent_validator.py +0 -1
  151. claude_mpm/services/agents/deployment/agent_version_manager.py +7 -9
  152. claude_mpm/services/agents/deployment/agent_versioning.py +3 -3
  153. claude_mpm/services/agents/deployment/agents_directory_resolver.py +6 -7
  154. claude_mpm/services/agents/deployment/async_agent_deployment.py +51 -38
  155. claude_mpm/services/agents/deployment/config/__init__.py +1 -1
  156. claude_mpm/services/agents/deployment/config/deployment_config.py +7 -8
  157. claude_mpm/services/agents/deployment/deployment_type_detector.py +1 -1
  158. claude_mpm/services/agents/deployment/deployment_wrapper.py +18 -18
  159. claude_mpm/services/agents/deployment/facade/__init__.py +1 -1
  160. claude_mpm/services/agents/deployment/facade/deployment_executor.py +0 -3
  161. claude_mpm/services/agents/deployment/facade/deployment_facade.py +3 -4
  162. claude_mpm/services/agents/deployment/interface_adapter.py +5 -7
  163. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +345 -276
  164. claude_mpm/services/agents/deployment/pipeline/__init__.py +2 -2
  165. claude_mpm/services/agents/deployment/pipeline/pipeline_builder.py +1 -1
  166. claude_mpm/services/agents/deployment/pipeline/pipeline_context.py +6 -4
  167. claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +3 -3
  168. claude_mpm/services/agents/deployment/pipeline/steps/__init__.py +2 -2
  169. claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +14 -13
  170. claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +0 -1
  171. claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +1 -1
  172. claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +8 -9
  173. claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +1 -1
  174. claude_mpm/services/agents/deployment/processors/__init__.py +1 -1
  175. claude_mpm/services/agents/deployment/processors/agent_processor.py +20 -16
  176. claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +5 -12
  177. claude_mpm/services/agents/deployment/results/__init__.py +1 -1
  178. claude_mpm/services/agents/deployment/results/deployment_result_builder.py +1 -1
  179. claude_mpm/services/agents/deployment/strategies/__init__.py +2 -2
  180. claude_mpm/services/agents/deployment/strategies/base_strategy.py +1 -7
  181. claude_mpm/services/agents/deployment/strategies/project_strategy.py +1 -4
  182. claude_mpm/services/agents/deployment/strategies/system_strategy.py +2 -3
  183. claude_mpm/services/agents/deployment/strategies/user_strategy.py +3 -7
  184. claude_mpm/services/agents/deployment/validation/__init__.py +1 -1
  185. claude_mpm/services/agents/deployment/validation/agent_validator.py +1 -1
  186. claude_mpm/services/agents/deployment/validation/template_validator.py +2 -2
  187. claude_mpm/services/agents/deployment/validation/validation_result.py +2 -6
  188. claude_mpm/services/agents/loading/__init__.py +1 -1
  189. claude_mpm/services/agents/loading/agent_profile_loader.py +6 -12
  190. claude_mpm/services/agents/loading/base_agent_manager.py +5 -5
  191. claude_mpm/services/agents/loading/framework_agent_loader.py +2 -4
  192. claude_mpm/services/agents/management/__init__.py +1 -1
  193. claude_mpm/services/agents/management/agent_capabilities_generator.py +1 -3
  194. claude_mpm/services/agents/management/agent_management_service.py +5 -9
  195. claude_mpm/services/agents/memory/__init__.py +4 -4
  196. claude_mpm/services/agents/memory/agent_memory_manager.py +280 -160
  197. claude_mpm/services/agents/memory/agent_persistence_service.py +0 -2
  198. claude_mpm/services/agents/memory/content_manager.py +44 -38
  199. claude_mpm/services/agents/memory/template_generator.py +4 -6
  200. claude_mpm/services/agents/registry/__init__.py +10 -6
  201. claude_mpm/services/agents/registry/deployed_agent_discovery.py +30 -27
  202. claude_mpm/services/agents/registry/modification_tracker.py +3 -6
  203. claude_mpm/services/async_session_logger.py +1 -2
  204. claude_mpm/services/claude_session_logger.py +1 -2
  205. claude_mpm/services/command_deployment_service.py +173 -0
  206. claude_mpm/services/command_handler_service.py +20 -22
  207. claude_mpm/services/core/__init__.py +25 -25
  208. claude_mpm/services/core/base.py +0 -5
  209. claude_mpm/services/core/interfaces/__init__.py +32 -32
  210. claude_mpm/services/core/interfaces/agent.py +0 -21
  211. claude_mpm/services/core/interfaces/communication.py +0 -27
  212. claude_mpm/services/core/interfaces/infrastructure.py +0 -56
  213. claude_mpm/services/core/interfaces/service.py +0 -29
  214. claude_mpm/services/diagnostics/__init__.py +1 -1
  215. claude_mpm/services/diagnostics/checks/__init__.py +6 -6
  216. claude_mpm/services/diagnostics/checks/agent_check.py +89 -80
  217. claude_mpm/services/diagnostics/checks/base_check.py +12 -16
  218. claude_mpm/services/diagnostics/checks/claude_desktop_check.py +84 -81
  219. claude_mpm/services/diagnostics/checks/common_issues_check.py +99 -91
  220. claude_mpm/services/diagnostics/checks/configuration_check.py +82 -77
  221. claude_mpm/services/diagnostics/checks/filesystem_check.py +67 -68
  222. claude_mpm/services/diagnostics/checks/installation_check.py +254 -94
  223. claude_mpm/services/diagnostics/checks/mcp_check.py +90 -88
  224. claude_mpm/services/diagnostics/checks/monitor_check.py +75 -76
  225. claude_mpm/services/diagnostics/checks/startup_log_check.py +67 -73
  226. claude_mpm/services/diagnostics/diagnostic_runner.py +67 -59
  227. claude_mpm/services/diagnostics/doctor_reporter.py +107 -70
  228. claude_mpm/services/diagnostics/models.py +21 -19
  229. claude_mpm/services/event_aggregator.py +10 -17
  230. claude_mpm/services/event_bus/__init__.py +1 -1
  231. claude_mpm/services/event_bus/config.py +54 -35
  232. claude_mpm/services/event_bus/event_bus.py +76 -71
  233. claude_mpm/services/event_bus/relay.py +74 -64
  234. claude_mpm/services/events/__init__.py +11 -11
  235. claude_mpm/services/events/consumers/__init__.py +3 -3
  236. claude_mpm/services/events/consumers/dead_letter.py +71 -63
  237. claude_mpm/services/events/consumers/logging.py +39 -37
  238. claude_mpm/services/events/consumers/metrics.py +56 -57
  239. claude_mpm/services/events/consumers/socketio.py +82 -81
  240. claude_mpm/services/events/core.py +110 -99
  241. claude_mpm/services/events/interfaces.py +56 -72
  242. claude_mpm/services/events/producers/__init__.py +1 -1
  243. claude_mpm/services/events/producers/hook.py +38 -38
  244. claude_mpm/services/events/producers/system.py +46 -44
  245. claude_mpm/services/exceptions.py +81 -80
  246. claude_mpm/services/framework_claude_md_generator/__init__.py +2 -4
  247. claude_mpm/services/framework_claude_md_generator/content_assembler.py +3 -5
  248. claude_mpm/services/framework_claude_md_generator/content_validator.py +1 -1
  249. claude_mpm/services/framework_claude_md_generator/deployment_manager.py +4 -4
  250. claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +0 -1
  251. claude_mpm/services/framework_claude_md_generator/section_generators/agents.py +0 -2
  252. claude_mpm/services/framework_claude_md_generator/version_manager.py +4 -5
  253. claude_mpm/services/hook_service.py +6 -9
  254. claude_mpm/services/infrastructure/__init__.py +1 -1
  255. claude_mpm/services/infrastructure/context_preservation.py +8 -12
  256. claude_mpm/services/infrastructure/monitoring.py +21 -23
  257. claude_mpm/services/mcp_gateway/__init__.py +37 -37
  258. claude_mpm/services/mcp_gateway/auto_configure.py +95 -103
  259. claude_mpm/services/mcp_gateway/config/__init__.py +1 -1
  260. claude_mpm/services/mcp_gateway/config/config_loader.py +23 -25
  261. claude_mpm/services/mcp_gateway/config/config_schema.py +5 -5
  262. claude_mpm/services/mcp_gateway/config/configuration.py +9 -6
  263. claude_mpm/services/mcp_gateway/core/__init__.py +10 -10
  264. claude_mpm/services/mcp_gateway/core/base.py +0 -3
  265. claude_mpm/services/mcp_gateway/core/interfaces.py +1 -38
  266. claude_mpm/services/mcp_gateway/core/process_pool.py +99 -93
  267. claude_mpm/services/mcp_gateway/core/singleton_manager.py +65 -62
  268. claude_mpm/services/mcp_gateway/core/startup_verification.py +75 -74
  269. claude_mpm/services/mcp_gateway/main.py +2 -1
  270. claude_mpm/services/mcp_gateway/registry/service_registry.py +5 -8
  271. claude_mpm/services/mcp_gateway/registry/tool_registry.py +1 -1
  272. claude_mpm/services/mcp_gateway/server/__init__.py +1 -1
  273. claude_mpm/services/mcp_gateway/server/mcp_gateway.py +12 -19
  274. claude_mpm/services/mcp_gateway/server/stdio_handler.py +4 -3
  275. claude_mpm/services/mcp_gateway/server/stdio_server.py +79 -71
  276. claude_mpm/services/mcp_gateway/tools/__init__.py +2 -2
  277. claude_mpm/services/mcp_gateway/tools/base_adapter.py +5 -6
  278. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +13 -22
  279. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +79 -78
  280. claude_mpm/services/mcp_gateway/tools/hello_world.py +12 -14
  281. claude_mpm/services/mcp_gateway/tools/ticket_tools.py +42 -49
  282. claude_mpm/services/mcp_gateway/tools/unified_ticket_tool.py +51 -55
  283. claude_mpm/services/memory/__init__.py +3 -3
  284. claude_mpm/services/memory/builder.py +3 -6
  285. claude_mpm/services/memory/cache/__init__.py +1 -1
  286. claude_mpm/services/memory/cache/shared_prompt_cache.py +3 -5
  287. claude_mpm/services/memory/cache/simple_cache.py +1 -1
  288. claude_mpm/services/memory/indexed_memory.py +5 -7
  289. claude_mpm/services/memory/optimizer.py +7 -10
  290. claude_mpm/services/memory/router.py +8 -9
  291. claude_mpm/services/memory_hook_service.py +48 -34
  292. claude_mpm/services/monitor_build_service.py +77 -73
  293. claude_mpm/services/port_manager.py +130 -108
  294. claude_mpm/services/project/analyzer.py +12 -10
  295. claude_mpm/services/project/registry.py +11 -11
  296. claude_mpm/services/recovery_manager.py +10 -19
  297. claude_mpm/services/response_tracker.py +0 -1
  298. claude_mpm/services/runner_configuration_service.py +19 -20
  299. claude_mpm/services/session_management_service.py +7 -11
  300. claude_mpm/services/shared/__init__.py +1 -1
  301. claude_mpm/services/shared/async_service_base.py +58 -50
  302. claude_mpm/services/shared/config_service_base.py +73 -67
  303. claude_mpm/services/shared/lifecycle_service_base.py +82 -78
  304. claude_mpm/services/shared/manager_base.py +94 -82
  305. claude_mpm/services/shared/service_factory.py +96 -98
  306. claude_mpm/services/socketio/__init__.py +3 -3
  307. claude_mpm/services/socketio/client_proxy.py +5 -5
  308. claude_mpm/services/socketio/event_normalizer.py +199 -181
  309. claude_mpm/services/socketio/handlers/__init__.py +3 -3
  310. claude_mpm/services/socketio/handlers/base.py +5 -4
  311. claude_mpm/services/socketio/handlers/connection.py +163 -136
  312. claude_mpm/services/socketio/handlers/file.py +13 -14
  313. claude_mpm/services/socketio/handlers/git.py +12 -7
  314. claude_mpm/services/socketio/handlers/hook.py +49 -44
  315. claude_mpm/services/socketio/handlers/memory.py +0 -1
  316. claude_mpm/services/socketio/handlers/project.py +0 -1
  317. claude_mpm/services/socketio/handlers/registry.py +37 -19
  318. claude_mpm/services/socketio/migration_utils.py +98 -84
  319. claude_mpm/services/socketio/server/__init__.py +1 -1
  320. claude_mpm/services/socketio/server/broadcaster.py +81 -87
  321. claude_mpm/services/socketio/server/core.py +65 -54
  322. claude_mpm/services/socketio/server/eventbus_integration.py +95 -56
  323. claude_mpm/services/socketio/server/main.py +64 -38
  324. claude_mpm/services/socketio_client_manager.py +10 -12
  325. claude_mpm/services/subprocess_launcher_service.py +4 -7
  326. claude_mpm/services/system_instructions_service.py +13 -14
  327. claude_mpm/services/ticket_manager.py +2 -2
  328. claude_mpm/services/utility_service.py +5 -13
  329. claude_mpm/services/version_control/__init__.py +16 -16
  330. claude_mpm/services/version_control/branch_strategy.py +5 -8
  331. claude_mpm/services/version_control/conflict_resolution.py +9 -23
  332. claude_mpm/services/version_control/git_operations.py +5 -7
  333. claude_mpm/services/version_control/semantic_versioning.py +16 -17
  334. claude_mpm/services/version_control/version_parser.py +13 -18
  335. claude_mpm/services/version_service.py +10 -11
  336. claude_mpm/storage/__init__.py +1 -1
  337. claude_mpm/storage/state_storage.py +22 -28
  338. claude_mpm/utils/__init__.py +6 -6
  339. claude_mpm/utils/agent_dependency_loader.py +47 -33
  340. claude_mpm/utils/config_manager.py +11 -14
  341. claude_mpm/utils/dependency_cache.py +1 -1
  342. claude_mpm/utils/dependency_manager.py +13 -17
  343. claude_mpm/utils/dependency_strategies.py +8 -10
  344. claude_mpm/utils/environment_context.py +3 -9
  345. claude_mpm/utils/error_handler.py +3 -13
  346. claude_mpm/utils/file_utils.py +1 -1
  347. claude_mpm/utils/path_operations.py +8 -12
  348. claude_mpm/utils/robust_installer.py +110 -33
  349. claude_mpm/utils/subprocess_utils.py +5 -6
  350. claude_mpm/validation/agent_validator.py +3 -6
  351. claude_mpm/validation/frontmatter_validator.py +1 -1
  352. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/METADATA +1 -1
  353. claude_mpm-4.1.2.dist-info/RECORD +498 -0
  354. claude_mpm-4.1.0.dist-info/RECORD +0 -494
  355. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/WHEEL +0 -0
  356. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/entry_points.txt +0 -0
  357. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/licenses/LICENSE +0 -0
  358. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/top_level.txt +0 -0
@@ -14,7 +14,7 @@ DESIGN DECISIONS:
14
14
 
15
15
  import json
16
16
  from pathlib import Path
17
- from typing import Dict, Any
17
+ from typing import Any, Dict
18
18
 
19
19
  import yaml
20
20
  from rich.panel import Panel
@@ -23,7 +23,10 @@ from rich.table import Table
23
23
 
24
24
  from ...core.config import Config
25
25
  from ...utils.console import console
26
- from ..shared import BaseCommand, CommandResult, add_config_arguments, add_output_arguments
26
+ from ..shared import (
27
+ BaseCommand,
28
+ CommandResult,
29
+ )
27
30
 
28
31
 
29
32
  class ConfigCommand(BaseCommand):
@@ -34,7 +37,7 @@ class ConfigCommand(BaseCommand):
34
37
 
35
38
  def validate_args(self, args) -> str:
36
39
  """Validate command arguments."""
37
- if not hasattr(args, 'config_command') or not args.config_command:
40
+ if not hasattr(args, "config_command") or not args.config_command:
38
41
  return "No config command specified"
39
42
 
40
43
  valid_commands = ["validate", "view", "status"]
@@ -47,31 +50,35 @@ class ConfigCommand(BaseCommand):
47
50
  """Execute the configuration command."""
48
51
  if args.config_command == "validate":
49
52
  return self._validate_config(args)
50
- elif args.config_command == "view":
53
+ if args.config_command == "view":
51
54
  return self._view_config(args)
52
- elif args.config_command == "status":
55
+ if args.config_command == "status":
53
56
  return self._show_config_status(args)
54
- else:
55
- return CommandResult.error_result(f"Unknown config command: {args.config_command}")
57
+ return CommandResult.error_result(
58
+ f"Unknown config command: {args.config_command}"
59
+ )
56
60
 
57
61
  def _validate_config(self, args) -> CommandResult:
58
62
  """Validate configuration file."""
59
- config_file = getattr(args, 'config_file', None) or Path(".claude-mpm/configuration.yaml")
63
+ config_file = getattr(args, "config_file", None) or Path(
64
+ ".claude-mpm/configuration.yaml"
65
+ )
60
66
 
61
67
  # Check if file exists
62
68
  if not config_file.exists():
63
69
  error_msg = f"Configuration file not found: {config_file}"
64
- suggestion = f"Create with: mkdir -p {config_file.parent} && touch {config_file}"
70
+ suggestion = (
71
+ f"Create with: mkdir -p {config_file.parent} && touch {config_file}"
72
+ )
65
73
 
66
- if getattr(args, 'format', 'text') in ['json', 'yaml']:
74
+ if getattr(args, "format", "text") in ["json", "yaml"]:
67
75
  return CommandResult.error_result(
68
76
  error_msg,
69
- data={"suggestion": suggestion, "config_file": str(config_file)}
77
+ data={"suggestion": suggestion, "config_file": str(config_file)},
70
78
  )
71
- else:
72
- console.print(f"[red] {error_msg}[/red]")
73
- console.print(f"[yellow]→ {suggestion}[/yellow]")
74
- return CommandResult.error_result(error_msg)
79
+ console.print(f"[red]✗ {error_msg}[/red]")
80
+ console.print(f"[yellow] {suggestion}[/yellow]")
81
+ return CommandResult.error_result(error_msg)
75
82
 
76
83
  try:
77
84
  # Load and validate configuration
@@ -90,74 +97,89 @@ class ConfigCommand(BaseCommand):
90
97
  "errors": errors,
91
98
  "warnings": warnings,
92
99
  "error_count": len(errors),
93
- "warning_count": len(warnings)
100
+ "warning_count": len(warnings),
94
101
  }
95
102
 
96
103
  # Handle output format
97
- output_format = getattr(args, 'format', 'text')
98
- if output_format in ['json', 'yaml']:
104
+ output_format = getattr(args, "format", "text")
105
+ if output_format in ["json", "yaml"]:
99
106
  if is_valid and not warnings:
100
- return CommandResult.success_result("Configuration is valid", data=result_data)
101
- elif is_valid and warnings:
107
+ return CommandResult.success_result(
108
+ "Configuration is valid", data=result_data
109
+ )
110
+ if is_valid and warnings:
102
111
  message = f"Configuration is valid with {len(warnings)} warning(s)"
103
- exit_code = 2 if getattr(args, 'strict', False) else 0
104
- return CommandResult(success=True, exit_code=exit_code, message=message, data=result_data)
105
- else:
106
- return CommandResult.error_result(
107
- f"Configuration validation failed with {len(errors)} error(s)",
108
- data=result_data
112
+ exit_code = 2 if getattr(args, "strict", False) else 0
113
+ return CommandResult(
114
+ success=True,
115
+ exit_code=exit_code,
116
+ message=message,
117
+ data=result_data,
109
118
  )
110
- else:
111
- # Rich console output for text format
112
- console.print(f"\n[bold blue]Validating configuration: {config_file}[/bold blue]\n")
113
-
114
- if errors:
115
- console.print("[bold red]ERRORS:[/bold red]")
116
- for error in errors:
117
- console.print(f" [red]✗ {error}[/red]")
118
-
119
- if warnings:
120
- console.print("\n[bold yellow]WARNINGS:[/bold yellow]")
121
- for warning in warnings:
122
- console.print(f" [yellow] {warning}[/yellow]")
123
-
124
- # Show summary
125
- if is_valid and not warnings:
126
- console.print("\n[green]✓ Configuration is valid[/green]")
127
- return CommandResult.success_result("Configuration is valid")
128
- elif is_valid and warnings:
129
- console.print(f"\n[green]✓ Configuration is valid with {len(warnings)} warning(s)[/green]")
130
- exit_code = 2 if getattr(args, 'strict', False) else 0
131
- return CommandResult(success=True, exit_code=exit_code, message="Configuration valid with warnings")
132
- else:
133
- console.print(f"\n[red]✗ Configuration validation failed with {len(errors)} error(s)[/red]")
134
- console.print("\n[yellow]Run 'python scripts/validate_configuration.py' for detailed analysis[/yellow]")
135
- return CommandResult.error_result("Configuration validation failed")
119
+ return CommandResult.error_result(
120
+ f"Configuration validation failed with {len(errors)} error(s)",
121
+ data=result_data,
122
+ )
123
+ # Rich console output for text format
124
+ console.print(
125
+ f"\n[bold blue]Validating configuration: {config_file}[/bold blue]\n"
126
+ )
127
+
128
+ if errors:
129
+ console.print("[bold red]ERRORS:[/bold red]")
130
+ for error in errors:
131
+ console.print(f" [red] {error}[/red]")
132
+
133
+ if warnings:
134
+ console.print("\n[bold yellow]WARNINGS:[/bold yellow]")
135
+ for warning in warnings:
136
+ console.print(f" [yellow]⚠ {warning}[/yellow]")
137
+
138
+ # Show summary
139
+ if is_valid and not warnings:
140
+ console.print("\n[green]✓ Configuration is valid[/green]")
141
+ return CommandResult.success_result("Configuration is valid")
142
+ if is_valid and warnings:
143
+ console.print(
144
+ f"\n[green]✓ Configuration is valid with {len(warnings)} warning(s)[/green]"
145
+ )
146
+ exit_code = 2 if getattr(args, "strict", False) else 0
147
+ return CommandResult(
148
+ success=True,
149
+ exit_code=exit_code,
150
+ message="Configuration valid with warnings",
151
+ )
152
+ console.print(
153
+ f"\n[red]✗ Configuration validation failed with {len(errors)} error(s)[/red]"
154
+ )
155
+ console.print(
156
+ "\n[yellow]Run 'python scripts/validate_configuration.py' for detailed analysis[/yellow]"
157
+ )
158
+ return CommandResult.error_result("Configuration validation failed")
136
159
 
137
160
  except Exception as e:
138
161
  self.logger.error(f"Configuration validation error: {e}", exc_info=True)
139
162
 
140
- if getattr(args, 'format', 'text') in ['json', 'yaml']:
163
+ if getattr(args, "format", "text") in ["json", "yaml"]:
141
164
  return CommandResult.error_result(
142
165
  f"Failed to validate configuration: {e}",
143
- data={"config_file": str(config_file), "exception": str(e)}
166
+ data={"config_file": str(config_file), "exception": str(e)},
144
167
  )
145
- else:
146
- console.print(f"[red]Failed to validate configuration: {e}[/red]")
147
- return CommandResult.error_result(f"Failed to validate configuration: {e}")
168
+ console.print(f"[red]Failed to validate configuration: {e}[/red]")
169
+ return CommandResult.error_result(f"Failed to validate configuration: {e}")
148
170
 
149
171
  def _view_config(self, args) -> CommandResult:
150
172
  """View current configuration."""
151
173
  try:
152
174
  # Load configuration
153
- config_file = getattr(args, 'config_file', None)
175
+ config_file = getattr(args, "config_file", None)
154
176
  config = Config(config_file=config_file)
155
177
 
156
178
  # Get configuration as dictionary
157
179
  config_dict = config.to_dict()
158
180
 
159
181
  # Filter by section if specified
160
- section = getattr(args, 'section', None)
182
+ section = getattr(args, "section", None)
161
183
  if section:
162
184
  if section in config_dict:
163
185
  config_dict = {section: config_dict[section]}
@@ -165,131 +187,144 @@ class ConfigCommand(BaseCommand):
165
187
  error_msg = f"Section '{section}' not found in configuration"
166
188
  available_sections = list(config_dict.keys())
167
189
 
168
- if getattr(args, 'format', 'text') in ['json', 'yaml']:
190
+ if getattr(args, "format", "text") in ["json", "yaml"]:
169
191
  return CommandResult.error_result(
170
- error_msg,
171
- data={"available_sections": available_sections}
192
+ error_msg, data={"available_sections": available_sections}
172
193
  )
173
- else:
174
- console.print(f"[red]{error_msg}[/red]")
175
- console.print(f"[yellow]Available sections: {', '.join(available_sections)}[/yellow]")
176
- return CommandResult.error_result(error_msg)
194
+ console.print(f"[red]{error_msg}[/red]")
195
+ console.print(
196
+ f"[yellow]Available sections: {', '.join(available_sections)}[/yellow]"
197
+ )
198
+ return CommandResult.error_result(error_msg)
177
199
 
178
200
  # Handle output format
179
- output_format = getattr(args, 'format', 'text')
201
+ output_format = getattr(args, "format", "text")
180
202
 
181
203
  if output_format == "json":
182
- if hasattr(args, 'output') and args.output:
183
- # Use shared output handling
184
- return CommandResult.success_result("Configuration retrieved", data=config_dict)
185
- else:
186
- # Direct console output with syntax highlighting
187
- output = json.dumps(config_dict, indent=2)
188
- syntax = Syntax(output, "json", theme="monokai", line_numbers=False)
189
- console.print(syntax)
190
- return CommandResult.success_result("Configuration displayed", data=config_dict)
191
-
192
- elif output_format == "yaml":
193
- if hasattr(args, 'output') and args.output:
204
+ if hasattr(args, "output") and args.output:
194
205
  # Use shared output handling
195
- return CommandResult.success_result("Configuration retrieved", data=config_dict)
196
- else:
197
- # Direct console output with syntax highlighting
198
- output = yaml.dump(config_dict, default_flow_style=False, sort_keys=False)
199
- syntax = Syntax(output, "yaml", theme="monokai", line_numbers=False)
200
- console.print(syntax)
201
- return CommandResult.success_result("Configuration displayed")
206
+ return CommandResult.success_result(
207
+ "Configuration retrieved", data=config_dict
208
+ )
209
+ # Direct console output with syntax highlighting
210
+ output = json.dumps(config_dict, indent=2)
211
+ syntax = Syntax(output, "json", theme="monokai", line_numbers=False)
212
+ console.print(syntax)
213
+ return CommandResult.success_result(
214
+ "Configuration displayed", data=config_dict
215
+ )
202
216
 
203
- elif output_format == "table":
204
- self._display_config_table(config_dict)
217
+ if output_format == "yaml":
218
+ if hasattr(args, "output") and args.output:
219
+ # Use shared output handling
220
+ return CommandResult.success_result(
221
+ "Configuration retrieved", data=config_dict
222
+ )
223
+ # Direct console output with syntax highlighting
224
+ output = yaml.dump(
225
+ config_dict, default_flow_style=False, sort_keys=False
226
+ )
227
+ syntax = Syntax(output, "yaml", theme="monokai", line_numbers=False)
228
+ console.print(syntax)
205
229
  return CommandResult.success_result("Configuration displayed")
206
230
 
207
- else: # text format
231
+ if output_format == "table":
208
232
  self._display_config_table(config_dict)
209
233
  return CommandResult.success_result("Configuration displayed")
210
234
 
235
+ # text format
236
+ self._display_config_table(config_dict)
237
+ return CommandResult.success_result("Configuration displayed")
238
+
211
239
  except Exception as e:
212
240
  self.logger.error(f"Configuration view error: {e}", exc_info=True)
213
241
 
214
- if getattr(args, 'format', 'text') in ['json', 'yaml']:
242
+ if getattr(args, "format", "text") in ["json", "yaml"]:
215
243
  return CommandResult.error_result(
216
- f"Failed to view configuration: {e}",
217
- data={"exception": str(e)}
244
+ f"Failed to view configuration: {e}", data={"exception": str(e)}
218
245
  )
219
- else:
220
- console.print(f"[red]Failed to view configuration: {e}[/red]")
221
- return CommandResult.error_result(f"Failed to view configuration: {e}")
246
+ console.print(f"[red]Failed to view configuration: {e}[/red]")
247
+ return CommandResult.error_result(f"Failed to view configuration: {e}")
222
248
 
223
249
  def _show_config_status(self, args) -> CommandResult:
224
250
  """Show configuration status and health."""
225
251
  try:
226
252
  # Load configuration
227
- config_file = getattr(args, 'config_file', None)
253
+ config_file = getattr(args, "config_file", None)
228
254
  config = Config(config_file=config_file)
229
255
 
230
256
  # Get status
231
257
  status = config.get_configuration_status()
232
258
 
233
259
  # Handle output format
234
- output_format = getattr(args, 'format', 'text')
260
+ output_format = getattr(args, "format", "text")
235
261
 
236
- if output_format in ['json', 'yaml']:
262
+ if output_format in ["json", "yaml"]:
237
263
  # Structured output
238
264
  result_data = status.copy()
239
265
 
240
266
  # Add response logging details if requested
241
- if getattr(args, 'check_response_logging', False):
242
- result_data['response_logging_config'] = config.get("response_logging", {})
267
+ if getattr(args, "check_response_logging", False):
268
+ result_data["response_logging_config"] = config.get(
269
+ "response_logging", {}
270
+ )
243
271
 
244
272
  if status["valid"]:
245
- return CommandResult.success_result("Configuration status retrieved", data=result_data)
246
- else:
247
- return CommandResult.error_result("Configuration has issues", data=result_data)
273
+ return CommandResult.success_result(
274
+ "Configuration status retrieved", data=result_data
275
+ )
276
+ return CommandResult.error_result(
277
+ "Configuration has issues", data=result_data
278
+ )
248
279
 
249
- else:
250
- # Rich console output for text format
251
- self._display_status_panel(status)
280
+ # Rich console output for text format
281
+ self._display_status_panel(status)
252
282
 
253
- # Show detailed errors/warnings if verbose
254
- if getattr(args, 'verbose', False):
255
- self._display_detailed_status(status)
283
+ # Show detailed errors/warnings if verbose
284
+ if getattr(args, "verbose", False):
285
+ self._display_detailed_status(status)
256
286
 
257
- # Check response logging specifically
258
- if getattr(args, 'check_response_logging', False):
259
- self._display_response_logging_config(config)
287
+ # Check response logging specifically
288
+ if getattr(args, "check_response_logging", False):
289
+ self._display_response_logging_config(config)
260
290
 
261
- return CommandResult.success_result("Configuration status displayed") if status["valid"] else CommandResult.error_result("Configuration has issues")
291
+ return (
292
+ CommandResult.success_result("Configuration status displayed")
293
+ if status["valid"]
294
+ else CommandResult.error_result("Configuration has issues")
295
+ )
262
296
 
263
297
  except Exception as e:
264
298
  self.logger.error(f"Configuration status error: {e}", exc_info=True)
265
299
 
266
- if getattr(args, 'format', 'text') in ['json', 'yaml']:
300
+ if getattr(args, "format", "text") in ["json", "yaml"]:
267
301
  return CommandResult.error_result(
268
302
  f"Failed to get configuration status: {e}",
269
- data={"exception": str(e)}
303
+ data={"exception": str(e)},
270
304
  )
271
- else:
272
- console.print(f"[red]Failed to get configuration status: {e}[/red]")
273
- return CommandResult.error_result(f"Failed to get configuration status: {e}")
305
+ console.print(f"[red]Failed to get configuration status: {e}[/red]")
306
+ return CommandResult.error_result(
307
+ f"Failed to get configuration status: {e}"
308
+ )
274
309
 
275
310
  def _display_status_panel(self, status: Dict[str, Any]) -> None:
276
311
  """Display configuration status panel."""
277
312
  panel_content = []
278
313
 
279
314
  # Basic info
280
- panel_content.append(f"[bold]Configuration Status[/bold]")
315
+ panel_content.append("[bold]Configuration Status[/bold]")
281
316
  panel_content.append(f"Valid: {'✓' if status.get('valid', False) else '✗'}")
282
317
  panel_content.append(f"Loaded from: {status.get('loaded_from', 'defaults')}")
283
318
  panel_content.append(f"Total keys: {status.get('key_count', 'unknown')}")
284
319
 
285
320
  # Feature status (only if available)
286
- if 'response_logging_enabled' in status or 'memory_enabled' in status:
321
+ if "response_logging_enabled" in status or "memory_enabled" in status:
287
322
  panel_content.append("\n[bold]Features:[/bold]")
288
- if 'response_logging_enabled' in status:
323
+ if "response_logging_enabled" in status:
289
324
  panel_content.append(
290
325
  f"Response Logging: {'✓ Enabled' if status['response_logging_enabled'] else '✗ Disabled'}"
291
326
  )
292
- if 'memory_enabled' in status:
327
+ if "memory_enabled" in status:
293
328
  panel_content.append(
294
329
  f"Memory System: {'✓ Enabled' if status['memory_enabled'] else '✗ Disabled'}"
295
330
  )
@@ -298,7 +333,9 @@ class ConfigCommand(BaseCommand):
298
333
  if status.get("errors"):
299
334
  panel_content.append(f"\n[red]Errors: {len(status['errors'])}[/red]")
300
335
  if status.get("warnings"):
301
- panel_content.append(f"\n[yellow]Warnings: {len(status['warnings'])}[/yellow]")
336
+ panel_content.append(
337
+ f"\n[yellow]Warnings: {len(status['warnings'])}[/yellow]"
338
+ )
302
339
 
303
340
  # Display panel
304
341
  panel = Panel(
@@ -336,9 +373,7 @@ class ConfigCommand(BaseCommand):
336
373
  "Session Directory",
337
374
  rl_config.get("session_directory", ".claude-mpm/responses"),
338
375
  )
339
- table.add_row(
340
- "Compression", str(rl_config.get("enable_compression", False))
341
- )
376
+ table.add_row("Compression", str(rl_config.get("enable_compression", False)))
342
377
 
343
378
  console.print(table)
344
379
 
@@ -394,7 +429,7 @@ def manage_config(args) -> int:
394
429
  result = command.execute(args)
395
430
 
396
431
  # Print result if not already handled
397
- if hasattr(args, 'format') and args.format in ['json', 'yaml']:
432
+ if hasattr(args, "format") and args.format in ["json", "yaml"]:
398
433
  command.print_result(result, args)
399
434
 
400
435
  return result.exit_code