claude-mpm 4.1.6__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 +431 -214
- 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/MEMORY.md +3 -0
- claude_mpm/agents/OUTPUT_STYLE.md +335 -0
- claude_mpm/agents/PM_INSTRUCTIONS.md +1159 -0
- claude_mpm/agents/WORKFLOW.md +355 -187
- claude_mpm/agents/agent_loader.py +40 -10
- claude_mpm/agents/agent_loader_integration.py +3 -2
- claude_mpm/agents/agents_metadata.py +57 -0
- 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/.claude-mpm/memories/README.md +17 -0
- claude_mpm/agents/templates/.claude-mpm/memories/engineer_memories.md +3 -0
- claude_mpm/agents/templates/README.md +465 -0
- claude_mpm/agents/templates/agent-manager.json +267 -18
- claude_mpm/agents/templates/agentic-coder-optimizer.json +248 -0
- 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 +25 -9
- 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 +44 -10
- 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_20250826_014258_728.md +39 -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 +27 -8
- 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 +26 -6
- claude_mpm/agents/templates/react_engineer.json +239 -0
- claude_mpm/agents/templates/refactoring_engineer.json +15 -5
- claude_mpm/agents/templates/research.json +47 -22
- 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 +243 -21
- claude_mpm/agents/templates/web_ui.json +18 -5
- claude_mpm/cli/__init__.py +38 -363
- claude_mpm/cli/commands/__init__.py +8 -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 +553 -0
- claude_mpm/cli/commands/analyze_code.py +528 -0
- 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 +488 -884
- 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 +286 -0
- claude_mpm/cli/commands/debug.py +1386 -0
- 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 +168 -617
- 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 +195 -0
- 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/analyze_code_parser.py +170 -0
- claude_mpm/cli/parsers/analyze_parser.py +135 -0
- claude_mpm/cli/parsers/auto_configure_parser.py +245 -0
- claude_mpm/cli/parsers/base_parser.py +187 -3
- claude_mpm/cli/parsers/configure_parser.py +34 -15
- claude_mpm/cli/parsers/dashboard_parser.py +113 -0
- claude_mpm/cli/parsers/debug_parser.py +319 -0
- 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 +311 -0
- 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/__init__.py +14 -0
- claude_mpm/commands/mpm-agents-detect.md +168 -0
- claude_mpm/commands/mpm-agents-recommend.md +214 -0
- claude_mpm/commands/mpm-agents.md +122 -0
- claude_mpm/commands/mpm-auto-configure.md +269 -0
- claude_mpm/commands/mpm-config.md +141 -0
- claude_mpm/commands/mpm-doctor.md +24 -0
- claude_mpm/commands/mpm-help.md +290 -0
- claude_mpm/commands/mpm-init.md +521 -0
- 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 +75 -0
- claude_mpm/commands/mpm-tickets.md +151 -0
- claude_mpm/commands/mpm-version.md +113 -0
- claude_mpm/commands/mpm.md +21 -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 +36 -7
- claude_mpm/constants.py +27 -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 +103 -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 +323 -1491
- claude_mpm/core/hook_manager.py +8 -6
- claude_mpm/core/injectable_service.py +11 -8
- claude_mpm/core/instruction_reinforcement_hook.py +267 -0
- 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 +100 -28
- 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 +118 -15
- 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 +116 -12
- claude_mpm/core/unified_config.py +6 -6
- claude_mpm/core/unified_paths.py +23 -20
- claude_mpm/dashboard/.claude-mpm/socketio-instances.json +1 -0
- claude_mpm/dashboard/__init__.py +12 -0
- claude_mpm/dashboard/analysis_runner.py +455 -0
- 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 +2 -0
- 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 +2 -0
- claude_mpm/dashboard/static/built/components/code-viewer.js +2 -0
- 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 +2 -0
- 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/activity.css +1958 -0
- claude_mpm/dashboard/static/css/dashboard.css +1413 -72
- claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +1 -0
- claude_mpm/dashboard/static/dist/components/activity-tree.js +2 -0
- claude_mpm/dashboard/static/dist/components/agent-inference.js +1 -1
- claude_mpm/dashboard/static/dist/components/code-tree.js +2 -0
- claude_mpm/dashboard/static/dist/components/code-viewer.js +2 -0
- 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 +2 -0
- 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 +1871 -0
- 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 +23 -13
- 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 -107
- claude_mpm/dashboard/static/js/components/event-viewer.js +98 -11
- 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 +68 -205
- claude_mpm/dashboard/static/js/components/session-manager.js +46 -10
- claude_mpm/dashboard/static/js/components/socket-manager.js +16 -0
- claude_mpm/dashboard/static/js/components/ui-state-manager.js +359 -40
- claude_mpm/dashboard/static/js/components/unified-data-viewer.js +1824 -0
- claude_mpm/dashboard/static/js/components/working-directory.js +61 -10
- claude_mpm/dashboard/static/js/connection-manager.js +1 -1
- claude_mpm/dashboard/static/js/dashboard.js +523 -622
- 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 +549 -62
- 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 +267 -9
- claude_mpm/experimental/__init__.py +10 -0
- 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 +209 -25
- claude_mpm/hooks/claude_hooks/installer.py +783 -0
- 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 +64 -49
- 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/schemas/__init__.py +12 -0
- claude_mpm/scripts/claude-hook-handler.sh +187 -0
- 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 +156 -396
- 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_config_provider.py +127 -27
- 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 +5 -6
- claude_mpm/services/agents/deployment/agent_state_service.py +2 -2
- claude_mpm/services/agents/deployment/agent_template_builder.py +722 -37
- claude_mpm/services/agents/deployment/agent_validator.py +31 -7
- claude_mpm/services/agents/deployment/agent_version_manager.py +9 -1
- 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 +7 -7
- 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 +6 -5
- claude_mpm/services/cli/agent_dependency_service.py +1 -1
- claude_mpm/services/cli/agent_listing_service.py +5 -5
- claude_mpm/services/cli/agent_validation_service.py +6 -5
- 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 -21
- claude_mpm/services/cli/unified_dashboard_manager.py +439 -0
- claude_mpm/services/command_deployment_service.py +17 -9
- 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/cache_manager.py +1 -3
- 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 +37 -18
- claude_mpm/services/core/service_container.py +2 -2
- 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 +22 -24
- 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 +152 -13
- 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 +12 -12
- 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/monitoring.py +12 -12
- 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 +6 -6
- claude_mpm/services/project/archive_manager.py +1045 -0
- claude_mpm/services/project/dependency_analyzer.py +8 -8
- 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/language_analyzer.py +3 -3
- claude_mpm/services/project/metrics_collector.py +7 -10
- 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 +74 -6
- claude_mpm/services/socketio/handlers/__init__.py +5 -0
- claude_mpm/services/socketio/handlers/base.py +2 -2
- claude_mpm/services/socketio/handlers/code_analysis.py +682 -0
- claude_mpm/services/socketio/handlers/connection.py +21 -40
- claude_mpm/services/socketio/handlers/connection_handler.py +16 -28
- 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 -0
- 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 +131 -68
- claude_mpm/services/socketio/server/core.py +275 -22
- claude_mpm/services/socketio/server/eventbus_integration.py +20 -14
- claude_mpm/services/socketio/server/main.py +99 -29
- 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/services/visualization/__init__.py +19 -0
- claude_mpm/services/visualization/mermaid_generator.py +938 -0
- 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/__init__.py +10 -0
- claude_mpm/tools/__main__.py +208 -0
- 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 +631 -0
- claude_mpm/tools/code_tree_events.py +420 -0
- claude_mpm/tools/socketio_debug.py +671 -0
- 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.6.dist-info → claude_mpm-4.24.0.dist-info}/entry_points.txt +1 -0
- claude_mpm/agents/INSTRUCTIONS.md +0 -237
- claude_mpm/agents/schema/agent_schema.json +0 -314
- claude_mpm/agents/templates/agent-manager.md +0 -304
- claude_mpm/cli/commands/configure_tui.py +0 -1921
- claude_mpm/cli/commands/socketio_monitor.py +0 -233
- 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_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 -424
- claude_mpm/services/cli/socketio_manager.py +0 -498
- 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-4.1.6.dist-info/METADATA +0 -325
- claude_mpm-4.1.6.dist-info/RECORD +0 -550
- {claude_mpm-4.1.6.dist-info → claude_mpm-4.24.0.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.6.dist-info → claude_mpm-4.24.0.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.6.dist-info → claude_mpm-4.24.0.dist-info}/top_level.txt +0 -0
|
@@ -13,25 +13,34 @@
|
|
|
13
13
|
* compatibility for existing code that depends on the dashboard interface.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
// ES6
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
16
|
+
// NOTE: Components are loaded as ES6 modules via index.html
|
|
17
|
+
// They expose their classes globally for backward compatibility
|
|
18
|
+
// Commenting out ES6 imports to avoid module resolution errors
|
|
19
|
+
|
|
20
|
+
// import { SocketManager } from './components/socket-manager.js';
|
|
21
|
+
// import { EventViewer } from './components/event-viewer.js';
|
|
22
|
+
// import { ModuleViewer } from './components/module-viewer.js';
|
|
23
|
+
// import { SessionManager } from './components/session-manager.js';
|
|
24
|
+
// import { AgentInference } from './components/agent-inference.js';
|
|
25
|
+
// import { AgentHierarchy } from './components/agent-hierarchy.js';
|
|
26
|
+
// import { UIStateManager } from './components/ui-state-manager.js';
|
|
27
|
+
// import { EventProcessor } from './components/event-processor.js';
|
|
28
|
+
// import { ExportManager } from './components/export-manager.js';
|
|
29
|
+
// import { WorkingDirectoryManager } from './components/working-directory.js';
|
|
30
|
+
// import { FileToolTracker } from './components/file-tool-tracker.js';
|
|
31
|
+
// import { BuildTracker } from './components/build-tracker.js';
|
|
32
|
+
// import { UnifiedDataViewer } from './components/unified-data-viewer.js';
|
|
33
|
+
|
|
29
34
|
class Dashboard {
|
|
30
35
|
constructor() {
|
|
31
36
|
// Core components (existing)
|
|
32
37
|
this.eventViewer = null;
|
|
33
38
|
this.moduleViewer = null;
|
|
34
39
|
this.sessionManager = null;
|
|
40
|
+
|
|
41
|
+
// Retry prevention
|
|
42
|
+
this.activityTreeRetryCount = 0;
|
|
43
|
+
this.maxRetryAttempts = 10;
|
|
35
44
|
|
|
36
45
|
// New modular components
|
|
37
46
|
this.socketManager = null;
|
|
@@ -55,6 +64,9 @@ class Dashboard {
|
|
|
55
64
|
console.log('Initializing refactored Claude MPM Dashboard...');
|
|
56
65
|
|
|
57
66
|
try {
|
|
67
|
+
// Fetch server configuration first
|
|
68
|
+
this.fetchServerConfig();
|
|
69
|
+
|
|
58
70
|
// Initialize modules in dependency order
|
|
59
71
|
this.initializeSocketManager();
|
|
60
72
|
this.initializeCoreComponents();
|
|
@@ -81,6 +93,39 @@ class Dashboard {
|
|
|
81
93
|
}
|
|
82
94
|
}
|
|
83
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Fetch server configuration for dashboard initialization
|
|
98
|
+
*/
|
|
99
|
+
fetchServerConfig() {
|
|
100
|
+
fetch('/api/config')
|
|
101
|
+
.then(response => response.json())
|
|
102
|
+
.then(config => {
|
|
103
|
+
// Store config globally for other components
|
|
104
|
+
window.dashboardConfig = config;
|
|
105
|
+
|
|
106
|
+
// Update initial UI elements if they exist
|
|
107
|
+
const workingDirEl = document.getElementById('working-dir-path');
|
|
108
|
+
if (workingDirEl && config.workingDirectory) {
|
|
109
|
+
workingDirEl.textContent = config.workingDirectory;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const gitBranchEl = document.getElementById('footer-git-branch');
|
|
113
|
+
if (gitBranchEl && config.gitBranch) {
|
|
114
|
+
gitBranchEl.textContent = config.gitBranch;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
console.log('Dashboard configuration loaded:', config);
|
|
118
|
+
})
|
|
119
|
+
.catch(error => {
|
|
120
|
+
console.warn('Failed to fetch server config:', error);
|
|
121
|
+
// Set default config as fallback
|
|
122
|
+
window.dashboardConfig = {
|
|
123
|
+
workingDirectory: '.',
|
|
124
|
+
gitBranch: 'Unknown'
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
84
129
|
/**
|
|
85
130
|
* Validate that all critical components are initialized
|
|
86
131
|
* WHY: Ensures dashboard is in a valid state after initialization
|
|
@@ -95,8 +140,6 @@ class Dashboard {
|
|
|
95
140
|
const missing = criticalComponents.filter(c => !c.component);
|
|
96
141
|
if (missing.length > 0) {
|
|
97
142
|
console.warn('Missing critical components:', missing.map(c => c.name));
|
|
98
|
-
} else {
|
|
99
|
-
console.log('All critical components initialized');
|
|
100
143
|
}
|
|
101
144
|
}
|
|
102
145
|
|
|
@@ -114,7 +157,6 @@ class Dashboard {
|
|
|
114
157
|
// Set global reference for agent hierarchy after dashboard is available
|
|
115
158
|
if (this.agentHierarchy) {
|
|
116
159
|
window.dashboard.agentHierarchy = this.agentHierarchy;
|
|
117
|
-
console.log('Agent hierarchy global reference set');
|
|
118
160
|
}
|
|
119
161
|
|
|
120
162
|
// Initialize any other components that need window.dashboard
|
|
@@ -163,14 +205,22 @@ class Dashboard {
|
|
|
163
205
|
// Set the socket client for receiving updates
|
|
164
206
|
this.buildTracker.setSocketClient(this.socketClient);
|
|
165
207
|
|
|
166
|
-
// Mount to header
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
208
|
+
// Mount to header with retry logic for DOM readiness
|
|
209
|
+
const mountBuildTracker = () => {
|
|
210
|
+
const headerTitle = document.querySelector('.header-title');
|
|
211
|
+
if (headerTitle) {
|
|
212
|
+
// Insert after the title and status badge
|
|
213
|
+
this.buildTracker.mount(headerTitle);
|
|
214
|
+
console.log('BuildTracker mounted successfully');
|
|
215
|
+
} else {
|
|
216
|
+
console.warn('Header-title element not found for build tracker, will retry');
|
|
217
|
+
// Retry after a short delay if DOM is still being constructed
|
|
218
|
+
setTimeout(mountBuildTracker, 100);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// Try to mount immediately, with retry logic if needed
|
|
223
|
+
mountBuildTracker();
|
|
174
224
|
|
|
175
225
|
// Make available globally for debugging
|
|
176
226
|
window.buildTracker = this.buildTracker;
|
|
@@ -193,7 +243,6 @@ class Dashboard {
|
|
|
193
243
|
try {
|
|
194
244
|
this.agentHierarchy = new AgentHierarchy(this.agentInference, this.eventViewer);
|
|
195
245
|
// Global reference will be set in postInit() after window.dashboard exists
|
|
196
|
-
console.log('Agent hierarchy component created');
|
|
197
246
|
} catch (error) {
|
|
198
247
|
console.error('Failed to initialize agent hierarchy:', error);
|
|
199
248
|
// Create a stub to prevent further errors
|
|
@@ -249,12 +298,29 @@ class Dashboard {
|
|
|
249
298
|
setupModuleInteractions() {
|
|
250
299
|
// Socket events to update file operations and tool calls
|
|
251
300
|
this.socketManager.onEventUpdate((events) => {
|
|
301
|
+
console.log('[Dashboard] Processing event update with', events.length, 'events');
|
|
302
|
+
|
|
303
|
+
// Debug: Log some sample events to see their structure
|
|
304
|
+
if (events.length > 0) {
|
|
305
|
+
console.log('[Dashboard] Sample event structure:', {
|
|
306
|
+
first_event: events[0],
|
|
307
|
+
has_tool_events: events.some(e => e.tool_name || (e.data && e.data.tool_name)),
|
|
308
|
+
hook_events: events.filter(e => e.type === 'hook').length,
|
|
309
|
+
tool_subtypes: events.filter(e => e.subtype === 'pre_tool' || e.subtype === 'post_tool').length
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
252
313
|
this.fileToolTracker.updateFileOperations(events);
|
|
253
314
|
this.fileToolTracker.updateToolCalls(events);
|
|
254
315
|
|
|
316
|
+
// Debug: Check what was tracked
|
|
317
|
+
const fileOps = this.fileToolTracker.getFileOperations();
|
|
318
|
+
const toolCalls = this.fileToolTracker.getToolCalls();
|
|
319
|
+
console.log('[Dashboard] After update - File operations:', fileOps.size, 'Tool calls:', toolCalls.size);
|
|
320
|
+
|
|
255
321
|
// Process agent inference for new events
|
|
256
322
|
this.agentInference.processAgentInference();
|
|
257
|
-
|
|
323
|
+
|
|
258
324
|
// Update agent hierarchy with new events
|
|
259
325
|
this.agentHierarchy.updateWithNewEvents(events);
|
|
260
326
|
|
|
@@ -296,7 +362,6 @@ class Dashboard {
|
|
|
296
362
|
|
|
297
363
|
// Session changes
|
|
298
364
|
document.addEventListener('sessionFilterChanged', (e) => {
|
|
299
|
-
console.log('Session filter changed, re-rendering current tab:', this.uiStateManager.getCurrentTab());
|
|
300
365
|
this.renderCurrentTab();
|
|
301
366
|
});
|
|
302
367
|
}
|
|
@@ -372,6 +437,63 @@ class Dashboard {
|
|
|
372
437
|
case 'events':
|
|
373
438
|
// Events tab is handled by EventViewer
|
|
374
439
|
break;
|
|
440
|
+
case 'activity':
|
|
441
|
+
// Trigger Activity tab rendering through the component
|
|
442
|
+
// Check if ActivityTree class is available (from built module)
|
|
443
|
+
if (window.ActivityTree && typeof window.ActivityTree === 'function') {
|
|
444
|
+
// Reset retry count on successful load
|
|
445
|
+
this.activityTreeRetryCount = 0;
|
|
446
|
+
|
|
447
|
+
// Create or get instance
|
|
448
|
+
if (!window.activityTreeInstance) {
|
|
449
|
+
window.activityTreeInstance = new window.ActivityTree();
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Initialize if needed and render
|
|
453
|
+
if (window.activityTreeInstance) {
|
|
454
|
+
if (!window.activityTreeInstance.initialized) {
|
|
455
|
+
window.activityTreeInstance.initialize();
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
if (typeof window.activityTreeInstance.renderWhenVisible === 'function') {
|
|
459
|
+
window.activityTreeInstance.renderWhenVisible();
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Force show to ensure the tree is visible
|
|
463
|
+
if (typeof window.activityTreeInstance.forceShow === 'function') {
|
|
464
|
+
window.activityTreeInstance.forceShow();
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
} else if (window.activityTree && typeof window.activityTree === 'function') {
|
|
468
|
+
// Fallback to legacy approach if available
|
|
469
|
+
const activityTreeInstance = window.activityTree();
|
|
470
|
+
if (activityTreeInstance) {
|
|
471
|
+
if (typeof activityTreeInstance.renderWhenVisible === 'function') {
|
|
472
|
+
activityTreeInstance.renderWhenVisible();
|
|
473
|
+
}
|
|
474
|
+
if (typeof activityTreeInstance.forceShow === 'function') {
|
|
475
|
+
activityTreeInstance.forceShow();
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
} else {
|
|
479
|
+
// Module not loaded yet, retry after a delay (with retry limit)
|
|
480
|
+
if (this.activityTreeRetryCount < this.maxRetryAttempts) {
|
|
481
|
+
this.activityTreeRetryCount++;
|
|
482
|
+
console.warn(`Activity tree component not available, retrying in 100ms... (attempt ${this.activityTreeRetryCount}/${this.maxRetryAttempts})`);
|
|
483
|
+
setTimeout(() => {
|
|
484
|
+
if (this.uiStateManager.getCurrentTab() === 'activity') {
|
|
485
|
+
this.renderCurrentTab();
|
|
486
|
+
}
|
|
487
|
+
}, 100);
|
|
488
|
+
} else {
|
|
489
|
+
console.error('Maximum retry attempts reached for ActivityTree initialization. Giving up.');
|
|
490
|
+
const activityContainer = document.getElementById('activity-tree-container') || document.getElementById('activity-tree');
|
|
491
|
+
if (activityContainer) {
|
|
492
|
+
activityContainer.innerHTML = '<div class="error-message">⚠️ Activity Tree failed to load. Please refresh the page.</div>';
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
break;
|
|
375
497
|
case 'agents':
|
|
376
498
|
this.renderAgents();
|
|
377
499
|
break;
|
|
@@ -394,7 +516,7 @@ class Dashboard {
|
|
|
394
516
|
}
|
|
395
517
|
|
|
396
518
|
/**
|
|
397
|
-
* Render agents tab with
|
|
519
|
+
* Render agents tab with flat chronological view
|
|
398
520
|
*/
|
|
399
521
|
renderAgents() {
|
|
400
522
|
const agentsList = document.getElementById('agents-list');
|
|
@@ -404,17 +526,12 @@ class Dashboard {
|
|
|
404
526
|
const searchText = document.getElementById('agents-search-input')?.value || '';
|
|
405
527
|
const agentType = document.getElementById('agents-type-filter')?.value || '';
|
|
406
528
|
|
|
407
|
-
//
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
if (agentType) filters.agentType = agentType;
|
|
411
|
-
|
|
412
|
-
// Generate hierarchical HTML
|
|
413
|
-
const hierarchyHTML = this.agentHierarchy.render(filters);
|
|
414
|
-
agentsList.innerHTML = hierarchyHTML;
|
|
529
|
+
// Generate flat HTML
|
|
530
|
+
const flatHTML = this.renderAgentsFlat(searchText, agentType);
|
|
531
|
+
agentsList.innerHTML = flatHTML;
|
|
415
532
|
|
|
416
|
-
//
|
|
417
|
-
this.
|
|
533
|
+
// Remove hierarchy controls if they exist
|
|
534
|
+
this.removeHierarchyControls();
|
|
418
535
|
|
|
419
536
|
// Update filter dropdowns with available agent types
|
|
420
537
|
const uniqueInstances = this.agentInference.getUniqueAgentInstances();
|
|
@@ -422,45 +539,202 @@ class Dashboard {
|
|
|
422
539
|
}
|
|
423
540
|
|
|
424
541
|
/**
|
|
425
|
-
*
|
|
542
|
+
* Remove hierarchy control buttons (flat view doesn't need them)
|
|
426
543
|
*/
|
|
427
|
-
|
|
428
|
-
const
|
|
429
|
-
if (
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
544
|
+
removeHierarchyControls() {
|
|
545
|
+
const existingControls = document.getElementById('hierarchy-controls');
|
|
546
|
+
if (existingControls) {
|
|
547
|
+
existingControls.remove();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Render agents as a flat chronological list
|
|
553
|
+
* @param {string} searchText - Search filter
|
|
554
|
+
* @param {string} agentType - Agent type filter
|
|
555
|
+
* @returns {string} HTML for flat agent list
|
|
556
|
+
*/
|
|
557
|
+
renderAgentsFlat(searchText, agentType) {
|
|
558
|
+
const events = this.eventViewer.events;
|
|
559
|
+
if (!events || events.length === 0) {
|
|
560
|
+
return '<div class="no-events">No agent events found...</div>';
|
|
561
|
+
}
|
|
433
562
|
|
|
434
|
-
//
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
controls.className = 'hierarchy-controls';
|
|
438
|
-
controls.innerHTML = `
|
|
439
|
-
<button data-action="expand-all"
|
|
440
|
-
class="hierarchy-btn hierarchy-expand-all">
|
|
441
|
-
Expand All
|
|
442
|
-
</button>
|
|
443
|
-
<button data-action="collapse-all"
|
|
444
|
-
class="hierarchy-btn hierarchy-collapse-all">
|
|
445
|
-
Collapse All
|
|
446
|
-
</button>
|
|
447
|
-
`;
|
|
563
|
+
// Process agent inference to get agent mappings
|
|
564
|
+
this.agentInference.processAgentInference();
|
|
565
|
+
const eventAgentMap = this.agentInference.getEventAgentMap();
|
|
448
566
|
|
|
449
|
-
//
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
567
|
+
// Collect all agent events with metadata
|
|
568
|
+
const agentEvents = [];
|
|
569
|
+
events.forEach((event, index) => {
|
|
570
|
+
const inference = eventAgentMap.get(index);
|
|
571
|
+
if (inference && (inference.type === 'subagent' || inference.type === 'main_agent')) {
|
|
572
|
+
// Apply filters
|
|
573
|
+
let includeEvent = true;
|
|
574
|
+
|
|
575
|
+
if (searchText) {
|
|
576
|
+
const searchLower = searchText.toLowerCase();
|
|
577
|
+
includeEvent = includeEvent && (
|
|
578
|
+
inference.agentName.toLowerCase().includes(searchLower) ||
|
|
579
|
+
(event.tool_name && event.tool_name.toLowerCase().includes(searchLower)) ||
|
|
580
|
+
(event.data && JSON.stringify(event.data).toLowerCase().includes(searchLower))
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
if (agentType) {
|
|
585
|
+
includeEvent = includeEvent && inference.agentName.includes(agentType);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
if (includeEvent) {
|
|
589
|
+
agentEvents.push({
|
|
590
|
+
event,
|
|
591
|
+
inference,
|
|
592
|
+
index,
|
|
593
|
+
timestamp: new Date(event.timestamp)
|
|
594
|
+
});
|
|
459
595
|
}
|
|
460
596
|
}
|
|
461
597
|
});
|
|
462
598
|
|
|
463
|
-
|
|
599
|
+
if (agentEvents.length === 0) {
|
|
600
|
+
return '<div class="no-events">No agent events match the current filters...</div>';
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// Generate HTML for each event
|
|
604
|
+
const html = agentEvents.map((item, listIndex) => {
|
|
605
|
+
const { event, inference, index, timestamp } = item;
|
|
606
|
+
|
|
607
|
+
// Determine action/tool
|
|
608
|
+
let action = 'Activity';
|
|
609
|
+
let actionIcon = '📋';
|
|
610
|
+
let details = '';
|
|
611
|
+
|
|
612
|
+
if (event.event_type === 'SubagentStart') {
|
|
613
|
+
action = 'Started';
|
|
614
|
+
actionIcon = '🟢';
|
|
615
|
+
details = 'Agent session began';
|
|
616
|
+
} else if (event.event_type === 'SubagentStop') {
|
|
617
|
+
action = 'Stopped';
|
|
618
|
+
actionIcon = '🔴';
|
|
619
|
+
details = 'Agent session ended';
|
|
620
|
+
} else if (event.tool_name) {
|
|
621
|
+
action = `Tool: ${event.tool_name}`;
|
|
622
|
+
actionIcon = this.getToolIcon(event.tool_name);
|
|
623
|
+
|
|
624
|
+
// Add tool parameters as details
|
|
625
|
+
if (event.data && event.data.tool_parameters) {
|
|
626
|
+
const params = event.data.tool_parameters;
|
|
627
|
+
if (params.file_path) {
|
|
628
|
+
details = params.file_path;
|
|
629
|
+
} else if (params.command) {
|
|
630
|
+
details = params.command.substring(0, 50) + (params.command.length > 50 ? '...' : '');
|
|
631
|
+
} else if (params.pattern) {
|
|
632
|
+
details = `pattern="${params.pattern}"`;
|
|
633
|
+
} else if (params.query) {
|
|
634
|
+
details = `query="${params.query}"`;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// Status based on event type
|
|
640
|
+
let status = 'completed';
|
|
641
|
+
if (event.event_type === 'SubagentStart') {
|
|
642
|
+
status = 'active';
|
|
643
|
+
} else if (event.data && event.data.error) {
|
|
644
|
+
status = 'error';
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return `
|
|
648
|
+
<div class="agent-event-item" data-index="${listIndex}" onclick="window.dashboard.showCardDetails('agents', ${index})">
|
|
649
|
+
<div class="agent-event-header">
|
|
650
|
+
<div class="agent-event-time">${this.formatTimestamp(timestamp)}</div>
|
|
651
|
+
<div class="agent-event-agent">
|
|
652
|
+
${this.getAgentIcon(inference.agentName)} ${inference.agentName}
|
|
653
|
+
</div>
|
|
654
|
+
<div class="agent-event-action">
|
|
655
|
+
${actionIcon} ${action}
|
|
656
|
+
</div>
|
|
657
|
+
<div class="agent-event-status status-${status}">
|
|
658
|
+
${this.getStatusIcon(status)}
|
|
659
|
+
</div>
|
|
660
|
+
</div>
|
|
661
|
+
${details ? `<div class="agent-event-details">${this.escapeHtml(details)}</div>` : ''}
|
|
662
|
+
</div>
|
|
663
|
+
`;
|
|
664
|
+
}).join('');
|
|
665
|
+
|
|
666
|
+
return `<div class="agent-events-flat">${html}</div>`;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Get icon for agent type
|
|
671
|
+
*/
|
|
672
|
+
getAgentIcon(agentName) {
|
|
673
|
+
const agentIcons = {
|
|
674
|
+
'PM': '🎯',
|
|
675
|
+
'Engineer Agent': '🔧',
|
|
676
|
+
'Research Agent': '🔍',
|
|
677
|
+
'QA Agent': '✅',
|
|
678
|
+
'Documentation Agent': '📝',
|
|
679
|
+
'Security Agent': '🔒',
|
|
680
|
+
'Ops Agent': '⚙️',
|
|
681
|
+
'Version Control Agent': '📦',
|
|
682
|
+
'Data Engineer Agent': '💾',
|
|
683
|
+
'Test Integration Agent': '🧪'
|
|
684
|
+
};
|
|
685
|
+
return agentIcons[agentName] || '🤖';
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Get icon for tool
|
|
690
|
+
*/
|
|
691
|
+
getToolIcon(toolName) {
|
|
692
|
+
const toolIcons = {
|
|
693
|
+
'Read': '📖',
|
|
694
|
+
'Write': '✏️',
|
|
695
|
+
'Edit': '📝',
|
|
696
|
+
'Bash': '💻',
|
|
697
|
+
'Grep': '🔍',
|
|
698
|
+
'Glob': '📂',
|
|
699
|
+
'LS': '📁',
|
|
700
|
+
'Task': '📋'
|
|
701
|
+
};
|
|
702
|
+
return toolIcons[toolName] || '🔧';
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Get icon for status
|
|
707
|
+
*/
|
|
708
|
+
getStatusIcon(status) {
|
|
709
|
+
const statusIcons = {
|
|
710
|
+
'active': '🟢',
|
|
711
|
+
'completed': '✅',
|
|
712
|
+
'error': '❌',
|
|
713
|
+
'pending': '🟡'
|
|
714
|
+
};
|
|
715
|
+
return statusIcons[status] || '❓';
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Format timestamp for display
|
|
720
|
+
*/
|
|
721
|
+
formatTimestamp(timestamp) {
|
|
722
|
+
return timestamp.toLocaleTimeString('en-US', {
|
|
723
|
+
hour: '2-digit',
|
|
724
|
+
minute: '2-digit',
|
|
725
|
+
second: '2-digit',
|
|
726
|
+
hour12: false
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Escape HTML for safe display
|
|
732
|
+
*/
|
|
733
|
+
escapeHtml(text) {
|
|
734
|
+
if (!text) return '';
|
|
735
|
+
const div = document.createElement('div');
|
|
736
|
+
div.textContent = text;
|
|
737
|
+
return div.innerHTML;
|
|
464
738
|
}
|
|
465
739
|
|
|
466
740
|
/**
|
|
@@ -491,10 +765,19 @@ class Dashboard {
|
|
|
491
765
|
|
|
492
766
|
const fileOperations = this.fileToolTracker.getFileOperations();
|
|
493
767
|
const filesArray = Array.from(fileOperations.entries());
|
|
768
|
+
|
|
769
|
+
console.log('[renderFiles] File operations map size:', fileOperations.size);
|
|
770
|
+
console.log('[renderFiles] Files array:', filesArray);
|
|
771
|
+
|
|
494
772
|
const uniqueFileInstances = this.eventProcessor.getUniqueFileInstances(filesArray);
|
|
495
773
|
const fileHTML = this.eventProcessor.generateFileHTML(uniqueFileInstances);
|
|
496
774
|
|
|
497
|
-
|
|
775
|
+
if (filesArray.length === 0) {
|
|
776
|
+
filesList.innerHTML = '<div class="empty-state">No file operations tracked yet. File operations will appear here when tools like Read, Write, Edit, or Grep are used.</div>';
|
|
777
|
+
} else {
|
|
778
|
+
filesList.innerHTML = fileHTML;
|
|
779
|
+
}
|
|
780
|
+
|
|
498
781
|
this.exportManager.scrollListToBottom('files-list');
|
|
499
782
|
|
|
500
783
|
// Update filter dropdowns
|
|
@@ -517,12 +800,7 @@ class Dashboard {
|
|
|
517
800
|
const sortedTypes = Array.from(agentTypes).filter(type => type && type.trim() !== '');
|
|
518
801
|
this.populateFilterDropdown('agents-type-filter', sortedTypes, 'All Agent Types');
|
|
519
802
|
|
|
520
|
-
//
|
|
521
|
-
if (sortedTypes.length > 0) {
|
|
522
|
-
console.log('Agent types found for filter:', sortedTypes);
|
|
523
|
-
} else {
|
|
524
|
-
console.log('No agent types found for filter. Instances:', uniqueInstances.length);
|
|
525
|
-
}
|
|
803
|
+
// Agent filter types populated
|
|
526
804
|
}
|
|
527
805
|
|
|
528
806
|
/**
|
|
@@ -845,35 +1123,7 @@ window.switchTab = function(tabName) {
|
|
|
845
1123
|
}
|
|
846
1124
|
};
|
|
847
1125
|
|
|
848
|
-
// File Viewer Modal Functions -
|
|
849
|
-
window.showFileViewerModal = function(filePath, workingDir) {
|
|
850
|
-
// Use the dashboard's current working directory if not provided
|
|
851
|
-
if (!workingDir && window.dashboard && window.dashboard.currentWorkingDir) {
|
|
852
|
-
workingDir = window.dashboard.currentWorkingDir;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
// Create modal if it doesn't exist
|
|
856
|
-
let modal = document.getElementById('file-viewer-modal');
|
|
857
|
-
if (!modal) {
|
|
858
|
-
modal = createFileViewerModal();
|
|
859
|
-
document.body.appendChild(modal);
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
// Update modal content
|
|
863
|
-
updateFileViewerModal(modal, filePath, workingDir);
|
|
864
|
-
|
|
865
|
-
// Show the modal as flex container
|
|
866
|
-
modal.style.display = 'flex';
|
|
867
|
-
document.body.style.overflow = 'hidden'; // Prevent background scrolling
|
|
868
|
-
};
|
|
869
|
-
|
|
870
|
-
window.hideFileViewerModal = function() {
|
|
871
|
-
const modal = document.getElementById('file-viewer-modal');
|
|
872
|
-
if (modal) {
|
|
873
|
-
modal.style.display = 'none';
|
|
874
|
-
document.body.style.overflow = ''; // Restore background scrolling
|
|
875
|
-
}
|
|
876
|
-
};
|
|
1126
|
+
// File Viewer Modal Functions - Removed broken duplicate (using the one at line 1505)
|
|
877
1127
|
|
|
878
1128
|
window.copyFileContent = function() {
|
|
879
1129
|
const modal = document.getElementById('file-viewer-modal');
|
|
@@ -888,11 +1138,13 @@ window.copyFileContent = function() {
|
|
|
888
1138
|
navigator.clipboard.writeText(text).then(() => {
|
|
889
1139
|
// Show brief feedback
|
|
890
1140
|
const button = modal.querySelector('.file-content-copy');
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1141
|
+
if (button) {
|
|
1142
|
+
const originalText = button.textContent;
|
|
1143
|
+
button.textContent = '✅ Copied!';
|
|
1144
|
+
setTimeout(() => {
|
|
1145
|
+
button.textContent = originalText;
|
|
1146
|
+
}, 2000);
|
|
1147
|
+
}
|
|
896
1148
|
}).catch(err => {
|
|
897
1149
|
console.error('Failed to copy text:', err);
|
|
898
1150
|
});
|
|
@@ -906,11 +1158,13 @@ window.copyFileContent = function() {
|
|
|
906
1158
|
document.body.removeChild(textarea);
|
|
907
1159
|
|
|
908
1160
|
const button = modal.querySelector('.file-content-copy');
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
1161
|
+
if (button) {
|
|
1162
|
+
const originalText = button.textContent;
|
|
1163
|
+
button.textContent = '✅ Copied!';
|
|
1164
|
+
setTimeout(() => {
|
|
1165
|
+
button.textContent = originalText;
|
|
1166
|
+
}, 2000);
|
|
1167
|
+
}
|
|
914
1168
|
}
|
|
915
1169
|
};
|
|
916
1170
|
|
|
@@ -986,60 +1240,97 @@ async function updateFileViewerModal(modal, filePath, workingDir) {
|
|
|
986
1240
|
const filePathElement = modal.querySelector('.file-viewer-file-path');
|
|
987
1241
|
const fileSizeElement = modal.querySelector('.file-viewer-file-size');
|
|
988
1242
|
|
|
989
|
-
filePathElement
|
|
990
|
-
|
|
1243
|
+
if (filePathElement) {
|
|
1244
|
+
filePathElement.textContent = filePath;
|
|
1245
|
+
}
|
|
1246
|
+
if (fileSizeElement) {
|
|
1247
|
+
fileSizeElement.textContent = '';
|
|
1248
|
+
}
|
|
991
1249
|
|
|
992
1250
|
// Show loading state
|
|
993
|
-
modal.querySelector('.file-viewer-loading')
|
|
994
|
-
modal.querySelector('.file-viewer-error')
|
|
995
|
-
modal.querySelector('.file-viewer-content-area')
|
|
1251
|
+
const loadingElement = modal.querySelector('.file-viewer-loading');
|
|
1252
|
+
const errorElement = modal.querySelector('.file-viewer-error');
|
|
1253
|
+
const contentArea = modal.querySelector('.file-viewer-content-area');
|
|
1254
|
+
|
|
1255
|
+
if (loadingElement) {
|
|
1256
|
+
loadingElement.style.display = 'flex';
|
|
1257
|
+
}
|
|
1258
|
+
if (errorElement) {
|
|
1259
|
+
errorElement.style.display = 'none';
|
|
1260
|
+
}
|
|
1261
|
+
if (contentArea) {
|
|
1262
|
+
contentArea.style.display = 'none';
|
|
1263
|
+
}
|
|
996
1264
|
|
|
997
1265
|
try {
|
|
998
1266
|
// Get the Socket.IO client
|
|
999
|
-
const socket = window.socket || window.dashboard?.socketClient?.socket;
|
|
1267
|
+
const socket = window.socket || window.dashboard?.socketClient?.socket || window.socketClient?.socket;
|
|
1268
|
+
|
|
1269
|
+
console.log('[FileViewer] Socket search results:', {
|
|
1270
|
+
'window.socket': !!window.socket,
|
|
1271
|
+
'window.socket.connected': window.socket?.connected,
|
|
1272
|
+
'dashboard.socketClient.socket': !!window.dashboard?.socketClient?.socket,
|
|
1273
|
+
'dashboard.socketClient.socket.connected': window.dashboard?.socketClient?.socket?.connected,
|
|
1274
|
+
'window.socketClient.socket': !!window.socketClient?.socket,
|
|
1275
|
+
'window.socketClient.socket.connected': window.socketClient?.socket?.connected
|
|
1276
|
+
});
|
|
1277
|
+
|
|
1000
1278
|
if (!socket) {
|
|
1001
|
-
throw new Error('No socket connection available');
|
|
1279
|
+
throw new Error('No socket connection available. Please ensure the dashboard is connected.');
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
if (!socket.connected) {
|
|
1283
|
+
console.warn('[FileViewer] Socket found but not connected, attempting to use anyway...');
|
|
1002
1284
|
}
|
|
1285
|
+
|
|
1286
|
+
console.log('[FileViewer] Socket found, setting up listener for file_content_response');
|
|
1003
1287
|
|
|
1004
1288
|
// Set up one-time listener for file content response
|
|
1005
1289
|
const responsePromise = new Promise((resolve, reject) => {
|
|
1006
1290
|
const responseHandler = (data) => {
|
|
1291
|
+
console.log('[FileViewer] Received file_content_response:', data);
|
|
1007
1292
|
if (data.file_path === filePath) {
|
|
1008
1293
|
socket.off('file_content_response', responseHandler);
|
|
1009
1294
|
if (data.success) {
|
|
1295
|
+
console.log('[FileViewer] File content loaded successfully');
|
|
1010
1296
|
resolve(data);
|
|
1011
1297
|
} else {
|
|
1298
|
+
console.error('[FileViewer] File read failed:', data.error);
|
|
1012
1299
|
reject(new Error(data.error || 'Failed to read file'));
|
|
1013
1300
|
}
|
|
1014
1301
|
}
|
|
1015
1302
|
};
|
|
1016
1303
|
|
|
1017
1304
|
socket.on('file_content_response', responseHandler);
|
|
1305
|
+
console.log('[FileViewer] Listener registered for file_content_response');
|
|
1018
1306
|
|
|
1019
1307
|
// Timeout after 10 seconds
|
|
1020
1308
|
setTimeout(() => {
|
|
1021
1309
|
socket.off('file_content_response', responseHandler);
|
|
1022
|
-
|
|
1310
|
+
console.error('[FileViewer] Request timeout after 10 seconds');
|
|
1311
|
+
reject(new Error('Request timeout - server did not respond'));
|
|
1023
1312
|
}, 10000);
|
|
1024
1313
|
});
|
|
1025
1314
|
|
|
1026
1315
|
// Send file read request
|
|
1027
|
-
|
|
1316
|
+
const requestData = {
|
|
1028
1317
|
file_path: filePath,
|
|
1029
1318
|
working_dir: workingDir
|
|
1030
|
-
}
|
|
1319
|
+
};
|
|
1320
|
+
console.log('[FileViewer] Emitting read_file event with data:', requestData);
|
|
1321
|
+
socket.emit('read_file', requestData);
|
|
1031
1322
|
|
|
1032
|
-
|
|
1033
|
-
filePath,
|
|
1034
|
-
workingDir
|
|
1035
|
-
});
|
|
1323
|
+
// File viewer request sent
|
|
1036
1324
|
|
|
1037
1325
|
// Wait for response
|
|
1038
1326
|
const result = await responsePromise;
|
|
1039
|
-
|
|
1327
|
+
// File content received successfully
|
|
1040
1328
|
|
|
1041
1329
|
// Hide loading
|
|
1042
|
-
modal.querySelector('.file-viewer-loading')
|
|
1330
|
+
const loadingEl = modal.querySelector('.file-viewer-loading');
|
|
1331
|
+
if (loadingEl) {
|
|
1332
|
+
loadingEl.style.display = 'none';
|
|
1333
|
+
}
|
|
1043
1334
|
|
|
1044
1335
|
// Show successful content
|
|
1045
1336
|
displayFileContent(modal, result);
|
|
@@ -1047,7 +1338,10 @@ async function updateFileViewerModal(modal, filePath, workingDir) {
|
|
|
1047
1338
|
} catch (error) {
|
|
1048
1339
|
console.error('❌ Failed to fetch file content:', error);
|
|
1049
1340
|
|
|
1050
|
-
modal.querySelector('.file-viewer-loading')
|
|
1341
|
+
const loadingEl2 = modal.querySelector('.file-viewer-loading');
|
|
1342
|
+
if (loadingEl2) {
|
|
1343
|
+
loadingEl2.style.display = 'none';
|
|
1344
|
+
}
|
|
1051
1345
|
|
|
1052
1346
|
// Create detailed error message
|
|
1053
1347
|
let errorMessage = error.message || 'Unknown error occurred';
|
|
@@ -1092,7 +1386,7 @@ async function updateFileViewerModal(modal, filePath, workingDir) {
|
|
|
1092
1386
|
}
|
|
1093
1387
|
|
|
1094
1388
|
function displayFileContent(modal, result) {
|
|
1095
|
-
|
|
1389
|
+
// Display file content in modal
|
|
1096
1390
|
const contentArea = modal.querySelector('.file-viewer-content-area');
|
|
1097
1391
|
const extensionElement = modal.querySelector('.file-extension');
|
|
1098
1392
|
const encodingElement = modal.querySelector('.file-encoding');
|
|
@@ -1106,7 +1400,7 @@ function displayFileContent(modal, result) {
|
|
|
1106
1400
|
|
|
1107
1401
|
// Update content with basic syntax highlighting
|
|
1108
1402
|
if (codeElement && result.content) {
|
|
1109
|
-
|
|
1403
|
+
// Setting file content
|
|
1110
1404
|
codeElement.innerHTML = highlightCode(result.content, result.extension);
|
|
1111
1405
|
|
|
1112
1406
|
// Force scrolling to work by setting explicit heights
|
|
@@ -1124,12 +1418,7 @@ function displayFileContent(modal, result) {
|
|
|
1124
1418
|
|
|
1125
1419
|
const availableHeight = modalHeight - headerHeight - toolbarHeight - 40; // 40px for padding
|
|
1126
1420
|
|
|
1127
|
-
|
|
1128
|
-
modalHeight,
|
|
1129
|
-
headerHeight,
|
|
1130
|
-
toolbarHeight,
|
|
1131
|
-
availableHeight
|
|
1132
|
-
});
|
|
1421
|
+
// Setting file viewer scroll height
|
|
1133
1422
|
|
|
1134
1423
|
wrapper.style.maxHeight = `${availableHeight}px`;
|
|
1135
1424
|
wrapper.style.overflowY = 'auto';
|
|
@@ -1142,7 +1431,7 @@ function displayFileContent(modal, result) {
|
|
|
1142
1431
|
// Show content area
|
|
1143
1432
|
if (contentArea) {
|
|
1144
1433
|
contentArea.style.display = 'block';
|
|
1145
|
-
|
|
1434
|
+
// File content area displayed
|
|
1146
1435
|
}
|
|
1147
1436
|
}
|
|
1148
1437
|
|
|
@@ -1153,21 +1442,25 @@ function displayFileError(modal, result) {
|
|
|
1153
1442
|
|
|
1154
1443
|
let errorMessage = result.error || 'Unknown error occurred';
|
|
1155
1444
|
|
|
1156
|
-
messageElement
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
if (result.suggestions && result.suggestions.length > 0) {
|
|
1163
|
-
suggestionsElement.innerHTML = `
|
|
1164
|
-
<h4>Suggestions:</h4>
|
|
1165
|
-
<ul>
|
|
1166
|
-
${result.suggestions.map(s => `<li>${s}</li>`).join('')}
|
|
1167
|
-
</ul>
|
|
1445
|
+
if (messageElement) {
|
|
1446
|
+
messageElement.innerHTML = `
|
|
1447
|
+
<div class="error-main">${errorMessage}</div>
|
|
1448
|
+
${result.file_path ? `<div class="error-file">File: ${result.file_path}</div>` : ''}
|
|
1449
|
+
${result.working_dir ? `<div class="error-dir">Working directory: ${result.working_dir}</div>` : ''}
|
|
1168
1450
|
`;
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
if (suggestionsElement) {
|
|
1454
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
1455
|
+
suggestionsElement.innerHTML = `
|
|
1456
|
+
<h4>Suggestions:</h4>
|
|
1457
|
+
<ul>
|
|
1458
|
+
${result.suggestions.map(s => `<li>${s}</li>`).join('')}
|
|
1459
|
+
</ul>
|
|
1460
|
+
`;
|
|
1461
|
+
} else {
|
|
1462
|
+
suggestionsElement.innerHTML = '';
|
|
1463
|
+
}
|
|
1171
1464
|
}
|
|
1172
1465
|
|
|
1173
1466
|
console.log('📋 Displaying file viewer error:', {
|
|
@@ -1176,7 +1469,9 @@ function displayFileError(modal, result) {
|
|
|
1176
1469
|
suggestions: result.suggestions
|
|
1177
1470
|
});
|
|
1178
1471
|
|
|
1179
|
-
errorArea
|
|
1472
|
+
if (errorArea) {
|
|
1473
|
+
errorArea.style.display = 'block';
|
|
1474
|
+
}
|
|
1180
1475
|
}
|
|
1181
1476
|
|
|
1182
1477
|
function highlightCode(code, extension) {
|
|
@@ -1281,459 +1576,38 @@ function formatFileSize(bytes) {
|
|
|
1281
1576
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
|
1282
1577
|
}
|
|
1283
1578
|
|
|
1284
|
-
// Git Diff Modal Functions - restored from original dashboard
|
|
1285
|
-
window.showGitDiffModal = function(filePath, timestamp, workingDir) {
|
|
1286
|
-
// Use the dashboard's current working directory if not provided
|
|
1287
|
-
if (!workingDir && window.dashboard && window.dashboard.currentWorkingDir) {
|
|
1288
|
-
workingDir = window.dashboard.currentWorkingDir;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
// Create modal if it doesn't exist
|
|
1292
|
-
let modal = document.getElementById('git-diff-modal');
|
|
1293
|
-
if (!modal) {
|
|
1294
|
-
modal = createGitDiffModal();
|
|
1295
|
-
document.body.appendChild(modal);
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
// Update modal content
|
|
1299
|
-
updateGitDiffModal(modal, filePath, timestamp, workingDir);
|
|
1300
|
-
|
|
1301
|
-
// Show the modal as flex container
|
|
1302
|
-
modal.style.display = 'flex';
|
|
1303
|
-
document.body.style.overflow = 'hidden'; // Prevent background scrolling
|
|
1304
|
-
};
|
|
1305
|
-
|
|
1306
|
-
window.hideGitDiffModal = function() {
|
|
1307
|
-
const modal = document.getElementById('git-diff-modal');
|
|
1308
|
-
if (modal) {
|
|
1309
|
-
modal.style.display = 'none';
|
|
1310
|
-
document.body.style.overflow = ''; // Restore background scrolling
|
|
1311
|
-
}
|
|
1312
|
-
};
|
|
1313
|
-
|
|
1314
|
-
window.copyGitDiff = function() {
|
|
1315
|
-
const modal = document.getElementById('git-diff-modal');
|
|
1316
|
-
if (!modal) return;
|
|
1317
|
-
|
|
1318
|
-
const codeElement = modal.querySelector('.git-diff-code');
|
|
1319
|
-
if (!codeElement) return;
|
|
1320
|
-
|
|
1321
|
-
const text = codeElement.textContent;
|
|
1322
|
-
|
|
1323
|
-
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1324
|
-
navigator.clipboard.writeText(text).then(() => {
|
|
1325
|
-
// Show brief feedback
|
|
1326
|
-
const button = modal.querySelector('.git-diff-copy');
|
|
1327
|
-
const originalText = button.textContent;
|
|
1328
|
-
button.textContent = '✅ Copied!';
|
|
1329
|
-
setTimeout(() => {
|
|
1330
|
-
button.textContent = originalText;
|
|
1331
|
-
}, 2000);
|
|
1332
|
-
}).catch(err => {
|
|
1333
|
-
console.error('Failed to copy text:', err);
|
|
1334
|
-
});
|
|
1335
|
-
} else {
|
|
1336
|
-
// Fallback for older browsers
|
|
1337
|
-
const textarea = document.createElement('textarea');
|
|
1338
|
-
textarea.value = text;
|
|
1339
|
-
document.body.appendChild(textarea);
|
|
1340
|
-
textarea.select();
|
|
1341
|
-
document.execCommand('copy');
|
|
1342
|
-
document.body.removeChild(textarea);
|
|
1343
|
-
|
|
1344
|
-
const button = modal.querySelector('.git-diff-copy');
|
|
1345
|
-
const originalText = button.textContent;
|
|
1346
|
-
button.textContent = '✅ Copied!';
|
|
1347
|
-
setTimeout(() => {
|
|
1348
|
-
button.textContent = originalText;
|
|
1349
|
-
}, 2000);
|
|
1350
|
-
}
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
|
-
function createGitDiffModal() {
|
|
1354
|
-
const modal = document.createElement('div');
|
|
1355
|
-
modal.id = 'git-diff-modal';
|
|
1356
|
-
modal.className = 'modal git-diff-modal';
|
|
1357
|
-
|
|
1358
|
-
modal.innerHTML = `
|
|
1359
|
-
<div class="modal-content git-diff-content">
|
|
1360
|
-
<div class="git-diff-header">
|
|
1361
|
-
<h2 class="git-diff-title">
|
|
1362
|
-
<span class="git-diff-icon">📋</span>
|
|
1363
|
-
<span class="git-diff-title-text">Git Diff</span>
|
|
1364
|
-
</h2>
|
|
1365
|
-
<div class="git-diff-meta">
|
|
1366
|
-
<span class="git-diff-file-path"></span>
|
|
1367
|
-
<span class="git-diff-timestamp"></span>
|
|
1368
|
-
</div>
|
|
1369
|
-
<button class="git-diff-close" onclick="hideGitDiffModal()">
|
|
1370
|
-
<span>×</span>
|
|
1371
|
-
</button>
|
|
1372
|
-
</div>
|
|
1373
|
-
<div class="git-diff-body">
|
|
1374
|
-
<div class="git-diff-loading">
|
|
1375
|
-
<div class="loading-spinner"></div>
|
|
1376
|
-
<span>Loading git diff...</span>
|
|
1377
|
-
</div>
|
|
1378
|
-
<div class="git-diff-error" style="display: none;">
|
|
1379
|
-
<div class="error-icon">⚠️</div>
|
|
1380
|
-
<div class="error-message"></div>
|
|
1381
|
-
<div class="error-suggestions"></div>
|
|
1382
|
-
</div>
|
|
1383
|
-
<div class="git-diff-content-area" style="display: none;">
|
|
1384
|
-
<div class="git-diff-toolbar">
|
|
1385
|
-
<div class="git-diff-info">
|
|
1386
|
-
<span class="commit-hash"></span>
|
|
1387
|
-
<span class="diff-method"></span>
|
|
1388
|
-
</div>
|
|
1389
|
-
<div class="git-diff-actions">
|
|
1390
|
-
<button class="git-diff-copy" onclick="copyGitDiff()">
|
|
1391
|
-
📋 Copy
|
|
1392
|
-
</button>
|
|
1393
|
-
</div>
|
|
1394
|
-
</div>
|
|
1395
|
-
<div class="git-diff-scroll-wrapper">
|
|
1396
|
-
<pre class="git-diff-display"><code class="git-diff-code"></code></pre>
|
|
1397
|
-
</div>
|
|
1398
|
-
</div>
|
|
1399
|
-
</div>
|
|
1400
|
-
</div>
|
|
1401
|
-
`;
|
|
1402
|
-
|
|
1403
|
-
// Close modal when clicking outside
|
|
1404
|
-
modal.addEventListener('click', (e) => {
|
|
1405
|
-
if (e.target === modal) {
|
|
1406
|
-
hideGitDiffModal();
|
|
1407
|
-
}
|
|
1408
|
-
});
|
|
1409
|
-
|
|
1410
|
-
// Close modal with Escape key
|
|
1411
|
-
document.addEventListener('keydown', (e) => {
|
|
1412
|
-
if (e.key === 'Escape' && modal.style.display === 'flex') {
|
|
1413
|
-
hideGitDiffModal();
|
|
1414
|
-
}
|
|
1415
|
-
});
|
|
1416
|
-
|
|
1417
|
-
return modal;
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
async function updateGitDiffModal(modal, filePath, timestamp, workingDir) {
|
|
1421
|
-
// Update header info
|
|
1422
|
-
const filePathElement = modal.querySelector('.git-diff-file-path');
|
|
1423
|
-
const timestampElement = modal.querySelector('.git-diff-timestamp');
|
|
1424
|
-
|
|
1425
|
-
filePathElement.textContent = filePath;
|
|
1426
|
-
timestampElement.textContent = timestamp ? new Date(timestamp).toLocaleString() : 'Latest';
|
|
1427
|
-
|
|
1428
|
-
// Show loading state
|
|
1429
|
-
modal.querySelector('.git-diff-loading').style.display = 'flex';
|
|
1430
|
-
modal.querySelector('.git-diff-error').style.display = 'none';
|
|
1431
|
-
modal.querySelector('.git-diff-content-area').style.display = 'none';
|
|
1432
|
-
|
|
1433
|
-
try {
|
|
1434
|
-
// Get the Socket.IO server port with multiple fallbacks
|
|
1435
|
-
let port = 8765; // Default fallback
|
|
1436
|
-
|
|
1437
|
-
// Try to get port from socketClient first
|
|
1438
|
-
if (window.dashboard && window.dashboard.socketClient && window.dashboard.socketClient.port) {
|
|
1439
|
-
port = window.dashboard.socketClient.port;
|
|
1440
|
-
}
|
|
1441
|
-
// Fallback to port input field if socketClient port is not available
|
|
1442
|
-
else {
|
|
1443
|
-
const portInput = document.getElementById('port-input');
|
|
1444
|
-
if (portInput && portInput.value) {
|
|
1445
|
-
port = portInput.value;
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
// Build URL parameters
|
|
1450
|
-
const params = new URLSearchParams({
|
|
1451
|
-
file: filePath
|
|
1452
|
-
});
|
|
1453
|
-
|
|
1454
|
-
if (timestamp) {
|
|
1455
|
-
params.append('timestamp', timestamp);
|
|
1456
|
-
}
|
|
1457
|
-
if (workingDir) {
|
|
1458
|
-
params.append('working_dir', workingDir);
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
const requestUrl = `http://localhost:${port}/api/git-diff?${params}`;
|
|
1462
|
-
console.log('🌐 Making git diff request to:', requestUrl);
|
|
1463
|
-
console.log('📋 Git diff request parameters:', {
|
|
1464
|
-
filePath,
|
|
1465
|
-
timestamp,
|
|
1466
|
-
workingDir,
|
|
1467
|
-
urlParams: params.toString()
|
|
1468
|
-
});
|
|
1469
|
-
|
|
1470
|
-
// Test server connectivity first
|
|
1471
|
-
try {
|
|
1472
|
-
const healthResponse = await fetch(`http://localhost:${port}/health`, {
|
|
1473
|
-
method: 'GET',
|
|
1474
|
-
headers: {
|
|
1475
|
-
'Accept': 'application/json',
|
|
1476
|
-
'Content-Type': 'application/json'
|
|
1477
|
-
},
|
|
1478
|
-
mode: 'cors'
|
|
1479
|
-
});
|
|
1480
|
-
|
|
1481
|
-
if (!healthResponse.ok) {
|
|
1482
|
-
throw new Error(`Server health check failed: ${healthResponse.status} ${healthResponse.statusText}`);
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
console.log('✅ Server health check passed');
|
|
1486
|
-
} catch (healthError) {
|
|
1487
|
-
throw new Error(`Cannot reach server at localhost:${port}. Health check failed: ${healthError.message}`);
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
// Make the actual git diff request
|
|
1491
|
-
const response = await fetch(requestUrl, {
|
|
1492
|
-
method: 'GET',
|
|
1493
|
-
headers: {
|
|
1494
|
-
'Accept': 'application/json',
|
|
1495
|
-
'Content-Type': 'application/json'
|
|
1496
|
-
},
|
|
1497
|
-
mode: 'cors'
|
|
1498
|
-
});
|
|
1499
|
-
|
|
1500
|
-
if (!response.ok) {
|
|
1501
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
const result = await response.json();
|
|
1505
|
-
console.log('📦 Git diff response:', result);
|
|
1506
|
-
|
|
1507
|
-
// Hide loading
|
|
1508
|
-
modal.querySelector('.git-diff-loading').style.display = 'none';
|
|
1509
|
-
|
|
1510
|
-
if (result.success) {
|
|
1511
|
-
console.log('📊 Displaying successful git diff');
|
|
1512
|
-
// Show successful diff
|
|
1513
|
-
displayGitDiff(modal, result);
|
|
1514
|
-
} else {
|
|
1515
|
-
console.log('⚠️ Displaying git diff error:', result);
|
|
1516
|
-
// Show error
|
|
1517
|
-
displayGitDiffError(modal, result);
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
} catch (error) {
|
|
1521
|
-
console.error('❌ Failed to fetch git diff:', error);
|
|
1522
|
-
console.error('Error details:', {
|
|
1523
|
-
name: error.name,
|
|
1524
|
-
message: error.message,
|
|
1525
|
-
stack: error.stack,
|
|
1526
|
-
filePath,
|
|
1527
|
-
timestamp,
|
|
1528
|
-
workingDir
|
|
1529
|
-
});
|
|
1530
|
-
|
|
1531
|
-
modal.querySelector('.git-diff-loading').style.display = 'none';
|
|
1532
|
-
|
|
1533
|
-
// Create detailed error message based on error type
|
|
1534
|
-
let errorMessage = `Network error: ${error.message}`;
|
|
1535
|
-
let suggestions = [];
|
|
1536
|
-
|
|
1537
|
-
if (error.message.includes('Failed to fetch')) {
|
|
1538
|
-
errorMessage = 'Failed to connect to the monitoring server';
|
|
1539
|
-
suggestions = [
|
|
1540
|
-
'Check if the monitoring server is running on port 8765',
|
|
1541
|
-
'Verify the port configuration in the dashboard',
|
|
1542
|
-
'Check browser console for CORS or network errors',
|
|
1543
|
-
'Try refreshing the page and reconnecting'
|
|
1544
|
-
];
|
|
1545
|
-
} else if (error.message.includes('health check failed')) {
|
|
1546
|
-
errorMessage = error.message;
|
|
1547
|
-
suggestions = [
|
|
1548
|
-
'The server may be starting up - try again in a few seconds',
|
|
1549
|
-
'Check if another process is using port 8765',
|
|
1550
|
-
'Restart the claude-mpm monitoring server'
|
|
1551
|
-
];
|
|
1552
|
-
} else if (error.message.includes('HTTP')) {
|
|
1553
|
-
errorMessage = `Server error: ${error.message}`;
|
|
1554
|
-
suggestions = [
|
|
1555
|
-
'The server encountered an internal error',
|
|
1556
|
-
'Check the server logs for more details',
|
|
1557
|
-
'Try with a different file or working directory'
|
|
1558
|
-
];
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
displayGitDiffError(modal, {
|
|
1562
|
-
error: errorMessage,
|
|
1563
|
-
file_path: filePath,
|
|
1564
|
-
working_dir: workingDir,
|
|
1565
|
-
suggestions: suggestions,
|
|
1566
|
-
debug_info: {
|
|
1567
|
-
error_type: error.name,
|
|
1568
|
-
original_message: error.message,
|
|
1569
|
-
port: window.dashboard?.socketClient?.port || document.getElementById('port-input')?.value || '8765',
|
|
1570
|
-
timestamp: new Date().toISOString()
|
|
1571
|
-
}
|
|
1572
|
-
});
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
function highlightGitDiff(diffText) {
|
|
1577
|
-
/**
|
|
1578
|
-
* Apply basic syntax highlighting to git diff output
|
|
1579
|
-
* WHY: Git diffs have a standard format that can be highlighted for better readability:
|
|
1580
|
-
* - Lines starting with '+' are additions (green)
|
|
1581
|
-
* - Lines starting with '-' are deletions (red)
|
|
1582
|
-
* - Lines starting with '@@' are context headers (blue)
|
|
1583
|
-
* - File headers and metadata get special formatting
|
|
1584
|
-
*/
|
|
1585
|
-
return diffText
|
|
1586
|
-
.split('\n')
|
|
1587
|
-
.map(line => {
|
|
1588
|
-
// Escape HTML entities
|
|
1589
|
-
const escaped = line
|
|
1590
|
-
.replace(/&/g, '&')
|
|
1591
|
-
.replace(/</g, '<')
|
|
1592
|
-
.replace(/>/g, '>');
|
|
1593
|
-
|
|
1594
|
-
// Apply diff highlighting
|
|
1595
|
-
if (line.startsWith('+++') || line.startsWith('---')) {
|
|
1596
|
-
return `<span class="diff-header">${escaped}</span>`;
|
|
1597
|
-
} else if (line.startsWith('@@')) {
|
|
1598
|
-
return `<span class="diff-meta">${escaped}</span>`;
|
|
1599
|
-
} else if (line.startsWith('+')) {
|
|
1600
|
-
return `<span class="diff-addition">${escaped}</span>`;
|
|
1601
|
-
} else if (line.startsWith('-')) {
|
|
1602
|
-
return `<span class="diff-deletion">${escaped}</span>`;
|
|
1603
|
-
} else if (line.startsWith('commit ') || line.startsWith('Author:') || line.startsWith('Date:')) {
|
|
1604
|
-
return `<span class="diff-header">${escaped}</span>`;
|
|
1605
|
-
} else {
|
|
1606
|
-
return `<span class="diff-context">${escaped}</span>`;
|
|
1607
|
-
}
|
|
1608
|
-
})
|
|
1609
|
-
.join('\n');
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
function displayGitDiff(modal, result) {
|
|
1613
|
-
console.log('📝 displayGitDiff called with:', result);
|
|
1614
|
-
const contentArea = modal.querySelector('.git-diff-content-area');
|
|
1615
|
-
const commitHashElement = modal.querySelector('.commit-hash');
|
|
1616
|
-
const methodElement = modal.querySelector('.diff-method');
|
|
1617
|
-
const codeElement = modal.querySelector('.git-diff-code');
|
|
1618
|
-
|
|
1619
|
-
console.log('🔍 Elements found:', {
|
|
1620
|
-
contentArea: !!contentArea,
|
|
1621
|
-
commitHashElement: !!commitHashElement,
|
|
1622
|
-
methodElement: !!methodElement,
|
|
1623
|
-
codeElement: !!codeElement
|
|
1624
|
-
});
|
|
1625
|
-
|
|
1626
|
-
// Update metadata
|
|
1627
|
-
if (commitHashElement) commitHashElement.textContent = `Commit: ${result.commit_hash}`;
|
|
1628
|
-
if (methodElement) methodElement.textContent = `Method: ${result.method}`;
|
|
1629
|
-
|
|
1630
|
-
// Update diff content with basic syntax highlighting
|
|
1631
|
-
if (codeElement && result.diff) {
|
|
1632
|
-
console.log('💡 Setting diff content, length:', result.diff.length);
|
|
1633
|
-
codeElement.innerHTML = highlightGitDiff(result.diff);
|
|
1634
|
-
|
|
1635
|
-
// Force scrolling to work by setting explicit heights
|
|
1636
|
-
const wrapper = modal.querySelector('.git-diff-scroll-wrapper');
|
|
1637
|
-
if (wrapper) {
|
|
1638
|
-
// Give it a moment for content to render
|
|
1639
|
-
setTimeout(() => {
|
|
1640
|
-
const modalContent = modal.querySelector('.modal-content');
|
|
1641
|
-
const header = modal.querySelector('.git-diff-header');
|
|
1642
|
-
const toolbar = modal.querySelector('.git-diff-toolbar');
|
|
1643
|
-
|
|
1644
|
-
const modalHeight = modalContent?.offsetHeight || 0;
|
|
1645
|
-
const headerHeight = header?.offsetHeight || 0;
|
|
1646
|
-
const toolbarHeight = toolbar?.offsetHeight || 0;
|
|
1647
|
-
|
|
1648
|
-
const availableHeight = modalHeight - headerHeight - toolbarHeight - 40; // 40px for padding
|
|
1649
|
-
|
|
1650
|
-
console.log('🎯 Setting explicit scroll height:', {
|
|
1651
|
-
modalHeight,
|
|
1652
|
-
headerHeight,
|
|
1653
|
-
toolbarHeight,
|
|
1654
|
-
availableHeight
|
|
1655
|
-
});
|
|
1656
|
-
|
|
1657
|
-
wrapper.style.maxHeight = `${availableHeight}px`;
|
|
1658
|
-
wrapper.style.overflowY = 'auto';
|
|
1659
|
-
}, 50);
|
|
1660
|
-
}
|
|
1661
|
-
} else {
|
|
1662
|
-
console.warn('⚠️ Missing codeElement or diff data');
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
// Show content area
|
|
1666
|
-
if (contentArea) {
|
|
1667
|
-
contentArea.style.display = 'block';
|
|
1668
|
-
console.log('✅ Content area displayed');
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
function displayGitDiffError(modal, result) {
|
|
1673
|
-
const errorArea = modal.querySelector('.git-diff-error');
|
|
1674
|
-
const messageElement = modal.querySelector('.error-message');
|
|
1675
|
-
const suggestionsElement = modal.querySelector('.error-suggestions');
|
|
1676
|
-
|
|
1677
|
-
// Create more user-friendly error messages
|
|
1678
|
-
let errorMessage = result.error || 'Unknown error occurred';
|
|
1679
|
-
let isUntracked = false;
|
|
1680
|
-
|
|
1681
|
-
if (errorMessage.includes('not tracked by git')) {
|
|
1682
|
-
errorMessage = '📝 This file is not tracked by git yet';
|
|
1683
|
-
isUntracked = true;
|
|
1684
|
-
} else if (errorMessage.includes('No git history found')) {
|
|
1685
|
-
errorMessage = '📋 No git history available for this file';
|
|
1686
|
-
}
|
|
1687
|
-
|
|
1688
|
-
messageElement.innerHTML = `
|
|
1689
|
-
<div class="error-main">${errorMessage}</div>
|
|
1690
|
-
${result.file_path ? `<div class="error-file">File: ${result.file_path}</div>` : ''}
|
|
1691
|
-
${result.working_dir ? `<div class="error-dir">Working directory: ${result.working_dir}</div>` : ''}
|
|
1692
|
-
`;
|
|
1693
|
-
|
|
1694
|
-
if (result.suggestions && result.suggestions.length > 0) {
|
|
1695
|
-
const suggestionTitle = isUntracked ? 'How to track this file:' : 'Suggestions:';
|
|
1696
|
-
suggestionsElement.innerHTML = `
|
|
1697
|
-
<h4>${suggestionTitle}</h4>
|
|
1698
|
-
<ul>
|
|
1699
|
-
${result.suggestions.map(s => `<li>${s}</li>`).join('')}
|
|
1700
|
-
</ul>
|
|
1701
|
-
`;
|
|
1702
|
-
} else {
|
|
1703
|
-
suggestionsElement.innerHTML = '';
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
console.log('📋 Displaying git diff error:', {
|
|
1707
|
-
originalError: result.error,
|
|
1708
|
-
processedMessage: errorMessage,
|
|
1709
|
-
isUntracked,
|
|
1710
|
-
suggestions: result.suggestions
|
|
1711
|
-
});
|
|
1712
|
-
|
|
1713
|
-
errorArea.style.display = 'block';
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
1579
|
// File Viewer Modal Functions
|
|
1717
|
-
window.showFileViewerModal = function(filePath) {
|
|
1580
|
+
window.showFileViewerModal = async function(filePath) {
|
|
1581
|
+
console.log('[FileViewer] Opening file:', filePath);
|
|
1582
|
+
|
|
1718
1583
|
// Use the dashboard's current working directory
|
|
1719
1584
|
let workingDir = '';
|
|
1720
1585
|
if (window.dashboard && window.dashboard.currentWorkingDir) {
|
|
1721
1586
|
workingDir = window.dashboard.currentWorkingDir;
|
|
1587
|
+
console.log('[FileViewer] Using working directory:', workingDir);
|
|
1722
1588
|
}
|
|
1723
1589
|
|
|
1724
1590
|
// Create modal if it doesn't exist
|
|
1725
1591
|
let modal = document.getElementById('file-viewer-modal');
|
|
1726
1592
|
if (!modal) {
|
|
1593
|
+
console.log('[FileViewer] Creating new modal');
|
|
1727
1594
|
modal = createFileViewerModal();
|
|
1728
1595
|
document.body.appendChild(modal);
|
|
1729
|
-
}
|
|
1730
1596
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1597
|
+
// Small delay to ensure DOM is fully updated
|
|
1598
|
+
await new Promise(resolve => setTimeout(resolve, 10));
|
|
1599
|
+
}
|
|
1733
1600
|
|
|
1734
|
-
// Show the modal as flex container
|
|
1601
|
+
// Show the modal as flex container first (ensures proper rendering)
|
|
1735
1602
|
modal.style.display = 'flex';
|
|
1736
1603
|
document.body.style.overflow = 'hidden'; // Prevent background scrolling
|
|
1604
|
+
|
|
1605
|
+
// Update modal content
|
|
1606
|
+
updateFileViewerModal(modal, filePath, workingDir).catch(error => {
|
|
1607
|
+
console.error('Error updating file viewer modal:', error);
|
|
1608
|
+
// Show error in the modal
|
|
1609
|
+
displayFileContentError(modal, { error: error.message });
|
|
1610
|
+
});
|
|
1737
1611
|
};
|
|
1738
1612
|
|
|
1739
1613
|
window.hideFileViewerModal = function() {
|
|
@@ -1757,11 +1631,13 @@ window.copyFileContent = function() {
|
|
|
1757
1631
|
navigator.clipboard.writeText(text).then(() => {
|
|
1758
1632
|
// Show brief feedback
|
|
1759
1633
|
const button = modal.querySelector('.file-content-copy');
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1634
|
+
if (button) {
|
|
1635
|
+
const originalText = button.textContent;
|
|
1636
|
+
button.textContent = '✅ Copied!';
|
|
1637
|
+
setTimeout(() => {
|
|
1638
|
+
button.textContent = originalText;
|
|
1639
|
+
}, 2000);
|
|
1640
|
+
}
|
|
1765
1641
|
}).catch(err => {
|
|
1766
1642
|
console.error('Failed to copy text:', err);
|
|
1767
1643
|
});
|
|
@@ -1775,11 +1651,13 @@ window.copyFileContent = function() {
|
|
|
1775
1651
|
document.body.removeChild(textarea);
|
|
1776
1652
|
|
|
1777
1653
|
const button = modal.querySelector('.file-content-copy');
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1654
|
+
if (button) {
|
|
1655
|
+
const originalText = button.textContent;
|
|
1656
|
+
button.textContent = '✅ Copied!';
|
|
1657
|
+
setTimeout(() => {
|
|
1658
|
+
button.textContent = originalText;
|
|
1659
|
+
}, 2000);
|
|
1660
|
+
}
|
|
1783
1661
|
}
|
|
1784
1662
|
};
|
|
1785
1663
|
|
|
@@ -1790,6 +1668,19 @@ function displayFileContentError(modal, result) {
|
|
|
1790
1668
|
const errorArea = modal.querySelector('.file-viewer-error');
|
|
1791
1669
|
const messageElement = modal.querySelector('.error-message');
|
|
1792
1670
|
const suggestionsElement = modal.querySelector('.error-suggestions');
|
|
1671
|
+
const loadingElement = modal.querySelector('.file-viewer-loading');
|
|
1672
|
+
const contentArea = modal.querySelector('.file-viewer-content-area');
|
|
1673
|
+
|
|
1674
|
+
// Hide loading and content areas, show error
|
|
1675
|
+
if (loadingElement) {
|
|
1676
|
+
loadingElement.style.display = 'none';
|
|
1677
|
+
}
|
|
1678
|
+
if (contentArea) {
|
|
1679
|
+
contentArea.style.display = 'none';
|
|
1680
|
+
}
|
|
1681
|
+
if (errorArea) {
|
|
1682
|
+
errorArea.style.display = 'flex';
|
|
1683
|
+
}
|
|
1793
1684
|
|
|
1794
1685
|
// Create user-friendly error messages
|
|
1795
1686
|
let errorMessage = result.error || 'Unknown error occurred';
|
|
@@ -1800,29 +1691,37 @@ function displayFileContentError(modal, result) {
|
|
|
1800
1691
|
errorMessage = '🔒 Permission denied accessing this file';
|
|
1801
1692
|
} else if (errorMessage.includes('too large')) {
|
|
1802
1693
|
errorMessage = '📏 File is too large to display';
|
|
1694
|
+
} else if (errorMessage.includes('socket connection')) {
|
|
1695
|
+
errorMessage = '🔌 Not connected to the server. Please check your connection.';
|
|
1696
|
+
} else if (errorMessage.includes('timeout')) {
|
|
1697
|
+
errorMessage = '⏱️ Request timed out. The server may be busy or unresponsive.';
|
|
1803
1698
|
} else if (!errorMessage.includes('📁') && !errorMessage.includes('🔒') && !errorMessage.includes('📏')) {
|
|
1804
1699
|
errorMessage = `⚠️ ${errorMessage}`;
|
|
1805
1700
|
}
|
|
1806
1701
|
|
|
1807
|
-
messageElement
|
|
1702
|
+
if (messageElement) {
|
|
1703
|
+
messageElement.textContent = errorMessage;
|
|
1704
|
+
}
|
|
1808
1705
|
|
|
1809
1706
|
// Add suggestions if available
|
|
1810
|
-
if (
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
<
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1707
|
+
if (suggestionsElement) {
|
|
1708
|
+
if (result.suggestions && result.suggestions.length > 0) {
|
|
1709
|
+
suggestionsElement.innerHTML = `
|
|
1710
|
+
<h4>Suggestions:</h4>
|
|
1711
|
+
<ul>
|
|
1712
|
+
${result.suggestions.map(suggestion => `<li>${suggestion}</li>`).join('')}
|
|
1713
|
+
</ul>
|
|
1714
|
+
`;
|
|
1715
|
+
} else {
|
|
1716
|
+
suggestionsElement.innerHTML = `
|
|
1717
|
+
<h4>Try:</h4>
|
|
1718
|
+
<ul>
|
|
1719
|
+
<li>Check if the file exists and is readable</li>
|
|
1720
|
+
<li>Verify file permissions</li>
|
|
1721
|
+
<li>Ensure the monitoring server has access to this file</li>
|
|
1722
|
+
</ul>
|
|
1723
|
+
`;
|
|
1724
|
+
}
|
|
1826
1725
|
}
|
|
1827
1726
|
|
|
1828
1727
|
console.log('📋 Displaying file content error:', {
|
|
@@ -1831,7 +1730,9 @@ function displayFileContentError(modal, result) {
|
|
|
1831
1730
|
suggestions: result.suggestions
|
|
1832
1731
|
});
|
|
1833
1732
|
|
|
1834
|
-
errorArea
|
|
1733
|
+
if (errorArea) {
|
|
1734
|
+
errorArea.style.display = 'block';
|
|
1735
|
+
}
|
|
1835
1736
|
}
|
|
1836
1737
|
|
|
1837
1738
|
// Search Viewer Modal Functions
|