claude-mpm 4.13.2__py3-none-any.whl → 4.18.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 (250) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +286 -0
  3. claude_mpm/agents/BASE_PM.md +48 -17
  4. claude_mpm/agents/OUTPUT_STYLE.md +329 -11
  5. claude_mpm/agents/PM_INSTRUCTIONS.md +227 -8
  6. claude_mpm/agents/agent_loader.py +17 -5
  7. claude_mpm/agents/frontmatter_validator.py +284 -253
  8. claude_mpm/agents/templates/agentic-coder-optimizer.json +9 -2
  9. claude_mpm/agents/templates/api_qa.json +7 -1
  10. claude_mpm/agents/templates/clerk-ops.json +8 -1
  11. claude_mpm/agents/templates/code_analyzer.json +4 -1
  12. claude_mpm/agents/templates/dart_engineer.json +11 -1
  13. claude_mpm/agents/templates/data_engineer.json +11 -1
  14. claude_mpm/agents/templates/documentation.json +6 -1
  15. claude_mpm/agents/templates/engineer.json +18 -1
  16. claude_mpm/agents/templates/gcp_ops_agent.json +8 -1
  17. claude_mpm/agents/templates/golang_engineer.json +11 -1
  18. claude_mpm/agents/templates/java_engineer.json +12 -2
  19. claude_mpm/agents/templates/local_ops_agent.json +1217 -6
  20. claude_mpm/agents/templates/nextjs_engineer.json +11 -1
  21. claude_mpm/agents/templates/ops.json +8 -1
  22. claude_mpm/agents/templates/php-engineer.json +11 -1
  23. claude_mpm/agents/templates/project_organizer.json +10 -3
  24. claude_mpm/agents/templates/prompt-engineer.json +5 -1
  25. claude_mpm/agents/templates/python_engineer.json +11 -1
  26. claude_mpm/agents/templates/qa.json +7 -1
  27. claude_mpm/agents/templates/react_engineer.json +11 -1
  28. claude_mpm/agents/templates/refactoring_engineer.json +8 -1
  29. claude_mpm/agents/templates/research.json +4 -1
  30. claude_mpm/agents/templates/ruby-engineer.json +11 -1
  31. claude_mpm/agents/templates/rust_engineer.json +11 -1
  32. claude_mpm/agents/templates/security.json +6 -1
  33. claude_mpm/agents/templates/svelte-engineer.json +225 -0
  34. claude_mpm/agents/templates/ticketing.json +6 -1
  35. claude_mpm/agents/templates/typescript_engineer.json +11 -1
  36. claude_mpm/agents/templates/vercel_ops_agent.json +8 -1
  37. claude_mpm/agents/templates/version_control.json +8 -1
  38. claude_mpm/agents/templates/web_qa.json +7 -1
  39. claude_mpm/agents/templates/web_ui.json +11 -1
  40. claude_mpm/cli/__init__.py +34 -706
  41. claude_mpm/cli/commands/agent_manager.py +25 -12
  42. claude_mpm/cli/commands/agent_state_manager.py +186 -0
  43. claude_mpm/cli/commands/agents.py +204 -148
  44. claude_mpm/cli/commands/aggregate.py +7 -3
  45. claude_mpm/cli/commands/analyze.py +9 -4
  46. claude_mpm/cli/commands/analyze_code.py +7 -2
  47. claude_mpm/cli/commands/auto_configure.py +7 -9
  48. claude_mpm/cli/commands/config.py +47 -13
  49. claude_mpm/cli/commands/configure.py +294 -1788
  50. claude_mpm/cli/commands/configure_agent_display.py +261 -0
  51. claude_mpm/cli/commands/configure_behavior_manager.py +204 -0
  52. claude_mpm/cli/commands/configure_hook_manager.py +225 -0
  53. claude_mpm/cli/commands/configure_models.py +18 -0
  54. claude_mpm/cli/commands/configure_navigation.py +167 -0
  55. claude_mpm/cli/commands/configure_paths.py +104 -0
  56. claude_mpm/cli/commands/configure_persistence.py +254 -0
  57. claude_mpm/cli/commands/configure_startup_manager.py +646 -0
  58. claude_mpm/cli/commands/configure_template_editor.py +497 -0
  59. claude_mpm/cli/commands/configure_validators.py +73 -0
  60. claude_mpm/cli/commands/local_deploy.py +537 -0
  61. claude_mpm/cli/commands/memory.py +54 -20
  62. claude_mpm/cli/commands/mpm_init.py +39 -25
  63. claude_mpm/cli/commands/mpm_init_handler.py +8 -3
  64. claude_mpm/cli/executor.py +202 -0
  65. claude_mpm/cli/helpers.py +105 -0
  66. claude_mpm/cli/interactive/__init__.py +3 -0
  67. claude_mpm/cli/interactive/skills_wizard.py +491 -0
  68. claude_mpm/cli/parsers/__init__.py +7 -1
  69. claude_mpm/cli/parsers/base_parser.py +98 -3
  70. claude_mpm/cli/parsers/local_deploy_parser.py +227 -0
  71. claude_mpm/cli/shared/output_formatters.py +28 -19
  72. claude_mpm/cli/startup.py +481 -0
  73. claude_mpm/cli/utils.py +52 -1
  74. claude_mpm/commands/mpm-help.md +3 -0
  75. claude_mpm/commands/mpm-version.md +113 -0
  76. claude_mpm/commands/mpm.md +1 -0
  77. claude_mpm/config/agent_config.py +2 -2
  78. claude_mpm/config/model_config.py +428 -0
  79. claude_mpm/core/base_service.py +13 -12
  80. claude_mpm/core/enums.py +452 -0
  81. claude_mpm/core/factories.py +1 -1
  82. claude_mpm/core/instruction_reinforcement_hook.py +2 -1
  83. claude_mpm/core/interactive_session.py +9 -3
  84. claude_mpm/core/logging_config.py +6 -2
  85. claude_mpm/core/oneshot_session.py +8 -4
  86. claude_mpm/core/optimized_agent_loader.py +3 -3
  87. claude_mpm/core/output_style_manager.py +12 -192
  88. claude_mpm/core/service_registry.py +5 -1
  89. claude_mpm/core/types.py +2 -9
  90. claude_mpm/core/typing_utils.py +7 -6
  91. claude_mpm/dashboard/static/js/dashboard.js +0 -14
  92. claude_mpm/dashboard/templates/index.html +3 -41
  93. claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
  94. claude_mpm/hooks/instruction_reinforcement.py +7 -2
  95. claude_mpm/models/resume_log.py +340 -0
  96. claude_mpm/services/agents/auto_config_manager.py +10 -11
  97. claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
  98. claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
  99. claude_mpm/services/agents/deployment/agent_validator.py +17 -1
  100. claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
  101. claude_mpm/services/agents/deployment/interface_adapter.py +3 -2
  102. claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
  103. claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +7 -6
  104. claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +7 -16
  105. claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +4 -3
  106. claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +5 -3
  107. claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +6 -5
  108. claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +9 -6
  109. claude_mpm/services/agents/deployment/validation/__init__.py +3 -1
  110. claude_mpm/services/agents/deployment/validation/validation_result.py +1 -9
  111. claude_mpm/services/agents/local_template_manager.py +1 -1
  112. claude_mpm/services/agents/memory/agent_memory_manager.py +5 -2
  113. claude_mpm/services/agents/registry/modification_tracker.py +5 -2
  114. claude_mpm/services/command_handler_service.py +11 -5
  115. claude_mpm/services/core/interfaces/__init__.py +74 -2
  116. claude_mpm/services/core/interfaces/health.py +172 -0
  117. claude_mpm/services/core/interfaces/model.py +281 -0
  118. claude_mpm/services/core/interfaces/process.py +372 -0
  119. claude_mpm/services/core/interfaces/restart.py +307 -0
  120. claude_mpm/services/core/interfaces/stability.py +260 -0
  121. claude_mpm/services/core/models/__init__.py +33 -0
  122. claude_mpm/services/core/models/agent_config.py +12 -28
  123. claude_mpm/services/core/models/health.py +162 -0
  124. claude_mpm/services/core/models/process.py +235 -0
  125. claude_mpm/services/core/models/restart.py +302 -0
  126. claude_mpm/services/core/models/stability.py +264 -0
  127. claude_mpm/services/core/path_resolver.py +23 -7
  128. claude_mpm/services/diagnostics/__init__.py +2 -2
  129. claude_mpm/services/diagnostics/checks/agent_check.py +25 -24
  130. claude_mpm/services/diagnostics/checks/claude_code_check.py +24 -23
  131. claude_mpm/services/diagnostics/checks/common_issues_check.py +25 -24
  132. claude_mpm/services/diagnostics/checks/configuration_check.py +24 -23
  133. claude_mpm/services/diagnostics/checks/filesystem_check.py +18 -17
  134. claude_mpm/services/diagnostics/checks/installation_check.py +30 -29
  135. claude_mpm/services/diagnostics/checks/instructions_check.py +20 -19
  136. claude_mpm/services/diagnostics/checks/mcp_check.py +50 -36
  137. claude_mpm/services/diagnostics/checks/mcp_services_check.py +36 -31
  138. claude_mpm/services/diagnostics/checks/monitor_check.py +23 -22
  139. claude_mpm/services/diagnostics/checks/startup_log_check.py +9 -8
  140. claude_mpm/services/diagnostics/diagnostic_runner.py +6 -5
  141. claude_mpm/services/diagnostics/doctor_reporter.py +28 -25
  142. claude_mpm/services/diagnostics/models.py +19 -24
  143. claude_mpm/services/infrastructure/monitoring/__init__.py +1 -1
  144. claude_mpm/services/infrastructure/monitoring/aggregator.py +12 -12
  145. claude_mpm/services/infrastructure/monitoring/base.py +5 -13
  146. claude_mpm/services/infrastructure/monitoring/network.py +7 -6
  147. claude_mpm/services/infrastructure/monitoring/process.py +13 -12
  148. claude_mpm/services/infrastructure/monitoring/resources.py +7 -6
  149. claude_mpm/services/infrastructure/monitoring/service.py +16 -15
  150. claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
  151. claude_mpm/services/local_ops/__init__.py +163 -0
  152. claude_mpm/services/local_ops/crash_detector.py +257 -0
  153. claude_mpm/services/local_ops/health_checks/__init__.py +28 -0
  154. claude_mpm/services/local_ops/health_checks/http_check.py +224 -0
  155. claude_mpm/services/local_ops/health_checks/process_check.py +236 -0
  156. claude_mpm/services/local_ops/health_checks/resource_check.py +255 -0
  157. claude_mpm/services/local_ops/health_manager.py +430 -0
  158. claude_mpm/services/local_ops/log_monitor.py +396 -0
  159. claude_mpm/services/local_ops/memory_leak_detector.py +294 -0
  160. claude_mpm/services/local_ops/process_manager.py +595 -0
  161. claude_mpm/services/local_ops/resource_monitor.py +331 -0
  162. claude_mpm/services/local_ops/restart_manager.py +401 -0
  163. claude_mpm/services/local_ops/restart_policy.py +387 -0
  164. claude_mpm/services/local_ops/state_manager.py +372 -0
  165. claude_mpm/services/local_ops/unified_manager.py +600 -0
  166. claude_mpm/services/mcp_config_manager.py +9 -4
  167. claude_mpm/services/mcp_gateway/core/__init__.py +1 -2
  168. claude_mpm/services/mcp_gateway/core/base.py +18 -31
  169. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +71 -24
  170. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +30 -28
  171. claude_mpm/services/memory_hook_service.py +4 -1
  172. claude_mpm/services/model/__init__.py +147 -0
  173. claude_mpm/services/model/base_provider.py +365 -0
  174. claude_mpm/services/model/claude_provider.py +412 -0
  175. claude_mpm/services/model/model_router.py +453 -0
  176. claude_mpm/services/model/ollama_provider.py +415 -0
  177. claude_mpm/services/monitor/daemon_manager.py +3 -2
  178. claude_mpm/services/monitor/handlers/dashboard.py +2 -1
  179. claude_mpm/services/monitor/handlers/hooks.py +2 -1
  180. claude_mpm/services/monitor/management/lifecycle.py +3 -2
  181. claude_mpm/services/monitor/server.py +2 -1
  182. claude_mpm/services/session_management_service.py +3 -2
  183. claude_mpm/services/session_manager.py +205 -1
  184. claude_mpm/services/shared/async_service_base.py +16 -27
  185. claude_mpm/services/shared/lifecycle_service_base.py +1 -14
  186. claude_mpm/services/socketio/handlers/__init__.py +5 -2
  187. claude_mpm/services/socketio/handlers/hook.py +13 -2
  188. claude_mpm/services/socketio/handlers/registry.py +4 -2
  189. claude_mpm/services/socketio/server/main.py +10 -8
  190. claude_mpm/services/subprocess_launcher_service.py +14 -5
  191. claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +8 -7
  192. claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +6 -5
  193. claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +8 -7
  194. claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +7 -6
  195. claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +5 -4
  196. claude_mpm/services/unified/config_strategies/validation_strategy.py +13 -9
  197. claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +10 -3
  198. claude_mpm/services/unified/deployment_strategies/local.py +6 -5
  199. claude_mpm/services/unified/deployment_strategies/utils.py +6 -5
  200. claude_mpm/services/unified/deployment_strategies/vercel.py +7 -6
  201. claude_mpm/services/unified/interfaces.py +3 -1
  202. claude_mpm/services/unified/unified_analyzer.py +14 -10
  203. claude_mpm/services/unified/unified_config.py +2 -1
  204. claude_mpm/services/unified/unified_deployment.py +9 -4
  205. claude_mpm/services/version_service.py +104 -1
  206. claude_mpm/skills/__init__.py +21 -0
  207. claude_mpm/skills/bundled/__init__.py +6 -0
  208. claude_mpm/skills/bundled/api-documentation.md +393 -0
  209. claude_mpm/skills/bundled/async-testing.md +571 -0
  210. claude_mpm/skills/bundled/code-review.md +143 -0
  211. claude_mpm/skills/bundled/database-migration.md +199 -0
  212. claude_mpm/skills/bundled/docker-containerization.md +194 -0
  213. claude_mpm/skills/bundled/express-local-dev.md +1429 -0
  214. claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
  215. claude_mpm/skills/bundled/git-workflow.md +414 -0
  216. claude_mpm/skills/bundled/imagemagick.md +204 -0
  217. claude_mpm/skills/bundled/json-data-handling.md +223 -0
  218. claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
  219. claude_mpm/skills/bundled/pdf.md +141 -0
  220. claude_mpm/skills/bundled/performance-profiling.md +567 -0
  221. claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
  222. claude_mpm/skills/bundled/security-scanning.md +327 -0
  223. claude_mpm/skills/bundled/systematic-debugging.md +473 -0
  224. claude_mpm/skills/bundled/test-driven-development.md +378 -0
  225. claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
  226. claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
  227. claude_mpm/skills/bundled/xlsx.md +157 -0
  228. claude_mpm/skills/registry.py +286 -0
  229. claude_mpm/skills/skill_manager.py +310 -0
  230. claude_mpm/tools/code_tree_analyzer.py +177 -141
  231. claude_mpm/tools/code_tree_events.py +4 -2
  232. claude_mpm/utils/agent_dependency_loader.py +2 -2
  233. {claude_mpm-4.13.2.dist-info → claude_mpm-4.18.2.dist-info}/METADATA +117 -8
  234. {claude_mpm-4.13.2.dist-info → claude_mpm-4.18.2.dist-info}/RECORD +238 -174
  235. claude_mpm/dashboard/static/css/code-tree.css +0 -1639
  236. claude_mpm/dashboard/static/js/components/code-tree/tree-breadcrumb.js +0 -353
  237. claude_mpm/dashboard/static/js/components/code-tree/tree-constants.js +0 -235
  238. claude_mpm/dashboard/static/js/components/code-tree/tree-search.js +0 -409
  239. claude_mpm/dashboard/static/js/components/code-tree/tree-utils.js +0 -435
  240. claude_mpm/dashboard/static/js/components/code-tree.js +0 -5869
  241. claude_mpm/dashboard/static/js/components/code-viewer.js +0 -1386
  242. claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +0 -425
  243. claude_mpm/hooks/claude_hooks/hook_handler_original.py +0 -1041
  244. claude_mpm/hooks/claude_hooks/hook_handler_refactored.py +0 -347
  245. claude_mpm/services/agents/deployment/agent_lifecycle_manager_refactored.py +0 -575
  246. claude_mpm/services/project/analyzer_refactored.py +0 -450
  247. {claude_mpm-4.13.2.dist-info → claude_mpm-4.18.2.dist-info}/WHEEL +0 -0
  248. {claude_mpm-4.13.2.dist-info → claude_mpm-4.18.2.dist-info}/entry_points.txt +0 -0
  249. {claude_mpm-4.13.2.dist-info → claude_mpm-4.18.2.dist-info}/licenses/LICENSE +0 -0
  250. {claude_mpm-4.13.2.dist-info → claude_mpm-4.18.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,452 @@
1
+ """
2
+ Centralized enums for type-safe string constants across Claude MPM.
3
+
4
+ This module provides enumerated types to replace magic strings throughout the codebase,
5
+ improving type safety, IDE autocomplete, and preventing typos.
6
+
7
+ Created: 2025-10-25
8
+ Priority: Phase 1 of systematic enum migration (3-4 week plan)
9
+ Impact: Replaces 2,050+ magic string occurrences
10
+
11
+ Usage:
12
+ from claude_mpm.core.enums import OperationResult, OutputFormat, ServiceState
13
+
14
+ # Type-safe operation results
15
+ result = OperationResult.SUCCESS
16
+ if result == OperationResult.SUCCESS:
17
+ print("Operation completed successfully")
18
+
19
+ # Type-safe output formatting
20
+ format_type = OutputFormat.JSON
21
+
22
+ # Type-safe service state management
23
+ state = ServiceState.RUNNING
24
+ """
25
+
26
+ from enum import StrEnum
27
+
28
+
29
+ class OperationResult(StrEnum):
30
+ """
31
+ Standard result codes for operations throughout Claude MPM.
32
+
33
+ Replaces 876+ occurrences of magic strings like "success", "error", "failed".
34
+ Used in: CLI commands, service operations, API responses, hook handlers.
35
+
36
+ Migration Priority: HIGH (Week 1)
37
+ Coverage: ~42% of all magic strings
38
+ """
39
+
40
+ SUCCESS = "success"
41
+ """Operation completed successfully."""
42
+
43
+ ERROR = "error"
44
+ """Operation encountered an error."""
45
+
46
+ FAILED = "failed"
47
+ """Operation failed to complete."""
48
+
49
+ PENDING = "pending"
50
+ """Operation is waiting to execute."""
51
+
52
+ COMPLETED = "completed"
53
+ """Operation has been completed."""
54
+
55
+ TIMEOUT = "timeout"
56
+ """Operation exceeded time limit."""
57
+
58
+ CANCELLED = "cancelled"
59
+ """Operation was cancelled before completion."""
60
+
61
+ CONTEXT_READY = "context_ready"
62
+ """Context is prepared and ready for use."""
63
+
64
+ SKIPPED = "skipped"
65
+ """Operation was intentionally skipped."""
66
+
67
+ RETRY = "retry"
68
+ """Operation should be retried."""
69
+
70
+ PARTIAL = "partial"
71
+ """Operation completed partially."""
72
+
73
+ WARNING = "warning"
74
+ """Operation completed with warnings (partial success with issues)."""
75
+
76
+ ROLLBACK = "rollback"
77
+ """Operation rolled back due to failure or cancellation."""
78
+
79
+ UNKNOWN = "unknown"
80
+ """Operation result is unknown or indeterminate."""
81
+
82
+
83
+ class OutputFormat(StrEnum):
84
+ """
85
+ Output format options for CLI commands and logging.
86
+
87
+ Replaces 200+ occurrences of format strings.
88
+ Used in: CLI output, logging, configuration exports, API responses.
89
+
90
+ Migration Priority: HIGH (Week 1)
91
+ Coverage: ~10% of all magic strings
92
+ """
93
+
94
+ JSON = "json"
95
+ """JavaScript Object Notation format."""
96
+
97
+ YAML = "yaml"
98
+ """YAML Ain't Markup Language format."""
99
+
100
+ TEXT = "text"
101
+ """Plain text format."""
102
+
103
+ MARKDOWN = "markdown"
104
+ """Markdown formatted text."""
105
+
106
+ RAW = "raw"
107
+ """Raw unformatted output."""
108
+
109
+ TABLE = "table"
110
+ """Tabular format for display."""
111
+
112
+ CSV = "csv"
113
+ """Comma-separated values format."""
114
+
115
+ HTML = "html"
116
+ """HyperText Markup Language format."""
117
+
118
+ XML = "xml"
119
+ """eXtensible Markup Language format."""
120
+
121
+
122
+ class ServiceState(StrEnum):
123
+ """
124
+ Service lifecycle states for all Claude MPM services.
125
+
126
+ Replaces 150+ occurrences of service state strings.
127
+ Used in: Hook services, MCP servers, monitoring, health checks, process management.
128
+
129
+ Migration Priority: HIGH (Week 1)
130
+ Coverage: ~7% of all magic strings
131
+
132
+ Notes:
133
+ - Consolidated with ProcessStatus enum (Phase 3A Batch 24)
134
+ - Process states are semantically equivalent to service states
135
+ - CRASHED processes map to ERROR state
136
+ """
137
+
138
+ UNINITIALIZED = "uninitialized"
139
+ """Service has not been initialized yet."""
140
+
141
+ INITIALIZING = "initializing"
142
+ """Service is in the process of initializing."""
143
+
144
+ INITIALIZED = "initialized"
145
+ """Service has been initialized but not started."""
146
+
147
+ STOPPED = "stopped"
148
+ """Service is completely stopped."""
149
+
150
+ STARTING = "starting"
151
+ """Service is in the process of starting."""
152
+
153
+ RUNNING = "running"
154
+ """Service is actively running."""
155
+
156
+ STOPPING = "stopping"
157
+ """Service is in the process of stopping."""
158
+
159
+ RESTARTING = "restarting"
160
+ """Service is restarting."""
161
+
162
+ ERROR = "error"
163
+ """Service encountered an error."""
164
+
165
+ UNKNOWN = "unknown"
166
+ """Service state cannot be determined."""
167
+
168
+ DEGRADED = "degraded"
169
+ """Service is running but with reduced functionality."""
170
+
171
+ IDLE = "idle"
172
+ """Service is running but not actively processing."""
173
+
174
+ def is_active(self) -> bool:
175
+ """
176
+ Check if state represents an active service/process.
177
+
178
+ Returns:
179
+ True if state is STARTING or RUNNING
180
+ """
181
+ return self in (ServiceState.STARTING, ServiceState.RUNNING)
182
+
183
+ def is_terminal(self) -> bool:
184
+ """
185
+ Check if state represents a terminal/stopped state.
186
+
187
+ Returns:
188
+ True if state is STOPPED or ERROR
189
+ """
190
+ return self in (ServiceState.STOPPED, ServiceState.ERROR)
191
+
192
+
193
+ class ValidationSeverity(StrEnum):
194
+ """
195
+ Severity levels for validation and error reporting.
196
+
197
+ Replaces validation severity strings across validators and error handlers.
198
+ Used in: Frontmatter validation, API validation, config validation.
199
+
200
+ Migration Priority: MEDIUM (Week 2)
201
+ Coverage: ~5% of all magic strings
202
+ """
203
+
204
+ INFO = "info"
205
+ """Informational message, no action required."""
206
+
207
+ WARNING = "warning"
208
+ """Warning that should be addressed but not critical."""
209
+
210
+ ERROR = "error"
211
+ """Error that prevents operation completion."""
212
+
213
+ CRITICAL = "critical"
214
+ """Critical error requiring immediate attention."""
215
+
216
+ DEBUG = "debug"
217
+ """Debug-level information for troubleshooting."""
218
+
219
+
220
+ class HealthStatus(StrEnum):
221
+ """
222
+ Health check status codes for services and components.
223
+
224
+ Replaces health check status strings throughout monitoring and diagnostics.
225
+ Used in: Health checks, monitoring, service diagnostics, uptime tracking.
226
+
227
+ Migration Priority: MEDIUM (Week 3)
228
+ Coverage: ~2% of all magic strings
229
+
230
+ Notes:
231
+ - Added in Phase 3C for comprehensive service health monitoring
232
+ - Distinct from ServiceState (operational) and OperationResult (transactional)
233
+ - Maps to standard health check patterns (healthy/unhealthy/degraded)
234
+ """
235
+
236
+ HEALTHY = "healthy"
237
+ """Component is functioning normally."""
238
+
239
+ UNHEALTHY = "unhealthy"
240
+ """Component is not functioning correctly."""
241
+
242
+ DEGRADED = "degraded"
243
+ """Component is functioning with reduced capability."""
244
+
245
+ UNKNOWN = "unknown"
246
+ """Health status cannot be determined."""
247
+
248
+ CHECKING = "checking"
249
+ """Health check is currently in progress."""
250
+
251
+ TIMEOUT = "timeout"
252
+ """Health check exceeded time limit."""
253
+
254
+ def is_operational(self) -> bool:
255
+ """
256
+ Check if health status indicates operational state.
257
+
258
+ Returns:
259
+ True if status is HEALTHY or DEGRADED
260
+ """
261
+ return self in (HealthStatus.HEALTHY, HealthStatus.DEGRADED)
262
+
263
+ def is_critical(self) -> bool:
264
+ """
265
+ Check if health status indicates critical failure.
266
+
267
+ Returns:
268
+ True if status is UNHEALTHY
269
+ """
270
+ return self == HealthStatus.UNHEALTHY
271
+
272
+
273
+ class ModelTier(StrEnum):
274
+ """
275
+ Claude model tier classifications and identifiers.
276
+
277
+ Replaces model name strings and enables model normalization.
278
+ Used in: Agent configuration, API calls, capability detection.
279
+
280
+ Migration Priority: MEDIUM (Week 2)
281
+ Coverage: ~4% of all magic strings
282
+
283
+ Notes:
284
+ - Replaces manual model normalization code
285
+ - Enables type-safe model selection
286
+ - Provides both tier names and full model identifiers
287
+ """
288
+
289
+ # Tier names (simplified)
290
+ OPUS = "opus"
291
+ """Claude Opus tier (highest capability)."""
292
+
293
+ SONNET = "sonnet"
294
+ """Claude Sonnet tier (balanced)."""
295
+
296
+ HAIKU = "haiku"
297
+ """Claude Haiku tier (fastest)."""
298
+
299
+ # Full model identifiers (Claude 4.x)
300
+ OPUS_4 = "claude-opus-4-20250514"
301
+ """Claude 4 Opus - May 2025 release."""
302
+
303
+ SONNET_4 = "claude-sonnet-4-20250514"
304
+ """Claude 4 Sonnet - May 2025 release."""
305
+
306
+ SONNET_4_5 = "claude-sonnet-4-5-20250929"
307
+ """Claude 4.5 Sonnet - September 2025 release."""
308
+
309
+ # Legacy model identifiers (Claude 3.x)
310
+ OPUS_3 = "claude-3-opus-20240229"
311
+ """Claude 3 Opus - February 2024 release."""
312
+
313
+ SONNET_3_5 = "claude-3-5-sonnet-20241022"
314
+ """Claude 3.5 Sonnet - October 2024 release."""
315
+
316
+ HAIKU_3 = "claude-3-haiku-20240307"
317
+ """Claude 3 Haiku - March 2024 release."""
318
+
319
+ @classmethod
320
+ def normalize(cls, model_name: str) -> "ModelTier":
321
+ """
322
+ Normalize a model name to its canonical tier.
323
+
324
+ Args:
325
+ model_name: Any model name variant (e.g., "opus", "claude-opus-4", "OPUS")
326
+
327
+ Returns:
328
+ Normalized ModelTier enum value
329
+
330
+ Examples:
331
+ >>> ModelTier.normalize("OPUS")
332
+ ModelTier.OPUS
333
+ >>> ModelTier.normalize("claude-sonnet-4-20250514")
334
+ ModelTier.SONNET_4
335
+ >>> ModelTier.normalize("sonnet")
336
+ ModelTier.SONNET
337
+ """
338
+ normalized = model_name.lower().strip()
339
+
340
+ # Direct enum value match
341
+ for tier in cls:
342
+ if tier.value == normalized:
343
+ return tier
344
+
345
+ # Tier name extraction
346
+ if "opus" in normalized:
347
+ return cls.OPUS
348
+ if "sonnet" in normalized:
349
+ return cls.SONNET
350
+ if "haiku" in normalized:
351
+ return cls.HAIKU
352
+
353
+ # Default to sonnet for unknown models
354
+ return cls.SONNET
355
+
356
+
357
+ class AgentCategory(StrEnum):
358
+ """
359
+ Agent specialization categories for classification and routing.
360
+
361
+ Replaces category strings in agent configurations and routing logic.
362
+ Used in: Agent templates, capability detection, routing decisions.
363
+
364
+ Migration Priority: MEDIUM (Week 3)
365
+ Coverage: ~3% of all magic strings
366
+
367
+ Notes:
368
+ - Expanded in Phase 3C to include all template categories
369
+ - Maps to actual usage in agent JSON templates
370
+ - Supports both legacy and new category schemes
371
+ """
372
+
373
+ # Core Engineering Categories
374
+ ENGINEERING = "engineering"
375
+ """Software engineering and implementation agents."""
376
+
377
+ # Research and Analysis
378
+ RESEARCH = "research"
379
+ """Research and analysis agents."""
380
+
381
+ ANALYSIS = "analysis"
382
+ """Code analysis and architectural review agents."""
383
+
384
+ # Quality and Testing
385
+ QUALITY = "quality"
386
+ """Quality assurance and testing agents (replaces QA)."""
387
+
388
+ QA = "qa"
389
+ """Legacy quality assurance category (use QUALITY for new agents)."""
390
+
391
+ SECURITY = "security"
392
+ """Security analysis and vulnerability assessment agents."""
393
+
394
+ # Operations and Infrastructure
395
+ OPERATIONS = "operations"
396
+ """DevOps and infrastructure management agents."""
397
+
398
+ INFRASTRUCTURE = "infrastructure"
399
+ """Infrastructure provisioning and cloud management agents."""
400
+
401
+ # Documentation and Content
402
+ DOCUMENTATION = "documentation"
403
+ """Documentation and technical writing agents."""
404
+
405
+ CONTENT = "content"
406
+ """Content creation, optimization, and management agents."""
407
+
408
+ # Data and Analytics
409
+ DATA = "data"
410
+ """Data engineering and analytics agents."""
411
+
412
+ # Specialized Functions
413
+ OPTIMIZATION = "optimization"
414
+ """Performance and resource optimization agents."""
415
+
416
+ SPECIALIZED = "specialized"
417
+ """Specialized single-purpose agents."""
418
+
419
+ SYSTEM = "system"
420
+ """System-level framework agents."""
421
+
422
+ # Management and Coordination
423
+ PROJECT_MANAGEMENT = "project-management"
424
+ """Project management and coordination agents."""
425
+
426
+ PRODUCT = "product"
427
+ """Product ownership and strategy agents."""
428
+
429
+ # Legacy and General
430
+ VERSION_CONTROL = "version_control"
431
+ """Version control and release management agents."""
432
+
433
+ DESIGN = "design"
434
+ """UI/UX design and frontend agents."""
435
+
436
+ GENERAL = "general"
437
+ """General-purpose agents without specific specialization."""
438
+
439
+ CUSTOM = "custom"
440
+ """User-defined custom agent categories."""
441
+
442
+
443
+ # Export all enums for convenient access
444
+ __all__ = [
445
+ "AgentCategory",
446
+ "HealthStatus",
447
+ "ModelTier",
448
+ "OperationResult",
449
+ "OutputFormat",
450
+ "ServiceState",
451
+ "ValidationSeverity",
452
+ ]
@@ -77,7 +77,7 @@ class AgentServiceFactory(ServiceFactory):
77
77
  if hasattr(service, "set_directories"):
78
78
  service.set_directories(framework_dir, project_dir)
79
79
 
80
- logger.info("Created agent deployment service")
80
+ logger.debug("Created agent deployment service")
81
81
  return service
82
82
 
83
83
 
@@ -21,6 +21,7 @@ import threading
21
21
  from datetime import datetime, timezone
22
22
  from typing import Any, Dict, List, Optional
23
23
 
24
+ from ..core.enums import OperationResult
24
25
  from ..core.logger import get_logger
25
26
 
26
27
 
@@ -158,7 +159,7 @@ class InstructionReinforcementHook:
158
159
  # Create reminder todo
159
160
  reminder_todo = {
160
161
  "content": message,
161
- "status": "pending",
162
+ "status": OperationResult.PENDING,
162
163
  "activeForm": "Processing instruction reminder",
163
164
  }
164
165
 
@@ -11,6 +11,7 @@ import uuid
11
11
  from pathlib import Path
12
12
  from typing import Any, Dict, Optional, Tuple
13
13
 
14
+ from claude_mpm.core.enums import ServiceState
14
15
  from claude_mpm.core.logger import get_logger
15
16
 
16
17
 
@@ -179,7 +180,8 @@ class InteractiveSession:
179
180
  # Notify WebSocket if connected
180
181
  if self.runner.websocket_server:
181
182
  self.runner.websocket_server.claude_status_changed(
182
- status="starting", message="Launching Claude interactive session"
183
+ status=ServiceState.STARTING,
184
+ message="Launching Claude interactive session",
183
185
  )
184
186
 
185
187
  # Launch using selected method
@@ -311,6 +313,9 @@ class InteractiveSession:
311
313
  print(
312
314
  "\033[32m│\033[0m /mpm - MPM overview and help \033[32m│\033[0m"
313
315
  )
316
+ print(
317
+ "\033[32m│\033[0m /mpm-init - Initialize or update project \033[32m│\033[0m"
318
+ )
314
319
  print(
315
320
  "\033[32m│\033[0m /mpm-agents - Show available agents \033[32m│\033[0m"
316
321
  )
@@ -451,7 +456,8 @@ class InteractiveSession:
451
456
  # Notify WebSocket before exec
452
457
  if self.runner.websocket_server:
453
458
  self.runner.websocket_server.claude_status_changed(
454
- status="running", message="Claude process started (exec mode)"
459
+ status=ServiceState.RUNNING,
460
+ message="Claude process started (exec mode)",
455
461
  )
456
462
 
457
463
  # This will not return if successful
@@ -491,7 +497,7 @@ class InteractiveSession:
491
497
  # Notify WebSocket of error
492
498
  if self.runner.websocket_server:
493
499
  self.runner.websocket_server.claude_status_changed(
494
- status="error", message=f"Failed to launch Claude: {error}"
500
+ status=ServiceState.ERROR, message=f"Failed to launch Claude: {error}"
495
501
  )
496
502
 
497
503
  def _handle_keyboard_interrupt(self) -> None:
@@ -24,6 +24,7 @@ from contextlib import contextmanager
24
24
  from pathlib import Path
25
25
  from typing import Any, Dict, Optional, Union
26
26
 
27
+ from claude_mpm.core.enums import OperationResult
27
28
  from claude_mpm.core.logger import (
28
29
  JsonFormatter,
29
30
  finalize_streaming_logs,
@@ -234,7 +235,10 @@ def log_operation(
234
235
  execution_time = time.time() - start_time
235
236
  logger.info(
236
237
  f"Completed {operation}",
237
- extra={"execution_time": execution_time, "status": "success"},
238
+ extra={
239
+ "execution_time": execution_time,
240
+ "status": OperationResult.SUCCESS,
241
+ },
238
242
  )
239
243
  except Exception as e:
240
244
  execution_time = time.time() - start_time
@@ -242,7 +246,7 @@ def log_operation(
242
246
  f"Failed {operation}: {e}",
243
247
  extra={
244
248
  "execution_time": execution_time,
245
- "status": "failure",
249
+ "status": OperationResult.FAILED,
246
250
  "error": str(e),
247
251
  },
248
252
  )
@@ -12,6 +12,7 @@ import uuid
12
12
  from pathlib import Path
13
13
  from typing import Any, Dict, Optional, Tuple
14
14
 
15
+ from claude_mpm.core.enums import OperationResult, ServiceState
15
16
  from claude_mpm.core.logger import get_logger
16
17
 
17
18
 
@@ -162,7 +163,7 @@ class OneshotSession:
162
163
 
163
164
  if self.runner.websocket_server:
164
165
  self.runner.websocket_server.claude_status_changed(
165
- status="running", message="Executing Claude oneshot command"
166
+ status=ServiceState.RUNNING, message="Executing Claude oneshot command"
166
167
  )
167
168
 
168
169
  def _run_subprocess(
@@ -222,7 +223,7 @@ class OneshotSession:
222
223
  # End WebSocket session
223
224
  if self.runner.websocket_server:
224
225
  self.runner.websocket_server.claude_status_changed(
225
- status="stopped", message="Session completed"
226
+ status=ServiceState.STOPPED, message="Session completed"
226
227
  )
227
228
  self.runner.websocket_server.session_ended()
228
229
 
@@ -299,7 +300,9 @@ class OneshotSession:
299
300
  agent_name = self.runner._extract_agent_from_response(response)
300
301
  if agent_name:
301
302
  self.runner.websocket_server.agent_delegated(
302
- agent=agent_name, task=prompt[:100], status="detected"
303
+ agent=agent_name,
304
+ task=prompt[:100],
305
+ status=OperationResult.PENDING,
303
306
  )
304
307
 
305
308
  # Log completion
@@ -335,7 +338,8 @@ class OneshotSession:
335
338
  if self.runner.websocket_server:
336
339
  self.runner.websocket_server.claude_output(error_msg, "stderr")
337
340
  self.runner.websocket_server.claude_status_changed(
338
- status="error", message=f"Command failed with code {return_code}"
341
+ status=ServiceState.ERROR,
342
+ message=f"Command failed with code {return_code}",
339
343
  )
340
344
 
341
345
  # Log error
@@ -236,7 +236,7 @@ class OptimizedAgentLoader:
236
236
 
237
237
  self.metrics.total_time = time.time() - start_time
238
238
 
239
- self.logger.info(
239
+ self.logger.debug(
240
240
  f"Loaded {self.metrics.loaded_agents}/{self.metrics.total_agents} agents "
241
241
  f"in {self.metrics.total_time:.2f}s "
242
242
  f"(cache hits: {self.metrics.cache_hits}, misses: {self.metrics.cache_misses})"
@@ -286,7 +286,7 @@ class OptimizedAgentLoader:
286
286
 
287
287
  self.metrics.total_time = time.time() - start_time
288
288
 
289
- self.logger.info(
289
+ self.logger.debug(
290
290
  f"Async loaded {self.metrics.loaded_agents}/{self.metrics.total_agents} agents "
291
291
  f"in {self.metrics.total_time:.2f}s"
292
292
  )
@@ -418,7 +418,7 @@ class OptimizedAgentLoader:
418
418
  Args:
419
419
  agent_dirs: List of directories containing agents
420
420
  """
421
- self.logger.info(f"Preloading agents from {len(agent_dirs)} directories")
421
+ self.logger.debug(f"Preloading agents from {len(agent_dirs)} directories")
422
422
 
423
423
  all_paths = []
424
424
  for dir_path in agent_dirs: