claude-mpm 0.3.0__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.
- claude_mpm/__init__.py +17 -0
- claude_mpm/__main__.py +14 -0
- claude_mpm/_version.py +32 -0
- claude_mpm/agents/BASE_AGENT_TEMPLATE.md +88 -0
- claude_mpm/agents/INSTRUCTIONS.md +375 -0
- claude_mpm/agents/__init__.py +118 -0
- claude_mpm/agents/agent_loader.py +621 -0
- claude_mpm/agents/agent_loader_integration.py +229 -0
- claude_mpm/agents/agents_metadata.py +204 -0
- claude_mpm/agents/base_agent.json +27 -0
- claude_mpm/agents/base_agent_loader.py +519 -0
- claude_mpm/agents/schema/agent_schema.json +160 -0
- claude_mpm/agents/system_agent_config.py +587 -0
- claude_mpm/agents/templates/__init__.py +101 -0
- claude_mpm/agents/templates/data_engineer_agent.json +46 -0
- claude_mpm/agents/templates/documentation_agent.json +45 -0
- claude_mpm/agents/templates/engineer_agent.json +49 -0
- claude_mpm/agents/templates/ops_agent.json +46 -0
- claude_mpm/agents/templates/qa_agent.json +45 -0
- claude_mpm/agents/templates/research_agent.json +49 -0
- claude_mpm/agents/templates/security_agent.json +46 -0
- claude_mpm/agents/templates/update-optimized-specialized-agents.json +374 -0
- claude_mpm/agents/templates/version_control_agent.json +46 -0
- claude_mpm/agents/test_fix_deployment/.claude-pm/config/project.json +6 -0
- claude_mpm/cli.py +655 -0
- claude_mpm/cli_main.py +13 -0
- claude_mpm/cli_module/__init__.py +15 -0
- claude_mpm/cli_module/args.py +222 -0
- claude_mpm/cli_module/commands.py +203 -0
- claude_mpm/cli_module/migration_example.py +183 -0
- claude_mpm/cli_module/refactoring_guide.md +253 -0
- claude_mpm/cli_old/__init__.py +1 -0
- claude_mpm/cli_old/ticket_cli.py +102 -0
- claude_mpm/config/__init__.py +5 -0
- claude_mpm/config/hook_config.py +42 -0
- claude_mpm/constants.py +150 -0
- claude_mpm/core/__init__.py +45 -0
- claude_mpm/core/agent_name_normalizer.py +248 -0
- claude_mpm/core/agent_registry.py +627 -0
- claude_mpm/core/agent_registry.py.bak +312 -0
- claude_mpm/core/agent_session_manager.py +273 -0
- claude_mpm/core/base_service.py +747 -0
- claude_mpm/core/base_service.py.bak +406 -0
- claude_mpm/core/config.py +334 -0
- claude_mpm/core/config_aliases.py +292 -0
- claude_mpm/core/container.py +347 -0
- claude_mpm/core/factories.py +281 -0
- claude_mpm/core/framework_loader.py +472 -0
- claude_mpm/core/injectable_service.py +206 -0
- claude_mpm/core/interfaces.py +539 -0
- claude_mpm/core/logger.py +468 -0
- claude_mpm/core/minimal_framework_loader.py +107 -0
- claude_mpm/core/mixins.py +150 -0
- claude_mpm/core/service_registry.py +299 -0
- claude_mpm/core/session_manager.py +190 -0
- claude_mpm/core/simple_runner.py +511 -0
- claude_mpm/core/tool_access_control.py +173 -0
- claude_mpm/hooks/README.md +243 -0
- claude_mpm/hooks/__init__.py +5 -0
- claude_mpm/hooks/base_hook.py +154 -0
- claude_mpm/hooks/builtin/__init__.py +1 -0
- claude_mpm/hooks/builtin/logging_hook_example.py +165 -0
- claude_mpm/hooks/builtin/post_delegation_hook_example.py +124 -0
- claude_mpm/hooks/builtin/pre_delegation_hook_example.py +125 -0
- claude_mpm/hooks/builtin/submit_hook_example.py +100 -0
- claude_mpm/hooks/builtin/ticket_extraction_hook_example.py +237 -0
- claude_mpm/hooks/builtin/todo_agent_prefix_hook.py +239 -0
- claude_mpm/hooks/builtin/workflow_start_hook.py +181 -0
- claude_mpm/hooks/hook_client.py +264 -0
- claude_mpm/hooks/hook_runner.py +370 -0
- claude_mpm/hooks/json_rpc_executor.py +259 -0
- claude_mpm/hooks/json_rpc_hook_client.py +319 -0
- claude_mpm/hooks/tool_call_interceptor.py +204 -0
- claude_mpm/init.py +246 -0
- claude_mpm/orchestration/SUBPROCESS_DESIGN.md +66 -0
- claude_mpm/orchestration/__init__.py +6 -0
- claude_mpm/orchestration/archive/direct_orchestrator.py +195 -0
- claude_mpm/orchestration/archive/factory.py +215 -0
- claude_mpm/orchestration/archive/hook_enabled_orchestrator.py +188 -0
- claude_mpm/orchestration/archive/hook_integration_example.py +178 -0
- claude_mpm/orchestration/archive/interactive_subprocess_orchestrator.py +826 -0
- claude_mpm/orchestration/archive/orchestrator.py +501 -0
- claude_mpm/orchestration/archive/pexpect_orchestrator.py +252 -0
- claude_mpm/orchestration/archive/pty_orchestrator.py +270 -0
- claude_mpm/orchestration/archive/simple_orchestrator.py +82 -0
- claude_mpm/orchestration/archive/subprocess_orchestrator.py +801 -0
- claude_mpm/orchestration/archive/system_prompt_orchestrator.py +278 -0
- claude_mpm/orchestration/archive/wrapper_orchestrator.py +187 -0
- claude_mpm/scripts/__init__.py +1 -0
- claude_mpm/scripts/ticket.py +269 -0
- claude_mpm/services/__init__.py +10 -0
- claude_mpm/services/agent_deployment.py +955 -0
- claude_mpm/services/agent_lifecycle_manager.py +948 -0
- claude_mpm/services/agent_management_service.py +596 -0
- claude_mpm/services/agent_modification_tracker.py +841 -0
- claude_mpm/services/agent_profile_loader.py +606 -0
- claude_mpm/services/agent_registry.py +677 -0
- claude_mpm/services/base_agent_manager.py +380 -0
- claude_mpm/services/framework_agent_loader.py +337 -0
- claude_mpm/services/framework_claude_md_generator/README.md +92 -0
- claude_mpm/services/framework_claude_md_generator/__init__.py +206 -0
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +151 -0
- claude_mpm/services/framework_claude_md_generator/content_validator.py +126 -0
- claude_mpm/services/framework_claude_md_generator/deployment_manager.py +137 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +106 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/agents.py +582 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/claude_pm_init.py +97 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/core_responsibilities.py +27 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/delegation_constraints.py +23 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/environment_config.py +23 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/footer.py +20 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/header.py +26 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/orchestration_principles.py +30 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/role_designation.py +37 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/subprocess_validation.py +111 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/todo_task_tools.py +89 -0
- claude_mpm/services/framework_claude_md_generator/section_generators/troubleshooting.py +39 -0
- claude_mpm/services/framework_claude_md_generator/section_manager.py +106 -0
- claude_mpm/services/framework_claude_md_generator/version_manager.py +121 -0
- claude_mpm/services/framework_claude_md_generator.py +621 -0
- claude_mpm/services/hook_service.py +388 -0
- claude_mpm/services/hook_service_manager.py +223 -0
- claude_mpm/services/json_rpc_hook_manager.py +92 -0
- claude_mpm/services/parent_directory_manager/README.md +83 -0
- claude_mpm/services/parent_directory_manager/__init__.py +577 -0
- claude_mpm/services/parent_directory_manager/backup_manager.py +258 -0
- claude_mpm/services/parent_directory_manager/config_manager.py +210 -0
- claude_mpm/services/parent_directory_manager/deduplication_manager.py +279 -0
- claude_mpm/services/parent_directory_manager/framework_protector.py +143 -0
- claude_mpm/services/parent_directory_manager/operations.py +186 -0
- claude_mpm/services/parent_directory_manager/state_manager.py +624 -0
- claude_mpm/services/parent_directory_manager/template_deployer.py +579 -0
- claude_mpm/services/parent_directory_manager/validation_manager.py +378 -0
- claude_mpm/services/parent_directory_manager/version_control_helper.py +339 -0
- claude_mpm/services/parent_directory_manager/version_manager.py +222 -0
- claude_mpm/services/shared_prompt_cache.py +819 -0
- claude_mpm/services/ticket_manager.py +213 -0
- claude_mpm/services/ticket_manager_di.py +318 -0
- claude_mpm/services/ticketing_service_original.py +508 -0
- claude_mpm/services/version_control/VERSION +1 -0
- claude_mpm/services/version_control/__init__.py +70 -0
- claude_mpm/services/version_control/branch_strategy.py +670 -0
- claude_mpm/services/version_control/conflict_resolution.py +744 -0
- claude_mpm/services/version_control/git_operations.py +784 -0
- claude_mpm/services/version_control/semantic_versioning.py +703 -0
- claude_mpm/ui/__init__.py +1 -0
- claude_mpm/ui/rich_terminal_ui.py +295 -0
- claude_mpm/ui/terminal_ui.py +328 -0
- claude_mpm/utils/__init__.py +16 -0
- claude_mpm/utils/config_manager.py +468 -0
- claude_mpm/utils/import_migration_example.py +80 -0
- claude_mpm/utils/imports.py +182 -0
- claude_mpm/utils/path_operations.py +357 -0
- claude_mpm/utils/paths.py +289 -0
- claude_mpm-0.3.0.dist-info/METADATA +290 -0
- claude_mpm-0.3.0.dist-info/RECORD +159 -0
- claude_mpm-0.3.0.dist-info/WHEEL +5 -0
- claude_mpm-0.3.0.dist-info/entry_points.txt +4 -0
- claude_mpm-0.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"""Path resolution utilities for Claude MPM.
|
|
2
|
+
|
|
3
|
+
This module provides centralized path discovery and resolution logic
|
|
4
|
+
to avoid duplication across the codebase.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Optional, Union, List
|
|
10
|
+
from functools import lru_cache
|
|
11
|
+
import logging
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class PathResolver:
|
|
17
|
+
"""Centralized path resolution for Claude MPM.
|
|
18
|
+
|
|
19
|
+
This class consolidates all path discovery logic to avoid duplication
|
|
20
|
+
across different modules. It handles various scenarios including:
|
|
21
|
+
- Running from different directories
|
|
22
|
+
- Installed vs development mode
|
|
23
|
+
- Missing directories
|
|
24
|
+
|
|
25
|
+
All methods use caching to improve performance for repeated lookups.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
@lru_cache(maxsize=1)
|
|
30
|
+
def get_framework_root(cls) -> Path:
|
|
31
|
+
"""Find the framework root directory.
|
|
32
|
+
|
|
33
|
+
This method searches for the framework root by looking for marker files
|
|
34
|
+
like pyproject.toml or the claude_mpm package directory.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
Path: The framework root directory
|
|
38
|
+
|
|
39
|
+
Raises:
|
|
40
|
+
FileNotFoundError: If framework root cannot be determined
|
|
41
|
+
"""
|
|
42
|
+
# First, try to find via the module location
|
|
43
|
+
try:
|
|
44
|
+
import claude_mpm
|
|
45
|
+
module_path = Path(claude_mpm.__file__).parent
|
|
46
|
+
# Go up to find the src directory, then one more for root
|
|
47
|
+
if module_path.parent.name == 'src':
|
|
48
|
+
return module_path.parent.parent
|
|
49
|
+
# Otherwise, assume we're in site-packages
|
|
50
|
+
return module_path
|
|
51
|
+
except ImportError:
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
# Fallback: search upward for pyproject.toml
|
|
55
|
+
current = Path.cwd()
|
|
56
|
+
while current != current.parent:
|
|
57
|
+
if (current / 'pyproject.toml').exists():
|
|
58
|
+
# Verify this is our project
|
|
59
|
+
if (current / 'src' / 'claude_mpm').exists():
|
|
60
|
+
return current
|
|
61
|
+
current = current.parent
|
|
62
|
+
|
|
63
|
+
raise FileNotFoundError(
|
|
64
|
+
"Could not determine framework root. Please run from within "
|
|
65
|
+
"the claude-mpm project or ensure it's properly installed."
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
@lru_cache(maxsize=1)
|
|
70
|
+
def get_agents_dir(cls) -> Path:
|
|
71
|
+
"""Get the agents directory path.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Path: The agents directory within the framework
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
FileNotFoundError: If agents directory doesn't exist
|
|
78
|
+
"""
|
|
79
|
+
framework_root = cls.get_framework_root()
|
|
80
|
+
|
|
81
|
+
# Check for development structure
|
|
82
|
+
agents_dir = framework_root / 'src' / 'claude_mpm' / 'agents'
|
|
83
|
+
if agents_dir.exists():
|
|
84
|
+
return agents_dir
|
|
85
|
+
|
|
86
|
+
# Check for installed structure
|
|
87
|
+
agents_dir = framework_root / 'claude_mpm' / 'agents'
|
|
88
|
+
if agents_dir.exists():
|
|
89
|
+
return agents_dir
|
|
90
|
+
|
|
91
|
+
raise FileNotFoundError(
|
|
92
|
+
f"Agents directory not found. Searched in:\n"
|
|
93
|
+
f" - {framework_root / 'src' / 'claude_mpm' / 'agents'}\n"
|
|
94
|
+
f" - {framework_root / 'claude_mpm' / 'agents'}"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
@lru_cache(maxsize=1)
|
|
99
|
+
def get_project_root(cls) -> Path:
|
|
100
|
+
"""Find the current project root.
|
|
101
|
+
|
|
102
|
+
Searches for project markers like .git, pyproject.toml, package.json, etc.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
Path: The current project root directory
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
FileNotFoundError: If no project root can be determined
|
|
109
|
+
"""
|
|
110
|
+
# Project root markers in order of preference
|
|
111
|
+
markers = ['.git', 'pyproject.toml', 'package.json', 'Cargo.toml',
|
|
112
|
+
'go.mod', 'pom.xml', 'build.gradle', '.claude-pm']
|
|
113
|
+
|
|
114
|
+
current = Path.cwd()
|
|
115
|
+
while current != current.parent:
|
|
116
|
+
for marker in markers:
|
|
117
|
+
if (current / marker).exists():
|
|
118
|
+
logger.debug(f"Found project root at {current} via {marker}")
|
|
119
|
+
return current
|
|
120
|
+
current = current.parent
|
|
121
|
+
|
|
122
|
+
# If no markers found, use current directory
|
|
123
|
+
logger.warning("No project markers found, using current directory as project root")
|
|
124
|
+
return Path.cwd()
|
|
125
|
+
|
|
126
|
+
@classmethod
|
|
127
|
+
@lru_cache(maxsize=4)
|
|
128
|
+
def get_config_dir(cls, scope: str = 'project') -> Path:
|
|
129
|
+
"""Get configuration directory for the specified scope.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
scope: One of 'project', 'user', 'system', or 'framework'
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
Path: The configuration directory
|
|
136
|
+
|
|
137
|
+
Raises:
|
|
138
|
+
ValueError: If scope is invalid
|
|
139
|
+
FileNotFoundError: If directory cannot be determined
|
|
140
|
+
"""
|
|
141
|
+
if scope == 'project':
|
|
142
|
+
return cls.get_project_root() / '.claude-pm'
|
|
143
|
+
elif scope == 'user':
|
|
144
|
+
# Support XDG_CONFIG_HOME if set
|
|
145
|
+
xdg_config = os.environ.get('XDG_CONFIG_HOME')
|
|
146
|
+
if xdg_config:
|
|
147
|
+
return Path(xdg_config) / 'claude-pm'
|
|
148
|
+
return Path.home() / '.config' / 'claude-pm'
|
|
149
|
+
elif scope == 'system':
|
|
150
|
+
# System-wide configuration
|
|
151
|
+
if os.name == 'posix':
|
|
152
|
+
return Path('/etc/claude-pm')
|
|
153
|
+
else:
|
|
154
|
+
# Windows: Use ProgramData
|
|
155
|
+
return Path(os.environ.get('ProgramData', 'C:\\ProgramData')) / 'claude-pm'
|
|
156
|
+
elif scope == 'framework':
|
|
157
|
+
return cls.get_framework_root() / '.claude-pm'
|
|
158
|
+
else:
|
|
159
|
+
raise ValueError(f"Invalid scope: {scope}. Must be one of: project, user, system, framework")
|
|
160
|
+
|
|
161
|
+
@classmethod
|
|
162
|
+
def find_file_upwards(cls, filename: str, start_path: Optional[Path] = None) -> Optional[Path]:
|
|
163
|
+
"""Generic upward file search.
|
|
164
|
+
|
|
165
|
+
Searches for a file by traversing up the directory tree.
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
filename: Name of the file to search for
|
|
169
|
+
start_path: Starting directory (defaults to current directory)
|
|
170
|
+
|
|
171
|
+
Returns:
|
|
172
|
+
Path: Full path to the found file, or None if not found
|
|
173
|
+
"""
|
|
174
|
+
current = Path(start_path) if start_path else Path.cwd()
|
|
175
|
+
|
|
176
|
+
while current != current.parent:
|
|
177
|
+
target = current / filename
|
|
178
|
+
if target.exists():
|
|
179
|
+
logger.debug(f"Found {filename} at {target}")
|
|
180
|
+
return target
|
|
181
|
+
current = current.parent
|
|
182
|
+
|
|
183
|
+
logger.debug(f"Could not find {filename} in any parent directory")
|
|
184
|
+
return None
|
|
185
|
+
|
|
186
|
+
@classmethod
|
|
187
|
+
@lru_cache(maxsize=8)
|
|
188
|
+
def get_claude_pm_dir(cls, base_path: Optional[Path] = None) -> Optional[Path]:
|
|
189
|
+
"""Find .claude-pm directory starting from base_path.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
base_path: Starting directory (defaults to current directory)
|
|
193
|
+
|
|
194
|
+
Returns:
|
|
195
|
+
Path: The .claude-pm directory, or None if not found
|
|
196
|
+
"""
|
|
197
|
+
result = cls.find_file_upwards('.claude-pm', base_path)
|
|
198
|
+
return result if result and result.is_dir() else None
|
|
199
|
+
|
|
200
|
+
@classmethod
|
|
201
|
+
def ensure_directory(cls, path: Path) -> Path:
|
|
202
|
+
"""Ensure a directory exists, creating it if necessary.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
path: Directory path to ensure exists
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
Path: The directory path
|
|
209
|
+
|
|
210
|
+
Raises:
|
|
211
|
+
OSError: If directory cannot be created
|
|
212
|
+
"""
|
|
213
|
+
try:
|
|
214
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
215
|
+
return path
|
|
216
|
+
except OSError as e:
|
|
217
|
+
logger.error(f"Failed to create directory {path}: {e}")
|
|
218
|
+
raise
|
|
219
|
+
|
|
220
|
+
@classmethod
|
|
221
|
+
def get_relative_to_root(cls, path: Union[str, Path], root_type: str = 'project') -> Path:
|
|
222
|
+
"""Get a path relative to a specific root.
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
path: Relative path within the root
|
|
226
|
+
root_type: Type of root ('project' or 'framework')
|
|
227
|
+
|
|
228
|
+
Returns:
|
|
229
|
+
Path: Full path relative to the specified root
|
|
230
|
+
|
|
231
|
+
Raises:
|
|
232
|
+
ValueError: If root_type is invalid
|
|
233
|
+
"""
|
|
234
|
+
if root_type == 'project':
|
|
235
|
+
root = cls.get_project_root()
|
|
236
|
+
elif root_type == 'framework':
|
|
237
|
+
root = cls.get_framework_root()
|
|
238
|
+
else:
|
|
239
|
+
raise ValueError(f"Invalid root_type: {root_type}. Must be 'project' or 'framework'")
|
|
240
|
+
|
|
241
|
+
return root / path
|
|
242
|
+
|
|
243
|
+
@classmethod
|
|
244
|
+
def find_files_by_pattern(cls, pattern: str, root: Optional[Path] = None) -> List[Path]:
|
|
245
|
+
"""Find all files matching a pattern within a directory tree.
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
pattern: Glob pattern to match (e.g., '*.py', '**/*.md')
|
|
249
|
+
root: Root directory to search (defaults to project root)
|
|
250
|
+
|
|
251
|
+
Returns:
|
|
252
|
+
List[Path]: List of matching file paths
|
|
253
|
+
"""
|
|
254
|
+
if root is None:
|
|
255
|
+
root = cls.get_project_root()
|
|
256
|
+
|
|
257
|
+
matches = list(root.glob(pattern))
|
|
258
|
+
logger.debug(f"Found {len(matches)} files matching '{pattern}' in {root}")
|
|
259
|
+
return matches
|
|
260
|
+
|
|
261
|
+
@classmethod
|
|
262
|
+
def clear_cache(cls):
|
|
263
|
+
"""Clear all cached path lookups.
|
|
264
|
+
|
|
265
|
+
Useful for testing or when the file system structure changes.
|
|
266
|
+
"""
|
|
267
|
+
# Clear all lru_cache instances
|
|
268
|
+
cls.get_framework_root.cache_clear()
|
|
269
|
+
cls.get_agents_dir.cache_clear()
|
|
270
|
+
cls.get_project_root.cache_clear()
|
|
271
|
+
cls.get_config_dir.cache_clear()
|
|
272
|
+
cls.get_claude_pm_dir.cache_clear()
|
|
273
|
+
logger.debug("Cleared all PathResolver caches")
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
# Convenience functions for backward compatibility
|
|
277
|
+
def get_framework_root() -> Path:
|
|
278
|
+
"""Get the framework root directory."""
|
|
279
|
+
return PathResolver.get_framework_root()
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def get_project_root() -> Path:
|
|
283
|
+
"""Get the current project root directory."""
|
|
284
|
+
return PathResolver.get_project_root()
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def find_file_upwards(filename: str, start_path: Optional[Path] = None) -> Optional[Path]:
|
|
288
|
+
"""Search for a file by traversing up the directory tree."""
|
|
289
|
+
return PathResolver.find_file_upwards(filename, start_path)
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claude-mpm
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Claude Multi-agent Project Manager - Clean orchestration with ticket management
|
|
5
|
+
Home-page: https://github.com/bobmatnyc/claude-mpm
|
|
6
|
+
Author: Claude MPM Team
|
|
7
|
+
Author-email: bob@matsuoka.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: claude,orchestration,multi-agent,ticket-management
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: ai-trackdown-pytools>=1.2.0
|
|
22
|
+
Requires-Dist: pyyaml>=6.0
|
|
23
|
+
Requires-Dist: python-dotenv>=0.19.0
|
|
24
|
+
Requires-Dist: rich>=13.0.0
|
|
25
|
+
Requires-Dist: click>=8.0.0
|
|
26
|
+
Requires-Dist: pexpect>=4.8.0
|
|
27
|
+
Requires-Dist: psutil>=5.9.0
|
|
28
|
+
Requires-Dist: requests>=2.25.0
|
|
29
|
+
Requires-Dist: flask>=3.0.0
|
|
30
|
+
Requires-Dist: flask-cors>=4.0.0
|
|
31
|
+
Requires-Dist: watchdog>=3.0.0
|
|
32
|
+
Requires-Dist: tree-sitter>=0.21.0
|
|
33
|
+
Requires-Dist: tree-sitter-language-pack>=0.8.0
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
36
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
38
|
+
Requires-Dist: black; extra == "dev"
|
|
39
|
+
Requires-Dist: flake8; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy; extra == "dev"
|
|
41
|
+
Dynamic: author-email
|
|
42
|
+
Dynamic: home-page
|
|
43
|
+
Dynamic: requires-python
|
|
44
|
+
|
|
45
|
+
# Claude MPM - Multi-Agent Project Manager
|
|
46
|
+
|
|
47
|
+
A framework for Claude that enables multi-agent workflows and extensible capabilities through a modular architecture.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 📚 Documentation
|
|
51
|
+
|
|
52
|
+
- **[User Guide](docs/user/)** - Getting started, usage, and troubleshooting
|
|
53
|
+
- **[Developer Guide](docs/developer/)** - Architecture, API reference, and contributing
|
|
54
|
+
- **[Design Documents](docs/design/)** - Architectural decisions and design patterns
|
|
55
|
+
- **[Differences from claude-multiagent-pm](docs/user/differences-from-claude-multiagent-pm.md)** - Migration guide
|
|
56
|
+
|
|
57
|
+
## Why Claude MPM?
|
|
58
|
+
|
|
59
|
+
Claude MPM provides a modular framework for extending Claude's capabilities:
|
|
60
|
+
|
|
61
|
+
- **🧩 Modular Architecture**: Extensible agent system and hook-based customization
|
|
62
|
+
- **🤖 Multi-Agent Support**: Specialized agents for different tasks
|
|
63
|
+
- **📝 Comprehensive Logging**: Every interaction is logged for review
|
|
64
|
+
- **🛠️ Service-Based Design**: Clean separation of concerns through services
|
|
65
|
+
|
|
66
|
+
## How It Works
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
┌─────────────┐ ┌─────────────────┐ ┌──────────────┐
|
|
70
|
+
│ Terminal │──────▶│ Claude MPM │──────▶│ Services │
|
|
71
|
+
│ (User) │ │ Framework │ │ & Agents │
|
|
72
|
+
└─────────────┘ └─────────────────┘ └──────────────┘
|
|
73
|
+
│
|
|
74
|
+
┌────────┴────────┐
|
|
75
|
+
│ │
|
|
76
|
+
┌─────▼─────┐ ┌─────▼─────┐
|
|
77
|
+
│ Hook │ │ Agent │
|
|
78
|
+
│ System │ │ Registry │
|
|
79
|
+
└───────────┘ └───────────┘
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Overview
|
|
83
|
+
|
|
84
|
+
Claude MPM provides a modular framework for extending Claude's capabilities:
|
|
85
|
+
|
|
86
|
+
- **Agent System**: Specialized agents for different task types
|
|
87
|
+
- **Hook System**: Extensible architecture through pre/post hooks
|
|
88
|
+
- **Service Layer**: Clean separation of business logic
|
|
89
|
+
- **Agent Registry**: Dynamic agent discovery and loading
|
|
90
|
+
- **Session Logging**: Comprehensive logging of all interactions
|
|
91
|
+
|
|
92
|
+
## Key Features
|
|
93
|
+
|
|
94
|
+
### Agent System
|
|
95
|
+
- Specialized agents for different domains (Research, Engineer, etc.)
|
|
96
|
+
- Dynamic agent discovery and registration
|
|
97
|
+
- Template-based agent definitions
|
|
98
|
+
- Extensible agent architecture
|
|
99
|
+
|
|
100
|
+
### Hook System
|
|
101
|
+
- Pre and post-processing hooks
|
|
102
|
+
- Customizable behavior injection
|
|
103
|
+
- Plugin-like extensibility
|
|
104
|
+
- Clean integration points
|
|
105
|
+
|
|
106
|
+
### Service Architecture
|
|
107
|
+
- Modular service components
|
|
108
|
+
- Clean separation of concerns
|
|
109
|
+
- Reusable business logic
|
|
110
|
+
- Well-defined interfaces
|
|
111
|
+
|
|
112
|
+
### Session Management
|
|
113
|
+
- Comprehensive logging of all interactions
|
|
114
|
+
- Debug mode for troubleshooting
|
|
115
|
+
- Organized log structure
|
|
116
|
+
- Performance monitoring
|
|
117
|
+
|
|
118
|
+
## Installation
|
|
119
|
+
|
|
120
|
+
### From Source
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Clone the repository
|
|
124
|
+
git clone https://github.com/yourusername/claude-mpm.git
|
|
125
|
+
cd claude-mpm
|
|
126
|
+
|
|
127
|
+
# Run development installation script
|
|
128
|
+
./install_dev.sh
|
|
129
|
+
|
|
130
|
+
# Activate virtual environment
|
|
131
|
+
source venv/bin/activate
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Dependencies
|
|
135
|
+
|
|
136
|
+
#### Core Requirements
|
|
137
|
+
- Python 3.8+
|
|
138
|
+
- Claude CLI (must be installed and in PATH)
|
|
139
|
+
|
|
140
|
+
#### Automatically Installed
|
|
141
|
+
- tree-sitter & language packs (for code analysis)
|
|
142
|
+
- All other Python dependencies
|
|
143
|
+
|
|
144
|
+
#### Code Analysis Dependencies
|
|
145
|
+
- **tree-sitter** (>=0.21.0) - Core parsing library for advanced code analysis
|
|
146
|
+
- **tree-sitter-language-pack** (>=0.20.0) - Multi-language support package providing parsers for 41+ programming languages
|
|
147
|
+
|
|
148
|
+
These tree-sitter dependencies enable:
|
|
149
|
+
- **Advanced Code Analysis**: The TreeSitterAnalyzer component provides syntax-aware code parsing for Research Agent operations
|
|
150
|
+
- **Agent Modification Tracking**: Real-time analysis of agent code changes with AST-level understanding
|
|
151
|
+
- **Multi-Language Support**: Out-of-the-box support for Python, JavaScript, TypeScript, Go, Rust, Java, C/C++, and 35+ other languages
|
|
152
|
+
- **Performance**: Fast, incremental parsing suitable for real-time analysis during agent operations
|
|
153
|
+
|
|
154
|
+
## Usage
|
|
155
|
+
|
|
156
|
+
### Basic Usage
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Run interactive session
|
|
160
|
+
claude-mpm
|
|
161
|
+
|
|
162
|
+
# Run with debug logging
|
|
163
|
+
claude-mpm --debug
|
|
164
|
+
|
|
165
|
+
# Show configuration info
|
|
166
|
+
claude-mpm info
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Command Line Options
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
claude-mpm [-h] [-d] [--log-dir LOG_DIR] {run,info}
|
|
174
|
+
|
|
175
|
+
Options:
|
|
176
|
+
-d, --debug Enable debug logging
|
|
177
|
+
--log-dir LOG_DIR Custom log directory (default: ~/.claude-mpm/logs)
|
|
178
|
+
|
|
179
|
+
Commands:
|
|
180
|
+
run Run Claude session (default)
|
|
181
|
+
info Show framework and configuration info
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Quick Start
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# 1. Clone and install
|
|
188
|
+
git clone https://github.com/yourusername/claude-mpm.git
|
|
189
|
+
cd claude-mpm
|
|
190
|
+
./install_dev.sh
|
|
191
|
+
source venv/bin/activate
|
|
192
|
+
|
|
193
|
+
# 2. Run interactive session
|
|
194
|
+
claude-mpm
|
|
195
|
+
|
|
196
|
+
# 3. Or run a single command
|
|
197
|
+
claude-mpm run -i "Explain the codebase structure" --non-interactive
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
## Architecture
|
|
202
|
+
|
|
203
|
+
### Core Components
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
claude-mpm/
|
|
207
|
+
├── src/claude_mpm/
|
|
208
|
+
│ ├── agents/ # Agent templates
|
|
209
|
+
│ ├── core/ # Core functionality
|
|
210
|
+
│ │ ├── agent_registry.py # Agent discovery
|
|
211
|
+
│ │ └── simple_runner.py # Main runner
|
|
212
|
+
│ ├── services/ # Business logic
|
|
213
|
+
│ │ ├── hook_service.py
|
|
214
|
+
│ │ └── agent_deployment.py
|
|
215
|
+
│ ├── hooks/ # Hook system
|
|
216
|
+
│ └── cli/ # CLI interface
|
|
217
|
+
└── docs/ # Organized documentation
|
|
218
|
+
├── user/ # User guides
|
|
219
|
+
├── developer/ # Developer docs
|
|
220
|
+
└── design/ # Architecture docs
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Testing
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Run all tests
|
|
227
|
+
./scripts/run_all_tests.sh
|
|
228
|
+
|
|
229
|
+
# Run E2E tests
|
|
230
|
+
./scripts/run_e2e_tests.sh
|
|
231
|
+
|
|
232
|
+
# Run specific test
|
|
233
|
+
pytest tests/test_orchestrator.py -v
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Logging
|
|
237
|
+
|
|
238
|
+
Logs are stored in `~/.claude-mpm/logs/` by default:
|
|
239
|
+
|
|
240
|
+
- `mpm_YYYYMMDD_HHMMSS.log` - Detailed debug logs
|
|
241
|
+
- `latest.log` - Symlink to most recent log
|
|
242
|
+
- Session logs in `~/.claude-mpm/sessions/`
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
## Development
|
|
246
|
+
|
|
247
|
+
For detailed development information, see the [Developer Documentation](docs/developer/).
|
|
248
|
+
|
|
249
|
+
### Quick Start
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Install development dependencies
|
|
253
|
+
pip install -e ".[dev]"
|
|
254
|
+
|
|
255
|
+
# Run tests
|
|
256
|
+
python run_tests.py
|
|
257
|
+
|
|
258
|
+
# Test agent integration
|
|
259
|
+
python examples/test_agent_integration.py
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Key Resources
|
|
263
|
+
|
|
264
|
+
- [Architecture Overview](docs/developer/README.md#architecture-overview)
|
|
265
|
+
- [Project Structure](docs/developer/STRUCTURE.md)
|
|
266
|
+
- [Testing Guide](docs/developer/QA.md)
|
|
267
|
+
- [API Reference](docs/developer/README.md#api-reference)
|
|
268
|
+
- [Contributing Guide](docs/developer/README.md#contributing)
|
|
269
|
+
|
|
270
|
+
## Troubleshooting
|
|
271
|
+
|
|
272
|
+
For detailed troubleshooting, see the [User Guide](docs/user/README.md#troubleshooting).
|
|
273
|
+
|
|
274
|
+
### Quick Fixes
|
|
275
|
+
|
|
276
|
+
**Claude not found**
|
|
277
|
+
```bash
|
|
278
|
+
which claude # Check if Claude is in PATH
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
**Debug mode**
|
|
283
|
+
```bash
|
|
284
|
+
claude-mpm --debug # Enable debug logging
|
|
285
|
+
tail -f ~/.claude-mpm/logs/latest.log # View logs
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## License
|
|
289
|
+
|
|
290
|
+
MIT License - See LICENSE file for details
|