claude-mpm 4.1.26__py3-none-any.whl ā 4.24.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/BUILD_NUMBER +1 -1
- claude_mpm/VERSION +1 -1
- claude_mpm/__init__.py +20 -5
- claude_mpm/agents/BASE_AGENT_TEMPLATE.md +118 -0
- claude_mpm/agents/BASE_DOCUMENTATION.md +53 -0
- claude_mpm/agents/BASE_ENGINEER.md +658 -0
- claude_mpm/agents/BASE_OPS.md +219 -0
- claude_mpm/agents/BASE_PM.md +420 -158
- claude_mpm/agents/BASE_PROMPT_ENGINEER.md +787 -0
- claude_mpm/agents/BASE_QA.md +167 -0
- claude_mpm/agents/BASE_RESEARCH.md +53 -0
- claude_mpm/agents/OUTPUT_STYLE.md +299 -29
- claude_mpm/agents/PM_INSTRUCTIONS.md +1159 -0
- claude_mpm/agents/WORKFLOW.md +355 -191
- claude_mpm/agents/agent_loader.py +40 -10
- claude_mpm/agents/agent_loader_integration.py +3 -2
- claude_mpm/agents/async_agent_loader.py +3 -3
- claude_mpm/agents/base_agent_loader.py +11 -9
- claude_mpm/agents/frontmatter_validator.py +291 -251
- claude_mpm/agents/system_agent_config.py +3 -2
- claude_mpm/agents/templates/README.md +465 -0
- claude_mpm/agents/templates/agent-manager.json +7 -4
- claude_mpm/agents/templates/{agentic_coder_optimizer.json ā agentic-coder-optimizer.json} +33 -7
- claude_mpm/agents/templates/api_qa.json +16 -4
- claude_mpm/agents/templates/circuit_breakers.md +638 -0
- claude_mpm/agents/templates/clerk-ops.json +235 -0
- claude_mpm/agents/templates/code_analyzer.json +10 -4
- claude_mpm/agents/templates/content-agent.json +358 -0
- claude_mpm/agents/templates/dart_engineer.json +307 -0
- claude_mpm/agents/templates/data_engineer.json +87 -14
- claude_mpm/agents/templates/documentation.json +76 -13
- claude_mpm/agents/templates/engineer.json +43 -9
- claude_mpm/agents/templates/gcp_ops_agent.json +253 -0
- claude_mpm/agents/templates/git_file_tracking.md +584 -0
- claude_mpm/agents/templates/golang_engineer.json +270 -0
- claude_mpm/agents/templates/imagemagick.json +5 -2
- claude_mpm/agents/templates/java_engineer.json +346 -0
- claude_mpm/agents/templates/javascript_engineer_agent.json +380 -0
- claude_mpm/agents/templates/local_ops_agent.json +1840 -0
- claude_mpm/agents/templates/logs/prompts/agent_engineer_20250901_010124_142.md +400 -0
- claude_mpm/agents/templates/memory_manager.json +6 -3
- claude_mpm/agents/templates/nextjs_engineer.json +285 -0
- claude_mpm/agents/templates/ops.json +14 -4
- claude_mpm/agents/templates/php-engineer.json +287 -0
- claude_mpm/agents/templates/pm_examples.md +474 -0
- claude_mpm/agents/templates/pm_red_flags.md +262 -0
- claude_mpm/agents/templates/product_owner.json +338 -0
- claude_mpm/agents/templates/project_organizer.json +19 -5
- claude_mpm/agents/templates/prompt-engineer.json +737 -0
- claude_mpm/agents/templates/python_engineer.json +387 -0
- claude_mpm/agents/templates/qa.json +25 -5
- claude_mpm/agents/templates/react_engineer.json +239 -0
- claude_mpm/agents/templates/refactoring_engineer.json +15 -5
- claude_mpm/agents/templates/research.json +46 -21
- claude_mpm/agents/templates/response_format.md +583 -0
- claude_mpm/agents/templates/ruby-engineer.json +280 -0
- claude_mpm/agents/templates/rust_engineer.json +275 -0
- claude_mpm/agents/templates/security.json +59 -10
- claude_mpm/agents/templates/svelte-engineer.json +225 -0
- claude_mpm/agents/templates/tauri_engineer.json +274 -0
- claude_mpm/agents/templates/ticketing.json +16 -7
- claude_mpm/agents/templates/typescript_engineer.json +285 -0
- claude_mpm/agents/templates/validation_templates.md +312 -0
- claude_mpm/agents/templates/vercel_ops_agent.json +164 -33
- claude_mpm/agents/templates/version_control.json +16 -4
- claude_mpm/agents/templates/web_qa.json +167 -21
- claude_mpm/agents/templates/web_ui.json +18 -5
- claude_mpm/cli/__init__.py +38 -378
- claude_mpm/cli/commands/__init__.py +2 -0
- claude_mpm/cli/commands/agent_manager.py +675 -20
- claude_mpm/cli/commands/agent_state_manager.py +186 -0
- claude_mpm/cli/commands/agents.py +722 -150
- claude_mpm/cli/commands/agents_detect.py +380 -0
- claude_mpm/cli/commands/agents_recommend.py +309 -0
- claude_mpm/cli/commands/aggregate.py +10 -6
- claude_mpm/cli/commands/analyze.py +15 -10
- claude_mpm/cli/commands/analyze_code.py +8 -4
- claude_mpm/cli/commands/auto_configure.py +570 -0
- claude_mpm/cli/commands/cleanup.py +12 -12
- claude_mpm/cli/commands/config.py +47 -13
- claude_mpm/cli/commands/configure.py +469 -1064
- claude_mpm/cli/commands/configure_agent_display.py +261 -0
- claude_mpm/cli/commands/configure_behavior_manager.py +204 -0
- claude_mpm/cli/commands/configure_hook_manager.py +225 -0
- claude_mpm/cli/commands/configure_models.py +18 -0
- claude_mpm/cli/commands/configure_navigation.py +167 -0
- claude_mpm/cli/commands/configure_paths.py +104 -0
- claude_mpm/cli/commands/configure_persistence.py +254 -0
- claude_mpm/cli/commands/configure_startup_manager.py +646 -0
- claude_mpm/cli/commands/configure_template_editor.py +497 -0
- claude_mpm/cli/commands/configure_validators.py +73 -0
- claude_mpm/cli/commands/dashboard.py +50 -52
- claude_mpm/cli/commands/debug.py +7 -7
- claude_mpm/cli/commands/doctor.py +43 -7
- claude_mpm/cli/commands/info.py +3 -4
- claude_mpm/cli/commands/local_deploy.py +537 -0
- claude_mpm/cli/commands/mcp.py +17 -10
- claude_mpm/cli/commands/mcp_command_router.py +11 -0
- claude_mpm/cli/commands/mcp_config.py +154 -0
- claude_mpm/cli/commands/mcp_external_commands.py +249 -0
- claude_mpm/cli/commands/mcp_install_commands.py +101 -32
- claude_mpm/cli/commands/mcp_pipx_config.py +2 -2
- claude_mpm/cli/commands/mcp_setup_external.py +868 -0
- claude_mpm/cli/commands/memory.py +55 -21
- claude_mpm/cli/commands/monitor.py +160 -70
- claude_mpm/cli/commands/mpm_init/__init__.py +73 -0
- claude_mpm/cli/commands/mpm_init/core.py +525 -0
- claude_mpm/cli/commands/mpm_init/display.py +341 -0
- claude_mpm/cli/commands/mpm_init/git_activity.py +427 -0
- claude_mpm/cli/commands/mpm_init/modes.py +397 -0
- claude_mpm/cli/commands/mpm_init/prompts.py +442 -0
- claude_mpm/cli/commands/mpm_init_cli.py +396 -0
- claude_mpm/cli/commands/mpm_init_handler.py +114 -4
- claude_mpm/cli/commands/run.py +169 -42
- claude_mpm/cli/commands/search.py +458 -0
- claude_mpm/cli/commands/skills.py +488 -0
- claude_mpm/cli/commands/uninstall.py +176 -0
- claude_mpm/cli/commands/upgrade.py +152 -0
- claude_mpm/cli/commands/verify.py +119 -0
- claude_mpm/cli/executor.py +204 -0
- claude_mpm/cli/helpers.py +105 -0
- claude_mpm/cli/interactive/__init__.py +21 -0
- claude_mpm/cli/interactive/agent_wizard.py +962 -0
- claude_mpm/cli/interactive/skills_wizard.py +491 -0
- claude_mpm/cli/parser.py +79 -2
- claude_mpm/cli/parsers/__init__.py +7 -1
- claude_mpm/cli/parsers/agent_manager_parser.py +161 -1
- claude_mpm/cli/parsers/agents_parser.py +116 -0
- claude_mpm/cli/parsers/auto_configure_parser.py +245 -0
- claude_mpm/cli/parsers/base_parser.py +143 -3
- claude_mpm/cli/parsers/configure_parser.py +11 -15
- claude_mpm/cli/parsers/local_deploy_parser.py +227 -0
- claude_mpm/cli/parsers/mcp_parser.py +15 -0
- claude_mpm/cli/parsers/monitor_parser.py +12 -2
- claude_mpm/cli/parsers/mpm_init_parser.py +179 -9
- claude_mpm/cli/parsers/run_parser.py +5 -0
- claude_mpm/cli/parsers/search_parser.py +245 -0
- claude_mpm/cli/parsers/skills_parser.py +137 -0
- claude_mpm/cli/shared/argument_patterns.py +20 -13
- claude_mpm/cli/shared/base_command.py +2 -2
- claude_mpm/cli/shared/output_formatters.py +28 -19
- claude_mpm/cli/startup.py +562 -0
- claude_mpm/cli/startup_logging.py +179 -13
- claude_mpm/cli/utils.py +53 -2
- claude_mpm/commands/mpm-agents-detect.md +168 -0
- claude_mpm/commands/mpm-agents-recommend.md +214 -0
- claude_mpm/commands/mpm-agents.md +118 -8
- claude_mpm/commands/mpm-auto-configure.md +269 -0
- claude_mpm/commands/mpm-config.md +137 -14
- claude_mpm/commands/mpm-help.md +285 -5
- claude_mpm/commands/mpm-init.md +374 -15
- claude_mpm/commands/mpm-monitor.md +409 -0
- claude_mpm/commands/mpm-organize.md +295 -0
- claude_mpm/commands/mpm-resume.md +372 -0
- claude_mpm/commands/mpm-status.md +71 -9
- claude_mpm/commands/mpm-tickets.md +56 -7
- claude_mpm/commands/mpm-version.md +113 -0
- claude_mpm/commands/mpm.md +2 -0
- claude_mpm/config/agent_config.py +4 -4
- claude_mpm/config/experimental_features.py +7 -7
- claude_mpm/config/model_config.py +428 -0
- claude_mpm/config/paths.py +3 -2
- claude_mpm/config/socketio_config.py +3 -3
- claude_mpm/constants.py +15 -1
- claude_mpm/core/__init__.py +53 -17
- claude_mpm/core/agent_name_normalizer.py +3 -2
- claude_mpm/core/agent_registry.py +2 -2
- claude_mpm/core/agent_session_manager.py +10 -10
- claude_mpm/core/api_validator.py +330 -0
- claude_mpm/core/base_service.py +33 -23
- claude_mpm/core/cache.py +9 -9
- claude_mpm/core/claude_runner.py +19 -8
- claude_mpm/core/config.py +85 -8
- claude_mpm/core/config_aliases.py +7 -6
- claude_mpm/core/constants.py +65 -0
- claude_mpm/core/container.py +11 -5
- claude_mpm/core/enums.py +452 -0
- claude_mpm/core/error_handler.py +623 -0
- claude_mpm/core/factories.py +1 -1
- claude_mpm/core/file_utils.py +764 -0
- claude_mpm/core/framework/__init__.py +38 -0
- claude_mpm/core/framework/formatters/__init__.py +11 -0
- claude_mpm/core/framework/formatters/capability_generator.py +367 -0
- claude_mpm/core/framework/formatters/content_formatter.py +288 -0
- claude_mpm/core/framework/formatters/context_generator.py +185 -0
- claude_mpm/core/framework/loaders/__init__.py +13 -0
- claude_mpm/core/framework/loaders/agent_loader.py +210 -0
- claude_mpm/core/framework/loaders/file_loader.py +223 -0
- claude_mpm/core/framework/loaders/instruction_loader.py +161 -0
- claude_mpm/core/framework/loaders/packaged_loader.py +232 -0
- claude_mpm/core/framework/processors/__init__.py +11 -0
- claude_mpm/core/framework/processors/memory_processor.py +230 -0
- claude_mpm/core/framework/processors/metadata_processor.py +146 -0
- claude_mpm/core/framework/processors/template_processor.py +244 -0
- claude_mpm/core/framework_loader.py +321 -1631
- claude_mpm/core/hook_manager.py +8 -6
- claude_mpm/core/injectable_service.py +11 -8
- claude_mpm/core/instruction_reinforcement_hook.py +4 -3
- claude_mpm/core/interactive_session.py +55 -8
- claude_mpm/core/interfaces.py +56 -1
- claude_mpm/core/lazy.py +3 -3
- claude_mpm/core/log_manager.py +92 -23
- claude_mpm/core/logger.py +19 -14
- claude_mpm/core/logging_config.py +6 -2
- claude_mpm/core/logging_utils.py +520 -0
- claude_mpm/core/oneshot_session.py +51 -7
- claude_mpm/core/optimized_agent_loader.py +9 -9
- claude_mpm/core/optimized_startup.py +1 -1
- claude_mpm/core/output_style_manager.py +12 -192
- claude_mpm/core/pm_hook_interceptor.py +18 -12
- claude_mpm/core/service_registry.py +7 -3
- claude_mpm/core/session_manager.py +14 -12
- claude_mpm/core/shared/config_loader.py +1 -1
- claude_mpm/core/socketio_pool.py +15 -15
- claude_mpm/core/tool_access_control.py +3 -2
- claude_mpm/core/types.py +4 -11
- claude_mpm/core/typing_utils.py +7 -6
- claude_mpm/core/unified_agent_registry.py +115 -11
- claude_mpm/core/unified_config.py +6 -6
- claude_mpm/core/unified_paths.py +23 -20
- claude_mpm/dashboard/analysis_runner.py +4 -4
- claude_mpm/dashboard/api/simple_directory.py +261 -0
- claude_mpm/dashboard/react/components/DataInspector/DataInspector.module.css +188 -0
- claude_mpm/dashboard/react/components/EventViewer/EventViewer.module.css +156 -0
- claude_mpm/dashboard/react/components/shared/ConnectionStatus.module.css +38 -0
- claude_mpm/dashboard/react/components/shared/FilterBar.module.css +92 -0
- claude_mpm/dashboard/static/archive/activity_dashboard_fixed.html +248 -0
- claude_mpm/dashboard/static/archive/activity_dashboard_test.html +61 -0
- claude_mpm/dashboard/static/archive/test_activity_connection.html +179 -0
- claude_mpm/dashboard/static/archive/test_claude_tree_tab.html +68 -0
- claude_mpm/dashboard/static/archive/test_dashboard.html +409 -0
- claude_mpm/dashboard/static/archive/test_dashboard_fixed.html +519 -0
- claude_mpm/dashboard/static/archive/test_dashboard_verification.html +181 -0
- claude_mpm/dashboard/static/archive/test_file_data.html +315 -0
- claude_mpm/dashboard/static/archive/test_file_tree_empty_state.html +243 -0
- claude_mpm/dashboard/static/archive/test_file_tree_fix.html +234 -0
- claude_mpm/dashboard/static/archive/test_file_tree_rename.html +117 -0
- claude_mpm/dashboard/static/archive/test_file_tree_tab.html +115 -0
- claude_mpm/dashboard/static/archive/test_file_viewer.html +224 -0
- claude_mpm/dashboard/static/archive/test_final_activity.html +220 -0
- claude_mpm/dashboard/static/archive/test_tab_fix.html +139 -0
- claude_mpm/dashboard/static/built/assets/events.DjpNxWNo.css +1 -0
- claude_mpm/dashboard/static/built/components/activity-tree.js +1 -1
- claude_mpm/dashboard/static/built/components/agent-hierarchy.js +777 -0
- claude_mpm/dashboard/static/built/components/agent-inference.js +1 -1
- claude_mpm/dashboard/static/built/components/build-tracker.js +333 -0
- claude_mpm/dashboard/static/built/components/code-simple.js +857 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-breadcrumb.js +353 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-constants.js +235 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-search.js +409 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-utils.js +435 -0
- claude_mpm/dashboard/static/built/components/code-tree.js +1 -1
- claude_mpm/dashboard/static/built/components/code-viewer.js +1 -1
- claude_mpm/dashboard/static/built/components/connection-debug.js +654 -0
- claude_mpm/dashboard/static/built/components/diff-viewer.js +891 -0
- claude_mpm/dashboard/static/built/components/event-processor.js +1 -1
- claude_mpm/dashboard/static/built/components/event-viewer.js +1 -1
- claude_mpm/dashboard/static/built/components/export-manager.js +1 -1
- claude_mpm/dashboard/static/built/components/file-change-tracker.js +443 -0
- claude_mpm/dashboard/static/built/components/file-change-viewer.js +690 -0
- claude_mpm/dashboard/static/built/components/file-tool-tracker.js +1 -1
- claude_mpm/dashboard/static/built/components/file-viewer.js +2 -0
- claude_mpm/dashboard/static/built/components/module-viewer.js +1 -1
- claude_mpm/dashboard/static/built/components/nav-bar.js +145 -0
- claude_mpm/dashboard/static/built/components/page-structure.js +429 -0
- claude_mpm/dashboard/static/built/components/session-manager.js +1 -1
- claude_mpm/dashboard/static/built/components/unified-data-viewer.js +1 -1
- claude_mpm/dashboard/static/built/components/working-directory.js +1 -1
- claude_mpm/dashboard/static/built/connection-manager.js +536 -0
- claude_mpm/dashboard/static/built/dashboard.js +1 -1
- claude_mpm/dashboard/static/built/extension-error-handler.js +164 -0
- claude_mpm/dashboard/static/built/react/events.js +30 -0
- claude_mpm/dashboard/static/built/shared/dom-helpers.js +396 -0
- claude_mpm/dashboard/static/built/shared/event-bus.js +330 -0
- claude_mpm/dashboard/static/built/shared/event-filter-service.js +540 -0
- claude_mpm/dashboard/static/built/shared/logger.js +385 -0
- claude_mpm/dashboard/static/built/shared/page-structure.js +249 -0
- claude_mpm/dashboard/static/built/shared/tooltip-service.js +253 -0
- claude_mpm/dashboard/static/built/socket-client.js +1 -1
- claude_mpm/dashboard/static/built/tab-isolation-fix.js +185 -0
- claude_mpm/dashboard/static/css/dashboard.css +588 -6
- claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +1 -0
- claude_mpm/dashboard/static/dist/components/activity-tree.js +1 -1
- claude_mpm/dashboard/static/dist/components/agent-inference.js +1 -1
- claude_mpm/dashboard/static/dist/components/code-tree.js +1 -1
- claude_mpm/dashboard/static/dist/components/code-viewer.js +1 -1
- claude_mpm/dashboard/static/dist/components/event-processor.js +1 -1
- claude_mpm/dashboard/static/dist/components/event-viewer.js +1 -1
- claude_mpm/dashboard/static/dist/components/export-manager.js +1 -1
- claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +1 -1
- claude_mpm/dashboard/static/dist/components/file-viewer.js +2 -0
- claude_mpm/dashboard/static/dist/components/module-viewer.js +1 -1
- claude_mpm/dashboard/static/dist/components/session-manager.js +1 -1
- claude_mpm/dashboard/static/dist/components/unified-data-viewer.js +1 -1
- claude_mpm/dashboard/static/dist/components/working-directory.js +1 -1
- claude_mpm/dashboard/static/dist/dashboard.js +1 -1
- claude_mpm/dashboard/static/dist/react/events.js +30 -0
- claude_mpm/dashboard/static/dist/socket-client.js +1 -1
- claude_mpm/dashboard/static/events.html +607 -0
- claude_mpm/dashboard/static/index.html +635 -0
- claude_mpm/dashboard/static/js/components/activity-tree.js +3 -17
- claude_mpm/dashboard/static/js/components/agent-hierarchy.js +4 -1
- claude_mpm/dashboard/static/js/components/agent-inference.js +3 -0
- claude_mpm/dashboard/static/js/components/build-tracker.js +8 -0
- claude_mpm/dashboard/static/js/components/code-simple.js +857 -0
- claude_mpm/dashboard/static/js/components/diff-viewer.js +891 -0
- claude_mpm/dashboard/static/js/components/event-processor.js +3 -0
- claude_mpm/dashboard/static/js/components/event-viewer.js +39 -2
- claude_mpm/dashboard/static/js/components/export-manager.js +3 -0
- claude_mpm/dashboard/static/js/components/file-change-tracker.js +443 -0
- claude_mpm/dashboard/static/js/components/file-change-viewer.js +690 -0
- claude_mpm/dashboard/static/js/components/file-tool-tracker.js +30 -10
- claude_mpm/dashboard/static/js/components/file-viewer.js +580 -0
- claude_mpm/dashboard/static/js/components/module-viewer.js +26 -0
- claude_mpm/dashboard/static/js/components/session-manager.js +7 -7
- claude_mpm/dashboard/static/js/components/socket-manager.js +4 -0
- claude_mpm/dashboard/static/js/components/ui-state-manager.js +356 -41
- claude_mpm/dashboard/static/js/components/unified-data-viewer.js +455 -23
- claude_mpm/dashboard/static/js/components/working-directory.js +44 -9
- claude_mpm/dashboard/static/js/dashboard.js +245 -132
- claude_mpm/dashboard/static/js/shared/dom-helpers.js +396 -0
- claude_mpm/dashboard/static/js/shared/event-bus.js +330 -0
- claude_mpm/dashboard/static/js/shared/logger.js +385 -0
- claude_mpm/dashboard/static/js/shared/tooltip-service.js +253 -0
- claude_mpm/dashboard/static/js/socket-client.js +49 -22
- claude_mpm/dashboard/static/js/stores/dashboard-store.js +562 -0
- claude_mpm/dashboard/static/js/tab-isolation-fix.js +185 -0
- claude_mpm/dashboard/static/legacy/activity.html +736 -0
- claude_mpm/dashboard/static/legacy/agents.html +786 -0
- claude_mpm/dashboard/static/legacy/files.html +747 -0
- claude_mpm/dashboard/static/legacy/tools.html +831 -0
- claude_mpm/dashboard/static/monitors.html +431 -0
- claude_mpm/dashboard/static/production/events.html +659 -0
- claude_mpm/dashboard/static/production/main.html +698 -0
- claude_mpm/dashboard/static/production/monitors.html +483 -0
- claude_mpm/dashboard/static/socket.io.min.js +7 -0
- claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +7 -0
- claude_mpm/dashboard/static/test-archive/dashboard.html +635 -0
- claude_mpm/dashboard/static/test-archive/debug-events.html +147 -0
- claude_mpm/dashboard/static/test-archive/test-navigation.html +256 -0
- claude_mpm/dashboard/static/test-archive/test-react-exports.html +180 -0
- claude_mpm/dashboard/static/test-archive/test_debug.html +25 -0
- claude_mpm/dashboard/templates/code_simple.html +153 -0
- claude_mpm/dashboard/templates/index.html +112 -109
- claude_mpm/experimental/cli_enhancements.py +4 -2
- claude_mpm/generators/agent_profile_generator.py +5 -3
- claude_mpm/hooks/__init__.py +37 -1
- claude_mpm/hooks/base_hook.py +5 -4
- claude_mpm/hooks/claude_hooks/connection_pool.py +4 -4
- claude_mpm/hooks/claude_hooks/event_handlers.py +21 -18
- claude_mpm/hooks/claude_hooks/hook_handler.py +29 -22
- claude_mpm/hooks/claude_hooks/installer.py +67 -22
- claude_mpm/hooks/claude_hooks/memory_integration.py +3 -3
- claude_mpm/hooks/claude_hooks/response_tracking.py +57 -17
- claude_mpm/hooks/claude_hooks/services/connection_manager.py +62 -64
- claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +140 -76
- claude_mpm/hooks/claude_hooks/services/state_manager.py +11 -9
- claude_mpm/hooks/claude_hooks/services/subagent_processor.py +3 -3
- claude_mpm/hooks/failure_learning/__init__.py +60 -0
- claude_mpm/hooks/failure_learning/failure_detection_hook.py +235 -0
- claude_mpm/hooks/failure_learning/fix_detection_hook.py +217 -0
- claude_mpm/hooks/failure_learning/learning_extraction_hook.py +286 -0
- claude_mpm/hooks/instruction_reinforcement.py +301 -0
- claude_mpm/hooks/kuzu_enrichment_hook.py +263 -0
- claude_mpm/hooks/kuzu_memory_hook.py +386 -0
- claude_mpm/hooks/kuzu_response_hook.py +183 -0
- claude_mpm/hooks/memory_integration_hook.py +1 -1
- claude_mpm/hooks/session_resume_hook.py +121 -0
- claude_mpm/hooks/templates/pre_tool_use_simple.py +78 -0
- claude_mpm/hooks/templates/pre_tool_use_template.py +323 -0
- claude_mpm/hooks/tool_call_interceptor.py +8 -5
- claude_mpm/hooks/validation_hooks.py +3 -3
- claude_mpm/init.py +23 -4
- claude_mpm/models/agent_session.py +8 -6
- claude_mpm/models/resume_log.py +340 -0
- claude_mpm/scripts/claude-hook-handler.sh +33 -7
- claude_mpm/scripts/launch_monitor.py +85 -0
- claude_mpm/scripts/mcp_server.py +3 -5
- claude_mpm/scripts/mpm_doctor.py +3 -2
- claude_mpm/scripts/socketio_daemon.py +159 -512
- claude_mpm/services/__init__.py +144 -160
- claude_mpm/services/agents/__init__.py +18 -5
- claude_mpm/services/agents/agent_builder.py +13 -11
- claude_mpm/services/agents/auto_config_manager.py +796 -0
- claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
- claude_mpm/services/agents/deployment/agent_deployment.py +38 -15
- claude_mpm/services/agents/deployment/agent_discovery_service.py +125 -7
- claude_mpm/services/agents/deployment/agent_filesystem_manager.py +5 -5
- claude_mpm/services/agents/deployment/agent_format_converter.py +56 -12
- claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +4 -2
- claude_mpm/services/agents/deployment/agent_operation_service.py +2 -2
- claude_mpm/services/agents/deployment/agent_record_service.py +4 -4
- claude_mpm/services/agents/deployment/agent_state_service.py +2 -2
- claude_mpm/services/agents/deployment/agent_template_builder.py +715 -47
- claude_mpm/services/agents/deployment/agent_validator.py +31 -7
- claude_mpm/services/agents/deployment/agent_version_manager.py +8 -5
- claude_mpm/services/agents/deployment/agent_versioning.py +1 -1
- claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
- claude_mpm/services/agents/deployment/deployment_config_loader.py +131 -7
- claude_mpm/services/agents/deployment/deployment_type_detector.py +10 -14
- claude_mpm/services/agents/deployment/deployment_wrapper.py +58 -0
- claude_mpm/services/agents/deployment/interface_adapter.py +3 -2
- claude_mpm/services/agents/deployment/local_template_deployment.py +360 -0
- claude_mpm/services/agents/deployment/multi_source_deployment_service.py +134 -38
- claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +8 -7
- claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +7 -16
- claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +4 -3
- claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +7 -5
- claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +6 -5
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +9 -6
- claude_mpm/services/agents/deployment/system_instructions_deployer.py +9 -6
- claude_mpm/services/agents/deployment/validation/__init__.py +3 -1
- claude_mpm/services/agents/deployment/validation/template_validator.py +64 -44
- claude_mpm/services/agents/deployment/validation/validation_result.py +1 -9
- claude_mpm/services/agents/loading/agent_profile_loader.py +10 -9
- claude_mpm/services/agents/loading/base_agent_manager.py +16 -6
- claude_mpm/services/agents/loading/framework_agent_loader.py +2 -2
- claude_mpm/services/agents/local_template_manager.py +744 -0
- claude_mpm/services/agents/management/agent_capabilities_generator.py +3 -2
- claude_mpm/services/agents/management/agent_management_service.py +5 -5
- claude_mpm/services/agents/memory/agent_memory_manager.py +32 -29
- claude_mpm/services/agents/memory/content_manager.py +17 -9
- claude_mpm/services/agents/memory/memory_categorization_service.py +4 -2
- claude_mpm/services/agents/memory/memory_file_service.py +32 -6
- claude_mpm/services/agents/memory/memory_format_service.py +6 -4
- claude_mpm/services/agents/memory/memory_limits_service.py +4 -2
- claude_mpm/services/agents/memory/template_generator.py +3 -3
- claude_mpm/services/agents/observers.py +547 -0
- claude_mpm/services/agents/recommender.py +615 -0
- claude_mpm/services/agents/registry/deployed_agent_discovery.py +3 -3
- claude_mpm/services/agents/registry/modification_tracker.py +30 -19
- claude_mpm/services/async_session_logger.py +141 -98
- claude_mpm/services/claude_session_logger.py +82 -74
- claude_mpm/services/cli/agent_cleanup_service.py +5 -0
- claude_mpm/services/cli/agent_listing_service.py +5 -5
- claude_mpm/services/cli/agent_validation_service.py +3 -1
- claude_mpm/services/cli/memory_crud_service.py +12 -7
- claude_mpm/services/cli/memory_output_formatter.py +2 -2
- claude_mpm/services/cli/resume_service.py +617 -0
- claude_mpm/services/cli/session_manager.py +104 -13
- claude_mpm/services/cli/session_pause_manager.py +504 -0
- claude_mpm/services/cli/session_resume_helper.py +372 -0
- claude_mpm/services/cli/startup_checker.py +13 -10
- claude_mpm/services/cli/unified_dashboard_manager.py +439 -0
- claude_mpm/services/command_deployment_service.py +9 -7
- claude_mpm/services/command_handler_service.py +11 -5
- claude_mpm/services/core/__init__.py +33 -1
- claude_mpm/services/core/base.py +26 -11
- claude_mpm/services/core/interfaces/__init__.py +90 -3
- claude_mpm/services/core/interfaces/agent.py +184 -0
- claude_mpm/services/core/interfaces/health.py +172 -0
- claude_mpm/services/core/interfaces/model.py +281 -0
- claude_mpm/services/core/interfaces/process.py +372 -0
- claude_mpm/services/core/interfaces/project.py +121 -0
- claude_mpm/services/core/interfaces/restart.py +307 -0
- claude_mpm/services/core/interfaces/stability.py +260 -0
- claude_mpm/services/core/interfaces.py +56 -1
- claude_mpm/services/core/memory_manager.py +92 -47
- claude_mpm/services/core/models/__init__.py +79 -0
- claude_mpm/services/core/models/agent_config.py +384 -0
- claude_mpm/services/core/models/health.py +162 -0
- claude_mpm/services/core/models/process.py +239 -0
- claude_mpm/services/core/models/restart.py +302 -0
- claude_mpm/services/core/models/stability.py +264 -0
- claude_mpm/services/core/models/toolchain.py +306 -0
- claude_mpm/services/core/path_resolver.py +36 -14
- claude_mpm/services/diagnostics/__init__.py +2 -2
- claude_mpm/services/diagnostics/checks/__init__.py +4 -2
- claude_mpm/services/diagnostics/checks/agent_check.py +30 -32
- claude_mpm/services/diagnostics/checks/claude_code_check.py +270 -0
- claude_mpm/services/diagnostics/checks/common_issues_check.py +28 -27
- claude_mpm/services/diagnostics/checks/configuration_check.py +26 -25
- claude_mpm/services/diagnostics/checks/filesystem_check.py +18 -17
- claude_mpm/services/diagnostics/checks/installation_check.py +165 -60
- claude_mpm/services/diagnostics/checks/instructions_check.py +20 -19
- claude_mpm/services/diagnostics/checks/mcp_check.py +57 -43
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +1066 -0
- claude_mpm/services/diagnostics/checks/monitor_check.py +24 -23
- claude_mpm/services/diagnostics/checks/startup_log_check.py +14 -11
- claude_mpm/services/diagnostics/diagnostic_runner.py +22 -13
- claude_mpm/services/diagnostics/doctor_reporter.py +275 -47
- claude_mpm/services/diagnostics/models.py +37 -21
- claude_mpm/services/event_aggregator.py +5 -3
- claude_mpm/services/event_bus/direct_relay.py +8 -4
- claude_mpm/services/event_bus/event_bus.py +51 -9
- claude_mpm/services/event_bus/relay.py +33 -14
- claude_mpm/services/events/consumers/dead_letter.py +7 -5
- claude_mpm/services/events/core.py +5 -6
- claude_mpm/services/events/producers/hook.py +6 -6
- claude_mpm/services/events/producers/system.py +8 -8
- claude_mpm/services/exceptions.py +5 -5
- claude_mpm/services/framework_claude_md_generator/__init__.py +1 -1
- claude_mpm/services/framework_claude_md_generator/content_assembler.py +5 -5
- claude_mpm/services/framework_claude_md_generator/content_validator.py +2 -2
- claude_mpm/services/framework_claude_md_generator/deployment_manager.py +3 -3
- claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +2 -2
- claude_mpm/services/framework_claude_md_generator/version_manager.py +1 -1
- claude_mpm/services/hook_installer_service.py +506 -0
- claude_mpm/services/hook_service.py +5 -6
- claude_mpm/services/infrastructure/context_preservation.py +13 -11
- claude_mpm/services/infrastructure/daemon_manager.py +9 -9
- claude_mpm/services/infrastructure/logging.py +2 -2
- claude_mpm/services/infrastructure/monitoring/__init__.py +1 -1
- claude_mpm/services/infrastructure/monitoring/aggregator.py +12 -12
- claude_mpm/services/infrastructure/monitoring/base.py +5 -13
- claude_mpm/services/infrastructure/monitoring/network.py +7 -6
- claude_mpm/services/infrastructure/monitoring/process.py +13 -12
- claude_mpm/services/infrastructure/monitoring/resources.py +8 -7
- claude_mpm/services/infrastructure/monitoring/service.py +16 -15
- claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
- claude_mpm/services/local_ops/__init__.py +165 -0
- claude_mpm/services/local_ops/crash_detector.py +257 -0
- claude_mpm/services/local_ops/health_checks/__init__.py +28 -0
- claude_mpm/services/local_ops/health_checks/http_check.py +224 -0
- claude_mpm/services/local_ops/health_checks/process_check.py +236 -0
- claude_mpm/services/local_ops/health_checks/resource_check.py +255 -0
- claude_mpm/services/local_ops/health_manager.py +430 -0
- claude_mpm/services/local_ops/log_monitor.py +396 -0
- claude_mpm/services/local_ops/memory_leak_detector.py +294 -0
- claude_mpm/services/local_ops/process_manager.py +595 -0
- claude_mpm/services/local_ops/resource_monitor.py +331 -0
- claude_mpm/services/local_ops/restart_manager.py +401 -0
- claude_mpm/services/local_ops/restart_policy.py +387 -0
- claude_mpm/services/local_ops/state_manager.py +372 -0
- claude_mpm/services/local_ops/unified_manager.py +600 -0
- claude_mpm/services/mcp_config_manager.py +1612 -0
- claude_mpm/services/mcp_gateway/__init__.py +97 -93
- claude_mpm/services/mcp_gateway/auto_configure.py +43 -38
- claude_mpm/services/mcp_gateway/config/config_loader.py +3 -3
- claude_mpm/services/mcp_gateway/config/configuration.py +23 -4
- claude_mpm/services/mcp_gateway/core/__init__.py +1 -2
- claude_mpm/services/mcp_gateway/core/base.py +20 -33
- claude_mpm/services/mcp_gateway/core/process_pool.py +585 -31
- claude_mpm/services/mcp_gateway/core/singleton_manager.py +2 -2
- claude_mpm/services/mcp_gateway/core/startup_verification.py +3 -3
- claude_mpm/services/mcp_gateway/main.py +90 -15
- claude_mpm/services/mcp_gateway/registry/service_registry.py +4 -2
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +12 -9
- claude_mpm/services/mcp_gateway/server/mcp_gateway.py +4 -4
- claude_mpm/services/mcp_gateway/server/stdio_server.py +9 -15
- claude_mpm/services/mcp_gateway/tools/__init__.py +14 -2
- claude_mpm/services/mcp_gateway/tools/base_adapter.py +15 -15
- claude_mpm/services/mcp_gateway/tools/document_summarizer.py +10 -9
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +654 -0
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +36 -34
- claude_mpm/services/mcp_gateway/tools/hello_world.py +8 -8
- claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +551 -0
- claude_mpm/services/mcp_gateway/utils/__init__.py +14 -0
- claude_mpm/services/mcp_gateway/utils/package_version_checker.py +160 -0
- claude_mpm/services/mcp_gateway/utils/update_preferences.py +170 -0
- claude_mpm/services/mcp_service_verifier.py +729 -0
- claude_mpm/services/memory/builder.py +9 -8
- claude_mpm/services/memory/cache/shared_prompt_cache.py +2 -1
- claude_mpm/services/memory/cache/simple_cache.py +2 -2
- claude_mpm/services/memory/failure_tracker.py +578 -0
- claude_mpm/services/memory/indexed_memory.py +8 -8
- claude_mpm/services/memory/optimizer.py +8 -9
- claude_mpm/services/memory/router.py +3 -3
- claude_mpm/services/memory_hook_service.py +165 -4
- claude_mpm/services/model/__init__.py +147 -0
- claude_mpm/services/model/base_provider.py +365 -0
- claude_mpm/services/model/claude_provider.py +412 -0
- claude_mpm/services/model/model_router.py +453 -0
- claude_mpm/services/model/ollama_provider.py +415 -0
- claude_mpm/services/monitor/__init__.py +20 -0
- claude_mpm/services/monitor/daemon.py +671 -0
- claude_mpm/services/monitor/daemon_manager.py +963 -0
- claude_mpm/services/monitor/event_emitter.py +350 -0
- claude_mpm/services/monitor/handlers/__init__.py +21 -0
- claude_mpm/services/monitor/handlers/code_analysis.py +332 -0
- claude_mpm/services/monitor/handlers/dashboard.py +299 -0
- claude_mpm/services/monitor/handlers/file.py +264 -0
- claude_mpm/services/monitor/handlers/hooks.py +512 -0
- claude_mpm/services/monitor/management/__init__.py +18 -0
- claude_mpm/services/monitor/management/health.py +124 -0
- claude_mpm/services/monitor/management/lifecycle.py +724 -0
- claude_mpm/services/monitor/server.py +817 -0
- claude_mpm/services/monitor_build_service.py +2 -2
- claude_mpm/services/native_agent_converter.py +356 -0
- claude_mpm/services/orphan_detection.py +786 -0
- claude_mpm/services/port_manager.py +2 -2
- claude_mpm/services/project/__init__.py +23 -0
- claude_mpm/services/project/analyzer.py +3 -3
- claude_mpm/services/project/architecture_analyzer.py +5 -5
- claude_mpm/services/project/archive_manager.py +1045 -0
- claude_mpm/services/project/dependency_analyzer.py +4 -4
- claude_mpm/services/project/detection_strategies.py +719 -0
- claude_mpm/services/project/documentation_manager.py +553 -0
- claude_mpm/services/project/enhanced_analyzer.py +572 -0
- claude_mpm/services/project/metrics_collector.py +4 -4
- claude_mpm/services/project/project_organizer.py +1005 -0
- claude_mpm/services/project/registry.py +13 -7
- claude_mpm/services/project/toolchain_analyzer.py +581 -0
- claude_mpm/services/project_port_allocator.py +596 -0
- claude_mpm/services/response_tracker.py +21 -10
- claude_mpm/services/runner_configuration_service.py +1 -0
- claude_mpm/services/self_upgrade_service.py +500 -0
- claude_mpm/services/session_management_service.py +7 -5
- claude_mpm/services/session_manager.py +380 -0
- claude_mpm/services/shared/__init__.py +2 -1
- claude_mpm/services/shared/async_service_base.py +16 -27
- claude_mpm/services/shared/config_service_base.py +17 -14
- claude_mpm/services/shared/lifecycle_service_base.py +1 -14
- claude_mpm/services/shared/service_factory.py +8 -5
- claude_mpm/services/socketio/client_proxy.py +60 -5
- claude_mpm/services/socketio/dashboard_server.py +361 -0
- claude_mpm/services/socketio/event_normalizer.py +10 -6
- claude_mpm/services/socketio/handlers/__init__.py +5 -2
- claude_mpm/services/socketio/handlers/base.py +2 -2
- claude_mpm/services/socketio/handlers/code_analysis.py +90 -27
- claude_mpm/services/socketio/handlers/connection.py +21 -40
- claude_mpm/services/socketio/handlers/connection_handler.py +13 -10
- claude_mpm/services/socketio/handlers/file.py +46 -10
- claude_mpm/services/socketio/handlers/git.py +8 -8
- claude_mpm/services/socketio/handlers/hook.py +29 -17
- claude_mpm/services/socketio/handlers/registry.py +4 -2
- claude_mpm/services/socketio/monitor_client.py +364 -0
- claude_mpm/services/socketio/server/broadcaster.py +9 -7
- claude_mpm/services/socketio/server/connection_manager.py +2 -2
- claude_mpm/services/socketio/server/core.py +141 -4
- claude_mpm/services/socketio/server/eventbus_integration.py +20 -14
- claude_mpm/services/socketio/server/main.py +23 -21
- claude_mpm/services/socketio_client_manager.py +4 -4
- claude_mpm/services/subprocess_launcher_service.py +19 -15
- claude_mpm/services/system_instructions_service.py +2 -2
- claude_mpm/services/ticket_services/formatter_service.py +1 -1
- claude_mpm/services/ticket_services/validation_service.py +5 -5
- 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 +518 -0
- claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +680 -0
- claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +903 -0
- claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +746 -0
- claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +733 -0
- claude_mpm/services/unified/config_strategies/__init__.py +175 -0
- claude_mpm/services/unified/config_strategies/config_schema.py +731 -0
- claude_mpm/services/unified/config_strategies/context_strategy.py +747 -0
- claude_mpm/services/unified/config_strategies/error_handling_strategy.py +1005 -0
- claude_mpm/services/unified/config_strategies/file_loader_strategy.py +881 -0
- claude_mpm/services/unified/config_strategies/unified_config_service.py +823 -0
- claude_mpm/services/unified/config_strategies/validation_strategy.py +1148 -0
- claude_mpm/services/unified/deployment_strategies/__init__.py +97 -0
- claude_mpm/services/unified/deployment_strategies/base.py +553 -0
- claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +573 -0
- claude_mpm/services/unified/deployment_strategies/local.py +607 -0
- claude_mpm/services/unified/deployment_strategies/utils.py +667 -0
- claude_mpm/services/unified/deployment_strategies/vercel.py +475 -0
- claude_mpm/services/unified/interfaces.py +475 -0
- claude_mpm/services/unified/migration.py +509 -0
- claude_mpm/services/unified/strategies.py +534 -0
- claude_mpm/services/unified/unified_analyzer.py +542 -0
- claude_mpm/services/unified/unified_config.py +691 -0
- claude_mpm/services/unified/unified_deployment.py +470 -0
- claude_mpm/services/utility_service.py +6 -3
- claude_mpm/services/version_control/branch_strategy.py +2 -2
- claude_mpm/services/version_control/conflict_resolution.py +8 -4
- claude_mpm/services/version_control/git_operations.py +26 -24
- claude_mpm/services/version_control/semantic_versioning.py +14 -14
- claude_mpm/services/version_control/version_parser.py +14 -11
- claude_mpm/services/version_service.py +104 -1
- claude_mpm/skills/__init__.py +42 -0
- claude_mpm/skills/agent_skills_injector.py +324 -0
- claude_mpm/skills/bundled/LICENSE_ATTRIBUTIONS.md +79 -0
- claude_mpm/skills/bundled/__init__.py +6 -0
- claude_mpm/skills/bundled/api-documentation.md +393 -0
- claude_mpm/skills/bundled/async-testing.md +571 -0
- claude_mpm/skills/bundled/code-review.md +143 -0
- claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
- claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
- claude_mpm/skills/bundled/database-migration.md +199 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
- claude_mpm/skills/bundled/docker-containerization.md +194 -0
- claude_mpm/skills/bundled/express-local-dev.md +1429 -0
- claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
- claude_mpm/skills/bundled/git-workflow.md +414 -0
- claude_mpm/skills/bundled/imagemagick.md +204 -0
- claude_mpm/skills/bundled/infrastructure/env-manager/scripts/validate_env.py +576 -0
- claude_mpm/skills/bundled/json-data-handling.md +223 -0
- claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
- claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
- claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
- claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
- claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
- claude_mpm/skills/bundled/main/mcp-builder/scripts/connections.py +157 -0
- claude_mpm/skills/bundled/main/mcp-builder/scripts/evaluation.py +425 -0
- claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
- claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
- claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
- claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
- claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
- claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
- claude_mpm/skills/bundled/main/skill-creator/scripts/init_skill.py +303 -0
- claude_mpm/skills/bundled/main/skill-creator/scripts/package_skill.py +113 -0
- claude_mpm/skills/bundled/main/skill-creator/scripts/quick_validate.py +72 -0
- claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
- claude_mpm/skills/bundled/pdf.md +141 -0
- claude_mpm/skills/bundled/performance-profiling.md +573 -0
- claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
- claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
- claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
- claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
- claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
- claude_mpm/skills/bundled/security-scanning.md +327 -0
- claude_mpm/skills/bundled/systematic-debugging.md +473 -0
- claude_mpm/skills/bundled/test-driven-development.md +378 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
- claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
- claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
- claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
- claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
- claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
- claude_mpm/skills/bundled/testing/webapp-testing/examples/console_logging.py +35 -0
- claude_mpm/skills/bundled/testing/webapp-testing/examples/element_discovery.py +44 -0
- claude_mpm/skills/bundled/testing/webapp-testing/examples/static_html_automation.py +34 -0
- claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
- claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
- claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +129 -0
- claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
- claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
- claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
- claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
- claude_mpm/skills/bundled/xlsx.md +157 -0
- claude_mpm/skills/registry.py +286 -0
- claude_mpm/skills/skill_manager.py +310 -0
- claude_mpm/skills/skills_registry.py +348 -0
- claude_mpm/skills/skills_service.py +739 -0
- claude_mpm/storage/state_storage.py +31 -31
- claude_mpm/tools/__main__.py +1 -1
- claude_mpm/tools/code_tree_analyzer/__init__.py +45 -0
- claude_mpm/tools/code_tree_analyzer/analysis.py +299 -0
- claude_mpm/tools/code_tree_analyzer/cache.py +131 -0
- claude_mpm/tools/code_tree_analyzer/core.py +380 -0
- claude_mpm/tools/code_tree_analyzer/discovery.py +403 -0
- claude_mpm/tools/code_tree_analyzer/events.py +168 -0
- claude_mpm/tools/code_tree_analyzer/gitignore.py +308 -0
- claude_mpm/tools/code_tree_analyzer/models.py +39 -0
- claude_mpm/tools/code_tree_analyzer/multilang_analyzer.py +224 -0
- claude_mpm/tools/code_tree_analyzer/python_analyzer.py +284 -0
- claude_mpm/tools/code_tree_builder.py +6 -6
- claude_mpm/tools/code_tree_events.py +14 -10
- claude_mpm/tools/socketio_debug.py +11 -11
- claude_mpm/utils/agent_dependency_loader.py +108 -27
- claude_mpm/utils/common.py +544 -0
- claude_mpm/utils/config_manager.py +12 -6
- claude_mpm/utils/database_connector.py +298 -0
- claude_mpm/utils/dependency_cache.py +2 -2
- claude_mpm/utils/dependency_strategies.py +15 -10
- claude_mpm/utils/display_helper.py +260 -0
- claude_mpm/utils/environment_context.py +4 -3
- claude_mpm/utils/error_handler.py +5 -3
- claude_mpm/utils/file_utils.py +13 -14
- claude_mpm/utils/git_analyzer.py +407 -0
- claude_mpm/utils/log_cleanup.py +627 -0
- claude_mpm/utils/path_operations.py +7 -4
- claude_mpm/utils/robust_installer.py +133 -24
- claude_mpm/utils/session_logging.py +2 -2
- claude_mpm/utils/subprocess_utils.py +9 -8
- claude_mpm/validation/agent_validator.py +6 -6
- claude_mpm/validation/frontmatter_validator.py +6 -6
- claude_mpm-4.24.0.dist-info/METADATA +675 -0
- claude_mpm-4.24.0.dist-info/RECORD +1018 -0
- {claude_mpm-4.1.26.dist-info ā claude_mpm-4.24.0.dist-info}/entry_points.txt +1 -0
- claude_mpm/agents/INSTRUCTIONS.md +0 -261
- claude_mpm/agents/templates/agent-manager.md +0 -619
- claude_mpm/cli/commands/configure_tui.py +0 -1927
- claude_mpm/cli/commands/mpm_init.py +0 -594
- claude_mpm/cli/commands/socketio_monitor.py +0 -233
- claude_mpm/dashboard/static/css/code-tree.css +0 -1408
- claude_mpm/dashboard/static/js/components/code-tree.js +0 -3220
- claude_mpm/dashboard/static/js/components/code-viewer.js +0 -480
- claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +0 -425
- claude_mpm/hooks/claude_hooks/hook_handler_original.py +0 -1040
- claude_mpm/hooks/claude_hooks/hook_handler_refactored.py +0 -347
- claude_mpm/scripts/socketio_daemon_hardened.py +0 -937
- claude_mpm/scripts/socketio_daemon_wrapper.py +0 -78
- claude_mpm/scripts/socketio_server_manager.py +0 -349
- claude_mpm/services/agents/deployment/agent_lifecycle_manager_refactored.py +0 -575
- claude_mpm/services/cli/dashboard_launcher.py +0 -423
- claude_mpm/services/cli/socketio_manager.py +0 -537
- claude_mpm/services/diagnostics/checks/claude_desktop_check.py +0 -286
- claude_mpm/services/mcp_gateway/tools/ticket_tools.py +0 -645
- claude_mpm/services/mcp_gateway/tools/unified_ticket_tool.py +0 -602
- claude_mpm/services/project/analyzer_refactored.py +0 -450
- claude_mpm/tools/code_tree_analyzer.py +0 -1693
- claude_mpm-4.1.26.dist-info/METADATA +0 -332
- claude_mpm-4.1.26.dist-info/RECORD +0 -606
- {claude_mpm-4.1.26.dist-info ā claude_mpm-4.24.0.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.26.dist-info ā claude_mpm-4.24.0.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.26.dist-info ā claude_mpm-4.24.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
"""Interactive Agent Creation Wizard for Claude MPM.
|
|
2
|
+
|
|
3
|
+
This module provides a step-by-step interactive wizard for creating and managing
|
|
4
|
+
local agents with user-friendly prompts, intelligent defaults, and validation.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
import re
|
|
9
|
+
import sys
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any, Dict, Optional, Tuple
|
|
12
|
+
|
|
13
|
+
from claude_mpm.core.logging_config import get_logger
|
|
14
|
+
from claude_mpm.services.agents.local_template_manager import (
|
|
15
|
+
LocalAgentTemplate,
|
|
16
|
+
LocalAgentTemplateManager,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
logger = get_logger(__name__)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AgentWizard:
|
|
23
|
+
"""Interactive wizard for agent creation and management."""
|
|
24
|
+
|
|
25
|
+
def __init__(self):
|
|
26
|
+
"""Initialize the agent wizard."""
|
|
27
|
+
self.manager = LocalAgentTemplateManager()
|
|
28
|
+
self.logger = logger
|
|
29
|
+
|
|
30
|
+
def run_interactive_create(self) -> Tuple[bool, str]:
|
|
31
|
+
"""Run interactive agent creation wizard.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
Tuple of (success, message)
|
|
35
|
+
"""
|
|
36
|
+
try:
|
|
37
|
+
print("\n" + "=" * 60)
|
|
38
|
+
print("š§āāļø Agent Creation Wizard")
|
|
39
|
+
print("=" * 60)
|
|
40
|
+
print("\nI'll guide you through creating a custom local agent.")
|
|
41
|
+
print("Press Ctrl+C anytime to cancel.\n")
|
|
42
|
+
|
|
43
|
+
# Step 1: Agent ID
|
|
44
|
+
agent_id = self._get_agent_id()
|
|
45
|
+
if not agent_id:
|
|
46
|
+
return False, "Agent creation cancelled"
|
|
47
|
+
|
|
48
|
+
# Step 2: Agent Name
|
|
49
|
+
agent_name = self._get_agent_name(agent_id)
|
|
50
|
+
|
|
51
|
+
# Step 3: Agent Type/Category
|
|
52
|
+
agent_type = self._get_agent_type()
|
|
53
|
+
|
|
54
|
+
# Step 4: Model Selection
|
|
55
|
+
model = self._get_model_choice()
|
|
56
|
+
|
|
57
|
+
# Step 5: Inheritance Option
|
|
58
|
+
parent_agent, _base_template = self._get_inheritance_option()
|
|
59
|
+
|
|
60
|
+
# Step 6: Capabilities Configuration
|
|
61
|
+
capabilities = self._get_capabilities_configuration()
|
|
62
|
+
|
|
63
|
+
# Step 7: Description
|
|
64
|
+
description = self._get_agent_description(agent_type)
|
|
65
|
+
|
|
66
|
+
# Step 8: Instructions
|
|
67
|
+
instructions = self._get_agent_instructions(
|
|
68
|
+
agent_id, agent_type, parent_agent
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Step 9: Preview Configuration
|
|
72
|
+
config_preview = self._create_preview_config(
|
|
73
|
+
agent_id,
|
|
74
|
+
agent_name,
|
|
75
|
+
agent_type,
|
|
76
|
+
model,
|
|
77
|
+
parent_agent,
|
|
78
|
+
capabilities,
|
|
79
|
+
description,
|
|
80
|
+
instructions,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
# Step 10: Confirmation
|
|
84
|
+
if not self._confirm_creation(config_preview):
|
|
85
|
+
return False, "Agent creation cancelled"
|
|
86
|
+
|
|
87
|
+
# Step 11: Create and Save Agent
|
|
88
|
+
template = self._create_agent_template(
|
|
89
|
+
agent_id,
|
|
90
|
+
agent_name,
|
|
91
|
+
agent_type,
|
|
92
|
+
model,
|
|
93
|
+
parent_agent,
|
|
94
|
+
capabilities,
|
|
95
|
+
description,
|
|
96
|
+
instructions,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
template_file = self.manager.save_local_template(template, "project")
|
|
100
|
+
|
|
101
|
+
print(f"\nā
Agent '{agent_id}' created successfully!")
|
|
102
|
+
print(f"š Saved to: {template_file}")
|
|
103
|
+
print("\nš” Next steps:")
|
|
104
|
+
print(
|
|
105
|
+
f" ⢠Deploy: claude-mpm agent-manager deploy-local --agent-id {agent_id}"
|
|
106
|
+
)
|
|
107
|
+
print(f" ⢠Edit: Edit {template_file} directly")
|
|
108
|
+
print(f" ⢠Test: claude-mpm run --agent {agent_id}")
|
|
109
|
+
|
|
110
|
+
return True, f"Agent '{agent_id}' created successfully"
|
|
111
|
+
|
|
112
|
+
except KeyboardInterrupt:
|
|
113
|
+
print("\n\nā Agent creation cancelled by user")
|
|
114
|
+
return False, "Agent creation cancelled"
|
|
115
|
+
except Exception as e:
|
|
116
|
+
error_msg = f"Failed to create agent: {e}"
|
|
117
|
+
self.logger.error(error_msg, exc_info=True)
|
|
118
|
+
return False, error_msg
|
|
119
|
+
|
|
120
|
+
def run_interactive_manage(self) -> Tuple[bool, str]:
|
|
121
|
+
"""Run interactive agent management menu.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
Tuple of (success, message)
|
|
125
|
+
"""
|
|
126
|
+
try:
|
|
127
|
+
while True:
|
|
128
|
+
# List current local agents
|
|
129
|
+
templates = self.manager.list_local_templates()
|
|
130
|
+
|
|
131
|
+
print("\n" + "=" * 60)
|
|
132
|
+
print("š§ Agent Management Menu")
|
|
133
|
+
print("=" * 60)
|
|
134
|
+
|
|
135
|
+
if not templates:
|
|
136
|
+
print("\nš No local agents found.")
|
|
137
|
+
print("\n1. Create new agent")
|
|
138
|
+
print("2. Import agents")
|
|
139
|
+
print("3. Exit")
|
|
140
|
+
|
|
141
|
+
choice = input("\nSelect option [1-3]: ").strip()
|
|
142
|
+
|
|
143
|
+
if choice == "1":
|
|
144
|
+
return self.run_interactive_create()
|
|
145
|
+
if choice == "2":
|
|
146
|
+
return self._interactive_import()
|
|
147
|
+
if choice == "3":
|
|
148
|
+
return True, "Management menu exited"
|
|
149
|
+
print("ā Invalid choice. Please try again.")
|
|
150
|
+
continue
|
|
151
|
+
# Show existing agents
|
|
152
|
+
print(f"\nš Found {len(templates)} local agent(s):")
|
|
153
|
+
for i, template in enumerate(templates, 1):
|
|
154
|
+
tier_icon = "š¢" if template.tier == "project" else "š¤"
|
|
155
|
+
print(
|
|
156
|
+
f" {i}. {tier_icon} {template.agent_id} - {template.metadata.get('name', template.agent_id)}"
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
print(f"\n{len(templates) + 1}. Create new agent")
|
|
160
|
+
print(f"{len(templates) + 2}. Delete agent(s)")
|
|
161
|
+
print(f"{len(templates) + 3}. Import agents")
|
|
162
|
+
print(f"{len(templates) + 4}. Export all agents")
|
|
163
|
+
print(f"{len(templates) + 5}. Exit")
|
|
164
|
+
|
|
165
|
+
max_choice = len(templates) + 5
|
|
166
|
+
choice = input(f"\nSelect option [1-{max_choice}]: ").strip()
|
|
167
|
+
|
|
168
|
+
try:
|
|
169
|
+
choice_num = int(choice)
|
|
170
|
+
except ValueError:
|
|
171
|
+
print("ā Invalid choice. Please enter a number.")
|
|
172
|
+
continue
|
|
173
|
+
|
|
174
|
+
if 1 <= choice_num <= len(templates):
|
|
175
|
+
# Manage specific agent
|
|
176
|
+
selected_template = templates[choice_num - 1]
|
|
177
|
+
result = self._manage_single_agent(selected_template)
|
|
178
|
+
if not result[0]:
|
|
179
|
+
print(f"ā {result[1]}")
|
|
180
|
+
elif choice_num == len(templates) + 1:
|
|
181
|
+
success, message = self.run_interactive_create()
|
|
182
|
+
if message:
|
|
183
|
+
# Message already has emoji from the function
|
|
184
|
+
print(f"\n{message}")
|
|
185
|
+
continue # Return to main menu
|
|
186
|
+
elif choice_num == len(templates) + 2:
|
|
187
|
+
success, message = self._interactive_delete_menu(templates)
|
|
188
|
+
if message:
|
|
189
|
+
# Message already has emoji from the function
|
|
190
|
+
print(f"\n{message}")
|
|
191
|
+
continue # Return to main menu
|
|
192
|
+
elif choice_num == len(templates) + 3:
|
|
193
|
+
success, message = self._interactive_import()
|
|
194
|
+
if message:
|
|
195
|
+
# Message already has emoji from the function
|
|
196
|
+
print(f"\n{message}")
|
|
197
|
+
continue # Return to main menu
|
|
198
|
+
elif choice_num == len(templates) + 4:
|
|
199
|
+
_success, message = self._interactive_export()
|
|
200
|
+
if message:
|
|
201
|
+
# Message already has emoji from the function
|
|
202
|
+
print(f"\n{message}")
|
|
203
|
+
continue # Return to main menu
|
|
204
|
+
elif choice_num == len(templates) + 5:
|
|
205
|
+
return True, "Management menu exited"
|
|
206
|
+
else:
|
|
207
|
+
print("ā Invalid choice. Please try again.")
|
|
208
|
+
|
|
209
|
+
except KeyboardInterrupt:
|
|
210
|
+
print("\n\nā Management menu cancelled")
|
|
211
|
+
return False, "Management cancelled"
|
|
212
|
+
except Exception as e:
|
|
213
|
+
error_msg = f"Management menu error: {e}"
|
|
214
|
+
self.logger.error(error_msg, exc_info=True)
|
|
215
|
+
return False, error_msg
|
|
216
|
+
|
|
217
|
+
def _get_agent_id(self) -> Optional[str]:
|
|
218
|
+
"""Get and validate agent ID from user."""
|
|
219
|
+
while True:
|
|
220
|
+
agent_id = input(
|
|
221
|
+
"1. What would you like to name your agent?\n Agent ID (lowercase, hyphens): "
|
|
222
|
+
).strip()
|
|
223
|
+
|
|
224
|
+
if not agent_id:
|
|
225
|
+
print("ā Agent ID is required.")
|
|
226
|
+
continue
|
|
227
|
+
|
|
228
|
+
# Validate format
|
|
229
|
+
if (
|
|
230
|
+
not re.match(r"^[a-z][a-z0-9-]*[a-z0-9]$", agent_id)
|
|
231
|
+
or len(agent_id) > 50
|
|
232
|
+
):
|
|
233
|
+
print("ā Agent ID must:")
|
|
234
|
+
print(" ⢠Start with a letter")
|
|
235
|
+
print(" ⢠Contain only lowercase letters, numbers, and hyphens")
|
|
236
|
+
print(" ⢠End with a letter or number")
|
|
237
|
+
print(" ⢠Be 50 characters or less")
|
|
238
|
+
continue
|
|
239
|
+
|
|
240
|
+
# Check for conflicts
|
|
241
|
+
existing_template = self.manager.get_local_template(agent_id)
|
|
242
|
+
if existing_template:
|
|
243
|
+
print(f"ā Agent '{agent_id}' already exists.")
|
|
244
|
+
overwrite = (
|
|
245
|
+
input(" Overwrite existing agent? [y/N]: ").strip().lower()
|
|
246
|
+
)
|
|
247
|
+
if overwrite not in ["y", "yes"]:
|
|
248
|
+
continue
|
|
249
|
+
|
|
250
|
+
return agent_id
|
|
251
|
+
|
|
252
|
+
def _get_agent_name(self, agent_id: str) -> str:
|
|
253
|
+
"""Get agent display name."""
|
|
254
|
+
default_name = agent_id.replace("-", " ").title()
|
|
255
|
+
agent_name = input(
|
|
256
|
+
f"\n2. What should be the display name? [{default_name}]: "
|
|
257
|
+
).strip()
|
|
258
|
+
return agent_name or default_name
|
|
259
|
+
|
|
260
|
+
def _get_agent_type(self) -> str:
|
|
261
|
+
"""Get agent type/category from user."""
|
|
262
|
+
print("\n3. What type of agent is this?")
|
|
263
|
+
agent_types = [
|
|
264
|
+
(
|
|
265
|
+
"research",
|
|
266
|
+
"Research & Analysis",
|
|
267
|
+
"Gathering information, analyzing data, investigating topics",
|
|
268
|
+
),
|
|
269
|
+
(
|
|
270
|
+
"engineer",
|
|
271
|
+
"Implementation & Engineering",
|
|
272
|
+
"Writing code, building features, technical development",
|
|
273
|
+
),
|
|
274
|
+
(
|
|
275
|
+
"qa",
|
|
276
|
+
"Quality Assurance & Testing",
|
|
277
|
+
"Testing code, reviewing quality, finding bugs",
|
|
278
|
+
),
|
|
279
|
+
(
|
|
280
|
+
"docs",
|
|
281
|
+
"Documentation & Writing",
|
|
282
|
+
"Creating docs, writing content, technical writing",
|
|
283
|
+
),
|
|
284
|
+
(
|
|
285
|
+
"ops",
|
|
286
|
+
"Operations & Deployment",
|
|
287
|
+
"DevOps, deployment, system administration",
|
|
288
|
+
),
|
|
289
|
+
("custom", "Custom/Other", "Specialized or unique functionality"),
|
|
290
|
+
]
|
|
291
|
+
|
|
292
|
+
for i, (_type_id, name, desc) in enumerate(agent_types, 1):
|
|
293
|
+
print(f" [{i}] {name}")
|
|
294
|
+
print(f" {desc}")
|
|
295
|
+
|
|
296
|
+
while True:
|
|
297
|
+
choice = input(f"\nSelect type [1-{len(agent_types)}]: ").strip()
|
|
298
|
+
|
|
299
|
+
try:
|
|
300
|
+
choice_num = int(choice)
|
|
301
|
+
if 1 <= choice_num <= len(agent_types):
|
|
302
|
+
return agent_types[choice_num - 1][0]
|
|
303
|
+
except ValueError:
|
|
304
|
+
pass
|
|
305
|
+
|
|
306
|
+
print("ā Invalid choice. Please select a number from the list.")
|
|
307
|
+
|
|
308
|
+
def _get_model_choice(self) -> str:
|
|
309
|
+
"""Get model selection from user."""
|
|
310
|
+
print("\n4. Which model should this agent use?")
|
|
311
|
+
models = [
|
|
312
|
+
(
|
|
313
|
+
"sonnet",
|
|
314
|
+
"claude-3-sonnet (balanced - recommended)",
|
|
315
|
+
"Good balance of capability and speed",
|
|
316
|
+
),
|
|
317
|
+
(
|
|
318
|
+
"opus",
|
|
319
|
+
"claude-3-opus (powerful)",
|
|
320
|
+
"Most capable but slower and more expensive",
|
|
321
|
+
),
|
|
322
|
+
("haiku", "claude-3-haiku (fast)", "Fastest and most economical"),
|
|
323
|
+
]
|
|
324
|
+
|
|
325
|
+
for i, (_model_id, name, desc) in enumerate(models, 1):
|
|
326
|
+
print(f" [{i}] {name}")
|
|
327
|
+
print(f" {desc}")
|
|
328
|
+
|
|
329
|
+
while True:
|
|
330
|
+
choice = input(f"\nSelect model [1-{len(models)}] [1]: ").strip() or "1"
|
|
331
|
+
|
|
332
|
+
try:
|
|
333
|
+
choice_num = int(choice)
|
|
334
|
+
if 1 <= choice_num <= len(models):
|
|
335
|
+
return models[choice_num - 1][0]
|
|
336
|
+
except ValueError:
|
|
337
|
+
pass
|
|
338
|
+
|
|
339
|
+
print("ā Invalid choice. Please select a number from the list.")
|
|
340
|
+
|
|
341
|
+
def _get_inheritance_option(self) -> Tuple[Optional[str], Optional[Dict]]:
|
|
342
|
+
"""Get inheritance option from user."""
|
|
343
|
+
print("\n5. Would you like to inherit from an existing agent?")
|
|
344
|
+
print(" [1] No, start fresh")
|
|
345
|
+
print(" [2] Yes, inherit from system agent")
|
|
346
|
+
|
|
347
|
+
while True:
|
|
348
|
+
choice = input("\nSelect option [1-2] [1]: ").strip() or "1"
|
|
349
|
+
|
|
350
|
+
if choice == "1":
|
|
351
|
+
return None, None
|
|
352
|
+
if choice == "2":
|
|
353
|
+
return self._select_system_agent()
|
|
354
|
+
print("ā Invalid choice. Please select 1 or 2.")
|
|
355
|
+
|
|
356
|
+
def _select_system_agent(self) -> Tuple[Optional[str], Optional[Dict]]:
|
|
357
|
+
"""Let user select a system agent to inherit from."""
|
|
358
|
+
try:
|
|
359
|
+
# Get available system agents
|
|
360
|
+
from claude_mpm.services.agents.agent_builder import AgentBuilderService
|
|
361
|
+
|
|
362
|
+
builder = AgentBuilderService()
|
|
363
|
+
templates = builder.list_available_templates()
|
|
364
|
+
|
|
365
|
+
if not templates:
|
|
366
|
+
print("ā No system agents found to inherit from.")
|
|
367
|
+
return None, None
|
|
368
|
+
|
|
369
|
+
print("\n Select system agent to inherit from:")
|
|
370
|
+
for i, template in enumerate(templates, 1):
|
|
371
|
+
name = template.get("name", template.get("id", "Unknown"))
|
|
372
|
+
description = template.get("description", "")
|
|
373
|
+
print(f" [{i}] {name}")
|
|
374
|
+
if description:
|
|
375
|
+
print(f" {description[:80]}...")
|
|
376
|
+
|
|
377
|
+
while True:
|
|
378
|
+
choice = input(f"\n Select agent [1-{len(templates)}]: ").strip()
|
|
379
|
+
|
|
380
|
+
try:
|
|
381
|
+
choice_num = int(choice)
|
|
382
|
+
if 1 <= choice_num <= len(templates):
|
|
383
|
+
selected = templates[choice_num - 1]
|
|
384
|
+
return selected.get("id"), selected
|
|
385
|
+
except ValueError:
|
|
386
|
+
pass
|
|
387
|
+
|
|
388
|
+
print("ā Invalid choice. Please select a number from the list.")
|
|
389
|
+
|
|
390
|
+
except Exception as e:
|
|
391
|
+
self.logger.warning(f"Failed to load system agents: {e}")
|
|
392
|
+
print("ā Could not load system agents for inheritance.")
|
|
393
|
+
return None, None
|
|
394
|
+
|
|
395
|
+
def _get_capabilities_configuration(self) -> Dict[str, Any]:
|
|
396
|
+
"""Get capabilities configuration from user."""
|
|
397
|
+
print("\n6. What additional capabilities should this agent have?")
|
|
398
|
+
|
|
399
|
+
capabilities_options = [
|
|
400
|
+
("code_analysis", "Code analysis and review"),
|
|
401
|
+
("test_generation", "Test generation and validation"),
|
|
402
|
+
("security_scanning", "Security analysis and scanning"),
|
|
403
|
+
("performance_profiling", "Performance analysis and optimization"),
|
|
404
|
+
("documentation", "Documentation generation"),
|
|
405
|
+
("api_design", "API design and documentation"),
|
|
406
|
+
("data_processing", "Data processing and analysis"),
|
|
407
|
+
("web_scraping", "Web scraping and data extraction"),
|
|
408
|
+
]
|
|
409
|
+
|
|
410
|
+
print(" Select capabilities (enter multiple numbers separated by spaces):")
|
|
411
|
+
for i, (_cap_id, desc) in enumerate(capabilities_options, 1):
|
|
412
|
+
print(f" [{i}] {desc}")
|
|
413
|
+
|
|
414
|
+
selected_capabilities = []
|
|
415
|
+
while True:
|
|
416
|
+
choices = input(
|
|
417
|
+
f"\nSelect capabilities [1-{len(capabilities_options)}] (space-separated) [none]: "
|
|
418
|
+
).strip()
|
|
419
|
+
|
|
420
|
+
if not choices or choices.lower() == "none":
|
|
421
|
+
break
|
|
422
|
+
|
|
423
|
+
try:
|
|
424
|
+
choice_nums = [int(x) for x in choices.split()]
|
|
425
|
+
valid_choices = []
|
|
426
|
+
|
|
427
|
+
for num in choice_nums:
|
|
428
|
+
if 1 <= num <= len(capabilities_options):
|
|
429
|
+
selected_capabilities.append(capabilities_options[num - 1][0])
|
|
430
|
+
valid_choices.append(str(num))
|
|
431
|
+
|
|
432
|
+
if valid_choices:
|
|
433
|
+
print(f"ā
Selected: {', '.join(selected_capabilities)}")
|
|
434
|
+
break
|
|
435
|
+
print("ā No valid choices selected.")
|
|
436
|
+
except ValueError:
|
|
437
|
+
print("ā Please enter numbers separated by spaces.")
|
|
438
|
+
|
|
439
|
+
return {"specializations": selected_capabilities}
|
|
440
|
+
|
|
441
|
+
def _get_agent_description(self, agent_type: str) -> str:
|
|
442
|
+
"""Get agent description from user."""
|
|
443
|
+
type_examples = {
|
|
444
|
+
"research": "Specializes in analyzing market trends and competitive intelligence",
|
|
445
|
+
"engineer": "Focused on building scalable web applications using React and Node.js",
|
|
446
|
+
"qa": "Expert in automated testing and code quality assurance",
|
|
447
|
+
"docs": "Creates clear technical documentation and user guides",
|
|
448
|
+
"ops": "Manages CI/CD pipelines and cloud infrastructure",
|
|
449
|
+
"custom": "Handles specialized domain-specific tasks",
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
example = type_examples.get(agent_type, "Performs specialized tasks")
|
|
453
|
+
|
|
454
|
+
print("\n7. Describe this agent's specialty (one line):")
|
|
455
|
+
print(f" Example: {example}")
|
|
456
|
+
|
|
457
|
+
while True:
|
|
458
|
+
description = input("\n Description: ").strip()
|
|
459
|
+
|
|
460
|
+
if not description:
|
|
461
|
+
print("ā Description is required.")
|
|
462
|
+
continue
|
|
463
|
+
|
|
464
|
+
if len(description) > 200:
|
|
465
|
+
print("ā Description should be 200 characters or less.")
|
|
466
|
+
continue
|
|
467
|
+
|
|
468
|
+
return description
|
|
469
|
+
|
|
470
|
+
def _get_agent_instructions(
|
|
471
|
+
self, agent_id: str, agent_type: str, parent_agent: Optional[str]
|
|
472
|
+
) -> str:
|
|
473
|
+
"""Get agent instructions from user."""
|
|
474
|
+
print("\n8. Agent Instructions:")
|
|
475
|
+
|
|
476
|
+
if parent_agent:
|
|
477
|
+
print(f" Since you're inheriting from '{parent_agent}', you can:")
|
|
478
|
+
print(" [1] Use default inherited instructions")
|
|
479
|
+
print(" [2] Add custom instructions")
|
|
480
|
+
print(" [3] Write completely new instructions")
|
|
481
|
+
|
|
482
|
+
choice = input("\n Select option [1-3] [1]: ").strip() or "1"
|
|
483
|
+
|
|
484
|
+
if choice == "1":
|
|
485
|
+
return f"Extends the {parent_agent} agent with project-specific enhancements."
|
|
486
|
+
if choice == "2":
|
|
487
|
+
additional = input("\n Enter additional instructions: ").strip()
|
|
488
|
+
return f"Extends the {parent_agent} agent.\n\nAdditional instructions:\n{additional}"
|
|
489
|
+
|
|
490
|
+
# Get custom instructions
|
|
491
|
+
print(" Enter custom instructions for this agent:")
|
|
492
|
+
print(" (Type 'DONE' on a new line when finished)")
|
|
493
|
+
|
|
494
|
+
lines = []
|
|
495
|
+
while True:
|
|
496
|
+
line = input(" ")
|
|
497
|
+
if line.strip() == "DONE":
|
|
498
|
+
break
|
|
499
|
+
lines.append(line)
|
|
500
|
+
|
|
501
|
+
instructions = "\n".join(lines).strip()
|
|
502
|
+
|
|
503
|
+
if not instructions:
|
|
504
|
+
# Provide default based on type
|
|
505
|
+
type_defaults = {
|
|
506
|
+
"research": f"You are {agent_id}, a research and analysis agent. Focus on gathering accurate information, analyzing data, and providing well-researched insights.",
|
|
507
|
+
"engineer": f"You are {agent_id}, a software engineering agent. Focus on writing clean, efficient code and implementing technical solutions.",
|
|
508
|
+
"qa": f"You are {agent_id}, a quality assurance agent. Focus on testing, code review, and ensuring high quality standards.",
|
|
509
|
+
"docs": f"You are {agent_id}, a documentation agent. Focus on creating clear, comprehensive documentation and technical writing.",
|
|
510
|
+
"ops": f"You are {agent_id}, an operations agent. Focus on deployment, infrastructure, and system administration tasks.",
|
|
511
|
+
"custom": f"You are {agent_id}, a specialized agent. Focus on your specific domain expertise.",
|
|
512
|
+
}
|
|
513
|
+
instructions = type_defaults.get(
|
|
514
|
+
agent_type, f"You are {agent_id}, a specialized agent."
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
return instructions
|
|
518
|
+
|
|
519
|
+
def _create_preview_config(
|
|
520
|
+
self,
|
|
521
|
+
agent_id: str,
|
|
522
|
+
agent_name: str,
|
|
523
|
+
agent_type: str,
|
|
524
|
+
model: str,
|
|
525
|
+
parent_agent: Optional[str],
|
|
526
|
+
capabilities: Dict,
|
|
527
|
+
description: str,
|
|
528
|
+
instructions: str,
|
|
529
|
+
) -> Dict[str, Any]:
|
|
530
|
+
"""Create preview configuration dictionary."""
|
|
531
|
+
config = {
|
|
532
|
+
"agent_id": agent_id,
|
|
533
|
+
"name": agent_name,
|
|
534
|
+
"type": agent_type,
|
|
535
|
+
"model": model,
|
|
536
|
+
"description": description,
|
|
537
|
+
"capabilities": capabilities.get("specializations", []),
|
|
538
|
+
"instructions_preview": (
|
|
539
|
+
instructions[:100] + "..." if len(instructions) > 100 else instructions
|
|
540
|
+
),
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
if parent_agent:
|
|
544
|
+
config["inherits_from"] = parent_agent
|
|
545
|
+
|
|
546
|
+
return config
|
|
547
|
+
|
|
548
|
+
def _confirm_creation(self, config: Dict[str, Any]) -> bool:
|
|
549
|
+
"""Show preview and get confirmation from user."""
|
|
550
|
+
print("\n" + "=" * 60)
|
|
551
|
+
print("š Agent Configuration Preview")
|
|
552
|
+
print("=" * 60)
|
|
553
|
+
|
|
554
|
+
print(f"Agent ID: {config['agent_id']}")
|
|
555
|
+
print(f"Name: {config['name']}")
|
|
556
|
+
print(f"Type: {config['type']}")
|
|
557
|
+
print(f"Model: {config['model']}")
|
|
558
|
+
print(f"Description: {config['description']}")
|
|
559
|
+
|
|
560
|
+
if config.get("inherits_from"):
|
|
561
|
+
print(f"Inherits: {config['inherits_from']}")
|
|
562
|
+
|
|
563
|
+
if config.get("capabilities"):
|
|
564
|
+
print(f"Capabilities: {', '.join(config['capabilities'])}")
|
|
565
|
+
|
|
566
|
+
print("\nInstructions Preview:")
|
|
567
|
+
print(f" {config['instructions_preview']}")
|
|
568
|
+
|
|
569
|
+
print("\n" + "=" * 60)
|
|
570
|
+
|
|
571
|
+
while True:
|
|
572
|
+
confirm = input("\nCreate this agent? [Y/n]: ").strip().lower()
|
|
573
|
+
|
|
574
|
+
if confirm in ["", "y", "yes"]:
|
|
575
|
+
return True
|
|
576
|
+
if confirm in ["n", "no"]:
|
|
577
|
+
return False
|
|
578
|
+
print("ā Please enter 'y' for yes or 'n' for no.")
|
|
579
|
+
|
|
580
|
+
def _create_agent_template(
|
|
581
|
+
self,
|
|
582
|
+
agent_id: str,
|
|
583
|
+
agent_name: str,
|
|
584
|
+
agent_type: str,
|
|
585
|
+
model: str,
|
|
586
|
+
parent_agent: Optional[str],
|
|
587
|
+
capabilities: Dict,
|
|
588
|
+
description: str,
|
|
589
|
+
instructions: str,
|
|
590
|
+
) -> LocalAgentTemplate:
|
|
591
|
+
"""Create the actual agent template."""
|
|
592
|
+
return self.manager.create_local_template(
|
|
593
|
+
agent_id=agent_id,
|
|
594
|
+
name=agent_name,
|
|
595
|
+
description=description,
|
|
596
|
+
instructions=instructions,
|
|
597
|
+
model=model,
|
|
598
|
+
tools="*",
|
|
599
|
+
parent_agent=parent_agent,
|
|
600
|
+
tier="project",
|
|
601
|
+
)
|
|
602
|
+
|
|
603
|
+
def _manage_single_agent(self, template: LocalAgentTemplate) -> Tuple[bool, str]:
|
|
604
|
+
"""Manage a single agent."""
|
|
605
|
+
print(f"\nš§ Managing Agent: {template.agent_id}")
|
|
606
|
+
print(f" Name: {template.metadata.get('name', template.agent_id)}")
|
|
607
|
+
print(f" Tier: {template.tier}")
|
|
608
|
+
print(f" Version: {template.agent_version}")
|
|
609
|
+
|
|
610
|
+
print("\n1. View details")
|
|
611
|
+
print("2. Edit configuration")
|
|
612
|
+
print("3. Deploy agent")
|
|
613
|
+
print("4. Delete agent")
|
|
614
|
+
print("5. Export agent")
|
|
615
|
+
print("6. Back to menu")
|
|
616
|
+
|
|
617
|
+
choice = input("\nSelect option [1-6]: ").strip()
|
|
618
|
+
|
|
619
|
+
if choice == "1":
|
|
620
|
+
return self._view_agent_details(template)
|
|
621
|
+
if choice == "2":
|
|
622
|
+
return self._edit_agent_config(template)
|
|
623
|
+
if choice == "3":
|
|
624
|
+
return self._deploy_single_agent(template)
|
|
625
|
+
if choice == "4":
|
|
626
|
+
return self._delete_agent(template)
|
|
627
|
+
if choice == "5":
|
|
628
|
+
return self._export_single_agent(template)
|
|
629
|
+
if choice == "6":
|
|
630
|
+
return True, "Back to menu"
|
|
631
|
+
return False, "Invalid choice"
|
|
632
|
+
|
|
633
|
+
def _view_agent_details(self, template: LocalAgentTemplate) -> Tuple[bool, str]:
|
|
634
|
+
"""View detailed agent information."""
|
|
635
|
+
print(f"\nš Agent Details: {template.agent_id}")
|
|
636
|
+
print("=" * 50)
|
|
637
|
+
print(f"Name: {template.metadata.get('name', template.agent_id)}")
|
|
638
|
+
print(f"Version: {template.agent_version}")
|
|
639
|
+
print(f"Author: {template.author}")
|
|
640
|
+
print(f"Tier: {template.tier}")
|
|
641
|
+
print(f"Model: {template.capabilities.get('model', 'unknown')}")
|
|
642
|
+
print(f"Tools: {template.capabilities.get('tools', '*')}")
|
|
643
|
+
|
|
644
|
+
if template.parent_agent:
|
|
645
|
+
print(f"Inherits: {template.parent_agent}")
|
|
646
|
+
|
|
647
|
+
print("\nDescription:")
|
|
648
|
+
print(f" {template.metadata.get('description', 'No description')}")
|
|
649
|
+
|
|
650
|
+
print("\nInstructions:")
|
|
651
|
+
print(
|
|
652
|
+
f" {template.instructions[:200]}{'...' if len(template.instructions) > 200 else ''}"
|
|
653
|
+
)
|
|
654
|
+
|
|
655
|
+
input("\nPress Enter to continue...")
|
|
656
|
+
return True, "Agent details viewed"
|
|
657
|
+
|
|
658
|
+
def _edit_agent_config(self, template: LocalAgentTemplate) -> Tuple[bool, str]:
|
|
659
|
+
"""Edit agent configuration."""
|
|
660
|
+
print(f"\nāļø Editing Agent: {template.agent_id}")
|
|
661
|
+
print("This will open the JSON file in your default editor.")
|
|
662
|
+
|
|
663
|
+
confirm = input("Continue? [y/N]: ").strip().lower()
|
|
664
|
+
if confirm not in ["y", "yes"]:
|
|
665
|
+
return False, "Edit cancelled"
|
|
666
|
+
|
|
667
|
+
# Get template file path
|
|
668
|
+
if template.tier == "project":
|
|
669
|
+
template_file = (
|
|
670
|
+
self.manager.project_agents_dir / f"{template.agent_id}.json"
|
|
671
|
+
)
|
|
672
|
+
else:
|
|
673
|
+
template_file = self.manager.user_agents_dir / f"{template.agent_id}.json"
|
|
674
|
+
|
|
675
|
+
# Open in editor
|
|
676
|
+
import os
|
|
677
|
+
import subprocess
|
|
678
|
+
|
|
679
|
+
editor = os.environ.get("EDITOR", "nano")
|
|
680
|
+
try:
|
|
681
|
+
subprocess.run([editor, str(template_file)], check=True)
|
|
682
|
+
return True, f"Agent {template.agent_id} edited"
|
|
683
|
+
except Exception as e:
|
|
684
|
+
return False, f"Failed to open editor: {e}"
|
|
685
|
+
|
|
686
|
+
def _deploy_single_agent(self, template: LocalAgentTemplate) -> Tuple[bool, str]:
|
|
687
|
+
"""Deploy a single agent."""
|
|
688
|
+
try:
|
|
689
|
+
from claude_mpm.services.agents.deployment.local_template_deployment import (
|
|
690
|
+
LocalTemplateDeploymentService,
|
|
691
|
+
)
|
|
692
|
+
|
|
693
|
+
service = LocalTemplateDeploymentService()
|
|
694
|
+
success = service.deploy_single_local_template(
|
|
695
|
+
template.agent_id, force=True
|
|
696
|
+
)
|
|
697
|
+
|
|
698
|
+
if success:
|
|
699
|
+
return True, f"Agent '{template.agent_id}' deployed successfully"
|
|
700
|
+
return False, f"Failed to deploy agent '{template.agent_id}'"
|
|
701
|
+
|
|
702
|
+
except Exception as e:
|
|
703
|
+
return False, f"Deployment error: {e}"
|
|
704
|
+
|
|
705
|
+
def _delete_agent(self, template: LocalAgentTemplate) -> Tuple[bool, str]:
|
|
706
|
+
"""Delete an agent with comprehensive options."""
|
|
707
|
+
print(f"\nšļø Delete Agent: {template.agent_id}")
|
|
708
|
+
print(f" Name: {template.metadata.get('name', template.agent_id)}")
|
|
709
|
+
print(f" Tier: {template.tier}")
|
|
710
|
+
print(f" Location: {self._get_template_path(template)}")
|
|
711
|
+
|
|
712
|
+
# Check if deployed
|
|
713
|
+
deployment_file = Path.cwd() / ".claude" / "agents" / f"{template.agent_id}.md"
|
|
714
|
+
if deployment_file.exists():
|
|
715
|
+
print(f" Deployed: Yes ({deployment_file})")
|
|
716
|
+
else:
|
|
717
|
+
print(" Deployed: No")
|
|
718
|
+
|
|
719
|
+
print("\nDelete options:")
|
|
720
|
+
print(" [1] Delete template and deployment")
|
|
721
|
+
print(" [2] Delete template only (keep deployment)")
|
|
722
|
+
print(" [3] Cancel")
|
|
723
|
+
|
|
724
|
+
option = input("\nSelect option [1-3]: ").strip()
|
|
725
|
+
|
|
726
|
+
if option == "3":
|
|
727
|
+
return False, "Deletion cancelled"
|
|
728
|
+
|
|
729
|
+
delete_deployment = option == "1"
|
|
730
|
+
|
|
731
|
+
# Confirmation
|
|
732
|
+
print("\nā ļø This will permanently delete:")
|
|
733
|
+
print(f" - Template: {self._get_template_path(template)}")
|
|
734
|
+
if delete_deployment and deployment_file.exists():
|
|
735
|
+
print(f" - Deployment: {deployment_file}")
|
|
736
|
+
|
|
737
|
+
# Ask about backup
|
|
738
|
+
backup_choice = (
|
|
739
|
+
input("\nCreate backup before deletion? [y/N]: ").strip().lower()
|
|
740
|
+
)
|
|
741
|
+
backup_first = backup_choice in ["y", "yes"]
|
|
742
|
+
|
|
743
|
+
confirm = input("\nAre you sure? Type 'DELETE' to confirm: ").strip()
|
|
744
|
+
|
|
745
|
+
if confirm != "DELETE":
|
|
746
|
+
return False, "Deletion cancelled"
|
|
747
|
+
|
|
748
|
+
# Perform deletion
|
|
749
|
+
result = self.manager.delete_local_template(
|
|
750
|
+
agent_id=template.agent_id,
|
|
751
|
+
tier=template.tier,
|
|
752
|
+
delete_deployment=delete_deployment,
|
|
753
|
+
backup_first=backup_first,
|
|
754
|
+
)
|
|
755
|
+
|
|
756
|
+
if result["success"]:
|
|
757
|
+
message = f"ā
Agent '{template.agent_id}' deleted successfully"
|
|
758
|
+
if result["backup_location"]:
|
|
759
|
+
message += f"\n Backup saved to: {result['backup_location']}"
|
|
760
|
+
message += f"\n Removed {len(result['deleted_files'])} file(s)"
|
|
761
|
+
return True, message
|
|
762
|
+
errors = "\n".join(result["errors"])
|
|
763
|
+
return False, f"Failed to delete agent:\n{errors}"
|
|
764
|
+
|
|
765
|
+
def _export_single_agent(self, template: LocalAgentTemplate) -> Tuple[bool, str]:
|
|
766
|
+
"""Export a single agent."""
|
|
767
|
+
output_dir = Path("./exported-agents")
|
|
768
|
+
output_dir.mkdir(exist_ok=True)
|
|
769
|
+
|
|
770
|
+
output_file = output_dir / f"{template.agent_id}.json"
|
|
771
|
+
|
|
772
|
+
with output_file.open("w") as f:
|
|
773
|
+
json.dump(template.to_json(), f, indent=2)
|
|
774
|
+
|
|
775
|
+
return True, f"Agent exported to {output_file}"
|
|
776
|
+
|
|
777
|
+
def _interactive_import(self) -> Tuple[bool, str]:
|
|
778
|
+
"""Interactive agent import."""
|
|
779
|
+
input_dir = input("\nEnter directory path to import from: ").strip()
|
|
780
|
+
|
|
781
|
+
if not input_dir:
|
|
782
|
+
return False, "Import cancelled"
|
|
783
|
+
|
|
784
|
+
input_path = Path(input_dir)
|
|
785
|
+
if not input_path.exists():
|
|
786
|
+
return False, f"Directory does not exist: {input_path}"
|
|
787
|
+
|
|
788
|
+
# Select tier
|
|
789
|
+
print("\nImport to which tier?")
|
|
790
|
+
print(" [1] Project (recommended)")
|
|
791
|
+
print(" [2] User")
|
|
792
|
+
|
|
793
|
+
tier_choice = input("Select tier [1-2] [1]: ").strip() or "1"
|
|
794
|
+
tier = "project" if tier_choice == "1" else "user"
|
|
795
|
+
|
|
796
|
+
count = self.manager.import_local_templates(input_path, tier)
|
|
797
|
+
return True, f"Imported {count} agents from {input_path}"
|
|
798
|
+
|
|
799
|
+
def _interactive_export(self) -> Tuple[bool, str]:
|
|
800
|
+
"""Interactive agent export."""
|
|
801
|
+
output_dir = input(
|
|
802
|
+
"\nEnter directory path to export to [./exported-agents]: "
|
|
803
|
+
).strip()
|
|
804
|
+
|
|
805
|
+
if not output_dir:
|
|
806
|
+
output_dir = "./exported-agents"
|
|
807
|
+
|
|
808
|
+
output_path = Path(output_dir)
|
|
809
|
+
count = self.manager.export_local_templates(output_path)
|
|
810
|
+
return True, f"Exported {count} agents to {output_path}"
|
|
811
|
+
|
|
812
|
+
def _get_template_path(self, template: LocalAgentTemplate) -> Path:
|
|
813
|
+
"""Get the file path for a template."""
|
|
814
|
+
if template.tier == "project":
|
|
815
|
+
return self.manager.project_agents_dir / f"{template.agent_id}.json"
|
|
816
|
+
return self.manager.user_agents_dir / f"{template.agent_id}.json"
|
|
817
|
+
|
|
818
|
+
def _interactive_delete_menu(self, templates: list) -> Tuple[bool, str]:
|
|
819
|
+
"""Interactive deletion menu for multiple agents."""
|
|
820
|
+
print("\nšļø Delete Agents")
|
|
821
|
+
print("=" * 50)
|
|
822
|
+
|
|
823
|
+
if not templates:
|
|
824
|
+
return False, "No agents available to delete"
|
|
825
|
+
|
|
826
|
+
print("\nAvailable agents:")
|
|
827
|
+
for i, template in enumerate(templates, 1):
|
|
828
|
+
tier_icon = "š¢" if template.tier == "project" else "š¤"
|
|
829
|
+
print(
|
|
830
|
+
f" [{i}] {tier_icon} {template.agent_id} - {template.metadata.get('name', template.agent_id)}"
|
|
831
|
+
)
|
|
832
|
+
|
|
833
|
+
print("\n[all] Select all agents")
|
|
834
|
+
print("[0] Cancel")
|
|
835
|
+
|
|
836
|
+
selection = input(
|
|
837
|
+
"\nSelect agents to delete (comma-separated numbers or 'all'): "
|
|
838
|
+
).strip()
|
|
839
|
+
|
|
840
|
+
if selection == "0" or not selection:
|
|
841
|
+
return False, "Deletion cancelled"
|
|
842
|
+
|
|
843
|
+
# Parse selection
|
|
844
|
+
selected_templates = []
|
|
845
|
+
if selection.lower() == "all":
|
|
846
|
+
selected_templates = templates
|
|
847
|
+
else:
|
|
848
|
+
try:
|
|
849
|
+
indices = [int(x.strip()) - 1 for x in selection.split(",")]
|
|
850
|
+
for idx in indices:
|
|
851
|
+
if 0 <= idx < len(templates):
|
|
852
|
+
selected_templates.append(templates[idx])
|
|
853
|
+
else:
|
|
854
|
+
print(f"ā ļø Invalid selection: {idx + 1}")
|
|
855
|
+
except ValueError:
|
|
856
|
+
return False, "Invalid selection format"
|
|
857
|
+
|
|
858
|
+
if not selected_templates:
|
|
859
|
+
return False, "No valid agents selected"
|
|
860
|
+
|
|
861
|
+
# Show what will be deleted
|
|
862
|
+
print(f"\nš Selected {len(selected_templates)} agent(s) for deletion:")
|
|
863
|
+
for template in selected_templates:
|
|
864
|
+
tier_icon = "š¢" if template.tier == "project" else "š¤"
|
|
865
|
+
print(f" - {tier_icon} {template.agent_id}")
|
|
866
|
+
|
|
867
|
+
# Deletion options
|
|
868
|
+
print("\nDelete options:")
|
|
869
|
+
print(" [1] Delete templates and deployments")
|
|
870
|
+
print(" [2] Delete templates only (keep deployments)")
|
|
871
|
+
print(" [3] Cancel")
|
|
872
|
+
|
|
873
|
+
option = input("\nSelect option [1-3]: ").strip()
|
|
874
|
+
|
|
875
|
+
if option == "3":
|
|
876
|
+
return False, "Deletion cancelled"
|
|
877
|
+
|
|
878
|
+
delete_deployment = option == "1"
|
|
879
|
+
|
|
880
|
+
# Ask about backup
|
|
881
|
+
backup_choice = (
|
|
882
|
+
input("\nCreate backups before deletion? [y/N]: ").strip().lower()
|
|
883
|
+
)
|
|
884
|
+
backup_first = backup_choice in ["y", "yes"]
|
|
885
|
+
|
|
886
|
+
# Strong confirmation for multiple deletions
|
|
887
|
+
if len(selected_templates) > 1:
|
|
888
|
+
print(f"\nā ļø WARNING: This will delete {len(selected_templates)} agents!")
|
|
889
|
+
|
|
890
|
+
confirm = input("\nAre you sure? Type 'DELETE ALL' to confirm: ").strip()
|
|
891
|
+
|
|
892
|
+
if confirm != "DELETE ALL":
|
|
893
|
+
return False, "Deletion cancelled"
|
|
894
|
+
|
|
895
|
+
# Perform bulk deletion
|
|
896
|
+
agent_ids = [t.agent_id for t in selected_templates]
|
|
897
|
+
results = self.manager.delete_multiple_templates(
|
|
898
|
+
agent_ids=agent_ids,
|
|
899
|
+
tier="all", # Check all tiers since we have mixed selection
|
|
900
|
+
delete_deployment=delete_deployment,
|
|
901
|
+
backup_first=backup_first,
|
|
902
|
+
)
|
|
903
|
+
|
|
904
|
+
# Format results
|
|
905
|
+
if results["successful"]:
|
|
906
|
+
message = (
|
|
907
|
+
f"ā
Successfully deleted {len(results['successful'])} agent(s):\n"
|
|
908
|
+
)
|
|
909
|
+
for agent_id in results["successful"]:
|
|
910
|
+
message += f" - {agent_id}\n"
|
|
911
|
+
else:
|
|
912
|
+
message = ""
|
|
913
|
+
|
|
914
|
+
if results["failed"]:
|
|
915
|
+
message += f"ā Failed to delete {len(results['failed'])} agent(s):\n"
|
|
916
|
+
for agent_id in results["failed"]:
|
|
917
|
+
errors = results["details"][agent_id]["errors"]
|
|
918
|
+
message += f" - {agent_id}: {', '.join(errors)}\n"
|
|
919
|
+
|
|
920
|
+
return len(results["successful"]) > 0, message.strip()
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
def run_interactive_agent_wizard() -> int:
|
|
924
|
+
"""Entry point for interactive agent wizard.
|
|
925
|
+
|
|
926
|
+
Returns:
|
|
927
|
+
Exit code (0 for success, non-zero for failure)
|
|
928
|
+
"""
|
|
929
|
+
try:
|
|
930
|
+
wizard = AgentWizard()
|
|
931
|
+
success, message = wizard.run_interactive_create()
|
|
932
|
+
|
|
933
|
+
if success:
|
|
934
|
+
print(f"\nā
{message}")
|
|
935
|
+
return 0
|
|
936
|
+
print(f"\nā {message}", file=sys.stderr)
|
|
937
|
+
return 1
|
|
938
|
+
|
|
939
|
+
except Exception as e:
|
|
940
|
+
print(f"\nā Wizard error: {e}", file=sys.stderr)
|
|
941
|
+
return 1
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
def run_interactive_agent_manager() -> int:
|
|
945
|
+
"""Entry point for interactive agent management.
|
|
946
|
+
|
|
947
|
+
Returns:
|
|
948
|
+
Exit code (0 for success, non-zero for failure)
|
|
949
|
+
"""
|
|
950
|
+
try:
|
|
951
|
+
wizard = AgentWizard()
|
|
952
|
+
success, message = wizard.run_interactive_manage()
|
|
953
|
+
|
|
954
|
+
if success:
|
|
955
|
+
print(f"\nā
{message}")
|
|
956
|
+
return 0
|
|
957
|
+
print(f"\nā {message}", file=sys.stderr)
|
|
958
|
+
return 1
|
|
959
|
+
|
|
960
|
+
except Exception as e:
|
|
961
|
+
print(f"\nā Management error: {e}", file=sys.stderr)
|
|
962
|
+
return 1
|