claude-mpm 4.4.3__py3-none-any.whl → 4.4.4__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 +3 -2
- claude_mpm/agents/agent_loader_integration.py +2 -1
- claude_mpm/agents/async_agent_loader.py +2 -2
- claude_mpm/agents/base_agent_loader.py +2 -2
- claude_mpm/agents/frontmatter_validator.py +1 -0
- claude_mpm/agents/system_agent_config.py +2 -1
- claude_mpm/cli/commands/doctor.py +44 -5
- claude_mpm/cli/commands/mpm_init.py +116 -62
- claude_mpm/cli/parsers/configure_parser.py +3 -1
- claude_mpm/cli/startup_logging.py +1 -3
- claude_mpm/config/agent_config.py +1 -1
- claude_mpm/config/paths.py +2 -1
- claude_mpm/core/agent_name_normalizer.py +1 -0
- claude_mpm/core/config.py +2 -1
- claude_mpm/core/config_aliases.py +2 -1
- claude_mpm/core/file_utils.py +0 -1
- claude_mpm/core/framework/__init__.py +6 -6
- claude_mpm/core/framework/formatters/__init__.py +2 -2
- claude_mpm/core/framework/formatters/capability_generator.py +19 -8
- claude_mpm/core/framework/formatters/content_formatter.py +8 -3
- claude_mpm/core/framework/formatters/context_generator.py +7 -3
- claude_mpm/core/framework/loaders/__init__.py +3 -3
- claude_mpm/core/framework/loaders/agent_loader.py +7 -3
- claude_mpm/core/framework/loaders/file_loader.py +16 -6
- claude_mpm/core/framework/loaders/instruction_loader.py +16 -6
- claude_mpm/core/framework/loaders/packaged_loader.py +36 -12
- claude_mpm/core/framework/processors/__init__.py +2 -2
- claude_mpm/core/framework/processors/memory_processor.py +14 -6
- claude_mpm/core/framework/processors/metadata_processor.py +5 -5
- claude_mpm/core/framework/processors/template_processor.py +12 -6
- claude_mpm/core/framework_loader.py +44 -20
- claude_mpm/core/log_manager.py +2 -1
- claude_mpm/core/tool_access_control.py +1 -0
- claude_mpm/core/unified_agent_registry.py +2 -1
- claude_mpm/core/unified_paths.py +1 -0
- claude_mpm/experimental/cli_enhancements.py +1 -0
- claude_mpm/hooks/base_hook.py +1 -0
- claude_mpm/hooks/instruction_reinforcement.py +1 -0
- claude_mpm/hooks/kuzu_memory_hook.py +20 -13
- claude_mpm/hooks/validation_hooks.py +1 -1
- claude_mpm/scripts/mpm_doctor.py +1 -0
- claude_mpm/services/agents/loading/agent_profile_loader.py +1 -1
- claude_mpm/services/agents/loading/base_agent_manager.py +1 -1
- claude_mpm/services/agents/loading/framework_agent_loader.py +1 -1
- claude_mpm/services/agents/management/agent_capabilities_generator.py +1 -0
- claude_mpm/services/agents/management/agent_management_service.py +1 -1
- claude_mpm/services/agents/memory/memory_categorization_service.py +0 -1
- claude_mpm/services/agents/memory/memory_file_service.py +6 -2
- claude_mpm/services/agents/memory/memory_format_service.py +0 -1
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +1 -1
- claude_mpm/services/async_session_logger.py +1 -1
- claude_mpm/services/claude_session_logger.py +1 -0
- claude_mpm/services/core/path_resolver.py +1 -0
- claude_mpm/services/diagnostics/checks/__init__.py +2 -0
- claude_mpm/services/diagnostics/checks/installation_check.py +126 -25
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +399 -0
- claude_mpm/services/diagnostics/diagnostic_runner.py +3 -0
- claude_mpm/services/diagnostics/doctor_reporter.py +259 -32
- claude_mpm/services/event_bus/direct_relay.py +2 -1
- claude_mpm/services/event_bus/event_bus.py +1 -0
- claude_mpm/services/event_bus/relay.py +3 -2
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +1 -1
- claude_mpm/services/infrastructure/daemon_manager.py +1 -1
- claude_mpm/services/mcp_config_manager.py +10 -10
- claude_mpm/services/mcp_gateway/core/process_pool.py +62 -23
- claude_mpm/services/mcp_gateway/tools/__init__.py +6 -5
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +3 -1
- claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +16 -31
- claude_mpm/services/memory/cache/simple_cache.py +1 -1
- claude_mpm/services/project/archive_manager.py +159 -96
- claude_mpm/services/project/documentation_manager.py +64 -45
- claude_mpm/services/project/enhanced_analyzer.py +132 -89
- claude_mpm/services/project/project_organizer.py +225 -131
- claude_mpm/services/response_tracker.py +1 -1
- claude_mpm/services/socketio/server/eventbus_integration.py +1 -1
- claude_mpm/services/unified/__init__.py +1 -1
- claude_mpm/services/unified/analyzer_strategies/__init__.py +3 -3
- claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +97 -53
- claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +81 -40
- claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +277 -178
- claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +196 -112
- claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +83 -49
- claude_mpm/services/unified/config_strategies/__init__.py +111 -126
- claude_mpm/services/unified/config_strategies/config_schema.py +157 -111
- claude_mpm/services/unified/config_strategies/context_strategy.py +91 -89
- claude_mpm/services/unified/config_strategies/error_handling_strategy.py +183 -173
- claude_mpm/services/unified/config_strategies/file_loader_strategy.py +160 -152
- claude_mpm/services/unified/config_strategies/unified_config_service.py +124 -112
- claude_mpm/services/unified/config_strategies/validation_strategy.py +298 -259
- claude_mpm/services/unified/deployment_strategies/__init__.py +7 -7
- claude_mpm/services/unified/deployment_strategies/base.py +24 -28
- claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +168 -88
- claude_mpm/services/unified/deployment_strategies/local.py +49 -34
- claude_mpm/services/unified/deployment_strategies/utils.py +39 -43
- claude_mpm/services/unified/deployment_strategies/vercel.py +30 -24
- claude_mpm/services/unified/interfaces.py +0 -26
- claude_mpm/services/unified/migration.py +17 -40
- claude_mpm/services/unified/strategies.py +9 -26
- claude_mpm/services/unified/unified_analyzer.py +48 -44
- claude_mpm/services/unified/unified_config.py +21 -19
- claude_mpm/services/unified/unified_deployment.py +21 -26
- claude_mpm/storage/state_storage.py +1 -0
- claude_mpm/utils/agent_dependency_loader.py +18 -6
- claude_mpm/utils/common.py +14 -12
- claude_mpm/utils/database_connector.py +15 -12
- claude_mpm/utils/error_handler.py +1 -0
- claude_mpm/utils/log_cleanup.py +1 -0
- claude_mpm/utils/path_operations.py +1 -0
- claude_mpm/utils/session_logging.py +1 -1
- claude_mpm/utils/subprocess_utils.py +1 -0
- claude_mpm/validation/agent_validator.py +1 -1
- {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.4.dist-info}/METADATA +9 -3
- {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.4.dist-info}/RECORD +118 -117
- {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.4.dist-info}/WHEEL +0 -0
- {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.4.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.4.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.4.3.dist-info → claude_mpm-4.4.4.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.4.
|
1
|
+
4.4.4
|
@@ -38,6 +38,9 @@ from enum import Enum
|
|
38
38
|
from pathlib import Path
|
39
39
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
40
40
|
|
41
|
+
# Module-level logger
|
42
|
+
from claude_mpm.core.logging_utils import get_logger
|
43
|
+
|
41
44
|
# Import modular components
|
42
45
|
from claude_mpm.core.unified_agent_registry import (
|
43
46
|
AgentTier,
|
@@ -49,8 +52,6 @@ from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCac
|
|
49
52
|
from ..core.agent_name_normalizer import AgentNameNormalizer
|
50
53
|
from .base_agent_loader import prepend_base_instructions
|
51
54
|
|
52
|
-
# Module-level logger
|
53
|
-
from claude_mpm.core.logging_utils import get_logger
|
54
55
|
logger = get_logger(__name__)
|
55
56
|
|
56
57
|
|
@@ -9,11 +9,12 @@ Provides backward compatibility while enabling advanced features.
|
|
9
9
|
|
10
10
|
from typing import Any, Dict, Optional
|
11
11
|
|
12
|
+
from claude_mpm.core.logging_utils import get_logger
|
13
|
+
|
12
14
|
from ..models.agent_definition import AgentDefinition
|
13
15
|
from ..services import AgentManager
|
14
16
|
from .agent_loader import get_agent_prompt
|
15
17
|
|
16
|
-
from claude_mpm.core.logging_utils import get_logger
|
17
18
|
logger = get_logger(__name__)
|
18
19
|
|
19
20
|
|
@@ -33,14 +33,14 @@ from typing import Any, Dict, List, Optional, Tuple
|
|
33
33
|
|
34
34
|
import aiofiles
|
35
35
|
|
36
|
+
# Module-level logger
|
37
|
+
from claude_mpm.core.logging_utils import get_logger
|
36
38
|
from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
|
37
39
|
|
38
40
|
from ..core.unified_paths import get_path_manager
|
39
41
|
from ..validation.agent_validator import AgentValidator
|
40
42
|
from .frontmatter_validator import FrontmatterValidator
|
41
43
|
|
42
|
-
# Module-level logger
|
43
|
-
from claude_mpm.core.logging_utils import get_logger
|
44
44
|
logger = get_logger(__name__)
|
45
45
|
|
46
46
|
|
@@ -27,10 +27,10 @@ from enum import Enum
|
|
27
27
|
from pathlib import Path
|
28
28
|
from typing import Dict, Optional
|
29
29
|
|
30
|
-
from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
|
31
|
-
|
32
30
|
# Module-level logger
|
33
31
|
from claude_mpm.core.logging_utils import get_logger
|
32
|
+
from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
|
33
|
+
|
34
34
|
logger = get_logger(__name__)
|
35
35
|
|
36
36
|
# Cache key for base agent instructions
|
@@ -18,6 +18,8 @@ Created: 2025-07-16
|
|
18
18
|
from dataclasses import dataclass, field
|
19
19
|
from typing import Any, Dict, List, Optional
|
20
20
|
|
21
|
+
from claude_mpm.core.logging_utils import get_logger
|
22
|
+
|
21
23
|
from ..config.default_model_config import (
|
22
24
|
DefaultModelConfigManager,
|
23
25
|
get_default_model_for_agent_type,
|
@@ -28,7 +30,6 @@ from ..config.model_env_defaults import (
|
|
28
30
|
)
|
29
31
|
from ..services.model_selector import ModelSelector, ModelType
|
30
32
|
|
31
|
-
from claude_mpm.core.logging_utils import get_logger
|
32
33
|
logger = get_logger(__name__)
|
33
34
|
|
34
35
|
|
@@ -79,6 +79,15 @@ def add_doctor_parser(subparsers):
|
|
79
79
|
|
80
80
|
parser.add_argument("--output", "-o", type=Path, help="Save output to file")
|
81
81
|
|
82
|
+
parser.add_argument(
|
83
|
+
"--output-file",
|
84
|
+
nargs="?",
|
85
|
+
const=".",
|
86
|
+
type=Path,
|
87
|
+
default=None,
|
88
|
+
help="Save report to file (default: mpm-doctor-report.md when used without path)",
|
89
|
+
)
|
90
|
+
|
82
91
|
parser.set_defaults(func=doctor_command)
|
83
92
|
|
84
93
|
|
@@ -108,13 +117,30 @@ def doctor_command(args):
|
|
108
117
|
"""
|
109
118
|
# Configure logging
|
110
119
|
from claude_mpm.core.logging_utils import get_logger
|
120
|
+
|
111
121
|
logger = get_logger(__name__)
|
112
122
|
|
123
|
+
# Handle output file parameter - support both --output and --output-file
|
124
|
+
output_file = args.output or args.output_file
|
125
|
+
if output_file is not None:
|
126
|
+
# If output_file is specified without a path, use default
|
127
|
+
if str(output_file) == ".":
|
128
|
+
output_file = Path("mpm-doctor-report.md")
|
129
|
+
elif not str(output_file).endswith((".md", ".json", ".txt")):
|
130
|
+
# Add .md extension if no extension provided
|
131
|
+
output_file = Path(str(output_file) + ".md")
|
132
|
+
|
113
133
|
# Determine output format
|
114
134
|
if args.json:
|
115
135
|
output_format = "json"
|
116
136
|
elif args.markdown:
|
117
137
|
output_format = "markdown"
|
138
|
+
elif output_file:
|
139
|
+
# Force markdown format when writing to file (unless json specified)
|
140
|
+
if str(output_file).endswith(".json"):
|
141
|
+
output_format = "json"
|
142
|
+
else:
|
143
|
+
output_format = "markdown"
|
118
144
|
else:
|
119
145
|
output_format = "terminal"
|
120
146
|
|
@@ -152,17 +178,29 @@ def doctor_command(args):
|
|
152
178
|
reporter = DoctorReporter(use_color=not args.no_color, verbose=args.verbose)
|
153
179
|
|
154
180
|
# Output results
|
155
|
-
if
|
181
|
+
if output_file:
|
156
182
|
# Save to file
|
157
183
|
try:
|
158
184
|
import sys
|
159
185
|
|
160
186
|
original_stdout = sys.stdout
|
161
|
-
with open(
|
187
|
+
with open(output_file, "w") as f:
|
162
188
|
sys.stdout = f
|
163
189
|
reporter.report(summary, format=output_format)
|
164
190
|
sys.stdout = original_stdout
|
165
|
-
print(f"Report saved to: {
|
191
|
+
print(f"✅ Report saved to: {output_file}")
|
192
|
+
|
193
|
+
# Also print brief summary to terminal
|
194
|
+
if summary.error_count > 0:
|
195
|
+
print(
|
196
|
+
f"❌ {summary.error_count} error(s) found - see report for details"
|
197
|
+
)
|
198
|
+
elif summary.warning_count > 0:
|
199
|
+
print(
|
200
|
+
f"⚠️ {summary.warning_count} warning(s) found - see report for details"
|
201
|
+
)
|
202
|
+
else:
|
203
|
+
print("✅ System is healthy!")
|
166
204
|
except Exception as e:
|
167
205
|
logger.error(f"Failed to save report: {e}")
|
168
206
|
print(f"❌ Failed to save report: {e!s}")
|
@@ -187,13 +225,14 @@ if __name__ == "__main__":
|
|
187
225
|
parser = argparse.ArgumentParser(description="Claude MPM Doctor")
|
188
226
|
parser.add_argument("--verbose", "-v", action="store_true")
|
189
227
|
parser.add_argument("--json", action="store_true")
|
228
|
+
parser.add_argument("--markdown", action="store_true")
|
190
229
|
parser.add_argument("--fix", action="store_true")
|
191
230
|
parser.add_argument("--no-color", action="store_true")
|
192
231
|
parser.add_argument("--checks", nargs="+")
|
193
232
|
parser.add_argument("--parallel", action="store_true")
|
233
|
+
parser.add_argument("--output", "-o", type=Path)
|
234
|
+
parser.add_argument("--output-file", type=Path)
|
194
235
|
|
195
236
|
args = parser.parse_args()
|
196
|
-
args.markdown = False
|
197
|
-
args.output = None
|
198
237
|
|
199
238
|
sys.exit(doctor_command(args))
|
@@ -18,16 +18,17 @@ import click
|
|
18
18
|
from rich.console import Console
|
19
19
|
from rich.panel import Panel
|
20
20
|
from rich.progress import Progress, SpinnerColumn, TextColumn
|
21
|
-
from rich.prompt import
|
21
|
+
from rich.prompt import Prompt
|
22
22
|
from rich.table import Table
|
23
23
|
|
24
|
+
from claude_mpm.core.logging_utils import get_logger
|
25
|
+
|
24
26
|
# Import new services
|
25
27
|
from claude_mpm.services.project.archive_manager import ArchiveManager
|
26
28
|
from claude_mpm.services.project.documentation_manager import DocumentationManager
|
27
29
|
from claude_mpm.services.project.enhanced_analyzer import EnhancedProjectAnalyzer
|
28
30
|
from claude_mpm.services.project.project_organizer import ProjectOrganizer
|
29
31
|
|
30
|
-
from claude_mpm.core.logging_utils import get_logger
|
31
32
|
logger = get_logger(__name__)
|
32
33
|
console = Console()
|
33
34
|
|
@@ -93,10 +94,14 @@ class MPMInitCommand:
|
|
93
94
|
# Auto-select update mode if organize_files or dry_run is specified
|
94
95
|
if organize_files or dry_run:
|
95
96
|
update_mode = True
|
96
|
-
console.print(
|
97
|
+
console.print(
|
98
|
+
"[cyan]Auto-selecting update mode for organization tasks.[/cyan]\n"
|
99
|
+
)
|
97
100
|
else:
|
98
101
|
# Offer update mode
|
99
|
-
console.print(
|
102
|
+
console.print(
|
103
|
+
"[yellow]⚠️ Project already has CLAUDE.md file.[/yellow]\n"
|
104
|
+
)
|
100
105
|
|
101
106
|
# Show current documentation analysis
|
102
107
|
doc_analysis = self.doc_manager.analyze_existing_content()
|
@@ -112,7 +117,10 @@ class MPMInitCommand:
|
|
112
117
|
elif action == "review":
|
113
118
|
return self._run_review_mode()
|
114
119
|
else:
|
115
|
-
return {
|
120
|
+
return {
|
121
|
+
"status": "cancelled",
|
122
|
+
"message": "Initialization cancelled",
|
123
|
+
}
|
116
124
|
|
117
125
|
# Handle dry-run mode
|
118
126
|
if dry_run:
|
@@ -156,7 +164,9 @@ class MPMInitCommand:
|
|
156
164
|
task = progress.add_task(task_desc, total=None)
|
157
165
|
|
158
166
|
# Run the initialization through subprocess
|
159
|
-
result = self._run_initialization(
|
167
|
+
result = self._run_initialization(
|
168
|
+
prompt, verbose, use_venv, update_mode
|
169
|
+
)
|
160
170
|
|
161
171
|
complete_desc = (
|
162
172
|
"[green]✓ Update complete"
|
@@ -406,24 +416,28 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
406
416
|
table.add_column("Value", style="white")
|
407
417
|
|
408
418
|
table.add_row("Size", f"{analysis.get('size', 0):,} characters")
|
409
|
-
table.add_row("Lines", str(analysis.get(
|
410
|
-
table.add_row("Sections", str(len(analysis.get(
|
411
|
-
table.add_row(
|
412
|
-
|
419
|
+
table.add_row("Lines", str(analysis.get("lines", 0)))
|
420
|
+
table.add_row("Sections", str(len(analysis.get("sections", []))))
|
421
|
+
table.add_row(
|
422
|
+
"Has Priority Index", "✓" if analysis.get("has_priority_index") else "✗"
|
423
|
+
)
|
424
|
+
table.add_row(
|
425
|
+
"Has Priority Markers", "✓" if analysis.get("has_priority_markers") else "✗"
|
426
|
+
)
|
413
427
|
|
414
|
-
if analysis.get(
|
415
|
-
table.add_row("Last Modified", analysis[
|
428
|
+
if analysis.get("last_modified"):
|
429
|
+
table.add_row("Last Modified", analysis["last_modified"])
|
416
430
|
|
417
431
|
console.print(table)
|
418
432
|
|
419
|
-
if analysis.get(
|
433
|
+
if analysis.get("outdated_patterns"):
|
420
434
|
console.print("\n[yellow]⚠️ Outdated patterns detected:[/yellow]")
|
421
|
-
for pattern in analysis[
|
435
|
+
for pattern in analysis["outdated_patterns"]:
|
422
436
|
console.print(f" • {pattern}")
|
423
437
|
|
424
|
-
if analysis.get(
|
438
|
+
if analysis.get("custom_sections"):
|
425
439
|
console.print("\n[blue]ℹ️ Custom sections found:[/blue]")
|
426
|
-
for section in analysis[
|
440
|
+
for section in analysis["custom_sections"][:5]:
|
427
441
|
console.print(f" • {section}")
|
428
442
|
|
429
443
|
def _prompt_update_action(self) -> str:
|
@@ -440,7 +454,9 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
440
454
|
for key, (_, desc) in choices.items():
|
441
455
|
console.print(f" [{key}] {desc}")
|
442
456
|
|
443
|
-
choice = Prompt.ask(
|
457
|
+
choice = Prompt.ask(
|
458
|
+
"\nSelect option", choices=list(choices.keys()), default="1"
|
459
|
+
)
|
444
460
|
return choices[choice][0]
|
445
461
|
|
446
462
|
def _run_review_mode(self) -> Dict:
|
@@ -460,7 +476,9 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
460
476
|
# Analyze documentation
|
461
477
|
task = progress.add_task("[cyan]Analyzing documentation...", total=None)
|
462
478
|
doc_analysis = self.doc_manager.analyze_existing_content()
|
463
|
-
progress.update(
|
479
|
+
progress.update(
|
480
|
+
task, description="[green]✓ Documentation analysis complete"
|
481
|
+
)
|
464
482
|
|
465
483
|
# Analyze git history
|
466
484
|
if self.analyzer.is_git_repo:
|
@@ -476,7 +494,9 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
476
494
|
progress.update(task, description="[green]✓ State detection complete")
|
477
495
|
|
478
496
|
# Display comprehensive report
|
479
|
-
self._display_review_report(
|
497
|
+
self._display_review_report(
|
498
|
+
structure_report, doc_analysis, git_analysis, project_state
|
499
|
+
)
|
480
500
|
|
481
501
|
return {
|
482
502
|
"status": "success",
|
@@ -498,46 +518,56 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
498
518
|
# Project State
|
499
519
|
console.print("[bold cyan]📊 Project State[/bold cyan]")
|
500
520
|
console.print(f" Phase: {state.get('phase', 'unknown')}")
|
501
|
-
if state.get(
|
521
|
+
if state.get("indicators"):
|
502
522
|
console.print(" Indicators:")
|
503
|
-
for indicator in state[
|
523
|
+
for indicator in state["indicators"][:5]:
|
504
524
|
console.print(f" • {indicator}")
|
505
525
|
|
506
526
|
# Structure Report
|
507
527
|
console.print("\n[bold cyan]📁 Project Structure[/bold cyan]")
|
508
528
|
console.print(f" Existing directories: {len(structure.get('exists', []))}")
|
509
529
|
console.print(f" Missing directories: {len(structure.get('missing', []))}")
|
510
|
-
if structure.get(
|
530
|
+
if structure.get("issues"):
|
511
531
|
console.print(f" Issues found: {len(structure['issues'])}")
|
512
|
-
for issue in structure[
|
532
|
+
for issue in structure["issues"][:3]:
|
513
533
|
console.print(f" ⚠️ {issue['description']}")
|
514
534
|
|
515
535
|
# Documentation Report
|
516
536
|
console.print("\n[bold cyan]📚 Documentation Status[/bold cyan]")
|
517
|
-
if docs.get(
|
537
|
+
if docs.get("exists"):
|
518
538
|
console.print(f" CLAUDE.md: Found ({docs.get('size', 0):,} chars)")
|
519
539
|
console.print(f" Sections: {len(docs.get('sections', []))}")
|
520
|
-
console.print(
|
540
|
+
console.print(
|
541
|
+
f" Priority markers: {'Yes' if docs.get('has_priority_markers') else 'No'}"
|
542
|
+
)
|
521
543
|
else:
|
522
544
|
console.print(" CLAUDE.md: Not found")
|
523
545
|
|
524
546
|
# Git Analysis
|
525
|
-
if git and git.get(
|
547
|
+
if git and git.get("git_available"):
|
526
548
|
console.print("\n[bold cyan]📈 Recent Activity (30 days)[/bold cyan]")
|
527
549
|
console.print(f" Commits: {len(git.get('recent_commits', []))}")
|
528
|
-
console.print(
|
529
|
-
|
550
|
+
console.print(
|
551
|
+
f" Authors: {git.get('authors', {}).get('total_authors', 0)}"
|
552
|
+
)
|
553
|
+
console.print(
|
554
|
+
f" Changed files: {git.get('changed_files', {}).get('total_files', 0)}"
|
555
|
+
)
|
530
556
|
|
531
|
-
if git.get(
|
532
|
-
branch_info = git[
|
533
|
-
console.print(
|
534
|
-
|
535
|
-
|
557
|
+
if git.get("branch_info"):
|
558
|
+
branch_info = git["branch_info"]
|
559
|
+
console.print(
|
560
|
+
f" Current branch: {branch_info.get('current_branch', 'unknown')}"
|
561
|
+
)
|
562
|
+
if branch_info.get("has_uncommitted_changes"):
|
563
|
+
console.print(
|
564
|
+
f" ⚠️ Uncommitted changes: {branch_info.get('uncommitted_files', 0)} files"
|
565
|
+
)
|
536
566
|
|
537
567
|
# Recommendations
|
538
|
-
if state.get(
|
568
|
+
if state.get("recommendations"):
|
539
569
|
console.print("\n[bold cyan]💡 Recommendations[/bold cyan]")
|
540
|
-
for rec in state[
|
570
|
+
for rec in state["recommendations"][:5]:
|
541
571
|
console.print(f" → {rec}")
|
542
572
|
|
543
573
|
console.print("\n" + "=" * 60 + "\n")
|
@@ -557,7 +587,9 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
557
587
|
if validation.get("issues"):
|
558
588
|
console.print(" [yellow]Files that would be organized:[/yellow]")
|
559
589
|
for issue in validation["issues"][:10]:
|
560
|
-
actions_planned.append(
|
590
|
+
actions_planned.append(
|
591
|
+
f"Organize: {issue.get('description', 'Unknown')}"
|
592
|
+
)
|
561
593
|
console.print(f" • {issue.get('description', 'Unknown')}")
|
562
594
|
else:
|
563
595
|
console.print(" ✅ Project structure is already well-organized")
|
@@ -567,15 +599,15 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
567
599
|
console.print("\n[bold]📚 Documentation Updates:[/bold]")
|
568
600
|
doc_analysis = self.doc_manager.analyze_existing_content()
|
569
601
|
|
570
|
-
if not doc_analysis.get(
|
602
|
+
if not doc_analysis.get("has_priority_markers"):
|
571
603
|
actions_planned.append("Add priority markers (🔴🟡🟢⚪)")
|
572
604
|
console.print(" • Add priority markers (🔴🟡🟢⚪)")
|
573
605
|
|
574
|
-
if doc_analysis.get(
|
606
|
+
if doc_analysis.get("outdated_patterns"):
|
575
607
|
actions_planned.append("Update outdated patterns")
|
576
608
|
console.print(" • Update outdated patterns")
|
577
609
|
|
578
|
-
if not doc_analysis.get(
|
610
|
+
if not doc_analysis.get("has_priority_index"):
|
579
611
|
actions_planned.append("Add priority index section")
|
580
612
|
console.print(" • Add priority index section")
|
581
613
|
|
@@ -589,23 +621,27 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
589
621
|
|
590
622
|
# General improvements
|
591
623
|
console.print("\n[bold]🔧 General Improvements:[/bold]")
|
592
|
-
actions_planned.extend(
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
624
|
+
actions_planned.extend(
|
625
|
+
[
|
626
|
+
"Update/create .gitignore if needed",
|
627
|
+
"Verify project structure compliance",
|
628
|
+
"Add memory system initialization",
|
629
|
+
"Set up single-path workflows",
|
630
|
+
]
|
631
|
+
)
|
598
632
|
for action in actions_planned[-4:]:
|
599
633
|
console.print(f" • {action}")
|
600
634
|
|
601
|
-
console.print(
|
635
|
+
console.print(
|
636
|
+
f"\n[bold cyan]Summary: {len(actions_planned)} actions would be performed[/bold cyan]"
|
637
|
+
)
|
602
638
|
console.print("\n[dim]Run without --dry-run to execute these changes.[/dim]\n")
|
603
639
|
|
604
640
|
return {
|
605
641
|
"status": "success",
|
606
642
|
"mode": "dry_run",
|
607
643
|
"actions_planned": actions_planned,
|
608
|
-
"message": "Dry run completed - no changes made"
|
644
|
+
"message": "Dry run completed - no changes made",
|
609
645
|
}
|
610
646
|
|
611
647
|
def _run_pre_initialization_checks(
|
@@ -618,7 +654,7 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
618
654
|
# Run comprehensive project readiness check
|
619
655
|
ready, actions = self.organizer.ensure_project_ready(
|
620
656
|
auto_organize=organize_files,
|
621
|
-
safe_mode=True # Only perform safe operations by default
|
657
|
+
safe_mode=True, # Only perform safe operations by default
|
622
658
|
)
|
623
659
|
|
624
660
|
if actions:
|
@@ -638,15 +674,14 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
638
674
|
# Archive existing documentation if needed
|
639
675
|
if has_existing and not skip_archive:
|
640
676
|
if self.archive_manager.auto_archive_before_update(
|
641
|
-
self.project_path / "CLAUDE.md",
|
642
|
-
update_reason="Before mpm-init update"
|
677
|
+
self.project_path / "CLAUDE.md", update_reason="Before mpm-init update"
|
643
678
|
):
|
644
679
|
checks_passed.append("Archived existing CLAUDE.md")
|
645
680
|
|
646
681
|
# Check for issues in validation report
|
647
|
-
if validation.get(
|
648
|
-
for issue in validation[
|
649
|
-
warnings.append(issue[
|
682
|
+
if validation.get("issues"):
|
683
|
+
for issue in validation["issues"]:
|
684
|
+
warnings.append(issue["description"])
|
650
685
|
|
651
686
|
if warnings:
|
652
687
|
console.print("\n[yellow]⚠️ Project issues detected:[/yellow]")
|
@@ -660,7 +695,11 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
660
695
|
console.print(f" • {check}")
|
661
696
|
console.print()
|
662
697
|
|
663
|
-
return {
|
698
|
+
return {
|
699
|
+
"status": "success",
|
700
|
+
"checks_passed": checks_passed,
|
701
|
+
"warnings": warnings,
|
702
|
+
}
|
664
703
|
|
665
704
|
def _show_update_plan(self, ast_analysis: bool, preserve_custom: bool) -> None:
|
666
705
|
"""Show update mode plan."""
|
@@ -673,7 +712,11 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
673
712
|
+ "• Priority-based reorganization (🔴🟡🟢⚪)\n"
|
674
713
|
"• Updated single-path workflows\n"
|
675
714
|
"• Refreshed tool configurations\n"
|
676
|
-
+ (
|
715
|
+
+ (
|
716
|
+
"• AST analysis for enhanced documentation\n"
|
717
|
+
if ast_analysis
|
718
|
+
else ""
|
719
|
+
)
|
677
720
|
+ "• Automatic archival of previous version\n"
|
678
721
|
+ "• Holistic review and optimization\n"
|
679
722
|
+ "\n[dim]Previous version will be archived in docs/_archive/[/dim]",
|
@@ -694,7 +737,11 @@ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI
|
|
694
737
|
"• Tool configurations (linting, formatting, testing)\n"
|
695
738
|
"• GitHub workflows and CI/CD setup\n"
|
696
739
|
"• Memory system initialization\n"
|
697
|
-
+ (
|
740
|
+
+ (
|
741
|
+
"• AST analysis for comprehensive code documentation\n"
|
742
|
+
if ast_analysis
|
743
|
+
else ""
|
744
|
+
)
|
698
745
|
+ "• Holistic CLAUDE.md organization with ranked instructions\n"
|
699
746
|
+ "• Priority-based content structure (🔴🟡🟢⚪)\n"
|
700
747
|
+ "\n[dim]Powered by Agentic Coder Optimizer Agent[/dim]",
|
@@ -732,7 +779,7 @@ Existing Documentation Analysis:
|
|
732
779
|
- Has Priority Index: {'Yes' if doc_analysis.get('has_priority_index') else 'No'}
|
733
780
|
- Custom Sections: {len(doc_analysis.get('custom_sections', []))} found
|
734
781
|
"""
|
735
|
-
if preserve_custom and doc_analysis.get(
|
782
|
+
if preserve_custom and doc_analysis.get("custom_sections"):
|
736
783
|
prompt += f"- Preserve Custom Sections: {', '.join(doc_analysis['custom_sections'][:5])}\n"
|
737
784
|
|
738
785
|
prompt += """
|
@@ -789,18 +836,25 @@ preserving valuable project-specific information while refreshing standard secti
|
|
789
836
|
latest_archive = self.archive_manager.get_latest_archive("CLAUDE.md")
|
790
837
|
if latest_archive:
|
791
838
|
comparison = self.archive_manager.compare_with_archive(
|
792
|
-
self.project_path / "CLAUDE.md",
|
793
|
-
latest_archive.name
|
839
|
+
self.project_path / "CLAUDE.md", latest_archive.name
|
794
840
|
)
|
795
841
|
|
796
842
|
if not comparison.get("identical"):
|
797
843
|
console.print("\n[bold cyan]📊 Update Summary[/bold cyan]")
|
798
|
-
console.print(
|
799
|
-
|
844
|
+
console.print(
|
845
|
+
f" Lines changed: {comparison.get('lines_added', 0):+d}"
|
846
|
+
)
|
847
|
+
console.print(
|
848
|
+
f" Size change: {comparison.get('size_change', 0):+,} characters"
|
849
|
+
)
|
800
850
|
console.print(f" Previous version: {latest_archive.name}")
|
801
851
|
|
802
852
|
def _run_initialization(
|
803
|
-
self,
|
853
|
+
self,
|
854
|
+
prompt: str,
|
855
|
+
verbose: bool,
|
856
|
+
use_venv: bool = False,
|
857
|
+
update_mode: bool = False,
|
804
858
|
) -> Dict:
|
805
859
|
"""Run the initialization through subprocess calling claude-mpm."""
|
806
860
|
import tempfile
|
@@ -122,7 +122,9 @@ def add_configure_subparser(subparsers) -> argparse.ArgumentParser:
|
|
122
122
|
# Display options
|
123
123
|
display_group = configure_parser.add_argument_group("display options")
|
124
124
|
display_group.add_argument(
|
125
|
-
"--no-colors",
|
125
|
+
"--no-colors",
|
126
|
+
action="store_true",
|
127
|
+
help="Disable colored output in the interface",
|
126
128
|
)
|
127
129
|
display_group.add_argument(
|
128
130
|
"--compact", action="store_true", help="Use compact display mode"
|
@@ -687,9 +687,7 @@ async def trigger_vector_search_indexing(project_root: Optional[Path] = None) ->
|
|
687
687
|
|
688
688
|
# Store PID for logging
|
689
689
|
pid = process.pid
|
690
|
-
logger.debug(
|
691
|
-
f"MCP Vector Search: Indexing process started (PID: {pid})"
|
692
|
-
)
|
690
|
+
logger.debug(f"MCP Vector Search: Indexing process started (PID: {pid})")
|
693
691
|
|
694
692
|
# Don't wait for completion - let it run independently in the background
|
695
693
|
# We don't need to track its completion, so we can safely detach
|
@@ -20,10 +20,10 @@ from enum import Enum
|
|
20
20
|
from pathlib import Path
|
21
21
|
from typing import Any, Dict, List, Optional
|
22
22
|
|
23
|
+
from claude_mpm.core.logging_utils import get_logger
|
23
24
|
from claude_mpm.core.shared.config_loader import ConfigLoader, ConfigPattern
|
24
25
|
from claude_mpm.core.unified_paths import get_path_manager
|
25
26
|
|
26
|
-
from claude_mpm.core.logging_utils import get_logger
|
27
27
|
logger = get_logger(__name__)
|
28
28
|
|
29
29
|
|
claude_mpm/config/paths.py
CHANGED
@@ -11,10 +11,11 @@ without fragile parent.parent.parent patterns.
|
|
11
11
|
from pathlib import Path
|
12
12
|
from typing import Optional, Union
|
13
13
|
|
14
|
+
from claude_mpm.core.logging_utils import get_logger
|
15
|
+
|
14
16
|
# Import from the unified path management system
|
15
17
|
from ..core.unified_paths import get_path_manager
|
16
18
|
|
17
|
-
from claude_mpm.core.logging_utils import get_logger
|
18
19
|
logger = get_logger(__name__)
|
19
20
|
|
20
21
|
|
claude_mpm/core/config.py
CHANGED
@@ -14,11 +14,12 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
|
14
14
|
|
15
15
|
import yaml
|
16
16
|
|
17
|
+
from claude_mpm.core.logging_utils import get_logger
|
18
|
+
|
17
19
|
from ..utils.config_manager import ConfigurationManager
|
18
20
|
from .exceptions import ConfigurationError, FileOperationError
|
19
21
|
from .unified_paths import get_path_manager
|
20
22
|
|
21
|
-
from claude_mpm.core.logging_utils import get_logger
|
22
23
|
logger = get_logger(__name__)
|
23
24
|
|
24
25
|
|
@@ -16,10 +16,11 @@ Aliases are stored in ~/.claude-mpm/config_aliases.json
|
|
16
16
|
import json
|
17
17
|
from typing import Dict, List, Optional, Tuple
|
18
18
|
|
19
|
+
from claude_mpm.core.logging_utils import get_logger
|
20
|
+
|
19
21
|
from ..utils.config_manager import ConfigurationManager
|
20
22
|
from .unified_paths import get_path_manager
|
21
23
|
|
22
|
-
from claude_mpm.core.logging_utils import get_logger
|
23
24
|
logger = get_logger(__name__)
|
24
25
|
|
25
26
|
|