claude-mpm 4.12.4__py3-none-any.whl → 4.13.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of claude-mpm might be problematic. Click here for more details.

Files changed (29) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/cli/__init__.py +10 -0
  3. claude_mpm/cli/commands/agents.py +31 -0
  4. claude_mpm/cli/commands/agents_detect.py +380 -0
  5. claude_mpm/cli/commands/agents_recommend.py +309 -0
  6. claude_mpm/cli/commands/auto_configure.py +572 -0
  7. claude_mpm/cli/parsers/agents_parser.py +9 -0
  8. claude_mpm/cli/parsers/auto_configure_parser.py +245 -0
  9. claude_mpm/cli/parsers/base_parser.py +7 -0
  10. claude_mpm/services/agents/__init__.py +18 -5
  11. claude_mpm/services/agents/auto_config_manager.py +797 -0
  12. claude_mpm/services/agents/observers.py +547 -0
  13. claude_mpm/services/agents/recommender.py +568 -0
  14. claude_mpm/services/core/__init__.py +33 -1
  15. claude_mpm/services/core/interfaces/__init__.py +16 -1
  16. claude_mpm/services/core/interfaces/agent.py +184 -0
  17. claude_mpm/services/core/interfaces/project.py +121 -0
  18. claude_mpm/services/core/models/__init__.py +46 -0
  19. claude_mpm/services/core/models/agent_config.py +397 -0
  20. claude_mpm/services/core/models/toolchain.py +306 -0
  21. claude_mpm/services/project/__init__.py +23 -0
  22. claude_mpm/services/project/detection_strategies.py +719 -0
  23. claude_mpm/services/project/toolchain_analyzer.py +581 -0
  24. {claude_mpm-4.12.4.dist-info → claude_mpm-4.13.1.dist-info}/METADATA +1 -1
  25. {claude_mpm-4.12.4.dist-info → claude_mpm-4.13.1.dist-info}/RECORD +29 -16
  26. {claude_mpm-4.12.4.dist-info → claude_mpm-4.13.1.dist-info}/WHEEL +0 -0
  27. {claude_mpm-4.12.4.dist-info → claude_mpm-4.13.1.dist-info}/entry_points.txt +0 -0
  28. {claude_mpm-4.12.4.dist-info → claude_mpm-4.13.1.dist-info}/licenses/LICENSE +0 -0
  29. {claude_mpm-4.12.4.dist-info → claude_mpm-4.13.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,245 @@
1
+ """
2
+ Auto-Configuration Parser for Claude MPM CLI
3
+ ============================================
4
+
5
+ WHY: This module provides argument parsing for auto-configuration commands,
6
+ enabling users to customize detection, recommendation, and deployment behavior.
7
+
8
+ DESIGN DECISION: Follows existing parser patterns in the codebase, using
9
+ add_common_arguments for consistency. Provides sensible defaults while
10
+ allowing full customization.
11
+
12
+ Part of TSK-0054: Auto-Configuration Feature - Phase 5
13
+ """
14
+
15
+ import argparse
16
+ from pathlib import Path
17
+
18
+ from .base_parser import add_common_arguments
19
+
20
+
21
+ def add_auto_configure_subparser(subparsers) -> argparse.ArgumentParser:
22
+ """
23
+ Add the auto-configure subparser for automated agent configuration.
24
+
25
+ WHY: Auto-configuration simplifies onboarding by detecting project toolchain
26
+ and deploying appropriate agents automatically.
27
+
28
+ Args:
29
+ subparsers: The subparsers object from the main parser
30
+
31
+ Returns:
32
+ The configured auto-configure subparser
33
+ """
34
+ # Auto-configure command
35
+ auto_configure_parser = subparsers.add_parser(
36
+ "auto-configure",
37
+ help="Auto-configure agents based on project toolchain detection",
38
+ description="""
39
+ Auto-configure agents for your project based on detected toolchain.
40
+
41
+ This command analyzes your project to detect languages, frameworks, and
42
+ deployment targets, then recommends and deploys appropriate specialized
43
+ agents automatically.
44
+
45
+ The command provides safety features including:
46
+ • Preview mode to see changes before applying
47
+ • Confidence thresholds to ensure quality matches
48
+ • Validation gates to block invalid configurations
49
+ • Rollback on failure to maintain consistency
50
+ """,
51
+ formatter_class=argparse.RawDescriptionHelpFormatter,
52
+ epilog="""
53
+ Examples:
54
+ # Interactive configuration with confirmation
55
+ claude-mpm auto-configure
56
+
57
+ # Preview configuration without deploying
58
+ claude-mpm auto-configure --preview
59
+
60
+ # Auto-approve deployment (for scripts)
61
+ claude-mpm auto-configure --yes
62
+
63
+ # Require 90% confidence for recommendations
64
+ claude-mpm auto-configure --min-confidence 0.9
65
+
66
+ # JSON output for scripting
67
+ claude-mpm auto-configure --json
68
+
69
+ # Configure specific project directory
70
+ claude-mpm auto-configure --project-path /path/to/project
71
+ """,
72
+ )
73
+ add_common_arguments(auto_configure_parser)
74
+
75
+ # Configuration mode
76
+ mode_group = auto_configure_parser.add_mutually_exclusive_group()
77
+ mode_group.add_argument(
78
+ "--preview",
79
+ "--dry-run",
80
+ dest="preview",
81
+ action="store_true",
82
+ help="Show what would be configured without deploying (preview mode)",
83
+ )
84
+ mode_group.add_argument(
85
+ "--yes",
86
+ "-y",
87
+ action="store_true",
88
+ help="Skip confirmation prompts and deploy automatically",
89
+ )
90
+
91
+ # Configuration options
92
+ auto_configure_parser.add_argument(
93
+ "--min-confidence",
94
+ type=float,
95
+ default=0.8,
96
+ metavar="FLOAT",
97
+ help="Minimum confidence threshold for recommendations (0.0-1.0, default: 0.8)",
98
+ )
99
+
100
+ auto_configure_parser.add_argument(
101
+ "--project-path",
102
+ type=Path,
103
+ metavar="PATH",
104
+ help="Project path to analyze (default: current directory)",
105
+ )
106
+
107
+ return auto_configure_parser
108
+
109
+
110
+ def add_agents_detect_subparser(agents_subparsers) -> argparse.ArgumentParser:
111
+ """
112
+ Add the agents detect subparser for toolchain detection.
113
+
114
+ WHY: Allows users to see what toolchain is detected without making changes,
115
+ useful for debugging and verification.
116
+
117
+ Args:
118
+ agents_subparsers: The agents subparsers object
119
+
120
+ Returns:
121
+ The configured detect subparser
122
+ """
123
+ detect_parser = agents_subparsers.add_parser(
124
+ "detect",
125
+ help="Detect project toolchain without deploying",
126
+ description="""
127
+ Detect and display project toolchain without making any changes.
128
+
129
+ This command analyzes your project to detect:
130
+ • Programming languages and versions
131
+ • Frameworks and libraries
132
+ • Deployment targets and platforms
133
+
134
+ Useful for debugging toolchain detection and verifying what would be
135
+ detected before running auto-configure.
136
+ """,
137
+ formatter_class=argparse.RawDescriptionHelpFormatter,
138
+ epilog="""
139
+ Examples:
140
+ # Detect toolchain in current directory
141
+ claude-mpm agents detect
142
+
143
+ # Detect with verbose output showing evidence
144
+ claude-mpm agents detect --verbose
145
+
146
+ # JSON output for scripting
147
+ claude-mpm agents detect --json
148
+
149
+ # Detect specific project
150
+ claude-mpm agents detect --project-path /path/to/project
151
+ """,
152
+ )
153
+ add_common_arguments(detect_parser)
154
+
155
+ detect_parser.add_argument(
156
+ "--project-path",
157
+ type=Path,
158
+ metavar="PATH",
159
+ help="Project path to analyze (default: current directory)",
160
+ )
161
+
162
+ return detect_parser
163
+
164
+
165
+ def add_agents_recommend_subparser(
166
+ agents_subparsers,
167
+ ) -> argparse.ArgumentParser:
168
+ """
169
+ Add the agents recommend subparser for agent recommendations.
170
+
171
+ WHY: Allows users to see what agents would be recommended without deploying,
172
+ useful for reviewing recommendations before committing to deployment.
173
+
174
+ Args:
175
+ agents_subparsers: The agents subparsers object
176
+
177
+ Returns:
178
+ The configured recommend subparser
179
+ """
180
+ recommend_parser = agents_subparsers.add_parser(
181
+ "recommend",
182
+ help="Show recommended agents without deploying",
183
+ description="""
184
+ Show recommended agents based on project toolchain without deploying.
185
+
186
+ This command analyzes your project toolchain and recommends appropriate
187
+ agents with detailed reasoning for each recommendation. No changes are
188
+ made to your project.
189
+
190
+ Useful for:
191
+ • Reviewing recommendations before deployment
192
+ • Understanding why agents are recommended
193
+ • Adjusting confidence thresholds
194
+ """,
195
+ formatter_class=argparse.RawDescriptionHelpFormatter,
196
+ epilog="""
197
+ Examples:
198
+ # Show recommendations with reasoning
199
+ claude-mpm agents recommend
200
+
201
+ # Require 90% confidence for recommendations
202
+ claude-mpm agents recommend --min-confidence 0.9
203
+
204
+ # JSON output for scripting
205
+ claude-mpm agents recommend --json
206
+
207
+ # Hide detailed reasoning
208
+ claude-mpm agents recommend --no-reasoning
209
+
210
+ # Recommend for specific project
211
+ claude-mpm agents recommend --project-path /path/to/project
212
+ """,
213
+ )
214
+ add_common_arguments(recommend_parser)
215
+
216
+ recommend_parser.add_argument(
217
+ "--project-path",
218
+ type=Path,
219
+ metavar="PATH",
220
+ help="Project path to analyze (default: current directory)",
221
+ )
222
+
223
+ recommend_parser.add_argument(
224
+ "--min-confidence",
225
+ type=float,
226
+ default=0.8,
227
+ metavar="FLOAT",
228
+ help="Minimum confidence threshold for recommendations (0.0-1.0, default: 0.8)",
229
+ )
230
+
231
+ recommend_parser.add_argument(
232
+ "--show-reasoning",
233
+ action="store_true",
234
+ default=True,
235
+ help="Show detailed reasoning for recommendations (default)",
236
+ )
237
+
238
+ recommend_parser.add_argument(
239
+ "--no-reasoning",
240
+ dest="show_reasoning",
241
+ action="store_false",
242
+ help="Hide detailed reasoning for recommendations",
243
+ )
244
+
245
+ return recommend_parser
@@ -301,6 +301,13 @@ def create_parser(
301
301
  except ImportError:
302
302
  pass
303
303
 
304
+ try:
305
+ from .auto_configure_parser import add_auto_configure_subparser
306
+
307
+ add_auto_configure_subparser(subparsers)
308
+ except ImportError:
309
+ pass
310
+
304
311
  try:
305
312
  from .memory_parser import add_memory_subparser
306
313
 
@@ -1,5 +1,8 @@
1
1
  """Agent services module - hierarchical organization of agent-related services."""
2
2
 
3
+ # Auto-configuration exports
4
+ from .auto_config_manager import AutoConfigManagerService
5
+
3
6
  # Registry exports
4
7
  # Deployment exports
5
8
  from .deployment.agent_deployment import AgentDeploymentService
@@ -29,6 +32,15 @@ from .memory.agent_persistence_service import (
29
32
  PersistenceRecord,
30
33
  PersistenceStrategy,
31
34
  )
35
+ from .observers import (
36
+ CompositeObserver,
37
+ ConsoleProgressObserver,
38
+ IDeploymentObserver,
39
+ NullObserver,
40
+ )
41
+
42
+ # Recommender exports
43
+ from .recommender import AgentRecommenderService
32
44
  from .registry import AgentMetadata, AgentRegistry, AgentTier, AgentType
33
45
  from .registry.deployed_agent_discovery import DeployedAgentDiscovery
34
46
  from .registry.modification_tracker import (
@@ -41,34 +53,35 @@ from .registry.modification_tracker import (
41
53
 
42
54
  __all__ = [
43
55
  "AgentCapabilitiesGenerator",
44
- # Deployment
45
56
  "AgentDeploymentService",
46
57
  "AgentLifecycleManager",
47
58
  "AgentLifecycleRecord",
48
- # Management
49
59
  "AgentManager",
50
- # Memory
51
60
  "AgentMemoryManager",
52
61
  "AgentMetadata",
53
62
  "AgentModification",
54
63
  "AgentModificationTracker",
55
64
  "AgentPersistenceService",
56
65
  "AgentProfileLoader",
57
- # Registry
66
+ "AgentRecommenderService",
58
67
  "AgentRegistry",
59
68
  "AgentTier",
60
69
  "AgentType",
61
70
  "AgentVersionManager",
71
+ "AutoConfigManagerService",
62
72
  "BaseAgentManager",
73
+ "CompositeObserver",
74
+ "ConsoleProgressObserver",
63
75
  "DeployedAgentDiscovery",
64
- # Loading
65
76
  "FrameworkAgentLoader",
77
+ "IDeploymentObserver",
66
78
  "LifecycleOperation",
67
79
  "LifecycleOperationResult",
68
80
  "LifecycleState",
69
81
  "ModificationHistory",
70
82
  "ModificationTier",
71
83
  "ModificationType",
84
+ "NullObserver",
72
85
  "PersistenceOperation",
73
86
  "PersistenceRecord",
74
87
  "PersistenceStrategy",