claude-mpm 4.24.0__py3-none-any.whl → 5.4.41__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/VERSION +1 -1
- claude_mpm/__init__.py +4 -0
- claude_mpm/agents/BASE_AGENT.md +164 -0
- claude_mpm/agents/{OUTPUT_STYLE.md → CLAUDE_MPM_OUTPUT_STYLE.md} +3 -48
- claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +2002 -0
- claude_mpm/agents/MEMORY.md +1 -1
- claude_mpm/agents/PM_INSTRUCTIONS.md +735 -925
- claude_mpm/agents/WORKFLOW.md +5 -254
- claude_mpm/agents/__init__.py +6 -0
- claude_mpm/agents/agent_loader.py +14 -48
- claude_mpm/agents/base_agent.json +7 -4
- claude_mpm/agents/frontmatter_validator.py +71 -3
- claude_mpm/agents/templates/circuit-breakers.md +1391 -0
- claude_mpm/agents/templates/context-management-examples.md +544 -0
- claude_mpm/agents/templates/{pm_red_flags.md → pm-red-flags.md} +48 -0
- claude_mpm/agents/templates/pr-workflow-examples.md +427 -0
- claude_mpm/agents/templates/research-gate-examples.md +669 -0
- claude_mpm/agents/templates/structured-questions-examples.md +615 -0
- claude_mpm/agents/templates/ticket-completeness-examples.md +139 -0
- claude_mpm/agents/templates/ticketing-examples.md +277 -0
- claude_mpm/cli/__init__.py +37 -2
- claude_mpm/cli/__main__.py +4 -0
- claude_mpm/cli/chrome_devtools_installer.py +175 -0
- claude_mpm/cli/commands/__init__.py +2 -0
- claude_mpm/cli/commands/agent_source.py +774 -0
- claude_mpm/cli/commands/agent_state_manager.py +180 -31
- claude_mpm/cli/commands/agents.py +1116 -55
- claude_mpm/cli/commands/agents_cleanup.py +210 -0
- claude_mpm/cli/commands/agents_discover.py +338 -0
- claude_mpm/cli/commands/aggregate.py +1 -1
- claude_mpm/cli/commands/analyze.py +3 -3
- claude_mpm/cli/commands/auto_configure.py +725 -242
- claude_mpm/cli/commands/config.py +95 -6
- claude_mpm/cli/commands/configure.py +1875 -46
- claude_mpm/cli/commands/configure_agent_display.py +29 -10
- claude_mpm/cli/commands/configure_navigation.py +63 -46
- claude_mpm/cli/commands/debug.py +12 -12
- claude_mpm/cli/commands/doctor.py +10 -2
- claude_mpm/cli/commands/hook_errors.py +277 -0
- claude_mpm/cli/commands/local_deploy.py +1 -4
- claude_mpm/cli/commands/mcp_install_commands.py +1 -1
- claude_mpm/cli/commands/mpm_init/core.py +229 -2
- claude_mpm/cli/commands/mpm_init/git_activity.py +10 -10
- claude_mpm/cli/commands/mpm_init/knowledge_extractor.py +481 -0
- claude_mpm/cli/commands/mpm_init/prompts.py +286 -6
- claude_mpm/cli/commands/postmortem.py +401 -0
- claude_mpm/cli/commands/profile.py +277 -0
- claude_mpm/cli/commands/run.py +123 -165
- claude_mpm/cli/commands/skill_source.py +694 -0
- claude_mpm/cli/commands/skills.py +782 -20
- claude_mpm/cli/commands/summarize.py +413 -0
- claude_mpm/cli/executor.py +96 -3
- claude_mpm/cli/interactive/agent_wizard.py +1030 -45
- claude_mpm/cli/parsers/agent_source_parser.py +171 -0
- claude_mpm/cli/parsers/agents_parser.py +307 -10
- claude_mpm/cli/parsers/auto_configure_parser.py +13 -138
- claude_mpm/cli/parsers/base_parser.py +65 -0
- claude_mpm/cli/parsers/config_parser.py +162 -39
- claude_mpm/cli/parsers/profile_parser.py +148 -0
- claude_mpm/cli/parsers/skill_source_parser.py +169 -0
- claude_mpm/cli/parsers/skills_parser.py +146 -0
- claude_mpm/cli/parsers/source_parser.py +138 -0
- claude_mpm/cli/startup.py +1280 -118
- claude_mpm/cli/startup_display.py +480 -0
- claude_mpm/cli/utils.py +1 -1
- claude_mpm/cli_module/commands.py +1 -1
- claude_mpm/commands/mpm-config.md +21 -134
- claude_mpm/commands/mpm-doctor.md +16 -20
- claude_mpm/commands/mpm-help.md +13 -283
- claude_mpm/commands/mpm-init.md +88 -489
- claude_mpm/commands/mpm-monitor.md +23 -401
- claude_mpm/commands/mpm-organize.md +72 -247
- claude_mpm/commands/mpm-postmortem.md +21 -0
- claude_mpm/commands/mpm-session-resume.md +30 -0
- claude_mpm/commands/mpm-status.md +13 -68
- claude_mpm/commands/mpm-ticket-view.md +109 -0
- claude_mpm/commands/mpm-version.md +13 -106
- claude_mpm/commands/mpm.md +10 -0
- claude_mpm/config/agent_presets.py +488 -0
- claude_mpm/config/agent_sources.py +352 -0
- claude_mpm/config/skill_presets.py +392 -0
- claude_mpm/config/skill_sources.py +590 -0
- claude_mpm/constants.py +13 -0
- claude_mpm/core/claude_runner.py +5 -34
- claude_mpm/core/config.py +15 -1
- claude_mpm/core/constants.py +1 -1
- claude_mpm/core/framework/__init__.py +3 -16
- claude_mpm/core/framework/formatters/content_formatter.py +3 -13
- claude_mpm/core/framework/loaders/agent_loader.py +8 -5
- claude_mpm/core/framework/loaders/file_loader.py +54 -101
- claude_mpm/core/framework/loaders/instruction_loader.py +66 -5
- claude_mpm/core/framework_loader.py +4 -2
- claude_mpm/core/hook_error_memory.py +381 -0
- claude_mpm/core/hook_manager.py +41 -2
- claude_mpm/core/interactive_session.py +91 -10
- claude_mpm/core/logger.py +16 -1
- claude_mpm/core/oneshot_session.py +71 -8
- claude_mpm/core/optimized_startup.py +59 -0
- claude_mpm/core/output_style_manager.py +173 -43
- claude_mpm/core/protocols/__init__.py +23 -0
- claude_mpm/core/protocols/runner_protocol.py +103 -0
- claude_mpm/core/protocols/session_protocol.py +131 -0
- claude_mpm/core/shared/config_loader.py +1 -1
- claude_mpm/core/shared/singleton_manager.py +11 -4
- claude_mpm/core/socketio_pool.py +3 -3
- claude_mpm/core/system_context.py +38 -0
- claude_mpm/core/unified_agent_registry.py +134 -16
- claude_mpm/core/unified_config.py +22 -0
- claude_mpm/dashboard/static/svelte-build/_app/env.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/0.B_FtCwCQ.css +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/2.Cl_eSA4x.css +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/BgChzWQ1.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CIXEwuWe.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CWc5urbQ.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/DMkZpdF2.js +2 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/DjhvlsAc.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/N4qtv3Hx.js +2 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/uj46x2Wr.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/app.DTL5mJO-.js +2 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/start.DzuEhzqh.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/0.CAGBuiOw.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/1.DFLC8jdE.js +1 -0
- claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/2.DPvEihJJ.js +10 -0
- claude_mpm/dashboard/static/svelte-build/_app/version.json +1 -0
- claude_mpm/dashboard/static/svelte-build/favicon.svg +7 -0
- claude_mpm/dashboard/static/svelte-build/index.html +36 -0
- claude_mpm/experimental/cli_enhancements.py +1 -5
- claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/correlation_manager.py +60 -0
- claude_mpm/hooks/claude_hooks/event_handlers.py +214 -79
- claude_mpm/hooks/claude_hooks/hook_handler.py +155 -1
- claude_mpm/hooks/claude_hooks/installer.py +33 -10
- claude_mpm/hooks/claude_hooks/memory_integration.py +28 -0
- claude_mpm/hooks/claude_hooks/response_tracking.py +2 -3
- claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
- claude_mpm/hooks/claude_hooks/services/connection_manager.py +30 -6
- claude_mpm/hooks/failure_learning/__init__.py +2 -8
- claude_mpm/hooks/failure_learning/failure_detection_hook.py +1 -6
- claude_mpm/hooks/failure_learning/fix_detection_hook.py +1 -6
- claude_mpm/hooks/failure_learning/learning_extraction_hook.py +1 -6
- claude_mpm/hooks/kuzu_response_hook.py +1 -5
- claude_mpm/hooks/memory_integration_hook.py +46 -1
- claude_mpm/init.py +63 -19
- claude_mpm/models/agent_definition.py +7 -0
- claude_mpm/models/git_repository.py +198 -0
- claude_mpm/scripts/claude-hook-handler.sh +60 -20
- claude_mpm/scripts/launch_monitor.py +93 -13
- claude_mpm/scripts/start_activity_logging.py +3 -1
- claude_mpm/services/agents/agent_builder.py +48 -12
- claude_mpm/services/agents/agent_preset_service.py +238 -0
- claude_mpm/services/agents/agent_recommendation_service.py +278 -0
- claude_mpm/services/agents/agent_review_service.py +280 -0
- claude_mpm/services/agents/agent_selection_service.py +484 -0
- claude_mpm/services/agents/auto_deploy_index_parser.py +569 -0
- claude_mpm/services/agents/cache_git_manager.py +621 -0
- claude_mpm/services/agents/deployment/agent_deployment.py +148 -2
- claude_mpm/services/agents/deployment/agent_discovery_service.py +104 -73
- claude_mpm/services/agents/deployment/agent_format_converter.py +1 -1
- claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +1 -5
- claude_mpm/services/agents/deployment/agent_metrics_collector.py +3 -3
- claude_mpm/services/agents/deployment/agent_restore_handler.py +1 -4
- claude_mpm/services/agents/deployment/agent_template_builder.py +238 -15
- claude_mpm/services/agents/deployment/agents_directory_resolver.py +101 -15
- claude_mpm/services/agents/deployment/async_agent_deployment.py +2 -1
- claude_mpm/services/agents/deployment/facade/deployment_facade.py +3 -3
- claude_mpm/services/agents/deployment/multi_source_deployment_service.py +422 -31
- claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +2 -2
- claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +1 -4
- claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +841 -0
- claude_mpm/services/agents/deployment/single_agent_deployer.py +2 -2
- claude_mpm/services/agents/deployment/system_instructions_deployer.py +168 -46
- claude_mpm/services/agents/deployment/validation/deployment_validator.py +2 -2
- claude_mpm/services/agents/git_source_manager.py +663 -0
- claude_mpm/services/agents/loading/base_agent_manager.py +1 -13
- claude_mpm/services/agents/loading/framework_agent_loader.py +9 -12
- claude_mpm/services/agents/local_template_manager.py +50 -10
- claude_mpm/services/agents/recommender.py +5 -3
- claude_mpm/services/agents/single_tier_deployment_service.py +696 -0
- claude_mpm/services/agents/sources/__init__.py +13 -0
- claude_mpm/services/agents/sources/agent_sync_state.py +516 -0
- claude_mpm/services/agents/sources/git_source_sync_service.py +1094 -0
- claude_mpm/services/agents/startup_sync.py +259 -0
- claude_mpm/services/agents/toolchain_detector.py +478 -0
- claude_mpm/services/analysis/__init__.py +35 -0
- claude_mpm/services/analysis/clone_detector.py +1030 -0
- claude_mpm/services/analysis/postmortem_reporter.py +474 -0
- claude_mpm/services/analysis/postmortem_service.py +765 -0
- claude_mpm/services/cli/session_pause_manager.py +1 -1
- claude_mpm/services/command_deployment_service.py +271 -6
- claude_mpm/services/core/base.py +7 -2
- claude_mpm/services/core/interfaces/__init__.py +1 -3
- claude_mpm/services/core/interfaces/health.py +1 -4
- claude_mpm/services/core/models/__init__.py +2 -11
- claude_mpm/services/diagnostics/checks/__init__.py +4 -0
- claude_mpm/services/diagnostics/checks/agent_check.py +2 -4
- claude_mpm/services/diagnostics/checks/agent_sources_check.py +577 -0
- claude_mpm/services/diagnostics/checks/instructions_check.py +1 -2
- claude_mpm/services/diagnostics/checks/mcp_check.py +0 -1
- claude_mpm/services/diagnostics/checks/mcp_services_check.py +7 -15
- claude_mpm/services/diagnostics/checks/monitor_check.py +0 -1
- claude_mpm/services/diagnostics/checks/skill_sources_check.py +587 -0
- claude_mpm/services/diagnostics/diagnostic_runner.py +9 -0
- claude_mpm/services/diagnostics/doctor_reporter.py +40 -10
- claude_mpm/services/event_bus/config.py +3 -1
- claude_mpm/services/event_bus/direct_relay.py +3 -3
- claude_mpm/services/events/consumers/logging.py +1 -2
- claude_mpm/services/git/__init__.py +21 -0
- claude_mpm/services/git/git_operations_service.py +579 -0
- claude_mpm/services/github/__init__.py +21 -0
- claude_mpm/services/github/github_cli_service.py +397 -0
- claude_mpm/services/infrastructure/monitoring/__init__.py +1 -5
- claude_mpm/services/infrastructure/monitoring/aggregator.py +1 -6
- claude_mpm/services/instructions/__init__.py +9 -0
- claude_mpm/services/instructions/instruction_cache_service.py +374 -0
- claude_mpm/services/local_ops/__init__.py +3 -13
- claude_mpm/services/local_ops/health_checks/__init__.py +1 -3
- claude_mpm/services/local_ops/health_manager.py +1 -4
- claude_mpm/services/local_ops/resource_monitor.py +1 -1
- claude_mpm/services/mcp_config_manager.py +75 -145
- claude_mpm/services/mcp_service_verifier.py +6 -3
- claude_mpm/services/model/model_router.py +1 -2
- claude_mpm/services/monitor/daemon.py +38 -11
- claude_mpm/services/monitor/daemon_manager.py +134 -21
- claude_mpm/services/monitor/management/lifecycle.py +8 -1
- claude_mpm/services/monitor/server.py +700 -24
- claude_mpm/services/pm_skills_deployer.py +676 -0
- claude_mpm/services/port_manager.py +1 -1
- claude_mpm/services/pr/__init__.py +14 -0
- claude_mpm/services/pr/pr_template_service.py +329 -0
- claude_mpm/services/profile_manager.py +331 -0
- claude_mpm/services/project/documentation_manager.py +2 -1
- claude_mpm/services/project/project_organizer.py +4 -0
- claude_mpm/services/project/toolchain_analyzer.py +3 -1
- claude_mpm/services/runner_configuration_service.py +16 -3
- claude_mpm/services/self_upgrade_service.py +120 -12
- claude_mpm/services/session_management_service.py +16 -4
- claude_mpm/services/skills/__init__.py +21 -0
- claude_mpm/services/skills/git_skill_source_manager.py +1297 -0
- claude_mpm/services/skills/selective_skill_deployer.py +704 -0
- claude_mpm/services/skills/skill_discovery_service.py +568 -0
- claude_mpm/services/skills/skill_to_agent_mapper.py +406 -0
- claude_mpm/services/skills_config.py +547 -0
- claude_mpm/services/skills_deployer.py +1072 -0
- claude_mpm/services/socketio/dashboard_server.py +1 -0
- claude_mpm/services/socketio/event_normalizer.py +51 -6
- claude_mpm/services/socketio/handlers/connection.py +1 -1
- claude_mpm/services/socketio/handlers/git.py +1 -1
- claude_mpm/services/socketio/server/core.py +387 -112
- claude_mpm/services/socketio/server/main.py +1 -3
- claude_mpm/services/system_instructions_service.py +1 -3
- claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +0 -3
- claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +0 -1
- claude_mpm/services/unified/deployment_strategies/vercel.py +1 -5
- claude_mpm/services/unified/unified_deployment.py +1 -5
- claude_mpm/services/version_control/conflict_resolution.py +6 -4
- claude_mpm/services/version_control/git_operations.py +103 -0
- claude_mpm/services/visualization/__init__.py +1 -5
- claude_mpm/services/visualization/mermaid_generator.py +2 -3
- claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +2 -2
- claude_mpm/skills/skill_manager.py +92 -3
- claude_mpm/skills/skills_registry.py +0 -1
- claude_mpm/templates/questions/__init__.py +38 -0
- claude_mpm/templates/questions/base.py +193 -0
- claude_mpm/templates/questions/pr_strategy.py +311 -0
- claude_mpm/templates/questions/project_init.py +385 -0
- claude_mpm/templates/questions/ticket_mgmt.py +394 -0
- claude_mpm/tools/__main__.py +8 -8
- claude_mpm/utils/agent_dependency_loader.py +91 -12
- claude_mpm/utils/agent_filters.py +261 -0
- claude_mpm/utils/dependency_cache.py +3 -1
- claude_mpm/utils/gitignore.py +244 -0
- claude_mpm/utils/migration.py +372 -0
- claude_mpm/utils/progress.py +387 -0
- claude_mpm/utils/robust_installer.py +49 -7
- claude_mpm/utils/structured_questions.py +619 -0
- {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/METADATA +445 -122
- {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/RECORD +298 -503
- claude_mpm-5.4.41.dist-info/entry_points.txt +5 -0
- claude_mpm-5.4.41.dist-info/licenses/LICENSE +94 -0
- claude_mpm-5.4.41.dist-info/licenses/LICENSE-FAQ.md +153 -0
- claude_mpm/agents/BASE_AGENT_TEMPLATE.md +0 -292
- claude_mpm/agents/BASE_DOCUMENTATION.md +0 -53
- claude_mpm/agents/BASE_OPS.md +0 -219
- claude_mpm/agents/BASE_PM.md +0 -468
- claude_mpm/agents/BASE_PROMPT_ENGINEER.md +0 -787
- claude_mpm/agents/BASE_QA.md +0 -167
- claude_mpm/agents/BASE_RESEARCH.md +0 -53
- claude_mpm/agents/base_agent_loader.py +0 -626
- claude_mpm/agents/templates/.claude-mpm/memories/README.md +0 -17
- claude_mpm/agents/templates/.claude-mpm/memories/engineer_memories.md +0 -3
- claude_mpm/agents/templates/agent-manager.json +0 -273
- claude_mpm/agents/templates/agentic-coder-optimizer.json +0 -248
- claude_mpm/agents/templates/api_qa.json +0 -183
- claude_mpm/agents/templates/circuit_breakers.md +0 -638
- claude_mpm/agents/templates/clerk-ops.json +0 -235
- claude_mpm/agents/templates/code_analyzer.json +0 -101
- claude_mpm/agents/templates/content-agent.json +0 -358
- claude_mpm/agents/templates/dart_engineer.json +0 -307
- claude_mpm/agents/templates/data_engineer.json +0 -225
- claude_mpm/agents/templates/documentation.json +0 -238
- claude_mpm/agents/templates/engineer.json +0 -210
- claude_mpm/agents/templates/gcp_ops_agent.json +0 -253
- claude_mpm/agents/templates/golang_engineer.json +0 -270
- claude_mpm/agents/templates/imagemagick.json +0 -264
- claude_mpm/agents/templates/java_engineer.json +0 -346
- claude_mpm/agents/templates/javascript_engineer_agent.json +0 -380
- claude_mpm/agents/templates/local_ops_agent.json +0 -1840
- claude_mpm/agents/templates/logs/prompts/agent_engineer_20250826_014258_728.md +0 -39
- claude_mpm/agents/templates/logs/prompts/agent_engineer_20250901_010124_142.md +0 -400
- claude_mpm/agents/templates/memory_manager.json +0 -158
- claude_mpm/agents/templates/nextjs_engineer.json +0 -285
- claude_mpm/agents/templates/ops.json +0 -185
- claude_mpm/agents/templates/php-engineer.json +0 -287
- claude_mpm/agents/templates/product_owner.json +0 -338
- claude_mpm/agents/templates/project_organizer.json +0 -144
- claude_mpm/agents/templates/prompt-engineer.json +0 -737
- claude_mpm/agents/templates/python_engineer.json +0 -387
- claude_mpm/agents/templates/qa.json +0 -243
- claude_mpm/agents/templates/react_engineer.json +0 -239
- claude_mpm/agents/templates/refactoring_engineer.json +0 -276
- claude_mpm/agents/templates/research.json +0 -188
- claude_mpm/agents/templates/ruby-engineer.json +0 -280
- claude_mpm/agents/templates/rust_engineer.json +0 -275
- claude_mpm/agents/templates/security.json +0 -202
- claude_mpm/agents/templates/svelte-engineer.json +0 -225
- claude_mpm/agents/templates/tauri_engineer.json +0 -274
- claude_mpm/agents/templates/ticketing.json +0 -178
- claude_mpm/agents/templates/typescript_engineer.json +0 -285
- claude_mpm/agents/templates/vercel_ops_agent.json +0 -412
- claude_mpm/agents/templates/version_control.json +0 -159
- claude_mpm/agents/templates/web_qa.json +0 -400
- claude_mpm/agents/templates/web_ui.json +0 -189
- claude_mpm/cli/commands/agents_detect.py +0 -380
- claude_mpm/cli/commands/agents_recommend.py +0 -309
- claude_mpm/cli/ticket_cli.py +0 -35
- claude_mpm/commands/mpm-agents-detect.md +0 -168
- claude_mpm/commands/mpm-agents-recommend.md +0 -214
- claude_mpm/commands/mpm-agents.md +0 -122
- claude_mpm/commands/mpm-auto-configure.md +0 -269
- claude_mpm/commands/mpm-resume.md +0 -372
- claude_mpm/commands/mpm-tickets.md +0 -151
- claude_mpm/dashboard/.claude-mpm/socketio-instances.json +0 -1
- claude_mpm/dashboard/analysis_runner.py +0 -455
- claude_mpm/dashboard/index.html +0 -13
- claude_mpm/dashboard/open_dashboard.py +0 -66
- claude_mpm/dashboard/react/components/DataInspector/DataInspector.module.css +0 -188
- claude_mpm/dashboard/react/components/EventViewer/EventViewer.module.css +0 -156
- claude_mpm/dashboard/react/components/shared/ConnectionStatus.module.css +0 -38
- claude_mpm/dashboard/react/components/shared/FilterBar.module.css +0 -92
- claude_mpm/dashboard/static/archive/activity_dashboard_fixed.html +0 -248
- claude_mpm/dashboard/static/archive/activity_dashboard_test.html +0 -61
- claude_mpm/dashboard/static/archive/test_activity_connection.html +0 -179
- claude_mpm/dashboard/static/archive/test_claude_tree_tab.html +0 -68
- claude_mpm/dashboard/static/archive/test_dashboard.html +0 -409
- claude_mpm/dashboard/static/archive/test_dashboard_fixed.html +0 -519
- claude_mpm/dashboard/static/archive/test_dashboard_verification.html +0 -181
- claude_mpm/dashboard/static/archive/test_file_data.html +0 -315
- claude_mpm/dashboard/static/archive/test_file_tree_empty_state.html +0 -243
- claude_mpm/dashboard/static/archive/test_file_tree_fix.html +0 -234
- claude_mpm/dashboard/static/archive/test_file_tree_rename.html +0 -117
- claude_mpm/dashboard/static/archive/test_file_tree_tab.html +0 -115
- claude_mpm/dashboard/static/archive/test_file_viewer.html +0 -224
- claude_mpm/dashboard/static/archive/test_final_activity.html +0 -220
- claude_mpm/dashboard/static/archive/test_tab_fix.html +0 -139
- claude_mpm/dashboard/static/built/assets/events.DjpNxWNo.css +0 -1
- claude_mpm/dashboard/static/built/components/activity-tree.js +0 -2
- claude_mpm/dashboard/static/built/components/agent-hierarchy.js +0 -777
- claude_mpm/dashboard/static/built/components/agent-inference.js +0 -2
- claude_mpm/dashboard/static/built/components/build-tracker.js +0 -333
- claude_mpm/dashboard/static/built/components/code-simple.js +0 -857
- claude_mpm/dashboard/static/built/components/code-tree/tree-breadcrumb.js +0 -353
- claude_mpm/dashboard/static/built/components/code-tree/tree-constants.js +0 -235
- claude_mpm/dashboard/static/built/components/code-tree/tree-search.js +0 -409
- claude_mpm/dashboard/static/built/components/code-tree/tree-utils.js +0 -435
- claude_mpm/dashboard/static/built/components/code-tree.js +0 -2
- claude_mpm/dashboard/static/built/components/code-viewer.js +0 -2
- claude_mpm/dashboard/static/built/components/connection-debug.js +0 -654
- claude_mpm/dashboard/static/built/components/diff-viewer.js +0 -891
- claude_mpm/dashboard/static/built/components/event-processor.js +0 -2
- claude_mpm/dashboard/static/built/components/event-viewer.js +0 -2
- claude_mpm/dashboard/static/built/components/export-manager.js +0 -2
- claude_mpm/dashboard/static/built/components/file-change-tracker.js +0 -443
- claude_mpm/dashboard/static/built/components/file-change-viewer.js +0 -690
- claude_mpm/dashboard/static/built/components/file-tool-tracker.js +0 -2
- claude_mpm/dashboard/static/built/components/file-viewer.js +0 -2
- claude_mpm/dashboard/static/built/components/hud-library-loader.js +0 -2
- claude_mpm/dashboard/static/built/components/hud-manager.js +0 -2
- claude_mpm/dashboard/static/built/components/hud-visualizer.js +0 -2
- claude_mpm/dashboard/static/built/components/module-viewer.js +0 -2
- claude_mpm/dashboard/static/built/components/nav-bar.js +0 -145
- claude_mpm/dashboard/static/built/components/page-structure.js +0 -429
- claude_mpm/dashboard/static/built/components/session-manager.js +0 -2
- claude_mpm/dashboard/static/built/components/socket-manager.js +0 -2
- claude_mpm/dashboard/static/built/components/ui-state-manager.js +0 -2
- claude_mpm/dashboard/static/built/components/unified-data-viewer.js +0 -2
- claude_mpm/dashboard/static/built/components/working-directory.js +0 -2
- claude_mpm/dashboard/static/built/connection-manager.js +0 -536
- claude_mpm/dashboard/static/built/dashboard.js +0 -2
- claude_mpm/dashboard/static/built/extension-error-handler.js +0 -164
- claude_mpm/dashboard/static/built/react/events.js +0 -30
- claude_mpm/dashboard/static/built/shared/dom-helpers.js +0 -396
- claude_mpm/dashboard/static/built/shared/event-bus.js +0 -330
- claude_mpm/dashboard/static/built/shared/event-filter-service.js +0 -540
- claude_mpm/dashboard/static/built/shared/logger.js +0 -385
- claude_mpm/dashboard/static/built/shared/page-structure.js +0 -249
- claude_mpm/dashboard/static/built/shared/tooltip-service.js +0 -253
- claude_mpm/dashboard/static/built/socket-client.js +0 -2
- claude_mpm/dashboard/static/built/tab-isolation-fix.js +0 -185
- claude_mpm/dashboard/static/css/activity.css +0 -1958
- claude_mpm/dashboard/static/css/connection-status.css +0 -370
- claude_mpm/dashboard/static/css/dashboard.css +0 -4701
- claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +0 -1
- claude_mpm/dashboard/static/dist/components/activity-tree.js +0 -2
- claude_mpm/dashboard/static/dist/components/agent-inference.js +0 -2
- claude_mpm/dashboard/static/dist/components/code-tree.js +0 -2
- claude_mpm/dashboard/static/dist/components/code-viewer.js +0 -2
- claude_mpm/dashboard/static/dist/components/event-processor.js +0 -2
- claude_mpm/dashboard/static/dist/components/event-viewer.js +0 -2
- claude_mpm/dashboard/static/dist/components/export-manager.js +0 -2
- claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +0 -2
- claude_mpm/dashboard/static/dist/components/file-viewer.js +0 -2
- claude_mpm/dashboard/static/dist/components/hud-library-loader.js +0 -2
- claude_mpm/dashboard/static/dist/components/hud-manager.js +0 -2
- claude_mpm/dashboard/static/dist/components/hud-visualizer.js +0 -2
- claude_mpm/dashboard/static/dist/components/module-viewer.js +0 -2
- claude_mpm/dashboard/static/dist/components/session-manager.js +0 -2
- claude_mpm/dashboard/static/dist/components/socket-manager.js +0 -2
- claude_mpm/dashboard/static/dist/components/ui-state-manager.js +0 -2
- claude_mpm/dashboard/static/dist/components/unified-data-viewer.js +0 -2
- claude_mpm/dashboard/static/dist/components/working-directory.js +0 -2
- claude_mpm/dashboard/static/dist/dashboard.js +0 -2
- claude_mpm/dashboard/static/dist/react/events.js +0 -30
- claude_mpm/dashboard/static/dist/socket-client.js +0 -2
- claude_mpm/dashboard/static/events.html +0 -607
- claude_mpm/dashboard/static/index.html +0 -635
- claude_mpm/dashboard/static/js/components/activity-tree.js +0 -1871
- claude_mpm/dashboard/static/js/components/agent-hierarchy.js +0 -777
- claude_mpm/dashboard/static/js/components/agent-inference.js +0 -956
- claude_mpm/dashboard/static/js/components/build-tracker.js +0 -333
- claude_mpm/dashboard/static/js/components/code-simple.js +0 -857
- claude_mpm/dashboard/static/js/components/connection-debug.js +0 -654
- claude_mpm/dashboard/static/js/components/diff-viewer.js +0 -891
- claude_mpm/dashboard/static/js/components/event-processor.js +0 -542
- claude_mpm/dashboard/static/js/components/event-viewer.js +0 -1155
- claude_mpm/dashboard/static/js/components/export-manager.js +0 -368
- claude_mpm/dashboard/static/js/components/file-change-tracker.js +0 -443
- claude_mpm/dashboard/static/js/components/file-change-viewer.js +0 -690
- claude_mpm/dashboard/static/js/components/file-tool-tracker.js +0 -724
- claude_mpm/dashboard/static/js/components/file-viewer.js +0 -580
- claude_mpm/dashboard/static/js/components/hud-library-loader.js +0 -211
- claude_mpm/dashboard/static/js/components/hud-manager.js +0 -671
- claude_mpm/dashboard/static/js/components/hud-visualizer.js +0 -1718
- claude_mpm/dashboard/static/js/components/module-viewer.js +0 -2764
- claude_mpm/dashboard/static/js/components/session-manager.js +0 -579
- claude_mpm/dashboard/static/js/components/socket-manager.js +0 -368
- claude_mpm/dashboard/static/js/components/ui-state-manager.js +0 -749
- claude_mpm/dashboard/static/js/components/unified-data-viewer.js +0 -1824
- claude_mpm/dashboard/static/js/components/working-directory.js +0 -920
- claude_mpm/dashboard/static/js/connection-manager.js +0 -536
- claude_mpm/dashboard/static/js/dashboard.js +0 -1896
- claude_mpm/dashboard/static/js/extension-error-handler.js +0 -164
- claude_mpm/dashboard/static/js/shared/dom-helpers.js +0 -396
- claude_mpm/dashboard/static/js/shared/event-bus.js +0 -330
- claude_mpm/dashboard/static/js/shared/logger.js +0 -385
- claude_mpm/dashboard/static/js/shared/tooltip-service.js +0 -253
- claude_mpm/dashboard/static/js/socket-client.js +0 -1457
- claude_mpm/dashboard/static/js/stores/dashboard-store.js +0 -562
- claude_mpm/dashboard/static/js/tab-isolation-fix.js +0 -185
- claude_mpm/dashboard/static/legacy/activity.html +0 -736
- claude_mpm/dashboard/static/legacy/agents.html +0 -786
- claude_mpm/dashboard/static/legacy/files.html +0 -747
- claude_mpm/dashboard/static/legacy/tools.html +0 -831
- claude_mpm/dashboard/static/monitors.html +0 -431
- claude_mpm/dashboard/static/production/events.html +0 -659
- claude_mpm/dashboard/static/production/main.html +0 -698
- claude_mpm/dashboard/static/production/monitors.html +0 -483
- claude_mpm/dashboard/static/socket.io.min.js +0 -7
- claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +0 -7
- claude_mpm/dashboard/static/test-archive/dashboard.html +0 -635
- claude_mpm/dashboard/static/test-archive/debug-events.html +0 -147
- claude_mpm/dashboard/static/test-archive/test-navigation.html +0 -256
- claude_mpm/dashboard/static/test-archive/test-react-exports.html +0 -180
- claude_mpm/dashboard/static/test-archive/test_debug.html +0 -25
- claude_mpm/dashboard/templates/code_simple.html +0 -153
- claude_mpm/dashboard/templates/index.html +0 -606
- claude_mpm/dashboard/test_dashboard.html +0 -372
- claude_mpm/scripts/mcp_server.py +0 -75
- claude_mpm/scripts/mcp_wrapper.py +0 -39
- claude_mpm/services/mcp_gateway/__init__.py +0 -159
- claude_mpm/services/mcp_gateway/auto_configure.py +0 -369
- claude_mpm/services/mcp_gateway/config/__init__.py +0 -17
- claude_mpm/services/mcp_gateway/config/config_loader.py +0 -296
- claude_mpm/services/mcp_gateway/config/config_schema.py +0 -243
- claude_mpm/services/mcp_gateway/config/configuration.py +0 -429
- claude_mpm/services/mcp_gateway/core/__init__.py +0 -43
- claude_mpm/services/mcp_gateway/core/base.py +0 -312
- claude_mpm/services/mcp_gateway/core/exceptions.py +0 -253
- claude_mpm/services/mcp_gateway/core/interfaces.py +0 -443
- claude_mpm/services/mcp_gateway/core/process_pool.py +0 -971
- claude_mpm/services/mcp_gateway/core/singleton_manager.py +0 -315
- claude_mpm/services/mcp_gateway/core/startup_verification.py +0 -316
- claude_mpm/services/mcp_gateway/main.py +0 -589
- claude_mpm/services/mcp_gateway/registry/__init__.py +0 -12
- claude_mpm/services/mcp_gateway/registry/service_registry.py +0 -412
- claude_mpm/services/mcp_gateway/registry/tool_registry.py +0 -489
- claude_mpm/services/mcp_gateway/server/__init__.py +0 -15
- claude_mpm/services/mcp_gateway/server/mcp_gateway.py +0 -419
- claude_mpm/services/mcp_gateway/server/stdio_handler.py +0 -372
- claude_mpm/services/mcp_gateway/server/stdio_server.py +0 -714
- claude_mpm/services/mcp_gateway/tools/__init__.py +0 -36
- claude_mpm/services/mcp_gateway/tools/base_adapter.py +0 -485
- claude_mpm/services/mcp_gateway/tools/document_summarizer.py +0 -789
- claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +0 -654
- claude_mpm/services/mcp_gateway/tools/health_check_tool.py +0 -456
- claude_mpm/services/mcp_gateway/tools/hello_world.py +0 -551
- claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +0 -551
- claude_mpm/services/mcp_gateway/utils/__init__.py +0 -14
- claude_mpm/services/mcp_gateway/utils/package_version_checker.py +0 -160
- claude_mpm/services/mcp_gateway/utils/update_preferences.py +0 -170
- claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +0 -79
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +0 -178
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +0 -577
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +0 -467
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +0 -537
- claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +0 -730
- claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +0 -112
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +0 -146
- claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +0 -412
- claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +0 -81
- claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +0 -362
- claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +0 -312
- claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +0 -152
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +0 -668
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +0 -587
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +0 -438
- claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +0 -391
- claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +0 -119
- claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +0 -148
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +0 -483
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +0 -452
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +0 -449
- claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +0 -411
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +0 -14
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +0 -58
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +0 -68
- claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +0 -69
- claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +0 -131
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +0 -325
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +0 -490
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +0 -425
- claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +0 -499
- claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +0 -86
- claude_mpm/skills/bundled/main/internal-comms/SKILL.md +0 -43
- claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +0 -47
- claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +0 -65
- claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +0 -30
- claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +0 -16
- claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +0 -160
- claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +0 -412
- claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +0 -602
- claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +0 -915
- claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +0 -916
- claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +0 -752
- claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +0 -1237
- claude_mpm/skills/bundled/main/skill-creator/SKILL.md +0 -189
- claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +0 -500
- claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +0 -464
- claude_mpm/skills/bundled/main/skill-creator/references/examples.md +0 -619
- claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +0 -437
- claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +0 -231
- claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +0 -170
- claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +0 -602
- claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +0 -821
- claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +0 -742
- claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +0 -726
- claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +0 -764
- claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +0 -831
- claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +0 -226
- claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +0 -901
- claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +0 -901
- claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +0 -775
- claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +0 -937
- claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +0 -770
- claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +0 -961
- claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +0 -119
- claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +0 -253
- claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +0 -145
- claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +0 -543
- claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +0 -741
- claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +0 -470
- claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +0 -458
- claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +0 -639
- claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +0 -140
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +0 -572
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +0 -411
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +0 -569
- claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +0 -695
- claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +0 -184
- claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +0 -459
- claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +0 -479
- claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +0 -687
- claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +0 -758
- claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +0 -868
- claude_mpm-4.24.0.dist-info/entry_points.txt +0 -10
- claude_mpm-4.24.0.dist-info/licenses/LICENSE +0 -21
- /claude_mpm/agents/templates/{git_file_tracking.md → git-file-tracking.md} +0 -0
- /claude_mpm/agents/templates/{pm_examples.md → pm-examples.md} +0 -0
- /claude_mpm/agents/templates/{response_format.md → response-format.md} +0 -0
- /claude_mpm/agents/templates/{validation_templates.md → validation-templates.md} +0 -0
- {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/WHEEL +0 -0
- {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/top_level.txt +0 -0
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Page Structure Component
|
|
3
|
-
* Provides standardized page layout for all dashboard views
|
|
4
|
-
* Includes header with title, connection status, and statistics
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export class PageStructure {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.connectionStatus = false;
|
|
10
|
-
this.startTime = Date.now();
|
|
11
|
-
this.uptimeInterval = null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create the standard page header structure
|
|
16
|
-
* @param {Object} config - Configuration for the page
|
|
17
|
-
* @param {string} config.title - Page title with emoji
|
|
18
|
-
* @param {Array} config.stats - Statistics to display
|
|
19
|
-
* @returns {string} HTML for the header
|
|
20
|
-
*/
|
|
21
|
-
createHeader(config) {
|
|
22
|
-
const { title, stats = [] } = config;
|
|
23
|
-
|
|
24
|
-
return `
|
|
25
|
-
<div class="header">
|
|
26
|
-
<h1>${title}</h1>
|
|
27
|
-
<div class="status-bar">
|
|
28
|
-
<div class="status-indicator">
|
|
29
|
-
<span class="status-dot disconnected" id="connection-status"></span>
|
|
30
|
-
<span id="connection-text">Disconnected</span>
|
|
31
|
-
</div>
|
|
32
|
-
${stats.map(stat => `
|
|
33
|
-
<div class="status-indicator">
|
|
34
|
-
<span>${stat.icon || ''}</span>
|
|
35
|
-
<span id="${stat.id}">${stat.defaultValue || '0'}</span>
|
|
36
|
-
</div>
|
|
37
|
-
`).join('')}
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Create the statistics panel
|
|
45
|
-
* @param {Array} cards - Statistics cards configuration
|
|
46
|
-
* @returns {string} HTML for the statistics panel
|
|
47
|
-
*/
|
|
48
|
-
createStatsPanel(cards) {
|
|
49
|
-
return `
|
|
50
|
-
<div class="stats-panel">
|
|
51
|
-
${cards.map(card => `
|
|
52
|
-
<div class="stat-card">
|
|
53
|
-
<div class="stat-icon">${card.icon}</div>
|
|
54
|
-
<div class="stat-info">
|
|
55
|
-
<div class="stat-label">${card.label}</div>
|
|
56
|
-
<div class="stat-value" id="${card.id}">${card.defaultValue || '0'}</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
`).join('')}
|
|
60
|
-
</div>
|
|
61
|
-
`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Create the controls panel
|
|
66
|
-
* @param {Array} controls - Control elements configuration
|
|
67
|
-
* @returns {string} HTML for the controls panel
|
|
68
|
-
*/
|
|
69
|
-
createControlsPanel(controls = []) {
|
|
70
|
-
if (controls.length === 0) return '';
|
|
71
|
-
|
|
72
|
-
return `
|
|
73
|
-
<div class="controls-panel">
|
|
74
|
-
${controls.map(control => {
|
|
75
|
-
switch (control.type) {
|
|
76
|
-
case 'select':
|
|
77
|
-
return `
|
|
78
|
-
<div class="control-group">
|
|
79
|
-
<label class="control-label">${control.label}:</label>
|
|
80
|
-
<select id="${control.id}">
|
|
81
|
-
${control.options.map(opt =>
|
|
82
|
-
`<option value="${opt.value}" ${opt.selected ? 'selected' : ''}>${opt.text}</option>`
|
|
83
|
-
).join('')}
|
|
84
|
-
</select>
|
|
85
|
-
</div>
|
|
86
|
-
`;
|
|
87
|
-
case 'input':
|
|
88
|
-
return `
|
|
89
|
-
<div class="control-group">
|
|
90
|
-
<input type="text" id="${control.id}" placeholder="${control.placeholder || ''}">
|
|
91
|
-
</div>
|
|
92
|
-
`;
|
|
93
|
-
case 'button':
|
|
94
|
-
return `
|
|
95
|
-
<button class="btn ${control.class || ''}" id="${control.id}">${control.text}</button>
|
|
96
|
-
`;
|
|
97
|
-
default:
|
|
98
|
-
return '';
|
|
99
|
-
}
|
|
100
|
-
}).join('')}
|
|
101
|
-
</div>
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Apply standard page structure to a container
|
|
107
|
-
* @param {string} containerId - ID of the container element
|
|
108
|
-
* @param {Object} config - Page configuration
|
|
109
|
-
*/
|
|
110
|
-
applyStructure(containerId, config) {
|
|
111
|
-
const container = document.getElementById(containerId);
|
|
112
|
-
if (!container) {
|
|
113
|
-
console.error(`Container with ID "${containerId}" not found`);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Create the complete structure
|
|
118
|
-
const structure = `
|
|
119
|
-
${this.createHeader(config.header)}
|
|
120
|
-
<div id="navigation-container"></div>
|
|
121
|
-
${config.statsPanel ? this.createStatsPanel(config.statsPanel) : ''}
|
|
122
|
-
${config.controls ? this.createControlsPanel(config.controls) : ''}
|
|
123
|
-
<div class="main-panel">
|
|
124
|
-
${config.mainContent || '<div id="main-content"></div>'}
|
|
125
|
-
</div>
|
|
126
|
-
`;
|
|
127
|
-
|
|
128
|
-
// Insert the structure
|
|
129
|
-
container.innerHTML = structure;
|
|
130
|
-
|
|
131
|
-
// Initialize connection status handlers
|
|
132
|
-
this.initializeConnectionStatus();
|
|
133
|
-
|
|
134
|
-
// Initialize uptime counter if needed
|
|
135
|
-
if (config.header.stats && config.header.stats.some(s => s.id === 'uptime')) {
|
|
136
|
-
this.startUptimeCounter();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Initialize connection status indicators
|
|
142
|
-
*/
|
|
143
|
-
initializeConnectionStatus() {
|
|
144
|
-
// This will be called by the socket manager when connection changes
|
|
145
|
-
window.addEventListener('connection-status-changed', (event) => {
|
|
146
|
-
this.updateConnectionStatus(event.detail.connected);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Update connection status display
|
|
152
|
-
* @param {boolean} connected - Connection status
|
|
153
|
-
*/
|
|
154
|
-
updateConnectionStatus(connected) {
|
|
155
|
-
const statusDot = document.getElementById('connection-status');
|
|
156
|
-
const statusText = document.getElementById('connection-text');
|
|
157
|
-
|
|
158
|
-
if (statusDot && statusText) {
|
|
159
|
-
this.connectionStatus = connected;
|
|
160
|
-
statusDot.className = `status-dot ${connected ? 'connected' : 'disconnected'}`;
|
|
161
|
-
statusText.textContent = connected ? 'Connected' : 'Disconnected';
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Start the uptime counter
|
|
167
|
-
*/
|
|
168
|
-
startUptimeCounter() {
|
|
169
|
-
if (this.uptimeInterval) {
|
|
170
|
-
clearInterval(this.uptimeInterval);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
this.uptimeInterval = setInterval(() => {
|
|
174
|
-
const uptime = Date.now() - this.startTime;
|
|
175
|
-
const hours = Math.floor(uptime / 3600000);
|
|
176
|
-
const minutes = Math.floor((uptime % 3600000) / 60000);
|
|
177
|
-
const seconds = Math.floor((uptime % 60000) / 1000);
|
|
178
|
-
|
|
179
|
-
const uptimeElement = document.getElementById('uptime');
|
|
180
|
-
if (uptimeElement) {
|
|
181
|
-
uptimeElement.textContent =
|
|
182
|
-
`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
|
183
|
-
}
|
|
184
|
-
}, 1000);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Update a statistic value
|
|
189
|
-
* @param {string} statId - ID of the statistic element
|
|
190
|
-
* @param {string|number} value - New value
|
|
191
|
-
*/
|
|
192
|
-
updateStat(statId, value) {
|
|
193
|
-
const element = document.getElementById(statId);
|
|
194
|
-
if (element) {
|
|
195
|
-
element.textContent = value;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Update multiple statistics at once
|
|
201
|
-
* @param {Object} stats - Object with stat IDs as keys and values as values
|
|
202
|
-
*/
|
|
203
|
-
updateStats(stats) {
|
|
204
|
-
Object.entries(stats).forEach(([id, value]) => {
|
|
205
|
-
this.updateStat(id, value);
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Clean up resources
|
|
211
|
-
*/
|
|
212
|
-
destroy() {
|
|
213
|
-
if (this.uptimeInterval) {
|
|
214
|
-
clearInterval(this.uptimeInterval);
|
|
215
|
-
this.uptimeInterval = null;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Export default styles that should be applied to all pages
|
|
221
|
-
export const pageStyles = `
|
|
222
|
-
* {
|
|
223
|
-
margin: 0;
|
|
224
|
-
padding: 0;
|
|
225
|
-
box-sizing: border-box;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
body {
|
|
229
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
230
|
-
background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
|
|
231
|
-
color: #e0e0e0;
|
|
232
|
-
min-height: 100vh;
|
|
233
|
-
padding: 20px;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.container {
|
|
237
|
-
max-width: 1600px;
|
|
238
|
-
margin: 0 auto;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.header {
|
|
242
|
-
background: rgba(255, 255, 255, 0.05);
|
|
243
|
-
backdrop-filter: blur(10px);
|
|
244
|
-
border-radius: 12px;
|
|
245
|
-
padding: 20px;
|
|
246
|
-
margin-bottom: 20px;
|
|
247
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.header h1 {
|
|
251
|
-
font-size: 24px;
|
|
252
|
-
margin-bottom: 10px;
|
|
253
|
-
background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
|
|
254
|
-
-webkit-background-clip: text;
|
|
255
|
-
-webkit-text-fill-color: transparent;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.status-bar {
|
|
259
|
-
display: flex;
|
|
260
|
-
gap: 20px;
|
|
261
|
-
align-items: center;
|
|
262
|
-
flex-wrap: wrap;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.status-indicator {
|
|
266
|
-
display: flex;
|
|
267
|
-
align-items: center;
|
|
268
|
-
gap: 8px;
|
|
269
|
-
padding: 8px 16px;
|
|
270
|
-
background: rgba(255, 255, 255, 0.05);
|
|
271
|
-
border-radius: 20px;
|
|
272
|
-
font-size: 14px;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.status-dot {
|
|
276
|
-
width: 10px;
|
|
277
|
-
height: 10px;
|
|
278
|
-
border-radius: 50%;
|
|
279
|
-
animation: pulse 2s infinite;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.status-dot.connected {
|
|
283
|
-
background: #4ade80;
|
|
284
|
-
box-shadow: 0 0 10px #4ade80;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.status-dot.disconnected {
|
|
288
|
-
background: #f87171;
|
|
289
|
-
box-shadow: 0 0 10px #f87171;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
@keyframes pulse {
|
|
293
|
-
0%, 100% { opacity: 1; }
|
|
294
|
-
50% { opacity: 0.5; }
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.stats-panel {
|
|
298
|
-
display: grid;
|
|
299
|
-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
300
|
-
gap: 15px;
|
|
301
|
-
margin-bottom: 20px;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.stat-card {
|
|
305
|
-
background: rgba(255, 255, 255, 0.05);
|
|
306
|
-
backdrop-filter: blur(10px);
|
|
307
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
308
|
-
border-radius: 10px;
|
|
309
|
-
padding: 15px;
|
|
310
|
-
display: flex;
|
|
311
|
-
align-items: center;
|
|
312
|
-
gap: 15px;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
.stat-icon {
|
|
316
|
-
font-size: 24px;
|
|
317
|
-
background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
|
|
318
|
-
-webkit-background-clip: text;
|
|
319
|
-
-webkit-text-fill-color: transparent;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.stat-info {
|
|
323
|
-
flex: 1;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.stat-label {
|
|
327
|
-
font-size: 12px;
|
|
328
|
-
color: #94a3b8;
|
|
329
|
-
text-transform: uppercase;
|
|
330
|
-
letter-spacing: 0.5px;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.stat-value {
|
|
334
|
-
font-size: 24px;
|
|
335
|
-
font-weight: 600;
|
|
336
|
-
color: #e0e0e0;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.controls-panel {
|
|
340
|
-
background: rgba(255, 255, 255, 0.05);
|
|
341
|
-
backdrop-filter: blur(10px);
|
|
342
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
343
|
-
border-radius: 10px;
|
|
344
|
-
padding: 15px;
|
|
345
|
-
margin-bottom: 20px;
|
|
346
|
-
display: flex;
|
|
347
|
-
gap: 15px;
|
|
348
|
-
align-items: center;
|
|
349
|
-
flex-wrap: wrap;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.control-group {
|
|
353
|
-
display: flex;
|
|
354
|
-
align-items: center;
|
|
355
|
-
gap: 10px;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.control-label {
|
|
359
|
-
font-size: 14px;
|
|
360
|
-
color: #94a3b8;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
select, input[type="text"] {
|
|
364
|
-
padding: 8px 12px;
|
|
365
|
-
background: rgba(255, 255, 255, 0.1);
|
|
366
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
367
|
-
border-radius: 6px;
|
|
368
|
-
color: #e0e0e0;
|
|
369
|
-
font-size: 14px;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
select option {
|
|
373
|
-
background: #1e293b;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.btn {
|
|
377
|
-
padding: 8px 16px;
|
|
378
|
-
background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
|
|
379
|
-
border: none;
|
|
380
|
-
border-radius: 6px;
|
|
381
|
-
color: white;
|
|
382
|
-
cursor: pointer;
|
|
383
|
-
font-size: 14px;
|
|
384
|
-
font-weight: 500;
|
|
385
|
-
transition: all 0.3s;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.btn:hover {
|
|
389
|
-
transform: translateY(-2px);
|
|
390
|
-
box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.btn.btn-secondary {
|
|
394
|
-
background: rgba(255, 255, 255, 0.1);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.btn.btn-secondary:hover {
|
|
398
|
-
background: rgba(255, 255, 255, 0.15);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.main-panel {
|
|
402
|
-
background: rgba(255, 255, 255, 0.05);
|
|
403
|
-
backdrop-filter: blur(10px);
|
|
404
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
405
|
-
border-radius: 10px;
|
|
406
|
-
padding: 20px;
|
|
407
|
-
min-height: 500px;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/* Scrollbar styling */
|
|
411
|
-
::-webkit-scrollbar {
|
|
412
|
-
width: 8px;
|
|
413
|
-
height: 8px;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
::-webkit-scrollbar-track {
|
|
417
|
-
background: rgba(255, 255, 255, 0.05);
|
|
418
|
-
border-radius: 4px;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
::-webkit-scrollbar-thumb {
|
|
422
|
-
background: rgba(255, 255, 255, 0.2);
|
|
423
|
-
border-radius: 4px;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
::-webkit-scrollbar-thumb:hover {
|
|
427
|
-
background: rgba(255, 255, 255, 0.3);
|
|
428
|
-
}
|
|
429
|
-
`;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
window.refreshSessions=function(){window.sessionManager&&window.sessionManager.refreshSessions()},window.SessionManager=class{constructor(e){this.socketClient=e,this.sessions=new Map,this.currentSessionId=null,this.selectedSessionId="",this.init()}init(){this.setupEventHandlers(),this.setupSocketListeners(),this.updateSessionSelect()}setupEventHandlers(){const e=document.getElementById("session-select");e&&e.addEventListener("change",e=>{this.selectedSessionId=e.target.value,this.onSessionFilterChanged(),window.dashboard&&window.dashboard.loadWorkingDirectoryForSession&&window.dashboard.loadWorkingDirectoryForSession(e.target.value)});const s=document.querySelector('button[onclick="refreshSessions()"]');s&&s.addEventListener("click",()=>{this.refreshSessions()})}setupSocketListeners(){this.socketClient.onEventUpdate((e,s)=>{console.log("[SESSION-MANAGER] Received sessions update:",s),this.sessions=s,this.updateSessionSelect(),this.updateFooterInfo()}),document.addEventListener("socketConnectionStatus",e=>{"connected"===e.detail.type&&setTimeout(()=>this.refreshSessions(),1e3)})}updateSessionSelect(){const e=document.getElementById("session-select");if(!e)return;const s=e.value;let t="/";if(window.dashboard&&window.dashboard.workingDirectoryManager)t=window.dashboard.workingDirectoryManager.getDefaultWorkingDir();else{const e=document.getElementById("working-dir-path");if(e?.textContent?.trim()){const s=e.textContent.trim();"Loading..."!==s&&"Unknown"!==s&&(t=s)}}if(console.log("[SESSION-MANAGER] Using default working directory:",t),e.innerHTML=`\n <option value="">${t} | All Sessions</option>\n `,this.sessions&&this.sessions.size>0){Array.from(this.sessions.values()).sort((e,s)=>new Date(s.lastActivity||s.startTime)-new Date(e.lastActivity||e.startTime)).forEach(s=>{const n=document.createElement("option");n.value=s.id,new Date(s.startTime||s.last_activity).toLocaleString(),s.eventCount||s.event_count;const o=s.id===this.currentSessionId;let i=s.working_directory||s.workingDirectory||"";if(console.log(`[SESSION-DROPDOWN] Session ${s.id.substring(0,8)} working_directory:`,i),!i){i=this.extractSessionInfoFromEvents(s.id).workingDir||t,console.log("[SESSION-DROPDOWN] Extracted working directory from events:",i)}const r=s.id.substring(0,8),a=i||t;n.textContent=`${a} | ${r}...${o?" [ACTIVE]":""}`,e.appendChild(n)})}s&&Array.from(e.options).some(e=>e.value===s)?(e.value=s,this.selectedSessionId=s,this.onSessionFilterChanged()):(this.selectedSessionId=e.value,this.selectedSessionId&&this.onSessionFilterChanged())}onSessionFilterChanged(){const e=window.eventViewer;e&&e.setSessionFilter(this.selectedSessionId),this.updateFooterInfo(),document.dispatchEvent(new CustomEvent("sessionFilterChanged",{detail:{sessionId:this.selectedSessionId}})),document.dispatchEvent(new CustomEvent("sessionChanged",{detail:{sessionId:this.selectedSessionId}}))}refreshSessions(){this.socketClient&&this.socketClient.getConnectionState().isConnected?(console.log("Refreshing sessions..."),this.socketClient.requestStatus()):console.warn("Cannot refresh sessions: not connected to server")}updateFooterInfo(){console.log("[SESSION-DEBUG] updateFooterInfo called, selectedSessionId:",this.selectedSessionId);const e=document.getElementById("footer-session"),s=document.getElementById("footer-working-dir"),t=document.getElementById("footer-git-branch");if(!e)return void console.warn("[SESSION-DEBUG] footer-session element not found");let n="All Sessions",o=window.dashboard?.workingDirectoryManager?.getDefaultWorkingDir()||window.dashboardConfig?.workingDirectory||".",i="Unknown";if(console.log("[SESSION-DEBUG] Initial values - sessionInfo:",n,"workingDir:",o,"gitBranch:",i),"current"===this.selectedSessionId){if(n=this.currentSessionId?`Current: ${this.currentSessionId.substring(0,8)}...`:"Current: None",this.currentSessionId){const e=this.extractSessionInfoFromEvents(this.currentSessionId);o=e.workingDir||window.dashboard?.workingDirectoryManager?.getDefaultWorkingDir()||window.dashboardConfig?.workingDirectory||".",i=e.gitBranch||"Unknown"}}else if(this.selectedSessionId){const e=this.sessions.get(this.selectedSessionId);if(e&&(n=`${this.selectedSessionId.substring(0,8)}...`,o=e.working_directory||e.workingDirectory||"",i=e.git_branch||e.gitBranch||"",!o||!i)){const e=this.extractSessionInfoFromEvents(this.selectedSessionId);o=o||e.workingDir||window.dashboardConfig?.workingDirectory||".",i=i||e.gitBranch||""}}console.log("[SESSION-DEBUG] Final values before setting footer - sessionInfo:",n,"workingDir:",o,"gitBranch:",i),e.textContent=n,s?(console.log("[SESSION-DEBUG] Setting footer working dir to:",o),s.textContent=o):console.warn("[SESSION-DEBUG] footer-working-dir element not found"),t?(console.log("[SESSION-DEBUG] Setting footer git branch to:",i),t.textContent=i):console.warn("[SESSION-DEBUG] footer-git-branch element not found")}extractSessionInfoFromEvents(e){let s="",t="";console.log(`[DEBUG] extractSessionInfoFromEvents called for sessionId: ${e}`);const n=this.socketClient;if(n&&n.events){console.log(`[DEBUG] Total events available: ${n.events.length}`);const o=n.events.filter(s=>s.data&&s.data.session_id===e);console.log(`[DEBUG] Events matching sessionId ${e}: ${o.length}`),o.length>0&&(console.log(`[DEBUG] Sample events for session ${e}:`),o.slice(0,3).forEach((e,s)=>{console.log(`[DEBUG] Event ${s+1}:`,{type:e.type,timestamp:e.timestamp,data_keys:e.data?Object.keys(e.data):"no data",full_event:e})}),o.length>3&&(console.log(`[DEBUG] Last 3 events for session ${e}:`),o.slice(-3).forEach((e,s)=>{console.log(`[DEBUG] Last Event ${s+1}:`,{type:e.type,timestamp:e.timestamp,data_keys:e.data?Object.keys(e.data):"no data",full_event:e})})));for(let e=o.length-1;e>=0;e--){const n=o[e];if(n.data){if(console.log(`[DEBUG] Examining event ${e} data:`,n.data),s||(n.data.working_directory?(s=n.data.working_directory,console.log(`[DEBUG] Found working_directory: ${s}`)):n.data.cwd?(s=n.data.cwd,console.log(`[DEBUG] Found cwd: ${s}`)):n.data.instance_info&&n.data.instance_info.working_dir&&(s=n.data.instance_info.working_dir,console.log(`[DEBUG] Found instance_info.working_dir: ${s}`))),!t){const e=["git_branch","gitBranch","branch","git.branch","vcs_branch","current_branch"];for(const s of e)if(n.data[s]){t=n.data[s],console.log(`[DEBUG] Found git branch in field '${s}': ${t}`);break}if(!t){if(n.data.instance_info){console.log("[DEBUG] Checking instance_info for branch:",n.data.instance_info);for(const s of e)if(n.data.instance_info[s]){t=n.data.instance_info[s],console.log(`[DEBUG] Found git branch in instance_info.${s}: ${t}`);break}}!t&&n.data.git&&(console.log("[DEBUG] Checking git object:",n.data.git),n.data.git.branch&&(t=n.data.git.branch,console.log(`[DEBUG] Found git branch in git.branch: ${t}`)))}}if(s&&t){console.log("[DEBUG] Found both workingDir and gitBranch, stopping search");break}}}}else console.log("[DEBUG] No socket client or events available");return console.log(`[DEBUG] Final results - workingDir: '${s}', gitBranch: '${t}'`),{workingDir:s,gitBranch:t}}setCurrentSessionId(e){this.currentSessionId=e,this.updateSessionSelect(),this.updateFooterInfo()}addSession(e){if(!e.id)return;const s=this.sessions.get(e.id);s?Object.assign(s,e):this.sessions.set(e.id,{id:e.id,startTime:e.startTime||e.start_time||(new Date).toISOString(),lastActivity:e.lastActivity||e.last_activity||(new Date).toISOString(),eventCount:e.eventCount||e.event_count||0,working_directory:e.working_directory||e.workingDirectory||"",git_branch:e.git_branch||e.gitBranch||"",agent_type:e.agent_type||e.agentType||"",...e}),this.updateSessionSelect()}removeSession(e){if(this.sessions.has(e)){if(this.sessions.delete(e),this.selectedSessionId===e){this.selectedSessionId="";const e=document.getElementById("session-select");e&&(e.value=""),this.onSessionFilterChanged()}this.updateSessionSelect()}}getCurrentFilter(){return this.selectedSessionId}getSession(e){return this.sessions.get(e)||null}getAllSessions(){return this.sessions}getCurrentSessionId(){return this.currentSessionId}clearSessions(){this.sessions.clear(),this.currentSessionId=null,this.selectedSessionId="",this.updateSessionSelect(),this.updateFooterInfo()}exportSessionData(){return{sessions:Array.from(this.sessions.entries()),currentSessionId:this.currentSessionId,selectedSessionId:this.selectedSessionId}}importSessionData(e){e.sessions&&Array.isArray(e.sessions)&&(this.sessions.clear(),e.sessions.forEach(([e,s])=>{this.sessions.set(e,s)})),e.currentSessionId&&(this.currentSessionId=e.currentSessionId),void 0!==e.selectedSessionId&&(this.selectedSessionId=e.selectedSessionId),this.updateSessionSelect(),this.updateFooterInfo()}getEventsForSession(e){if(!e||!this.socketClient)return[];return(this.socketClient.events||[]).filter(s=>(s.session_id||s.data&&s.data.session_id||null)===e)}};
|
|
2
|
-
//# sourceMappingURL=session-manager.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
class e{constructor(e="module-data-content"){this.container=document.getElementById(e),this.currentData=null,this.currentType=null,this.globalJsonExpanded="true"===localStorage.getItem("dashboard-json-expanded"),this.fullEventDataExpanded="true"===localStorage.getItem("dashboard-full-event-expanded"),document.addEventListener("jsonToggleChanged",e=>{this.globalJsonExpanded=e.detail.expanded,this.updateAllJsonSections()}),document.addEventListener("fullEventToggleChanged",e=>{this.fullEventDataExpanded=e.detail.expanded,this.updateAllFullEventSections()})}display(e,n=null){if(this.container)switch(this.currentData=e,this.currentType=n,n||(n=this.detectType(e)),this.container.innerHTML="",n){case"event":this.displayEvent(e);break;case"agent":this.displayAgent(e);break;case"tool":this.displayTool(e);break;case"todo":this.displayTodo(e);break;case"instruction":this.displayInstruction(e);break;case"session":this.displaySession(e);break;case"file_operation":if(e.name&&(e.params||e.tool_parameters)){const n=this.convertToolToFileOperation(e);this.displayFileOperation(n)}else this.displayFileOperation(e);break;case"hook":this.displayHook(e);break;default:this.displayGeneric(e)}else console.warn("UnifiedDataViewer: Container not found")}detectType(e){return e&&"object"==typeof e?e.hook_event_name||e.event_type||e.type&&e.timestamp?"event":e.agent_name||e.agentName||e.name&&("active"===e.status||"completed"===e.status)?"agent":e.tool_name||"TodoWrite"===e.name||"Read"===e.name||e.tool_parameters||e.params&&e.icon||e.name&&"tool"===e.type?"tool":!e.todos||e.name||e.params?e.content&&e.activeForm&&e.status&&!e.name&&!e.params?"todo":e.text&&e.preview&&"user_instruction"===e.type?"instruction":e.session_id&&(e.startTime||e.lastActivity)?"session":e.file_path&&(e.operations||e.operation)?"file_operation":"Read"!==e.name&&"Write"!==e.name&&"Edit"!==e.name&&"MultiEdit"!==e.name&&"Grep"!==e.name&&"Glob"!==e.name||!e.params?.file_path&&!e.tool_parameters?.file_path?e.event_type&&(e.hook_name||e.subtype)?"hook":"generic":"file_operation":"todo":"generic"}displayEvent(e){let n=`\n <div class="unified-viewer-header">\n <h6>${this.formatEventType(e)}</h6>\n <span class="unified-viewer-timestamp">${this.formatTimestamp(e.timestamp)}</span>\n </div>\n <div class="unified-viewer-content">\n `;if(n+='<div class="primary-data">',n+=this.formatEventDetails(e),e.tool_name||e.data?.tool_name){const t=e.tool_name||e.data.tool_name;n+=`\n <div class="detail-row highlight">\n <span class="detail-label">Tool:</span>\n <span class="detail-value">${this.getToolIcon(t)} ${t}</span>\n </div>\n `;const a=e.tool_parameters||e.data?.tool_parameters;a&&(a.file_path&&(n+=`\n <div class="detail-row">\n <span class="detail-label">File:</span>\n <span class="detail-value code">${a.file_path}</span>\n </div>\n `),a.command&&(n+=`\n <div class="detail-row">\n <span class="detail-label">Command:</span>\n <pre class="code-snippet">${this.escapeHtml(a.command)}</pre>\n </div>\n `))}n+="</div>",n+=this.createCollapsibleJSON(e,"Full Event Data"),n+="</div>",this.container.innerHTML=n}displayAgent(e){const n=this.getAgentIcon(e.name||e.agentName),t=e.name||e.agentName||"Unknown Agent",a=this.formatStatus(e.status);let s=`\n <div class="unified-viewer-header">\n <h6>${n} ${t}</h6>\n <span class="unified-viewer-status">${a}</span>\n </div>\n <div class="unified-viewer-content">\n `;if(s+='<div class="primary-data">',s+=`\n <div class="detail-row highlight">\n <span class="detail-label">Status:</span>\n <span class="detail-value ${this.formatStatusClass(a)}">${a}</span>\n </div>\n `,e.tools&&e.tools.length>0){const n=e.tools.filter(e=>"in_progress"===e.status),t=e.tools.filter(e=>"completed"===e.status);n.length>0&&(s+='\n <div class="active-tools-section">\n <span class="section-label">🔄 Active Tools:</span>\n <div class="tools-grid">\n ',n.forEach(e=>{s+=`\n <div class="tool-chip active">\n ${this.getToolIcon(e.name)} ${e.name}\n </div>\n `}),s+="</div></div>"),s+=`\n <div class="detail-row">\n <span class="detail-label">Tools Summary:</span>\n <span class="detail-value">\n ${n.length} active, ${t.length} completed, ${e.tools.length} total\n </span>\n </div>\n `}(e.currentTask||e.description)&&(s+=`\n <div class="detail-row">\n <span class="detail-label">Current Task:</span>\n <span class="detail-value">${e.currentTask||e.description}</span>\n </div>\n `),s+="</div>",s+=this.createCollapsibleJSON(e,"Full Agent Details"),s+="</div>",this.container.innerHTML=s}displayTool(e){const n=e.name||e.tool_name||"Unknown Tool",t=this.getToolIcon(n),a=this.formatStatus(e.status);if("TodoWrite"===n)return void this.displayTodoWriteTool(e);let s=`\n <div class="unified-viewer-header">\n <h6>${t} ${n}</h6>\n <span class="unified-viewer-status">${a}</span>\n </div>\n <div class="unified-viewer-content">\n `;const i=e.params||e.tool_parameters||{};"Read"===n||"Edit"===n||"Write"===n?i.file_path&&(s+=`\n <div class="primary-data">\n <div class="detail-row highlight">\n <span class="detail-label">📁 File:</span>\n <span class="detail-value code">${i.file_path}</span>\n </div>\n `,i.old_string&&(s+=`\n <div class="detail-row">\n <span class="detail-label">Old Text:</span>\n <pre class="code-snippet">${this.escapeHtml(i.old_string.substring(0,200))}${i.old_string.length>200?"...":""}</pre>\n </div>\n `),i.new_string&&(s+=`\n <div class="detail-row">\n <span class="detail-label">New Text:</span>\n <pre class="code-snippet">${this.escapeHtml(i.new_string.substring(0,200))}${i.new_string.length>200?"...":""}</pre>\n </div>\n `),s+="</div>"):"Bash"===n?i.command&&(s+=`\n <div class="primary-data">\n <div class="detail-row highlight">\n <span class="detail-label">💻 Command:</span>\n <pre class="code-snippet">${this.escapeHtml(i.command)}</pre>\n </div>\n </div>\n `):"Grep"===n||"Glob"===n?i.pattern&&(s+=`\n <div class="primary-data">\n <div class="detail-row highlight">\n <span class="detail-label">🔍 Pattern:</span>\n <span class="detail-value code">${this.escapeHtml(i.pattern)}</span>\n </div>\n `,i.path&&(s+=`\n <div class="detail-row">\n <span class="detail-label">Path:</span>\n <span class="detail-value">${i.path}</span>\n </div>\n `),s+="</div>"):"Task"===n&&i.subagent_type&&(s+=`\n <div class="primary-data">\n <div class="detail-row highlight">\n <span class="detail-label">🤖 Delegating to:</span>\n <span class="detail-value">${i.subagent_type} agent</span>\n </div>\n `,i.description&&(s+=`\n <div class="detail-row">\n <span class="detail-label">Task:</span>\n <span class="detail-value">${i.description}</span>\n </div>\n `),s+="</div>"),s+=`\n <div class="detail-row">\n <span class="detail-label">Status:</span>\n <span class="detail-value">${a}</span>\n </div>\n `,e.callCount&&(s+=`\n <div class="detail-row">\n <span class="detail-label">Call Count:</span>\n <span class="detail-value">${e.callCount}</span>\n </div>\n `),s+=this.createCollapsibleJSON(e,"Full Tool Details"),s+="</div>",this.container.innerHTML=s}displayTodoWriteTool(e){const n=this.formatStatus(e.status),t=(e.params||e.tool_parameters||{}).todos||[];let a=`\n <div class="unified-viewer-header">\n <h6>📝 TodoWrite</h6>\n <span class="unified-viewer-status">${n}</span>\n </div>\n <div class="unified-viewer-content">\n `;if(t.length>0){const e=this.getTodoStatusCounts(t);a+=`\n <div class="todo-status-line">\n <span class="status-inline">✅ ${e.completed} Done</span>\n <span class="status-inline">🔄 ${e.in_progress} Active</span>\n <span class="status-inline">⏳ ${e.pending} Pending</span>\n </div>\n `,a+='\n <div class="todo-list-primary">\n ',t.forEach((e,n)=>{const t=this.getCheckboxIcon(e.status),s="in_progress"===e.status&&e.activeForm||e.content,i=this.formatStatusClass(e.status);a+=`\n <div class="todo-item ${e.status}">\n <span class="todo-icon ${i}">${t}</span>\n <span class="todo-text">${this.escapeHtml(s)}</span>\n ${"in_progress"===e.status?'<span class="todo-badge active">ACTIVE</span>':""}\n </div>\n `}),a+="\n </div>\n "}else a+='\n <div class="detail-row">\n <span class="detail-value">No todos in list</span>\n </div>\n ';e.callCount&&e.callCount>1&&(a+=`\n <div class="detail-row">\n <span class="detail-label">Updates:</span>\n <span class="detail-value">${e.callCount}</span>\n </div>\n `),a+=this.createCollapsibleJSON(e,"Full Details"),a+="</div>",this.container.innerHTML=a}displayTodo(e){let n;n=e.todos&&Array.isArray(e.todos)?e.todos:Array.isArray(e)?e:e.content&&e.activeForm&&e.status?[e]:[];let t='\n <div class="unified-viewer-header">\n <h6>📋 Todo List</h6>\n </div>\n <div class="unified-viewer-content">\n ';n.length>0?(t+='\n <div class="todo-list-primary">\n ',n.forEach(e=>{const n=this.getCheckboxIcon(e.status),a="in_progress"===e.status&&e.activeForm||e.content,s=this.formatStatusClass(e.status);t+=`\n <div class="todo-item ${e.status}">\n <span class="todo-icon ${s}">${n}</span>\n <span class="todo-text">${this.escapeHtml(a)}</span>\n <span class="todo-status-text ${s}">${e.status.replace("_"," ")}</span>\n </div>\n `}),t+="\n </div>\n "):t+='\n <div class="detail-section">\n <div class="no-todos">No todo items found</div>\n </div>\n ',t+="</div>",this.container.innerHTML=t}displayInstruction(e){let n=`\n <div class="unified-viewer-header">\n <h6>💬 User Instruction</h6>\n <span class="unified-viewer-timestamp">${this.formatTimestamp(e.timestamp)}</span>\n </div>\n <div class="unified-viewer-content">\n `;n+=`\n <div class="primary-data">\n <div class="instruction-content">\n ${this.escapeHtml(e.text)}\n </div>\n <div class="instruction-meta">\n <span class="meta-item">📏 ${e.text.length} characters</span>\n <span class="meta-item">🕐 ${this.formatTimestamp(e.timestamp)}</span>\n </div>\n </div>\n `,Object.keys(e).length>3&&(n+=this.createCollapsibleJSON(e,"Full Instruction Data")),n+="</div>",this.container.innerHTML=n}displaySession(e){let n=`\n <div class="unified-viewer-header">\n <h6>🎯 Session: ${e.session_id||e.id}</h6>\n <span class="unified-viewer-status">${this.formatStatus(e.status||"active")}</span>\n </div>\n <div class="unified-viewer-content">\n <div class="detail-row">\n <span class="detail-label">Session ID:</span>\n <span class="detail-value">${e.session_id||e.id}</span>\n </div>\n <div class="detail-row">\n <span class="detail-label">Start Time:</span>\n <span class="detail-value">${this.formatTimestamp(e.startTime||e.timestamp)}</span>\n </div>\n `;e.working_directory&&(n+=`\n <div class="detail-row">\n <span class="detail-label">Working Directory:</span>\n <span class="detail-value">${e.working_directory}</span>\n </div>\n `),e.git_branch&&(n+=`\n <div class="detail-row">\n <span class="detail-label">Git Branch:</span>\n <span class="detail-value">${e.git_branch}</span>\n </div>\n `),void 0!==e.eventCount&&(n+=`\n <div class="detail-row">\n <span class="detail-label">Events:</span>\n <span class="detail-value">${e.eventCount}</span>\n </div>\n `),n+="</div>",this.container.innerHTML=n}displayFileOperation(e){const n=e.file_path?e.file_path.split("/").pop():"Unknown File",t=this.isSingleFileOperation(e),a=this.getFileIcon(e.file_path),s=this.getFileType(e.file_path);let i=`\n <div class="unified-viewer-header ${t?"single-file-header":""}">\n <h6>${a} File: ${n}</h6>\n <span class="unified-viewer-count">${e.operations?e.operations.length:1} operation${e.operations&&1!==e.operations.length?"s":""}</span>\n ${s?`<span class="file-type-badge">${s}</span>`:""}\n </div>\n <div class="unified-viewer-content">\n <div class="primary-data">\n <div class="detail-row highlight">\n <span class="detail-label">📁 File Path:</span>\n <span class="detail-value code clickable-file-path" \n onclick="window.showFileViewerModal && window.showFileViewerModal('${e.file_path}')"\n title="Click to view file contents\\nKeyboard: Hover + V key or Ctrl/Cmd + Click\\nFile: ${e.file_path}"\n tabindex="0"\n role="button"\n aria-label="Open file ${e.file_path} in viewer"\n onkeypress="if(event.key==='Enter'||event.key===' '){window.showFileViewerModal && window.showFileViewerModal('${e.file_path}')}">${e.file_path}</span>\n </div>\n `;if(e.file_path){const n=this.shouldShowInlinePreview(e);if(i+=`\n <div class="file-actions ${t?"single-file-actions":""}">\n <button class="file-action-btn view-file-btn ${t?"primary-action":""}" \n onclick="window.showFileViewerModal && window.showFileViewerModal('${e.file_path}')"\n title="View file contents with syntax highlighting">\n ${a} View File Contents\n </button>\n ${t&&this.isTextFile(e.file_path)?`\n <button class="file-action-btn inline-preview-btn" \n onclick="window.unifiedDataViewer && window.unifiedDataViewer.toggleInlinePreview('${e.file_path}', this)"\n title="Toggle inline preview">\n 📖 Quick Preview\n </button>\n `:""}\n </div>\n `,t&&n){i+=`\n <div class="inline-preview-container" id="preview-${this.generatePreviewId(e.file_path)}" style="display: none;">\n <div class="inline-preview-loading">Loading preview...</div>\n </div>\n `}}i+="</div>",e.operations&&Array.isArray(e.operations)&&(i+=`\n <div class="detail-section">\n <span class="detail-section-title">Operations (${e.operations.length}):</span>\n <div class="operations-list">\n ${e.operations.map((e,n)=>`\n <div class="operation-item">\n <div class="operation-header">\n <span class="operation-type">${this.getOperationIcon(e.operation)} ${e.operation}</span>\n <span class="operation-timestamp">${this.formatTimestamp(e.timestamp)}</span>\n </div>\n <div class="operation-details">\n <span class="operation-agent">by ${e.agent||"Unknown"}</span>\n ${e.workingDirectory?`<span class="operation-dir">in ${e.workingDirectory}</span>`:""}\n </div>\n </div>\n `).join("")}\n </div>\n </div>\n `),i+=this.createCollapsibleJSON(e,"Full File Data"),i+="</div>",this.container.innerHTML=i}displayHook(e){let n=`\n <div class="unified-viewer-header">\n <h6>🔗 Hook: ${e.event_type||e.subtype||"unknown"}</h6>\n <span class="unified-viewer-timestamp">${this.formatTimestamp(e.timestamp)}</span>\n </div>\n <div class="unified-viewer-content">\n `;n+=this.formatHookDetails(e),n+="</div>",this.container.innerHTML=n}displayGeneric(e){let n=`\n <div class="unified-viewer-header">\n <h6>📊 Data Details</h6>\n ${e.timestamp?`<span class="unified-viewer-timestamp">${this.formatTimestamp(e.timestamp)}</span>`:""}\n </div>\n <div class="unified-viewer-content">\n `;if("object"==typeof e&&null!==e){const t=["id","name","type","status","timestamp","text","content","message"];for(let a of t)if(void 0!==e[a]){let t=e[a];"string"==typeof t&&t.length>200&&(t=t.substring(0,200)+"..."),n+=`\n <div class="detail-row">\n <span class="detail-label">${a}:</span>\n <span class="detail-value">${this.escapeHtml(String(t))}</span>\n </div>\n `}}else n+=`<div class="simple-value">${this.escapeHtml(String(e))}</div>`;n+="</div>",this.container.innerHTML=n}formatEventType(e){return e.type&&e.subtype?e.type===e.subtype||"generic"===e.subtype?e.type:`${e.type}.${e.subtype}`:e.type?e.type:e.hook_event_name?e.hook_event_name:"unknown"}formatEventDetails(e){switch(e.data,e.type){case"hook":return this.formatHookDetails(e);case"agent":return this.formatAgentEventDetails(e);case"todo":return this.formatTodoEventDetails(e);case"session":return this.formatSessionEventDetails(e);default:return this.formatGenericEventDetails(e)}}formatHookDetails(e){const n=e.data||{},t=e.subtype||e.event_type||"unknown";let a=`\n <div class="detail-row">\n <span class="detail-label">Hook Type:</span>\n <span class="detail-value">${t}</span>\n </div>\n `;switch(t){case"user_prompt":const e=n.prompt_text||n.prompt_preview||"";a+=`\n <div class="detail-row">\n <span class="detail-label">Prompt:</span>\n <div class="detail-value prompt-text">${this.escapeHtml(e)}</div>\n </div>\n `;break;case"pre_tool":case"post_tool":a+=`\n <div class="detail-row">\n <span class="detail-label">Tool:</span>\n <span class="detail-value">${n.tool_name||"Unknown tool"}</span>\n </div>\n `,n.operation_type&&(a+=`\n <div class="detail-row">\n <span class="detail-label">Operation:</span>\n <span class="detail-value">${n.operation_type}</span>\n </div>\n `),"post_tool"===t&&n.duration_ms&&(a+=`\n <div class="detail-row">\n <span class="detail-label">Duration:</span>\n <span class="detail-value">${n.duration_ms}ms</span>\n </div>\n `);break;case"subagent_start":case"subagent_stop":a+=`\n <div class="detail-row">\n <span class="detail-label">Agent:</span>\n <span class="detail-value">${n.agent_type||n.agent||"Unknown"}</span>\n </div>\n `,"subagent_start"===t&&n.prompt&&(a+=`\n <div class="detail-row">\n <span class="detail-label">Task:</span>\n <div class="detail-value">${this.escapeHtml(n.prompt)}</div>\n </div>\n `),"subagent_stop"===t&&n.reason&&(a+=`\n <div class="detail-row">\n <span class="detail-label">Reason:</span>\n <span class="detail-value">${n.reason}</span>\n </div>\n `)}return a}formatAgentEventDetails(e){const n=e.data||{};let t="";return(n.agent_type||n.name)&&(t+=`\n <div class="detail-row">\n <span class="detail-label">Agent Type:</span>\n <span class="detail-value">${n.agent_type||n.name}</span>\n </div>\n `),e.subtype&&(t+=`\n <div class="detail-row">\n <span class="detail-label">Action:</span>\n <span class="detail-value">${e.subtype}</span>\n </div>\n `),t}formatTodoEventDetails(e){const n=e.data||{};let t="";if(n.todos&&Array.isArray(n.todos)){const e=this.getTodoStatusCounts(n.todos);t+=`\n <div class="detail-row">\n <span class="detail-label">Todo Items:</span>\n <span class="detail-value">${n.todos.length} total</span>\n </div>\n <div class="detail-row">\n <span class="detail-label">Status:</span>\n <span class="detail-value">${e.completed} completed, ${e.in_progress} in progress</span>\n </div>\n `}return t}formatSessionEventDetails(e){const n=e.data||{};let t="";return n.session_id&&(t+=`\n <div class="detail-row">\n <span class="detail-label">Session ID:</span>\n <span class="detail-value">${n.session_id}</span>\n </div>\n `),e.subtype&&(t+=`\n <div class="detail-row">\n <span class="detail-label">Action:</span>\n <span class="detail-value">${e.subtype}</span>\n </div>\n `),t}formatGenericEventDetails(e){const n=e.data||{};let t="";const a=["message","description","value","result"];for(let s of a)if(void 0!==n[s]){let e=n[s];"string"==typeof e&&e.length>200&&(e=e.substring(0,200)+"..."),t+=`\n <div class="detail-row">\n <span class="detail-label">${s}:</span>\n <span class="detail-value">${this.escapeHtml(String(e))}</span>\n </div>\n `}return t}formatEventData(e){const n=e.data;return n&&0!==Object.keys(n).length?`\n <div class="detail-section">\n <span class="detail-section-title">Event Data:</span>\n <pre class="event-data-json">${this.escapeHtml(JSON.stringify(n,null,2))}</pre>\n </div>\n `:""}formatParameters(e,n="Parameters"){if(!e||0===Object.keys(e).length)return`\n <div class="detail-section">\n <span class="detail-section-title">${n}:</span>\n <div class="no-params">No parameters</div>\n </div>\n `;const t=Object.keys(e);return`\n <div class="detail-section">\n <span class="detail-section-title">${n} (${t.length}):</span>\n <div class="params-list">\n ${t.map(n=>{const t=e[n];return`\n <div class="param-item">\n <div class="param-key">${n}:</div>\n <div class="param-value">${this.formatParameterValue(t)}</div>\n </div>\n `}).join("")}\n </div>\n </div>\n `}formatParameterValue(e){if("string"==typeof e)return e.length>500?`<pre class="param-text-long">${this.escapeHtml(e.substring(0,500)+"...\n\n[Content truncated - "+e.length+" total characters]")}</pre>`:e.length>100?`<pre class="param-text">${this.escapeHtml(e)}</pre>`:`<span class="param-text-short">${this.escapeHtml(e)}</span>`;if("object"!=typeof e||null===e)return`<span class="param-primitive">${this.escapeHtml(String(e))}</span>`;if(Array.isArray(e)&&e.length>0&&e[0].hasOwnProperty("content")&&e[0].hasOwnProperty("status"))return this.formatTodosAsParameter(e);try{return`<pre class="param-json">${this.escapeHtml(JSON.stringify(e,null,2))}</pre>`}catch(n){return'<span class="param-error">Error displaying object</span>'}}formatTodosAsParameter(e){const n=this.getTodoStatusCounts(e);let t=`\n <div class="param-todos">\n <div class="param-todos-header">\n Array of todo objects (${e.length} items)\n </div>\n <div class="param-todos-summary">\n ${n.completed} completed • ${n.in_progress} in progress • ${n.pending} pending\n </div>\n <div class="param-todos-list">\n `;return e.forEach((e,n)=>{const a=this.getCheckboxIcon(e.status),s="in_progress"===e.status&&e.activeForm||e.content,i=this.formatStatusClass(e.status);t+=`\n <div class="param-todo-item ${e.status}">\n <div class="param-todo-checkbox">\n <span class="param-checkbox-icon ${i}">${a}</span>\n </div>\n <div class="param-todo-text">\n <span class="param-todo-content">${this.escapeHtml(s)}</span>\n <span class="param-todo-status-badge ${i}">${e.status.replace("_"," ")}</span>\n </div>\n </div>\n `}),t+="\n </div>\n </div>\n ",t}isSingleFileOperation(e){return!e.operations||1===e.operations.length}getFileIcon(e){if(!e)return"📄";const n=e.split(".").pop()?.toLowerCase();return{js:"🟨",jsx:"⚛️",ts:"🔷",tsx:"⚛️",py:"🐍",java:"☕",cpp:"⚡",c:"⚡",cs:"#️⃣",php:"🐘",rb:"💎",go:"🐹",rs:"🦀",swift:"🦉",kt:"🅺",scala:"🎯",html:"🌐",htm:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",vue:"💚",json:"📋",xml:"📄",yaml:"⚙️",yml:"⚙️",toml:"⚙️",ini:"⚙️",conf:"⚙️",config:"⚙️",md:"📝",txt:"📃",rtf:"📃",pdf:"📕",doc:"📘",docx:"📘",jpg:"🖼️",jpeg:"🖼️",png:"🖼️",gif:"🖼️",svg:"🎨",webp:"🖼️",ico:"🖼️",zip:"🗜️",tar:"🗜️",gz:"🗜️",rar:"🗜️","7z":"🗜️",sql:"🗃️",db:"🗃️",log:"📊",env:"🔐",lock:"🔒"}[n]||"📄"}getFileType(e){if(!e)return null;const n=e.split(".").pop()?.toLowerCase();return{js:"JavaScript",jsx:"React JSX",ts:"TypeScript",tsx:"React TSX",py:"Python",java:"Java",cpp:"C++",c:"C",cs:"C#",php:"PHP",rb:"Ruby",go:"Go",rs:"Rust",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",xml:"XML",yaml:"YAML",yml:"YAML",md:"Markdown",txt:"Text",sql:"SQL",log:"Log File"}[n]||null}shouldShowInlinePreview(e){return this.isSingleFileOperation(e)&&this.isTextFile(e.file_path)}isTextFile(e){if(!e)return!1;const n=e.split(".").pop()?.toLowerCase();return["txt","md","json","xml","yaml","yml","ini","conf","config","js","jsx","ts","tsx","py","java","cpp","c","cs","php","rb","go","rs","swift","kt","scala","html","htm","css","scss","sass","less","vue","sql","log","env","gitignore","dockerignore"].includes(n)}async toggleInlinePreview(e,n){const t=`preview-${this.generatePreviewId(e)}`,a=document.getElementById(t);a?"none"===a.style.display?(a.style.display="block",n.innerHTML="📖 Hide Preview",await this.loadInlinePreview(e,a)):(a.style.display="none",n.innerHTML="📖 Quick Preview"):console.warn("Preview container not found")}async loadInlinePreview(e,n){try{n.innerHTML=`\n <div class="inline-preview-header">\n <span class="preview-label">Quick Preview:</span>\n <span class="preview-file">${e}</span>\n </div>\n <div class="inline-preview-content">\n <div class="preview-note">\n 💡 Inline preview feature ready - API integration needed\n <br>Click "View File Contents" for full syntax-highlighted view\n </div>\n </div>\n `}catch(t){n.innerHTML=`\n <div class="inline-preview-error">\n ❌ Could not load preview: ${t.message}\n </div>\n `}}generateId(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}generatePreviewId(e){return btoa(e).replace(/[^a-zA-Z0-9]/g,"")}formatTimestamp(e){if(!e)return"Unknown time";try{const n=new Date(e);return isNaN(n.getTime())?"Invalid date":n.toLocaleString()}catch(n){return"Invalid date"}}formatStatus(e){if(!e)return"unknown";return{active:"🟢 Active",completed:"✅ Completed",in_progress:"🔄 In Progress",pending:"⏳ Pending",error:"❌ Error",failed:"❌ Failed"}[e]||e}formatStatusClass(e){return`status-${e}`}getAgentIcon(e){return{PM:"🎯",Engineer:"🔧","Engineer Agent":"🔧",Research:"🔍","Research Agent":"🔍",QA:"✅","QA Agent":"✅",Architect:"🏗️","Architect Agent":"🏗️",Ops:"⚙️","Ops Agent":"⚙️"}[e]||"🤖"}getToolIcon(e){return{Read:"👁️",Write:"✍️",Edit:"✏️",MultiEdit:"📝",Bash:"💻",Grep:"🔍",Glob:"📂",LS:"📁",TodoWrite:"📝",Task:"📋",WebFetch:"🌐"}[e]||"🔧"}getCheckboxIcon(e){return{pending:"⏳",in_progress:"🔄",completed:"✅"}[e]||"❓"}getOperationIcon(e){return{read:"👁️",write:"✍️",edit:"✏️",delete:"🗑️",create:"📝",search:"🔍",list:"📂",copy:"📋",move:"📦",bash:"💻"}[e.toLowerCase()]||"📄"}convertToolToFileOperation(e){const n=e.params||e.tool_parameters||{},t=n.file_path||n.path||n.notebook_path;if(!t)return e;const a={operation:e.name.toLowerCase(),timestamp:e.timestamp||(new Date).toISOString(),agent:"Activity Tool",sessionId:e.sessionId||"unknown",details:{parameters:n,tool_name:e.name,status:e.status||"completed"}};return{file_path:t,operations:[a],lastOperation:a.timestamp,originalTool:e}}getTodoStatusCounts(e){const n={completed:0,in_progress:0,pending:0};return e.forEach(e=>{n.hasOwnProperty(e.status)&&n[e.status]++}),n}escapeHtml(e){if("string"!=typeof e)return"";const n=document.createElement("div");return n.textContent=e,n.innerHTML}toggleJsonSection(e,n){this.globalJsonExpanded=!this.globalJsonExpanded,localStorage.setItem("dashboard-json-expanded",this.globalJsonExpanded.toString()),this.updateAllJsonSections(),document.dispatchEvent(new CustomEvent("jsonToggleChanged",{detail:{expanded:this.globalJsonExpanded}}))}toggleFullEventSection(e,n){this.fullEventDataExpanded=!this.fullEventDataExpanded,localStorage.setItem("dashboard-full-event-expanded",this.fullEventDataExpanded.toString()),this.updateAllFullEventSections(),document.dispatchEvent(new CustomEvent("fullEventToggleChanged",{detail:{expanded:this.fullEventDataExpanded}}))}updateAllJsonSections(){const e=document.querySelectorAll(".unified-json-content"),n=document.querySelectorAll(".unified-json-toggle");e.forEach(e=>{this.globalJsonExpanded?e.style.display="block":e.style.display="none"}),n.forEach(e=>{const n=e.textContent.substring(2);this.globalJsonExpanded?(e.innerHTML="▼ "+n,e.classList.add("expanded")):(e.innerHTML="▶ "+n,e.classList.remove("expanded"))})}updateAllFullEventSections(){const e=document.querySelectorAll(".full-event-content"),n=document.querySelectorAll(".full-event-toggle");e.forEach(e=>{this.fullEventDataExpanded?e.style.display="block":e.style.display="none"}),n.forEach(e=>{const n=e.textContent.substring(2);this.fullEventDataExpanded?(e.innerHTML="▼ "+n,e.classList.add("expanded")):(e.innerHTML="▶ "+n,e.classList.remove("expanded"))})}createCollapsibleJSON(e,n="Full Details"){const t=`json-details-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,a=this.cleanDataForDisplay(e),s=n.includes("Full Event")||n.includes("Full Details")||n.includes("Full Agent")||n.includes("Full Tool"),i=s?this.fullEventDataExpanded:this.globalJsonExpanded;return`\n <div class="collapsible-json-section">\n <button class="collapsible-json-toggle ${s?"full-event-toggle":"unified-json-toggle"} ${i?"expanded":""}" \n data-section-id="${t}"\n data-is-full-event="${s}"\n onclick="window.unifiedDataViewer.${s?"toggleFullEventSection":"toggleJsonSection"}('${t}', this)">\n ${i?"▼":"▶"} ${n}\n </button>\n <div id="${t}" class="collapsible-json-content ${s?"full-event-content":"unified-json-content"}" style="display: ${i?"block":"none"};">\n <pre class="json-viewer">${this.escapeHtml(JSON.stringify(a,null,2))}</pre>\n </div>\n </div>\n `}cleanDataForDisplay(e){const n=new WeakSet;return JSON.parse(JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(n.has(t))return"[Circular Reference]";n.add(t)}return"string"==typeof t&&t.length>1e3?t.substring(0,1e3)+"... [truncated]":"function"==typeof t?"[Function]":t}))}clear(){this.container&&(this.container.innerHTML=""),this.currentData=null,this.currentType=null}getCurrentData(){return this.currentData}getCurrentType(){return this.currentType}hasData(){return null!==this.currentData}}window.UnifiedDataViewer=e,"undefined"!=typeof window&&(window.unifiedDataViewer=new e,window.toggleFullEventSection=function(e,n){window.unifiedDataViewer&&window.unifiedDataViewer.toggleFullEventSection(e,n)},window.toggleJsonSection=function(e,n){window.unifiedDataViewer&&window.unifiedDataViewer.toggleJsonSection(e,n)}),"undefined"!=typeof window&&window.addEventListener("DOMContentLoaded",function(){window.unifiedDataViewer||(window.unifiedDataViewer=new e),document.addEventListener("keydown",function(e){if((e.ctrlKey||e.metaKey)&&e.target.classList.contains("clickable-file-path")){e.preventDefault();const n=e.target.textContent.trim();window.showFileViewerModal&&window.showFileViewerModal(n)}if("v"===e.key.toLowerCase()&&document.querySelector(".clickable-file-path:hover")){const n=document.querySelector(".clickable-file-path:hover");if(n&&window.showFileViewerModal){e.preventDefault();const t=n.textContent.trim();window.showFileViewerModal(t)}}})});export{e as U};
|
|
2
|
-
//# sourceMappingURL=unified-data-viewer.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
window.WorkingDirectoryManager=class{constructor(e){this.socketManager=e,this.currentWorkingDir=null,this.footerDirObserver=null,this._updatingFooter=!1,this.setupEventHandlers(),this.initialize(),console.log("Working directory manager initialized")}initialize(){this.initializeWorkingDirectory(),this.watchFooterDirectory()}setupEventHandlers(){const e=document.getElementById("change-dir-btn"),t=document.getElementById("working-dir-path");if(e&&e.addEventListener("click",()=>{this.showChangeDirDialog()}),t&&t.addEventListener("click",e=>{e.shiftKey?this.showChangeDirDialog():this.showWorkingDirectoryViewer()}),document.addEventListener("sessionChanged",e=>{const t=e.detail.sessionId;console.log("[WORKING-DIR-DEBUG] sessionChanged event received, sessionId:",this.repr(t)),t&&this.loadWorkingDirectoryForSession(t)}),this.socketManager&&this.socketManager.getSocket){const e=this.socketManager.getSocket();e&&(console.log("[WORKING-DIR-DEBUG] Setting up git_branch_response listener"),e.on("git_branch_response",e=>{console.log("[GIT-BRANCH-DEBUG] Received git_branch_response:",e),this.handleGitBranchResponse(e)}))}}initializeWorkingDirectory(){const e=document.getElementById("working-dir-path");e&&!e.textContent.trim()&&(e.textContent="Loading...");const t=document.getElementById("session-select");t&&t.value&&"all"!==t.value?this.loadWorkingDirectoryForSession(t.value):this.setWorkingDirectory(this.getDefaultWorkingDir())}watchFooterDirectory(){const e=document.getElementById("footer-working-dir");e&&(this.footerDirObserver=new MutationObserver(t=>{this._updatingFooter||t.forEach(t=>{if("childList"===t.type||"characterData"===t.type){const t=e.textContent.trim();console.log("Footer directory changed to:",t),t&&t!==this.currentWorkingDir&&(console.log("Syncing working directory from footer change"),this.setWorkingDirectory(t))}})}),this.footerDirObserver.observe(e,{childList:!0,characterData:!0,subtree:!0}),console.log("Started watching footer directory for changes"))}loadWorkingDirectoryForSession(e){if(console.log("[WORKING-DIR-DEBUG] loadWorkingDirectoryForSession called with sessionId:",this.repr(e)),!e||"all"===e){console.log('[WORKING-DIR-DEBUG] No sessionId or sessionId is "all", using default working dir');const e=this.getDefaultWorkingDir();return console.log("[WORKING-DIR-DEBUG] Default working dir:",this.repr(e)),void this.setWorkingDirectory(e)}const t=JSON.parse(localStorage.getItem("sessionWorkingDirs")||"{}");console.log("[WORKING-DIR-DEBUG] Session directories from localStorage:",t);const r=t[e],o=this.getDefaultWorkingDir(),i=r||o;console.log("[WORKING-DIR-DEBUG] Directory selection:",{sessionId:e,sessionDir:this.repr(r),defaultDir:this.repr(o),finalDir:this.repr(i)}),this.setWorkingDirectory(i)}setWorkingDirectory(e){console.log("[WORKING-DIR-DEBUG] setWorkingDirectory called with:",this.repr(e)),this.currentWorkingDir=e,e&&this.validateDirectoryPath(e)&&(sessionStorage.setItem("currentWorkingDirectory",e),console.log("[WORKING-DIR-DEBUG] Stored working directory in session storage:",e));const t=document.getElementById("working-dir-path");t?(console.log("[WORKING-DIR-DEBUG] Updating UI path element to:",e),t.textContent=e):console.warn("[WORKING-DIR-DEBUG] working-dir-path element not found");const r=document.getElementById("footer-working-dir");if(r){const t=r.textContent;console.log("[WORKING-DIR-DEBUG] Footer directory current text:",this.repr(t),"new text:",this.repr(e)),t!==e?(this._updatingFooter=!0,r.textContent=e,console.log("[WORKING-DIR-DEBUG] Updated footer directory to:",e),setTimeout(()=>{this._updatingFooter=!1,console.log("[WORKING-DIR-DEBUG] Cleared _updatingFooter flag")},100)):console.log("[WORKING-DIR-DEBUG] Footer directory already has correct text")}else console.warn("[WORKING-DIR-DEBUG] footer-working-dir element not found");const o=document.getElementById("session-select");if(o&&o.value&&"all"!==o.value){const t=o.value,r=JSON.parse(localStorage.getItem("sessionWorkingDirs")||"{}");r[t]=e,localStorage.setItem("sessionWorkingDirs",JSON.stringify(r)),console.log(`[WORKING-DIR-DEBUG] Saved working directory for session ${t}:`,e)}else console.log('[WORKING-DIR-DEBUG] No session selected or session is "all", not saving to localStorage');console.log("[WORKING-DIR-DEBUG] About to call updateGitBranch with:",this.repr(e)),this.validateDirectoryPath(e)?this.updateGitBranch(e):console.log("[WORKING-DIR-DEBUG] Skipping git branch update for invalid directory:",this.repr(e)),document.dispatchEvent(new CustomEvent("workingDirectoryChanged",{detail:{directory:e}})),console.log("[WORKING-DIR-DEBUG] Working directory set to:",e)}updateGitBranch(e){if(console.log("[GIT-BRANCH-DEBUG] updateGitBranch called with dir:",this.repr(e),"type:",typeof e),!this.socketManager||!this.socketManager.isConnected()){console.log("[GIT-BRANCH-DEBUG] Not connected to socket server");const e=document.getElementById("footer-git-branch");return void(e&&(e.textContent="Not Connected",e.style.display="inline"))}const t=this.validateDirectoryPath(e),r="Loading..."===e||"Loading"===e,o="Unknown"===e,i=!e||"string"==typeof e&&""===e.trim();if(console.log("[GIT-BRANCH-DEBUG] Validation results:",{dir:e,isValidPath:t,isLoadingState:r,isUnknown:o,isEmptyOrWhitespace:i,shouldReject:!t||r||o||i}),!t||r||o||i){console.warn("[GIT-BRANCH-DEBUG] Invalid working directory for git branch request:",e);const t=document.getElementById("footer-git-branch");return void(t&&(t.textContent=r?"Loading...":o||i?"No Directory":"Invalid Directory",t.style.display="inline"))}const n=this.socketManager.getSocket();n?(console.log("[GIT-BRANCH-DEBUG] Requesting git branch for directory:",e),console.log("[GIT-BRANCH-DEBUG] Socket state:",{connected:n.connected,id:n.id}),n.emit("get_git_branch",e)):console.error("[GIT-BRANCH-DEBUG] No socket available for git branch request")}getDefaultWorkingDir(){if(console.log("[WORKING-DIR-DEBUG] getDefaultWorkingDir called"),this.currentWorkingDir&&this.validateDirectoryPath(this.currentWorkingDir))return console.log("[WORKING-DIR-DEBUG] Using current working directory:",this.currentWorkingDir),this.currentWorkingDir;const e=document.querySelector(".working-dir-text");if(e?.textContent?.trim()){const t=e.textContent.trim();if("Loading..."!==t&&"Unknown"!==t&&this.validateDirectoryPath(t))return console.log("[WORKING-DIR-DEBUG] Using header working directory:",t),t}const t=document.getElementById("footer-working-dir");if(t?.textContent?.trim()){const e=t.textContent.trim();console.log("[WORKING-DIR-DEBUG] Footer path found:",this.repr(e));const r="Unknown"===e,o=this.validateDirectoryPath(e);if(console.log("[WORKING-DIR-DEBUG] Footer path validation:",{footerPath:this.repr(e),isUnknown:r,isValid:o,shouldUse:!r&&o}),!r&&o)return console.log("[WORKING-DIR-DEBUG] Using footer path as default:",e),e}else console.log("[WORKING-DIR-DEBUG] No footer directory element or no text content");if(window.socketClient&&window.socketClient.events){const e=window.socketClient.events.filter(e=>e.data&&(e.data.working_directory||e.data.cwd||e.data.working_dir)).reverse();if(e.length>0){const t=e[0],r=t.data.working_directory||t.data.cwd||t.data.working_dir;return console.log("[WORKING-DIR-DEBUG] Using working directory from recent event:",r),r}}const r=document.getElementById("working-dir-path");if(r?.textContent?.trim()){const e=r.textContent.trim();if(console.log("[WORKING-DIR-DEBUG] Found working-dir-path element text:",this.repr(e)),"Unknown"!==e&&this.validateDirectoryPath(e))return console.log("[WORKING-DIR-DEBUG] Using working-dir-path as fallback:",e),e}const o=sessionStorage.getItem("currentWorkingDirectory");if(o&&this.validateDirectoryPath(o))return console.log("[WORKING-DIR-DEBUG] Using session storage working directory:",this.repr(o)),o;const i=window.processWorkingDirectory||process?.cwd?.()||null;if(i&&this.validateDirectoryPath(i))return console.log("[WORKING-DIR-DEBUG] Using process working directory:",this.repr(i)),i;const n=window.homeDirectory||process?.env?.HOME||process?.env?.USERPROFILE||null||process?.cwd?.()||os?.homedir?.()||"/Users/masa";return console.log("[WORKING-DIR-DEBUG] Using fallback directory (home or cwd):",this.repr(n)),n}showChangeDirDialog(){const e=prompt("Enter new working directory:",this.currentWorkingDir||"");e&&""!==e.trim()&&this.setWorkingDirectory(e.trim())}showWorkingDirectoryViewer(){this.createDirectoryViewerOverlay()}createDirectoryViewerOverlay(){this.removeDirectoryViewerOverlay();const e=document.querySelector(".working-dir-display");if(!e)return;const t=document.createElement("div");t.id="directory-viewer-overlay",t.className="directory-viewer-overlay",t.innerHTML=`\n <div class="directory-viewer-content">\n <div class="directory-viewer-header">\n <h3 class="directory-viewer-title">\n 📁 ${this.currentWorkingDir||"Working Directory"}\n </h3>\n <button class="close-btn" onclick="workingDirectoryManager.removeDirectoryViewerOverlay()">✕</button>\n </div>\n <div class="directory-viewer-body">\n <div class="loading-indicator">Loading directory contents...</div>\n </div>\n <div class="directory-viewer-footer">\n <span class="directory-hint">Click file to view • Shift+Click directory path to change</span>\n </div>\n </div>\n `;const r=e.getBoundingClientRect();t.style.cssText=`\n position: fixed;\n top: ${r.bottom+5}px;\n left: ${r.left}px;\n min-width: 400px;\n max-width: 600px;\n max-height: 400px;\n z-index: 1001;\n background: white;\n border-radius: 8px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);\n border: 1px solid #e2e8f0;\n `,document.body.appendChild(t),this.loadDirectoryContents(),setTimeout(()=>{document.addEventListener("click",this.handleOutsideClick.bind(this),!0)},100)}removeDirectoryViewerOverlay(){const e=document.getElementById("directory-viewer-overlay");e&&(e.remove(),document.removeEventListener("click",this.handleOutsideClick.bind(this),!0))}handleOutsideClick(e){const t=document.getElementById("directory-viewer-overlay"),r=document.getElementById("working-dir-path");t&&!t.contains(e.target)&&e.target!==r&&this.removeDirectoryViewerOverlay()}loadDirectoryContents(){if(!this.socketManager||!this.socketManager.isConnected())return void this.showDirectoryError("Not connected to server");const e=this.socketManager.getSocket();if(!e)return void this.showDirectoryError("No socket connection available");e.emit("get_directory_listing",{directory:this.currentWorkingDir,limit:50});const t=r=>{e.off("directory_listing_response",t),this.handleDirectoryListingResponse(r)};e.on("directory_listing_response",t),setTimeout(()=>{e.off("directory_listing_response",t);const r=document.getElementById("directory-viewer-overlay");r&&r.querySelector(".loading-indicator")&&this.showDirectoryError("Request timeout")},5e3)}handleDirectoryListingResponse(e){const t=document.querySelector(".directory-viewer-body");if(!t)return;if(!e.success)return void this.showDirectoryError(e.error||"Failed to load directory");const r=e.files||[],o=e.directories||[];let i="";if(this.currentWorkingDir&&"/"!==this.currentWorkingDir){const e=this.currentWorkingDir.split("/").slice(0,-1).join("/")||"/";i+=`\n <div class="file-item directory-item" onclick="workingDirectoryManager.setWorkingDirectory('${e}')">\n <span class="file-icon">📁</span>\n <span class="file-name">..</span>\n <span class="file-type">parent directory</span>\n </div>\n `}o.forEach(e=>{const t=`${this.currentWorkingDir}/${e}`.replace(/\/+/g,"/");i+=`\n <div class="file-item directory-item" onclick="workingDirectoryManager.setWorkingDirectory('${t}')">\n <span class="file-icon">📁</span>\n <span class="file-name">${e}</span>\n <span class="file-type">directory</span>\n </div>\n `}),r.forEach(e=>{const t=`${this.currentWorkingDir}/${e}`.replace(/\/+/g,"/"),r=e.split(".").pop().toLowerCase(),o=this.getFileIcon(r);i+=`\n <div class="file-item" onclick="workingDirectoryManager.viewFile('${t}')">\n <span class="file-icon">${o}</span>\n <span class="file-name">${e}</span>\n <span class="file-type">${r}</span>\n </div>\n `}),""===i&&(i='<div class="no-files">Empty directory</div>'),t.innerHTML=i}showDirectoryError(e){const t=document.querySelector(".directory-viewer-body");t&&(t.innerHTML=`\n <div class="directory-error">\n <span class="error-icon">⚠️</span>\n <span class="error-message">${e}</span>\n </div>\n `)}getFileIcon(e){return{js:"📄",py:"🐍",html:"🌐",css:"🎨",json:"📋",md:"📝",txt:"📝",yml:"⚙️",yaml:"⚙️",xml:"📄",pdf:"📕",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",svg:"🖼️",zip:"📦",tar:"📦",gz:"📦",sh:"🔧",bat:"🔧",exe:"⚙️",dll:"⚙️"}[e]||"📄"}viewFile(e){this.removeDirectoryViewerOverlay(),window.showFileViewerModal?window.showFileViewerModal(e):console.warn("File viewer modal function not available")}getCurrentWorkingDir(){return this.currentWorkingDir}getSessionDirectories(){return JSON.parse(localStorage.getItem("sessionWorkingDirs")||"{}")}setSessionDirectory(e,t){const r=this.getSessionDirectories();r[e]=t,localStorage.setItem("sessionWorkingDirs",JSON.stringify(r));const o=document.getElementById("session-select");o&&o.value===e&&this.setWorkingDirectory(t)}removeSessionDirectory(e){const t=this.getSessionDirectories();delete t[e],localStorage.setItem("sessionWorkingDirs",JSON.stringify(t))}clearAllSessionDirectories(){localStorage.removeItem("sessionWorkingDirs")}extractWorkingDirectoryFromPair(e){return e.pre?.working_dir?e.pre.working_dir:e.post?.working_dir?e.post.working_dir:e.pre?.data?.working_dir?e.pre.data.working_dir:e.post?.data?.working_dir?e.post.data.working_dir:this.currentWorkingDir||this.getDefaultWorkingDir()}validateDirectoryPath(e){if(!e||"string"!=typeof e)return!1;const t=e.trim();if(0===t.length)return!1;if(t.includes("\0"))return!1;return!["Loading...","Loading","Unknown","undefined","null","Not Connected","Invalid Directory","No Directory"].includes(t)&&(!(!t.startsWith("/")&&!/^[A-Za-z]:/.test(t))||!!(t.startsWith("./")||t.startsWith("../")||/^[a-zA-Z0-9._-]+/.test(t)))}handleGitBranchResponse(e){console.log("[GIT-BRANCH-DEBUG] handleGitBranchResponse called with:",e);const t=document.getElementById("footer-git-branch");if(t){if(e.success)console.log("[GIT-BRANCH-DEBUG] Git branch request successful, branch:",e.branch),t.textContent=e.branch,t.style.display="inline",t.classList.remove("git-error"),t.classList.add("git-success");else{let r="Git Error";const o=e.error||"Unknown error";r=o.includes("Directory not found")||o.includes("does not exist")?"Dir Not Found":o.includes("Not a directory")?"Invalid Path":o.includes("Not a git repository")?"No Git Repo":o.includes("git")?"Git Error":"Unknown",console.log("[GIT-BRANCH-DEBUG] Git branch request failed:",o,"- showing as:",r),t.textContent=r,t.style.display="inline",t.classList.remove("git-success"),t.classList.add("git-error")}e.original_working_dir&&console.log("[GIT-BRANCH-DEBUG] Server received original working_dir:",this.repr(e.original_working_dir)),e.working_dir&&console.log("[GIT-BRANCH-DEBUG] Server used working_dir:",this.repr(e.working_dir)),e.git_error&&console.log("[GIT-BRANCH-DEBUG] Git command stderr:",e.git_error)}else console.warn("[GIT-BRANCH-DEBUG] footer-git-branch element not found")}isWorkingDirectoryReady(){const e=this.getCurrentWorkingDir();return this.validateDirectoryPath(e)&&"Loading..."!==e&&"Unknown"!==e}whenDirectoryReady(e,t=5e3){const r=Date.now(),o=()=>{this.isWorkingDirectoryReady()?e():Date.now()-r<t?setTimeout(o,100):console.warn("[WORKING-DIR-DEBUG] Timeout waiting for directory to be ready")};o()}repr(e){return null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:String(e)}cleanup(){this.footerDirObserver&&(this.footerDirObserver.disconnect(),this.footerDirObserver=null),console.log("Working directory manager cleaned up")}};
|
|
2
|
-
//# sourceMappingURL=working-directory.js.map
|