claude-mpm 4.3.20__py3-none-any.whl → 4.4.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.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/agent_loader.py +2 -2
- claude_mpm/agents/agent_loader_integration.py +2 -2
- claude_mpm/agents/async_agent_loader.py +2 -2
- claude_mpm/agents/base_agent_loader.py +2 -2
- claude_mpm/agents/frontmatter_validator.py +2 -2
- claude_mpm/agents/system_agent_config.py +2 -2
- claude_mpm/agents/templates/data_engineer.json +1 -2
- claude_mpm/cli/commands/doctor.py +2 -2
- claude_mpm/cli/commands/mpm_init.py +560 -47
- claude_mpm/cli/commands/mpm_init_handler.py +6 -0
- claude_mpm/cli/parsers/mpm_init_parser.py +39 -1
- claude_mpm/cli/startup_logging.py +11 -9
- claude_mpm/commands/mpm-init.md +76 -12
- claude_mpm/config/agent_config.py +2 -2
- claude_mpm/config/paths.py +2 -2
- claude_mpm/core/agent_name_normalizer.py +2 -2
- claude_mpm/core/config.py +2 -1
- claude_mpm/core/config_aliases.py +2 -2
- claude_mpm/core/file_utils.py +1 -0
- claude_mpm/core/log_manager.py +2 -2
- claude_mpm/core/tool_access_control.py +2 -2
- claude_mpm/core/unified_agent_registry.py +2 -2
- claude_mpm/core/unified_paths.py +2 -2
- claude_mpm/experimental/cli_enhancements.py +3 -2
- claude_mpm/hooks/base_hook.py +2 -2
- claude_mpm/hooks/instruction_reinforcement.py +2 -2
- claude_mpm/hooks/memory_integration_hook.py +1 -1
- claude_mpm/hooks/validation_hooks.py +2 -2
- claude_mpm/scripts/mpm_doctor.py +2 -2
- claude_mpm/services/agents/loading/agent_profile_loader.py +2 -2
- claude_mpm/services/agents/loading/base_agent_manager.py +2 -2
- claude_mpm/services/agents/loading/framework_agent_loader.py +2 -2
- claude_mpm/services/agents/management/agent_capabilities_generator.py +2 -2
- claude_mpm/services/agents/management/agent_management_service.py +2 -2
- claude_mpm/services/agents/memory/content_manager.py +5 -2
- claude_mpm/services/agents/memory/memory_categorization_service.py +5 -2
- claude_mpm/services/agents/memory/memory_file_service.py +28 -6
- claude_mpm/services/agents/memory/memory_format_service.py +5 -2
- claude_mpm/services/agents/memory/memory_limits_service.py +4 -2
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +2 -2
- claude_mpm/services/agents/registry/modification_tracker.py +4 -4
- claude_mpm/services/async_session_logger.py +2 -1
- claude_mpm/services/claude_session_logger.py +2 -2
- claude_mpm/services/core/path_resolver.py +3 -2
- claude_mpm/services/diagnostics/diagnostic_runner.py +4 -3
- claude_mpm/services/event_bus/direct_relay.py +2 -1
- claude_mpm/services/event_bus/event_bus.py +2 -1
- claude_mpm/services/event_bus/relay.py +2 -2
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +2 -2
- claude_mpm/services/infrastructure/daemon_manager.py +2 -2
- claude_mpm/services/memory/cache/simple_cache.py +2 -2
- claude_mpm/services/project/archive_manager.py +981 -0
- claude_mpm/services/project/documentation_manager.py +536 -0
- claude_mpm/services/project/enhanced_analyzer.py +491 -0
- claude_mpm/services/project/project_organizer.py +904 -0
- claude_mpm/services/response_tracker.py +2 -2
- claude_mpm/services/socketio/handlers/connection.py +14 -33
- claude_mpm/services/socketio/server/eventbus_integration.py +2 -2
- claude_mpm/services/unified/__init__.py +65 -0
- claude_mpm/services/unified/analyzer_strategies/__init__.py +44 -0
- claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +473 -0
- claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +643 -0
- claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +804 -0
- claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +661 -0
- claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +696 -0
- claude_mpm/services/unified/deployment_strategies/__init__.py +97 -0
- claude_mpm/services/unified/deployment_strategies/base.py +557 -0
- claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +486 -0
- claude_mpm/services/unified/deployment_strategies/local.py +594 -0
- claude_mpm/services/unified/deployment_strategies/utils.py +672 -0
- claude_mpm/services/unified/deployment_strategies/vercel.py +471 -0
- claude_mpm/services/unified/interfaces.py +499 -0
- claude_mpm/services/unified/migration.py +532 -0
- claude_mpm/services/unified/strategies.py +551 -0
- claude_mpm/services/unified/unified_analyzer.py +534 -0
- claude_mpm/services/unified/unified_config.py +688 -0
- claude_mpm/services/unified/unified_deployment.py +470 -0
- claude_mpm/services/version_control/version_parser.py +5 -4
- claude_mpm/storage/state_storage.py +2 -2
- claude_mpm/utils/agent_dependency_loader.py +49 -0
- claude_mpm/utils/common.py +542 -0
- claude_mpm/utils/database_connector.py +298 -0
- claude_mpm/utils/error_handler.py +2 -1
- claude_mpm/utils/log_cleanup.py +2 -2
- claude_mpm/utils/path_operations.py +2 -2
- claude_mpm/utils/robust_installer.py +56 -0
- claude_mpm/utils/session_logging.py +2 -2
- claude_mpm/utils/subprocess_utils.py +2 -2
- claude_mpm/validation/agent_validator.py +2 -2
- {claude_mpm-4.3.20.dist-info → claude_mpm-4.4.0.dist-info}/METADATA +1 -1
- {claude_mpm-4.3.20.dist-info → claude_mpm-4.4.0.dist-info}/RECORD +96 -71
- {claude_mpm-4.3.20.dist-info → claude_mpm-4.4.0.dist-info}/WHEEL +0 -0
- {claude_mpm-4.3.20.dist-info → claude_mpm-4.4.0.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.3.20.dist-info → claude_mpm-4.4.0.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.3.20.dist-info → claude_mpm-4.4.0.dist-info}/top_level.txt +0 -0
@@ -57,6 +57,12 @@ def manage_mpm_init(args): # noqa: PLR0911
|
|
57
57
|
"verbose": getattr(args, "verbose", False),
|
58
58
|
"use_venv": getattr(args, "use_venv", False),
|
59
59
|
"ast_analysis": getattr(args, "ast_analysis", True),
|
60
|
+
"update_mode": getattr(args, "update", False),
|
61
|
+
"review_only": getattr(args, "review", False),
|
62
|
+
"organize_files": getattr(args, "organize", False),
|
63
|
+
"preserve_custom": getattr(args, "preserve_custom", True),
|
64
|
+
"skip_archive": getattr(args, "skip_archive", False),
|
65
|
+
"dry_run": getattr(args, "dry_run", False),
|
60
66
|
}
|
61
67
|
|
62
68
|
# Execute initialization (now synchronous)
|
@@ -30,7 +30,10 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
|
|
30
30
|
),
|
31
31
|
epilog=(
|
32
32
|
"Examples:\n"
|
33
|
-
" claude-mpm mpm-init # Initialize current directory\n"
|
33
|
+
" claude-mpm mpm-init # Initialize/update current directory\n"
|
34
|
+
" claude-mpm mpm-init --review # Review project state without changes\n"
|
35
|
+
" claude-mpm mpm-init --update # Update existing CLAUDE.md\n"
|
36
|
+
" claude-mpm mpm-init --organize # Organize project structure\n"
|
34
37
|
" claude-mpm mpm-init --project-type web # Initialize as web project\n"
|
35
38
|
" claude-mpm mpm-init --framework react # Initialize with React framework\n"
|
36
39
|
" claude-mpm mpm-init /path/to/project --force # Force reinitialize project"
|
@@ -73,6 +76,16 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
|
|
73
76
|
action="store_true",
|
74
77
|
help="Force reinitialization even if project is already configured",
|
75
78
|
)
|
79
|
+
init_group.add_argument(
|
80
|
+
"--update",
|
81
|
+
action="store_true",
|
82
|
+
help="Update existing CLAUDE.md instead of recreating (smart merge)",
|
83
|
+
)
|
84
|
+
init_group.add_argument(
|
85
|
+
"--review",
|
86
|
+
action="store_true",
|
87
|
+
help="Review project state without making changes (analysis only)",
|
88
|
+
)
|
76
89
|
init_group.add_argument(
|
77
90
|
"--minimal",
|
78
91
|
action="store_true",
|
@@ -113,6 +126,31 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
|
|
113
126
|
"--list-templates", action="store_true", help="List available project templates"
|
114
127
|
)
|
115
128
|
|
129
|
+
# Project organization options
|
130
|
+
org_group = mpm_init_parser.add_argument_group("organization options")
|
131
|
+
org_group.add_argument(
|
132
|
+
"--organize",
|
133
|
+
action="store_true",
|
134
|
+
help="Organize misplaced files into proper directories",
|
135
|
+
)
|
136
|
+
org_group.add_argument(
|
137
|
+
"--preserve-custom/--no-preserve-custom",
|
138
|
+
default=True,
|
139
|
+
dest="preserve_custom",
|
140
|
+
help="Preserve custom sections when updating (default: preserve)",
|
141
|
+
)
|
142
|
+
org_group.add_argument(
|
143
|
+
"--skip-archive",
|
144
|
+
action="store_true",
|
145
|
+
help="Skip archiving existing files before updating",
|
146
|
+
)
|
147
|
+
org_group.add_argument(
|
148
|
+
"--archive-dir",
|
149
|
+
type=str,
|
150
|
+
default="docs/_archive",
|
151
|
+
help="Directory for archiving old documentation (default: docs/_archive)",
|
152
|
+
)
|
153
|
+
|
116
154
|
# Output options
|
117
155
|
output_group = mpm_init_parser.add_argument_group("output options")
|
118
156
|
output_group.add_argument(
|
@@ -685,11 +685,15 @@ async def trigger_vector_search_indexing(project_root: Optional[Path] = None) ->
|
|
685
685
|
cwd=str(project_root),
|
686
686
|
)
|
687
687
|
|
688
|
-
#
|
688
|
+
# Store PID for logging
|
689
|
+
pid = process.pid
|
689
690
|
logger.debug(
|
690
|
-
f"MCP Vector Search: Indexing process started (PID: {
|
691
|
+
f"MCP Vector Search: Indexing process started (PID: {pid})"
|
691
692
|
)
|
692
693
|
|
694
|
+
# Don't wait for completion - let it run independently in the background
|
695
|
+
# We don't need to track its completion, so we can safely detach
|
696
|
+
|
693
697
|
except ImportError:
|
694
698
|
logger.debug(
|
695
699
|
"MCP config manager not available, skipping vector search indexing"
|
@@ -718,13 +722,11 @@ def start_vector_search_indexing(project_root: Optional[Path] = None) -> None:
|
|
718
722
|
# Store reference to avoid RUF006 warning
|
719
723
|
_ = loop.create_task(trigger_vector_search_indexing(project_root))
|
720
724
|
except RuntimeError:
|
721
|
-
# No event loop running
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
logger.debug(f"Async indexing failed, trying subprocess: {e}")
|
727
|
-
_start_vector_search_subprocess(project_root)
|
725
|
+
# No event loop running - use subprocess directly to avoid event loop lifecycle issues
|
726
|
+
# The async approach with asyncio.run() creates and closes a loop which causes
|
727
|
+
# warnings when subprocesses are still running
|
728
|
+
logger.debug("No event loop running, using subprocess approach")
|
729
|
+
_start_vector_search_subprocess(project_root)
|
728
730
|
|
729
731
|
|
730
732
|
def _start_vector_search_subprocess(project_root: Optional[Path] = None) -> None:
|
claude_mpm/commands/mpm-init.md
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
# /mpm-init
|
2
2
|
|
3
|
-
Initialize your project for optimal use with Claude Code and Claude MPM using the Agentic Coder Optimizer agent.
|
3
|
+
Initialize or intelligently update your project for optimal use with Claude Code and Claude MPM using the Agentic Coder Optimizer agent.
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
7
|
```
|
8
|
-
/mpm-init
|
8
|
+
/mpm-init # Auto-detects and offers update or create
|
9
|
+
/mpm-init --review # Review project state without changes
|
10
|
+
/mpm-init --update # Update existing CLAUDE.md
|
11
|
+
/mpm-init --organize # Organize project structure
|
12
|
+
/mpm-init --force # Force recreate from scratch
|
9
13
|
/mpm-init --project-type web --framework react
|
10
|
-
/mpm-init --
|
11
|
-
/mpm-init --ast-analysis
|
12
|
-
/mpm-init --comprehensive
|
14
|
+
/mpm-init --ast-analysis --comprehensive
|
13
15
|
```
|
14
16
|
|
15
17
|
## Description
|
16
18
|
|
17
|
-
This command delegates to the Agentic Coder Optimizer agent to establish clear, single-path project standards for documentation, tooling, and workflows.
|
19
|
+
This command delegates to the Agentic Coder Optimizer agent to establish clear, single-path project standards for documentation, tooling, and workflows.
|
20
|
+
|
21
|
+
**Smart Update Mode**: When CLAUDE.md exists, the command automatically offers to update rather than recreate, preserving your custom content while refreshing standard sections. Previous versions are archived in `docs/_archive/` for safety.
|
18
22
|
|
19
23
|
## Features
|
20
24
|
|
@@ -28,16 +32,37 @@ This command delegates to the Agentic Coder Optimizer agent to establish clear,
|
|
28
32
|
|
29
33
|
## Options
|
30
34
|
|
35
|
+
### Mode Options
|
36
|
+
- `--review`: Review project state without making changes
|
37
|
+
- `--update`: Update existing CLAUDE.md instead of recreating
|
38
|
+
- `--force`: Force reinitialization even if project is already configured
|
39
|
+
|
40
|
+
### Configuration Options
|
31
41
|
- `--project-type [type]`: Specify project type (web, api, cli, library, etc.)
|
32
42
|
- `--framework [name]`: Specify framework (react, vue, django, fastapi, etc.)
|
33
|
-
- `--force`: Force reinitialization even if project is already configured
|
34
43
|
- `--ast-analysis`: Enable AST analysis for enhanced documentation (default: enabled)
|
35
44
|
- `--no-ast-analysis`: Disable AST analysis for faster initialization
|
36
45
|
- `--comprehensive`: Create comprehensive setup including CI/CD and deployment
|
37
46
|
- `--minimal`: Create minimal configuration (CLAUDE.md only)
|
38
47
|
|
48
|
+
### Organization Options
|
49
|
+
- `--organize`: Organize misplaced files into proper directories
|
50
|
+
- `--preserve-custom`: Preserve custom sections when updating (default)
|
51
|
+
- `--no-preserve-custom`: Don't preserve custom sections
|
52
|
+
- `--skip-archive`: Skip archiving existing files before updating
|
53
|
+
|
39
54
|
## What This Command Does
|
40
55
|
|
56
|
+
### Auto-Detection (NEW)
|
57
|
+
When run without flags and CLAUDE.md exists:
|
58
|
+
1. Analyzes existing documentation
|
59
|
+
2. Shows current status (size, sections, priority markers)
|
60
|
+
3. Offers options:
|
61
|
+
- Update (smart merge)
|
62
|
+
- Recreate (fresh start)
|
63
|
+
- Review (analysis only)
|
64
|
+
- Cancel
|
65
|
+
|
41
66
|
### 1. Project Analysis
|
42
67
|
- Scans project structure and existing configurations
|
43
68
|
- Identifies project type, language, and frameworks
|
@@ -94,13 +119,39 @@ After all tasks, performs a comprehensive review:
|
|
94
119
|
- Ensures single-path principle
|
95
120
|
- Adds meta-instructions for maintenance
|
96
121
|
|
122
|
+
### 8. Update Mode Features (NEW)
|
123
|
+
When updating existing documentation:
|
124
|
+
- **Smart Merging**: Intelligently merges new content with existing
|
125
|
+
- **Custom Preservation**: Keeps your project-specific sections
|
126
|
+
- **Automatic Archival**: Backs up previous version to `docs/_archive/`
|
127
|
+
- **Conflict Resolution**: Removes duplicate or contradictory information
|
128
|
+
- **Change Tracking**: Shows what was updated after completion
|
129
|
+
|
97
130
|
## Examples
|
98
131
|
|
99
|
-
###
|
132
|
+
### Smart Auto-Detection (Recommended)
|
100
133
|
```bash
|
101
134
|
/mpm-init
|
102
135
|
```
|
103
|
-
Analyzes
|
136
|
+
Analyzes project and offers appropriate action (create/update/review).
|
137
|
+
|
138
|
+
### Review Project State
|
139
|
+
```bash
|
140
|
+
/mpm-init --review
|
141
|
+
```
|
142
|
+
Analyzes project structure, documentation, and git history without changes.
|
143
|
+
|
144
|
+
### Update Existing Documentation
|
145
|
+
```bash
|
146
|
+
/mpm-init --update
|
147
|
+
```
|
148
|
+
Updates CLAUDE.md while preserving custom sections.
|
149
|
+
|
150
|
+
### Organize Project Structure
|
151
|
+
```bash
|
152
|
+
/mpm-init --organize --update
|
153
|
+
```
|
154
|
+
Organizes misplaced files AND updates documentation.
|
104
155
|
|
105
156
|
### Web Project with React
|
106
157
|
```bash
|
@@ -108,11 +159,11 @@ Analyzes current directory and creates optimal setup.
|
|
108
159
|
```
|
109
160
|
Initializes with web-specific configurations and React patterns.
|
110
161
|
|
111
|
-
### Force
|
162
|
+
### Force Fresh Start
|
112
163
|
```bash
|
113
164
|
/mpm-init --force --comprehensive
|
114
165
|
```
|
115
|
-
Overwrites
|
166
|
+
Overwrites everything with comprehensive setup.
|
116
167
|
|
117
168
|
### Fast Mode (No AST)
|
118
169
|
```bash
|
@@ -138,16 +189,29 @@ The command delegates to the Agentic Coder Optimizer agent which:
|
|
138
189
|
|
139
190
|
## Expected Output
|
140
191
|
|
141
|
-
|
192
|
+
### For New Projects
|
142
193
|
- ✅ **CLAUDE.md**: Main AI agent documentation with priority rankings
|
194
|
+
- ✅ **Project structure**: Standard directories created (tmp/, scripts/, docs/)
|
143
195
|
- ✅ **Single-path workflows**: Clear commands for all operations
|
144
196
|
- ✅ **Tool configurations**: Linting, formatting, testing setup
|
145
197
|
- ✅ **Memory system**: Initialized for knowledge retention
|
146
198
|
- ✅ **Developer docs**: Technical documentation (with AST analysis)
|
147
199
|
- ✅ **Priority organization**: Instructions ranked by importance
|
148
200
|
|
201
|
+
### For Existing Projects (Update Mode)
|
202
|
+
- ✅ **Updated CLAUDE.md**: Refreshed with latest standards
|
203
|
+
- ✅ **Preserved content**: Your custom sections maintained
|
204
|
+
- ✅ **Archive created**: Previous version in `docs/_archive/`
|
205
|
+
- ✅ **Structure verified**: Missing directories created
|
206
|
+
- ✅ **Files organized**: Misplaced files moved (if --organize)
|
207
|
+
- ✅ **Change summary**: Report of what was updated
|
208
|
+
|
149
209
|
## Notes
|
150
210
|
|
211
|
+
- **Smart Mode**: Automatically detects existing CLAUDE.md and offers update vs recreate
|
212
|
+
- **Safe Updates**: Previous versions always archived before updating
|
213
|
+
- **Custom Content**: Your project-specific sections are preserved by default
|
214
|
+
- **Git Integration**: Analyzes recent commits to understand project evolution
|
151
215
|
- The command uses the Agentic Coder Optimizer agent for implementation
|
152
216
|
- AST analysis is enabled by default for comprehensive documentation
|
153
217
|
- Priority rankings help AI agents focus on critical instructions first
|
@@ -14,7 +14,6 @@ This module handles:
|
|
14
14
|
UPDATED: Migrated to use shared ConfigLoader pattern (TSK-0141)
|
15
15
|
"""
|
16
16
|
|
17
|
-
import logging
|
18
17
|
import os
|
19
18
|
from dataclasses import dataclass, field
|
20
19
|
from enum import Enum
|
@@ -24,7 +23,8 @@ from typing import Any, Dict, List, Optional
|
|
24
23
|
from claude_mpm.core.shared.config_loader import ConfigLoader, ConfigPattern
|
25
24
|
from claude_mpm.core.unified_paths import get_path_manager
|
26
25
|
|
27
|
-
|
26
|
+
from claude_mpm.core.logging_utils import get_logger
|
27
|
+
logger = get_logger(__name__)
|
28
28
|
|
29
29
|
|
30
30
|
class AgentPrecedenceMode(Enum):
|
claude_mpm/config/paths.py
CHANGED
@@ -8,14 +8,14 @@ This module provides a consistent, reliable way to access project paths
|
|
8
8
|
without fragile parent.parent.parent patterns.
|
9
9
|
"""
|
10
10
|
|
11
|
-
import logging
|
12
11
|
from pathlib import Path
|
13
12
|
from typing import Optional, Union
|
14
13
|
|
15
14
|
# Import from the unified path management system
|
16
15
|
from ..core.unified_paths import get_path_manager
|
17
16
|
|
18
|
-
|
17
|
+
from claude_mpm.core.logging_utils import get_logger
|
18
|
+
logger = get_logger(__name__)
|
19
19
|
|
20
20
|
|
21
21
|
class ClaudeMPMPaths:
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"""Agent name normalization utilities for consistent naming across the system."""
|
2
2
|
|
3
|
-
import logging
|
4
3
|
from typing import Optional
|
5
4
|
|
6
|
-
|
5
|
+
from claude_mpm.core.logging_utils import get_logger
|
6
|
+
logger = get_logger(__name__)
|
7
7
|
|
8
8
|
|
9
9
|
class AgentNameNormalizer:
|
claude_mpm/core/config.py
CHANGED
@@ -18,7 +18,8 @@ from ..utils.config_manager import ConfigurationManager
|
|
18
18
|
from .exceptions import ConfigurationError, FileOperationError
|
19
19
|
from .unified_paths import get_path_manager
|
20
20
|
|
21
|
-
|
21
|
+
from claude_mpm.core.logging_utils import get_logger
|
22
|
+
logger = get_logger(__name__)
|
22
23
|
|
23
24
|
|
24
25
|
class Config:
|
@@ -14,13 +14,13 @@ Aliases are stored in ~/.claude-mpm/config_aliases.json
|
|
14
14
|
"""
|
15
15
|
|
16
16
|
import json
|
17
|
-
import logging
|
18
17
|
from typing import Dict, List, Optional, Tuple
|
19
18
|
|
20
19
|
from ..utils.config_manager import ConfigurationManager
|
21
20
|
from .unified_paths import get_path_manager
|
22
21
|
|
23
|
-
|
22
|
+
from claude_mpm.core.logging_utils import get_logger
|
23
|
+
logger = get_logger(__name__)
|
24
24
|
|
25
25
|
|
26
26
|
class ConfigAliasError(Exception):
|
claude_mpm/core/file_utils.py
CHANGED
@@ -22,6 +22,7 @@ from claude_mpm.core.logging_utils import get_logger
|
|
22
22
|
logger = get_logger(__name__)
|
23
23
|
|
24
24
|
|
25
|
+
|
25
26
|
# ==============================================================================
|
26
27
|
# PATH UTILITIES
|
27
28
|
# ==============================================================================
|
claude_mpm/core/log_manager.py
CHANGED
@@ -16,7 +16,6 @@ DESIGN DECISIONS:
|
|
16
16
|
|
17
17
|
import asyncio
|
18
18
|
import json
|
19
|
-
import logging
|
20
19
|
import os
|
21
20
|
from datetime import datetime, timedelta, timezone
|
22
21
|
from pathlib import Path
|
@@ -27,7 +26,8 @@ from typing import Any, Dict, Optional
|
|
27
26
|
from ..core.config import Config
|
28
27
|
from ..core.constants import SystemLimits
|
29
28
|
|
30
|
-
|
29
|
+
from claude_mpm.core.logging_utils import get_logger
|
30
|
+
logger = get_logger(__name__)
|
31
31
|
|
32
32
|
# Import cleanup utility for automatic cleanup
|
33
33
|
try:
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"""Tool access control system for managing which tools agents can use."""
|
2
2
|
|
3
|
-
import logging
|
4
3
|
from typing import Dict, List, Set
|
5
4
|
|
6
|
-
|
5
|
+
from claude_mpm.core.logging_utils import get_logger
|
6
|
+
logger = get_logger(__name__)
|
7
7
|
|
8
8
|
|
9
9
|
class ToolAccessControl:
|
@@ -27,7 +27,6 @@ Architecture:
|
|
27
27
|
|
28
28
|
import contextlib
|
29
29
|
import json
|
30
|
-
import logging
|
31
30
|
import time
|
32
31
|
from dataclasses import asdict, dataclass
|
33
32
|
from datetime import datetime, timezone
|
@@ -37,7 +36,8 @@ from typing import Any, Dict, List, Optional, Set, Union
|
|
37
36
|
|
38
37
|
from .unified_paths import get_path_manager
|
39
38
|
|
40
|
-
|
39
|
+
from claude_mpm.core.logging_utils import get_logger
|
40
|
+
logger = get_logger(__name__)
|
41
41
|
|
42
42
|
|
43
43
|
class AgentTier(Enum):
|
claude_mpm/core/unified_paths.py
CHANGED
@@ -24,7 +24,6 @@ Architecture:
|
|
24
24
|
- Cached properties with smart invalidation
|
25
25
|
"""
|
26
26
|
|
27
|
-
import logging
|
28
27
|
import os
|
29
28
|
import sys
|
30
29
|
from enum import Enum
|
@@ -32,7 +31,8 @@ from functools import lru_cache
|
|
32
31
|
from pathlib import Path
|
33
32
|
from typing import Optional, Union
|
34
33
|
|
35
|
-
|
34
|
+
from claude_mpm.core.logging_utils import get_logger
|
35
|
+
logger = get_logger(__name__)
|
36
36
|
|
37
37
|
|
38
38
|
class PathType(Enum):
|
@@ -25,11 +25,11 @@ integrate selected features into the main CLI.
|
|
25
25
|
Implements error handling and user guidance patterns from awesome-claude-code.
|
26
26
|
"""
|
27
27
|
|
28
|
-
import logging
|
29
28
|
import sys
|
30
29
|
|
31
30
|
import click
|
32
31
|
|
32
|
+
from claude_mpm.core.logging_utils import get_logger
|
33
33
|
from claude_mpm.hooks.validation_hooks import ValidationHooks
|
34
34
|
from claude_mpm.utils.error_handler import (
|
35
35
|
ErrorContext,
|
@@ -38,7 +38,7 @@ from claude_mpm.utils.error_handler import (
|
|
38
38
|
)
|
39
39
|
from claude_mpm.validation import AgentValidator, ValidationResult
|
40
40
|
|
41
|
-
logger =
|
41
|
+
logger = get_logger(__name__)
|
42
42
|
|
43
43
|
|
44
44
|
class CLIContext:
|
@@ -53,6 +53,7 @@ class CLIContext:
|
|
53
53
|
|
54
54
|
def setup_logging(self, debug: bool = False) -> None:
|
55
55
|
"""Setup logging based on debug flag."""
|
56
|
+
import logging
|
56
57
|
level = logging.DEBUG if debug else logging.INFO
|
57
58
|
format_str = (
|
58
59
|
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
claude_mpm/hooks/base_hook.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
"""Base hook class and types for claude-mpm hook system."""
|
2
2
|
|
3
3
|
import asyncio
|
4
|
-
import logging
|
5
4
|
from abc import ABC, abstractmethod
|
6
5
|
from dataclasses import dataclass
|
7
6
|
from datetime import datetime, timezone
|
8
7
|
from enum import Enum
|
9
8
|
from typing import Any, Dict, Optional
|
10
9
|
|
11
|
-
|
10
|
+
from claude_mpm.core.logging_utils import get_logger
|
11
|
+
logger = get_logger(__name__)
|
12
12
|
|
13
13
|
|
14
14
|
class HookType(Enum):
|
@@ -5,13 +5,13 @@ This hook monitors PM behavior for delegation violations and provides
|
|
5
5
|
escalating warnings when the PM attempts to implement instead of delegate.
|
6
6
|
"""
|
7
7
|
|
8
|
-
import logging
|
9
8
|
import re
|
10
9
|
from dataclasses import dataclass
|
11
10
|
from enum import Enum
|
12
11
|
from typing import Dict, List, Optional, Tuple
|
13
12
|
|
14
|
-
|
13
|
+
from claude_mpm.core.logging_utils import get_logger
|
14
|
+
logger = get_logger(__name__)
|
15
15
|
|
16
16
|
|
17
17
|
class ViolationType(Enum):
|
@@ -16,7 +16,7 @@ import re
|
|
16
16
|
from typing import Dict, List
|
17
17
|
|
18
18
|
from claude_mpm.core.config import Config
|
19
|
-
from claude_mpm.core.
|
19
|
+
from claude_mpm.core.logging_utils import get_logger
|
20
20
|
from claude_mpm.core.shared.config_loader import ConfigLoader
|
21
21
|
from claude_mpm.hooks.base_hook import (
|
22
22
|
HookContext,
|
@@ -6,14 +6,14 @@ Validation hooks for claude-mpm operations.
|
|
6
6
|
Inspired by awesome-claude-code's pre-push validation approach.
|
7
7
|
"""
|
8
8
|
|
9
|
-
import logging
|
10
9
|
from typing import Any, Callable, Dict, List, Optional
|
11
10
|
|
12
11
|
import yaml
|
13
12
|
|
14
13
|
from claude_mpm.validation import AgentValidator, ValidationResult
|
15
14
|
|
16
|
-
|
15
|
+
from claude_mpm.core.logging_utils import get_logger
|
16
|
+
logger = get_logger(__name__)
|
17
17
|
|
18
18
|
|
19
19
|
class ValidationHooks:
|
claude_mpm/scripts/mpm_doctor.py
CHANGED
@@ -14,7 +14,6 @@ DESIGN DECISIONS:
|
|
14
14
|
"""
|
15
15
|
|
16
16
|
import argparse
|
17
|
-
import logging
|
18
17
|
import sys
|
19
18
|
from pathlib import Path
|
20
19
|
from typing import Any, Dict, List, Optional
|
@@ -52,7 +51,8 @@ def run_diagnostics(
|
|
52
51
|
- warning_count: int - number of warnings found
|
53
52
|
- message: str - optional error message if failed
|
54
53
|
"""
|
55
|
-
|
54
|
+
from claude_mpm.core.logging_utils import get_logger
|
55
|
+
logger = get_logger(__name__)
|
56
56
|
|
57
57
|
# Create diagnostic runner
|
58
58
|
runner = DiagnosticRunner(verbose=verbose, fix=fix)
|
@@ -21,7 +21,6 @@ multi-file implementation for better maintainability.
|
|
21
21
|
|
22
22
|
import asyncio
|
23
23
|
import json
|
24
|
-
import logging
|
25
24
|
import os
|
26
25
|
from dataclasses import dataclass, field
|
27
26
|
from datetime import datetime, timezone
|
@@ -37,7 +36,8 @@ from claude_mpm.core.unified_paths import get_path_manager
|
|
37
36
|
from claude_mpm.services.agents.registry import AgentRegistry
|
38
37
|
from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
|
39
38
|
|
40
|
-
|
39
|
+
from claude_mpm.core.logging_utils import get_logger
|
40
|
+
logger = get_logger(__name__)
|
41
41
|
|
42
42
|
# ============================================================================
|
43
43
|
# Data Models
|
@@ -7,7 +7,6 @@ Specialized manager for base_agent.md with structured update capabilities.
|
|
7
7
|
Enforces template structure and provides section-specific update methods.
|
8
8
|
"""
|
9
9
|
|
10
|
-
import logging
|
11
10
|
from dataclasses import dataclass, field
|
12
11
|
from datetime import datetime, timezone
|
13
12
|
from enum import Enum
|
@@ -18,7 +17,8 @@ from claude_mpm.agents.base_agent_loader import clear_base_agent_cache
|
|
18
17
|
from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
|
19
18
|
from claude_mpm.services.shared import ConfigServiceBase
|
20
19
|
|
21
|
-
|
20
|
+
from claude_mpm.core.logging_utils import get_logger
|
21
|
+
logger = get_logger(__name__)
|
22
22
|
|
23
23
|
|
24
24
|
class BaseAgentSection(str, Enum):
|
@@ -12,7 +12,6 @@ This service integrates with the main agent_loader.py to provide
|
|
12
12
|
markdown-based agent profiles alongside JSON-based templates.
|
13
13
|
"""
|
14
14
|
|
15
|
-
import logging
|
16
15
|
from pathlib import Path
|
17
16
|
from typing import Any, Dict, Optional
|
18
17
|
|
@@ -22,7 +21,8 @@ from claude_mpm.agents.agent_loader import (
|
|
22
21
|
)
|
23
22
|
from claude_mpm.core.unified_paths import get_path_manager
|
24
23
|
|
25
|
-
|
24
|
+
from claude_mpm.core.logging_utils import get_logger
|
25
|
+
logger = get_logger(__name__)
|
26
26
|
|
27
27
|
|
28
28
|
class FrameworkAgentLoader:
|
@@ -4,12 +4,12 @@ This service generates markdown content for agent capabilities section
|
|
4
4
|
from discovered deployed agents.
|
5
5
|
"""
|
6
6
|
|
7
|
-
import logging
|
8
7
|
from typing import Any, Dict, List
|
9
8
|
|
10
9
|
from jinja2 import Template
|
11
10
|
|
12
|
-
|
11
|
+
from claude_mpm.core.logging_utils import get_logger
|
12
|
+
logger = get_logger(__name__)
|
13
13
|
|
14
14
|
|
15
15
|
class AgentCapabilitiesGenerator:
|
@@ -11,7 +11,6 @@ section extraction/updates, and version management.
|
|
11
11
|
Uses python-frontmatter and mistune for markdown parsing as recommended.
|
12
12
|
"""
|
13
13
|
|
14
|
-
import logging
|
15
14
|
import re
|
16
15
|
from datetime import datetime, timezone
|
17
16
|
from typing import Any, Dict, List, Optional
|
@@ -33,7 +32,8 @@ from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCac
|
|
33
32
|
|
34
33
|
from ..deployment.agent_versioning import AgentVersionManager
|
35
34
|
|
36
|
-
|
35
|
+
from claude_mpm.core.logging_utils import get_logger
|
36
|
+
logger = get_logger(__name__)
|
37
37
|
|
38
38
|
|
39
39
|
class AgentManager:
|
@@ -12,12 +12,15 @@ This module provides:
|
|
12
12
|
- Content repair and structure validation
|
13
13
|
"""
|
14
14
|
|
15
|
-
import logging
|
16
15
|
import re
|
17
16
|
from datetime import datetime, timezone
|
18
17
|
from difflib import SequenceMatcher
|
19
18
|
from typing import Any, Dict, List, Optional, Tuple
|
20
19
|
|
20
|
+
from claude_mpm.core.logging_utils import get_logger
|
21
|
+
|
22
|
+
logger = get_logger(__name__)
|
23
|
+
|
21
24
|
|
22
25
|
class MemoryContentManager:
|
23
26
|
"""Manages memory content manipulation and validation.
|
@@ -34,7 +37,7 @@ class MemoryContentManager:
|
|
34
37
|
memory_limits: Dictionary containing memory limits configuration
|
35
38
|
"""
|
36
39
|
self.memory_limits = memory_limits
|
37
|
-
self.logger =
|
40
|
+
self.logger = logger # Use the module-level logger
|
38
41
|
|
39
42
|
def add_item_to_list(self, content: str, new_item: str) -> str:
|
40
43
|
"""Add item to memory list with deduplication.
|