claude-mpm 4.1.2__py3-none-any.whl โ 4.1.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/BASE_AGENT_TEMPLATE.md +16 -19
- claude_mpm/agents/MEMORY.md +21 -49
- claude_mpm/agents/templates/OPTIMIZATION_REPORT.md +156 -0
- claude_mpm/agents/templates/api_qa.json +36 -116
- claude_mpm/agents/templates/backup/data_engineer_agent_20250726_234551.json +42 -9
- claude_mpm/agents/templates/backup/documentation_agent_20250726_234551.json +29 -6
- claude_mpm/agents/templates/backup/engineer_agent_20250726_234551.json +34 -6
- claude_mpm/agents/templates/backup/ops_agent_20250726_234551.json +41 -9
- claude_mpm/agents/templates/backup/qa_agent_20250726_234551.json +30 -8
- claude_mpm/agents/templates/backup/research_agent_2025011_234551.json +2 -2
- claude_mpm/agents/templates/backup/research_agent_20250726_234551.json +29 -6
- claude_mpm/agents/templates/backup/research_memory_efficient.json +2 -2
- claude_mpm/agents/templates/backup/security_agent_20250726_234551.json +41 -9
- claude_mpm/agents/templates/backup/version_control_agent_20250726_234551.json +23 -7
- claude_mpm/agents/templates/code_analyzer.json +18 -36
- claude_mpm/agents/templates/data_engineer.json +43 -14
- claude_mpm/agents/templates/documentation.json +55 -74
- claude_mpm/agents/templates/engineer.json +57 -40
- claude_mpm/agents/templates/imagemagick.json +7 -2
- claude_mpm/agents/templates/memory_manager.json +1 -1
- claude_mpm/agents/templates/ops.json +36 -4
- claude_mpm/agents/templates/project_organizer.json +23 -71
- claude_mpm/agents/templates/qa.json +34 -2
- claude_mpm/agents/templates/refactoring_engineer.json +9 -5
- claude_mpm/agents/templates/research.json +36 -4
- claude_mpm/agents/templates/security.json +29 -2
- claude_mpm/agents/templates/ticketing.json +3 -3
- claude_mpm/agents/templates/vercel_ops_agent.json +2 -2
- claude_mpm/agents/templates/version_control.json +28 -2
- claude_mpm/agents/templates/web_qa.json +38 -151
- claude_mpm/agents/templates/web_ui.json +2 -2
- claude_mpm/cli/commands/agent_manager.py +221 -1
- claude_mpm/cli/commands/agents.py +556 -1009
- claude_mpm/cli/commands/memory.py +248 -927
- claude_mpm/cli/commands/run.py +139 -484
- claude_mpm/cli/parsers/agent_manager_parser.py +34 -0
- claude_mpm/cli/startup_logging.py +76 -0
- claude_mpm/core/agent_registry.py +6 -10
- claude_mpm/core/framework_loader.py +205 -595
- claude_mpm/core/log_manager.py +49 -1
- claude_mpm/core/logging_config.py +2 -4
- claude_mpm/hooks/claude_hooks/event_handlers.py +7 -117
- claude_mpm/hooks/claude_hooks/hook_handler.py +91 -755
- claude_mpm/hooks/claude_hooks/hook_handler_original.py +1040 -0
- claude_mpm/hooks/claude_hooks/hook_handler_refactored.py +347 -0
- claude_mpm/hooks/claude_hooks/services/__init__.py +13 -0
- claude_mpm/hooks/claude_hooks/services/connection_manager.py +190 -0
- claude_mpm/hooks/claude_hooks/services/duplicate_detector.py +106 -0
- claude_mpm/hooks/claude_hooks/services/state_manager.py +282 -0
- claude_mpm/hooks/claude_hooks/services/subagent_processor.py +374 -0
- claude_mpm/services/agents/deployment/agent_deployment.py +42 -454
- claude_mpm/services/agents/deployment/base_agent_locator.py +132 -0
- claude_mpm/services/agents/deployment/deployment_results_manager.py +185 -0
- claude_mpm/services/agents/deployment/single_agent_deployer.py +315 -0
- claude_mpm/services/agents/memory/agent_memory_manager.py +42 -508
- claude_mpm/services/agents/memory/memory_categorization_service.py +165 -0
- claude_mpm/services/agents/memory/memory_file_service.py +103 -0
- claude_mpm/services/agents/memory/memory_format_service.py +201 -0
- claude_mpm/services/agents/memory/memory_limits_service.py +99 -0
- claude_mpm/services/agents/registry/__init__.py +1 -1
- claude_mpm/services/cli/__init__.py +18 -0
- claude_mpm/services/cli/agent_cleanup_service.py +407 -0
- claude_mpm/services/cli/agent_dependency_service.py +395 -0
- claude_mpm/services/cli/agent_listing_service.py +463 -0
- claude_mpm/services/cli/agent_output_formatter.py +605 -0
- claude_mpm/services/cli/agent_validation_service.py +589 -0
- claude_mpm/services/cli/dashboard_launcher.py +424 -0
- claude_mpm/services/cli/memory_crud_service.py +617 -0
- claude_mpm/services/cli/memory_output_formatter.py +604 -0
- claude_mpm/services/cli/session_manager.py +513 -0
- claude_mpm/services/cli/socketio_manager.py +498 -0
- claude_mpm/services/cli/startup_checker.py +370 -0
- claude_mpm/services/core/cache_manager.py +311 -0
- claude_mpm/services/core/memory_manager.py +637 -0
- claude_mpm/services/core/path_resolver.py +498 -0
- claude_mpm/services/core/service_container.py +520 -0
- claude_mpm/services/core/service_interfaces.py +436 -0
- claude_mpm/services/diagnostics/checks/agent_check.py +65 -19
- claude_mpm/services/memory/router.py +116 -10
- {claude_mpm-4.1.2.dist-info โ claude_mpm-4.1.4.dist-info}/METADATA +1 -1
- {claude_mpm-4.1.2.dist-info โ claude_mpm-4.1.4.dist-info}/RECORD +86 -55
- claude_mpm/cli/commands/run_config_checker.py +0 -159
- {claude_mpm-4.1.2.dist-info โ claude_mpm-4.1.4.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.2.dist-info โ claude_mpm-4.1.4.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.1.2.dist-info โ claude_mpm-4.1.4.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.2.dist-info โ claude_mpm-4.1.4.dist-info}/top_level.txt +0 -0
|
@@ -57,6 +57,7 @@ class AgentManagerCommand(AgentCommand):
|
|
|
57
57
|
"show": self._show_agent,
|
|
58
58
|
"test": self._test_agent,
|
|
59
59
|
"templates": self._list_templates,
|
|
60
|
+
"reset": self._reset_agents,
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
command = args.agent_manager_command
|
|
@@ -330,6 +331,218 @@ class AgentManagerCommand(AgentCommand):
|
|
|
330
331
|
output += f" {template['description']}\n"
|
|
331
332
|
return CommandResult.success_result(output)
|
|
332
333
|
|
|
334
|
+
def _reset_agents(self, args) -> CommandResult:
|
|
335
|
+
"""Reset by removing claude-mpm authored agents from project and user directories.
|
|
336
|
+
|
|
337
|
+
This command removes any agents with "author: claude-mpm" in their frontmatter,
|
|
338
|
+
preserving user-created agents. This is useful for clean reinstalls or when
|
|
339
|
+
wanting to get fresh versions of system agents.
|
|
340
|
+
"""
|
|
341
|
+
try:
|
|
342
|
+
# Determine which directories to clean
|
|
343
|
+
clean_project = not getattr(args, "user_only", False)
|
|
344
|
+
clean_user = not getattr(args, "project_only", False)
|
|
345
|
+
dry_run = getattr(args, "dry_run", False)
|
|
346
|
+
force = getattr(args, "force", False)
|
|
347
|
+
output_format = getattr(args, "format", "text")
|
|
348
|
+
|
|
349
|
+
# Track results
|
|
350
|
+
results = {
|
|
351
|
+
"project": {"checked": False, "removed": [], "preserved": []},
|
|
352
|
+
"user": {"checked": False, "removed": [], "preserved": []},
|
|
353
|
+
"dry_run": dry_run,
|
|
354
|
+
"total_removed": 0,
|
|
355
|
+
"total_preserved": 0,
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
# Check project directory - always scan first to see what's there
|
|
359
|
+
if clean_project:
|
|
360
|
+
project_dir = Path.cwd() / ".claude" / "agents"
|
|
361
|
+
if project_dir.exists():
|
|
362
|
+
results["project"]["checked"] = True
|
|
363
|
+
# Always scan with dry_run=True first to see what's there
|
|
364
|
+
self._scan_and_clean_directory(
|
|
365
|
+
project_dir, results["project"], dry_run=True
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
# Check user directory - always scan first to see what's there
|
|
369
|
+
if clean_user:
|
|
370
|
+
user_dir = Path.home() / ".claude" / "agents"
|
|
371
|
+
if user_dir.exists():
|
|
372
|
+
results["user"]["checked"] = True
|
|
373
|
+
# Always scan with dry_run=True first to see what's there
|
|
374
|
+
self._scan_and_clean_directory(
|
|
375
|
+
user_dir, results["user"], dry_run=True
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
# Calculate totals
|
|
379
|
+
results["total_removed"] = len(results["project"]["removed"]) + len(
|
|
380
|
+
results["user"]["removed"]
|
|
381
|
+
)
|
|
382
|
+
results["total_preserved"] = len(results["project"]["preserved"]) + len(
|
|
383
|
+
results["user"]["preserved"]
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
# Handle output based on format
|
|
387
|
+
if output_format == "json":
|
|
388
|
+
return CommandResult.success_result("Reset completed", data=results)
|
|
389
|
+
|
|
390
|
+
# Generate text output
|
|
391
|
+
output = self._format_reset_results(results, dry_run, force)
|
|
392
|
+
|
|
393
|
+
# If not dry-run, perform actual removal
|
|
394
|
+
if not dry_run and results["total_removed"] > 0:
|
|
395
|
+
# If force mode, remove immediately; otherwise get confirmation
|
|
396
|
+
if not force:
|
|
397
|
+
# Get confirmation first
|
|
398
|
+
print(output)
|
|
399
|
+
print("\nโ ๏ธ This will permanently remove the agents listed above.")
|
|
400
|
+
|
|
401
|
+
# Ensure stdout is flushed before reading input
|
|
402
|
+
sys.stdout.flush()
|
|
403
|
+
|
|
404
|
+
# Get confirmation
|
|
405
|
+
try:
|
|
406
|
+
response = input("Continue? [y/N]: ").strip().lower()
|
|
407
|
+
if response not in ["y", "yes"]:
|
|
408
|
+
return CommandResult.success_result(
|
|
409
|
+
"Reset cancelled by user"
|
|
410
|
+
)
|
|
411
|
+
except (KeyboardInterrupt, EOFError):
|
|
412
|
+
return CommandResult.success_result("\nReset cancelled")
|
|
413
|
+
|
|
414
|
+
# Perform actual removal using the list we already have
|
|
415
|
+
if clean_project and results["project"]["removed"]:
|
|
416
|
+
project_dir = Path.cwd() / ".claude" / "agents"
|
|
417
|
+
for agent in results["project"]["removed"]:
|
|
418
|
+
agent_file = project_dir / agent
|
|
419
|
+
try:
|
|
420
|
+
if agent_file.exists():
|
|
421
|
+
agent_file.unlink()
|
|
422
|
+
self.logger.info(
|
|
423
|
+
f"Removed claude-mpm agent: {agent_file}"
|
|
424
|
+
)
|
|
425
|
+
except Exception as e:
|
|
426
|
+
self.logger.warning(f"Could not remove {agent_file}: {e}")
|
|
427
|
+
|
|
428
|
+
if clean_user and results["user"]["removed"]:
|
|
429
|
+
user_dir = Path.home() / ".claude" / "agents"
|
|
430
|
+
for agent in results["user"]["removed"]:
|
|
431
|
+
agent_file = user_dir / agent
|
|
432
|
+
try:
|
|
433
|
+
if agent_file.exists():
|
|
434
|
+
agent_file.unlink()
|
|
435
|
+
self.logger.info(
|
|
436
|
+
f"Removed claude-mpm agent: {agent_file}"
|
|
437
|
+
)
|
|
438
|
+
except Exception as e:
|
|
439
|
+
self.logger.warning(f"Could not remove {agent_file}: {e}")
|
|
440
|
+
|
|
441
|
+
# Update output to show actual removal
|
|
442
|
+
output = self._format_reset_results(results, dry_run=False, force=force)
|
|
443
|
+
|
|
444
|
+
return CommandResult.success_result(output)
|
|
445
|
+
|
|
446
|
+
except Exception as e:
|
|
447
|
+
self.logger.error(f"Failed to reset agents: {e}", exc_info=True)
|
|
448
|
+
return CommandResult.error_result(f"Failed to reset agents: {e}")
|
|
449
|
+
|
|
450
|
+
def _scan_and_clean_directory(
|
|
451
|
+
self, directory: Path, results: Dict[str, Any], dry_run: bool
|
|
452
|
+
) -> None:
|
|
453
|
+
"""Scan a directory for claude-mpm authored agents and optionally remove them.
|
|
454
|
+
|
|
455
|
+
Args:
|
|
456
|
+
directory: Directory to scan
|
|
457
|
+
results: Results dictionary to update
|
|
458
|
+
dry_run: If True, only scan without removing
|
|
459
|
+
"""
|
|
460
|
+
for agent_file in directory.glob("*.md"):
|
|
461
|
+
try:
|
|
462
|
+
content = agent_file.read_text()
|
|
463
|
+
# Check if this is a claude-mpm authored agent
|
|
464
|
+
if "author: claude-mpm" in content.lower():
|
|
465
|
+
results["removed"].append(agent_file.name)
|
|
466
|
+
if not dry_run:
|
|
467
|
+
agent_file.unlink()
|
|
468
|
+
self.logger.info(f"Removed claude-mpm agent: {agent_file}")
|
|
469
|
+
else:
|
|
470
|
+
results["preserved"].append(agent_file.name)
|
|
471
|
+
self.logger.debug(f"Preserved user agent: {agent_file}")
|
|
472
|
+
except Exception as e:
|
|
473
|
+
self.logger.warning(f"Could not process {agent_file}: {e}")
|
|
474
|
+
|
|
475
|
+
def _format_reset_results(
|
|
476
|
+
self, results: Dict[str, Any], dry_run: bool, force: bool
|
|
477
|
+
) -> str:
|
|
478
|
+
"""Format reset results for display.
|
|
479
|
+
|
|
480
|
+
Args:
|
|
481
|
+
results: Results dictionary
|
|
482
|
+
dry_run: Whether this was a dry run
|
|
483
|
+
force: Whether force mode was used
|
|
484
|
+
|
|
485
|
+
Returns:
|
|
486
|
+
Formatted output string
|
|
487
|
+
"""
|
|
488
|
+
if dry_run:
|
|
489
|
+
output = "๐ DRY RUN - No changes will be made\n"
|
|
490
|
+
output += "=" * 50 + "\n\n"
|
|
491
|
+
else:
|
|
492
|
+
output = "๐งน Agent Reset Complete\n"
|
|
493
|
+
output += "=" * 50 + "\n\n"
|
|
494
|
+
|
|
495
|
+
# Show project results
|
|
496
|
+
if results["project"]["checked"]:
|
|
497
|
+
output += "๐ Project Level (.claude/agents):\n"
|
|
498
|
+
if results["project"]["removed"]:
|
|
499
|
+
action = "Would remove" if dry_run else "Removed"
|
|
500
|
+
output += f" {action} {len(results['project']['removed'])} claude-mpm agent(s):\n"
|
|
501
|
+
for agent in results["project"]["removed"][:5]:
|
|
502
|
+
output += f" โข {agent}\n"
|
|
503
|
+
if len(results["project"]["removed"]) > 5:
|
|
504
|
+
output += (
|
|
505
|
+
f" ... and {len(results['project']['removed']) - 5} more\n"
|
|
506
|
+
)
|
|
507
|
+
else:
|
|
508
|
+
output += " No claude-mpm agents found\n"
|
|
509
|
+
|
|
510
|
+
if results["project"]["preserved"]:
|
|
511
|
+
output += f" Preserved {len(results['project']['preserved'])} user-created agent(s)\n"
|
|
512
|
+
output += "\n"
|
|
513
|
+
|
|
514
|
+
# Show user results
|
|
515
|
+
if results["user"]["checked"]:
|
|
516
|
+
output += "๐ User Level (~/.claude/agents):\n"
|
|
517
|
+
if results["user"]["removed"]:
|
|
518
|
+
action = "Would remove" if dry_run else "Removed"
|
|
519
|
+
output += f" {action} {len(results['user']['removed'])} claude-mpm agent(s):\n"
|
|
520
|
+
for agent in results["user"]["removed"][:5]:
|
|
521
|
+
output += f" โข {agent}\n"
|
|
522
|
+
if len(results["user"]["removed"]) > 5:
|
|
523
|
+
output += (
|
|
524
|
+
f" ... and {len(results['user']['removed']) - 5} more\n"
|
|
525
|
+
)
|
|
526
|
+
else:
|
|
527
|
+
output += " No claude-mpm agents found\n"
|
|
528
|
+
|
|
529
|
+
if results["user"]["preserved"]:
|
|
530
|
+
output += f" Preserved {len(results['user']['preserved'])} user-created agent(s)\n"
|
|
531
|
+
output += "\n"
|
|
532
|
+
|
|
533
|
+
# Show summary
|
|
534
|
+
output += "๐ Summary:\n"
|
|
535
|
+
if dry_run:
|
|
536
|
+
output += f" โข Would remove: {results['total_removed']} agent(s)\n"
|
|
537
|
+
else:
|
|
538
|
+
output += f" โข Removed: {results['total_removed']} agent(s)\n"
|
|
539
|
+
output += f" โข Preserved: {results['total_preserved']} user agent(s)\n"
|
|
540
|
+
|
|
541
|
+
if dry_run and results["total_removed"] > 0:
|
|
542
|
+
output += "\n๐ก Run with --force to execute this cleanup immediately"
|
|
543
|
+
|
|
544
|
+
return output
|
|
545
|
+
|
|
333
546
|
def _interactive_create(self) -> CommandResult:
|
|
334
547
|
"""Interactive agent creation wizard."""
|
|
335
548
|
print("\n=== Agent Creation Wizard ===\n")
|
|
@@ -493,6 +706,7 @@ Commands:
|
|
|
493
706
|
show Display detailed agent information
|
|
494
707
|
test Validate agent configuration
|
|
495
708
|
templates List available agent templates
|
|
709
|
+
reset Remove claude-mpm authored agents for clean install
|
|
496
710
|
|
|
497
711
|
Examples:
|
|
498
712
|
claude-mpm agent-manager list
|
|
@@ -500,6 +714,8 @@ Examples:
|
|
|
500
714
|
claude-mpm agent-manager variant --base research --id research-v2
|
|
501
715
|
claude-mpm agent-manager deploy --agent-id my-agent --tier user
|
|
502
716
|
claude-mpm agent-manager customize-pm --level project
|
|
717
|
+
claude-mpm agent-manager reset --dry-run
|
|
718
|
+
claude-mpm agent-manager reset --force --project-only
|
|
503
719
|
|
|
504
720
|
Note: PM customization writes to .claude-mpm/INSTRUCTIONS.md, not CLAUDE.md
|
|
505
721
|
"""
|
|
@@ -520,7 +736,11 @@ def manage_agent_manager(args) -> int:
|
|
|
520
736
|
result = command.run(args)
|
|
521
737
|
|
|
522
738
|
if result.success:
|
|
523
|
-
|
|
739
|
+
# Handle JSON output format
|
|
740
|
+
output_format = getattr(args, "format", "text")
|
|
741
|
+
if output_format == "json" and result.data is not None:
|
|
742
|
+
print(json.dumps(result.data, indent=2))
|
|
743
|
+
elif result.message:
|
|
524
744
|
print(result.message)
|
|
525
745
|
return 0
|
|
526
746
|
if result.message:
|