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.

Files changed (623) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/__init__.py +4 -0
  3. claude_mpm/agents/BASE_AGENT.md +164 -0
  4. claude_mpm/agents/{OUTPUT_STYLE.md → CLAUDE_MPM_OUTPUT_STYLE.md} +3 -48
  5. claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +2002 -0
  6. claude_mpm/agents/MEMORY.md +1 -1
  7. claude_mpm/agents/PM_INSTRUCTIONS.md +735 -925
  8. claude_mpm/agents/WORKFLOW.md +5 -254
  9. claude_mpm/agents/__init__.py +6 -0
  10. claude_mpm/agents/agent_loader.py +14 -48
  11. claude_mpm/agents/base_agent.json +7 -4
  12. claude_mpm/agents/frontmatter_validator.py +71 -3
  13. claude_mpm/agents/templates/circuit-breakers.md +1391 -0
  14. claude_mpm/agents/templates/context-management-examples.md +544 -0
  15. claude_mpm/agents/templates/{pm_red_flags.md → pm-red-flags.md} +48 -0
  16. claude_mpm/agents/templates/pr-workflow-examples.md +427 -0
  17. claude_mpm/agents/templates/research-gate-examples.md +669 -0
  18. claude_mpm/agents/templates/structured-questions-examples.md +615 -0
  19. claude_mpm/agents/templates/ticket-completeness-examples.md +139 -0
  20. claude_mpm/agents/templates/ticketing-examples.md +277 -0
  21. claude_mpm/cli/__init__.py +37 -2
  22. claude_mpm/cli/__main__.py +4 -0
  23. claude_mpm/cli/chrome_devtools_installer.py +175 -0
  24. claude_mpm/cli/commands/__init__.py +2 -0
  25. claude_mpm/cli/commands/agent_source.py +774 -0
  26. claude_mpm/cli/commands/agent_state_manager.py +180 -31
  27. claude_mpm/cli/commands/agents.py +1116 -55
  28. claude_mpm/cli/commands/agents_cleanup.py +210 -0
  29. claude_mpm/cli/commands/agents_discover.py +338 -0
  30. claude_mpm/cli/commands/aggregate.py +1 -1
  31. claude_mpm/cli/commands/analyze.py +3 -3
  32. claude_mpm/cli/commands/auto_configure.py +725 -242
  33. claude_mpm/cli/commands/config.py +95 -6
  34. claude_mpm/cli/commands/configure.py +1875 -46
  35. claude_mpm/cli/commands/configure_agent_display.py +29 -10
  36. claude_mpm/cli/commands/configure_navigation.py +63 -46
  37. claude_mpm/cli/commands/debug.py +12 -12
  38. claude_mpm/cli/commands/doctor.py +10 -2
  39. claude_mpm/cli/commands/hook_errors.py +277 -0
  40. claude_mpm/cli/commands/local_deploy.py +1 -4
  41. claude_mpm/cli/commands/mcp_install_commands.py +1 -1
  42. claude_mpm/cli/commands/mpm_init/core.py +229 -2
  43. claude_mpm/cli/commands/mpm_init/git_activity.py +10 -10
  44. claude_mpm/cli/commands/mpm_init/knowledge_extractor.py +481 -0
  45. claude_mpm/cli/commands/mpm_init/prompts.py +286 -6
  46. claude_mpm/cli/commands/postmortem.py +401 -0
  47. claude_mpm/cli/commands/profile.py +277 -0
  48. claude_mpm/cli/commands/run.py +123 -165
  49. claude_mpm/cli/commands/skill_source.py +694 -0
  50. claude_mpm/cli/commands/skills.py +782 -20
  51. claude_mpm/cli/commands/summarize.py +413 -0
  52. claude_mpm/cli/executor.py +96 -3
  53. claude_mpm/cli/interactive/agent_wizard.py +1030 -45
  54. claude_mpm/cli/parsers/agent_source_parser.py +171 -0
  55. claude_mpm/cli/parsers/agents_parser.py +307 -10
  56. claude_mpm/cli/parsers/auto_configure_parser.py +13 -138
  57. claude_mpm/cli/parsers/base_parser.py +65 -0
  58. claude_mpm/cli/parsers/config_parser.py +162 -39
  59. claude_mpm/cli/parsers/profile_parser.py +148 -0
  60. claude_mpm/cli/parsers/skill_source_parser.py +169 -0
  61. claude_mpm/cli/parsers/skills_parser.py +146 -0
  62. claude_mpm/cli/parsers/source_parser.py +138 -0
  63. claude_mpm/cli/startup.py +1280 -118
  64. claude_mpm/cli/startup_display.py +480 -0
  65. claude_mpm/cli/utils.py +1 -1
  66. claude_mpm/cli_module/commands.py +1 -1
  67. claude_mpm/commands/mpm-config.md +21 -134
  68. claude_mpm/commands/mpm-doctor.md +16 -20
  69. claude_mpm/commands/mpm-help.md +13 -283
  70. claude_mpm/commands/mpm-init.md +88 -489
  71. claude_mpm/commands/mpm-monitor.md +23 -401
  72. claude_mpm/commands/mpm-organize.md +72 -247
  73. claude_mpm/commands/mpm-postmortem.md +21 -0
  74. claude_mpm/commands/mpm-session-resume.md +30 -0
  75. claude_mpm/commands/mpm-status.md +13 -68
  76. claude_mpm/commands/mpm-ticket-view.md +109 -0
  77. claude_mpm/commands/mpm-version.md +13 -106
  78. claude_mpm/commands/mpm.md +10 -0
  79. claude_mpm/config/agent_presets.py +488 -0
  80. claude_mpm/config/agent_sources.py +352 -0
  81. claude_mpm/config/skill_presets.py +392 -0
  82. claude_mpm/config/skill_sources.py +590 -0
  83. claude_mpm/constants.py +13 -0
  84. claude_mpm/core/claude_runner.py +5 -34
  85. claude_mpm/core/config.py +15 -1
  86. claude_mpm/core/constants.py +1 -1
  87. claude_mpm/core/framework/__init__.py +3 -16
  88. claude_mpm/core/framework/formatters/content_formatter.py +3 -13
  89. claude_mpm/core/framework/loaders/agent_loader.py +8 -5
  90. claude_mpm/core/framework/loaders/file_loader.py +54 -101
  91. claude_mpm/core/framework/loaders/instruction_loader.py +66 -5
  92. claude_mpm/core/framework_loader.py +4 -2
  93. claude_mpm/core/hook_error_memory.py +381 -0
  94. claude_mpm/core/hook_manager.py +41 -2
  95. claude_mpm/core/interactive_session.py +91 -10
  96. claude_mpm/core/logger.py +16 -1
  97. claude_mpm/core/oneshot_session.py +71 -8
  98. claude_mpm/core/optimized_startup.py +59 -0
  99. claude_mpm/core/output_style_manager.py +173 -43
  100. claude_mpm/core/protocols/__init__.py +23 -0
  101. claude_mpm/core/protocols/runner_protocol.py +103 -0
  102. claude_mpm/core/protocols/session_protocol.py +131 -0
  103. claude_mpm/core/shared/config_loader.py +1 -1
  104. claude_mpm/core/shared/singleton_manager.py +11 -4
  105. claude_mpm/core/socketio_pool.py +3 -3
  106. claude_mpm/core/system_context.py +38 -0
  107. claude_mpm/core/unified_agent_registry.py +134 -16
  108. claude_mpm/core/unified_config.py +22 -0
  109. claude_mpm/dashboard/static/svelte-build/_app/env.js +1 -0
  110. claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/0.B_FtCwCQ.css +1 -0
  111. claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/2.Cl_eSA4x.css +1 -0
  112. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/BgChzWQ1.js +1 -0
  113. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CIXEwuWe.js +1 -0
  114. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CWc5urbQ.js +1 -0
  115. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/DMkZpdF2.js +2 -0
  116. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/DjhvlsAc.js +1 -0
  117. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/N4qtv3Hx.js +2 -0
  118. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/uj46x2Wr.js +1 -0
  119. claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/app.DTL5mJO-.js +2 -0
  120. claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/start.DzuEhzqh.js +1 -0
  121. claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/0.CAGBuiOw.js +1 -0
  122. claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/1.DFLC8jdE.js +1 -0
  123. claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/2.DPvEihJJ.js +10 -0
  124. claude_mpm/dashboard/static/svelte-build/_app/version.json +1 -0
  125. claude_mpm/dashboard/static/svelte-build/favicon.svg +7 -0
  126. claude_mpm/dashboard/static/svelte-build/index.html +36 -0
  127. claude_mpm/experimental/cli_enhancements.py +1 -5
  128. claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc +0 -0
  129. claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc +0 -0
  130. claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
  131. claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
  132. claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc +0 -0
  133. claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
  134. claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
  135. claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-311.pyc +0 -0
  136. claude_mpm/hooks/claude_hooks/correlation_manager.py +60 -0
  137. claude_mpm/hooks/claude_hooks/event_handlers.py +214 -79
  138. claude_mpm/hooks/claude_hooks/hook_handler.py +155 -1
  139. claude_mpm/hooks/claude_hooks/installer.py +33 -10
  140. claude_mpm/hooks/claude_hooks/memory_integration.py +28 -0
  141. claude_mpm/hooks/claude_hooks/response_tracking.py +2 -3
  142. claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc +0 -0
  143. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager.cpython-311.pyc +0 -0
  144. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
  145. claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc +0 -0
  146. claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
  147. claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
  148. claude_mpm/hooks/claude_hooks/services/connection_manager.py +30 -6
  149. claude_mpm/hooks/failure_learning/__init__.py +2 -8
  150. claude_mpm/hooks/failure_learning/failure_detection_hook.py +1 -6
  151. claude_mpm/hooks/failure_learning/fix_detection_hook.py +1 -6
  152. claude_mpm/hooks/failure_learning/learning_extraction_hook.py +1 -6
  153. claude_mpm/hooks/kuzu_response_hook.py +1 -5
  154. claude_mpm/hooks/memory_integration_hook.py +46 -1
  155. claude_mpm/init.py +63 -19
  156. claude_mpm/models/agent_definition.py +7 -0
  157. claude_mpm/models/git_repository.py +198 -0
  158. claude_mpm/scripts/claude-hook-handler.sh +60 -20
  159. claude_mpm/scripts/launch_monitor.py +93 -13
  160. claude_mpm/scripts/start_activity_logging.py +3 -1
  161. claude_mpm/services/agents/agent_builder.py +48 -12
  162. claude_mpm/services/agents/agent_preset_service.py +238 -0
  163. claude_mpm/services/agents/agent_recommendation_service.py +278 -0
  164. claude_mpm/services/agents/agent_review_service.py +280 -0
  165. claude_mpm/services/agents/agent_selection_service.py +484 -0
  166. claude_mpm/services/agents/auto_deploy_index_parser.py +569 -0
  167. claude_mpm/services/agents/cache_git_manager.py +621 -0
  168. claude_mpm/services/agents/deployment/agent_deployment.py +148 -2
  169. claude_mpm/services/agents/deployment/agent_discovery_service.py +104 -73
  170. claude_mpm/services/agents/deployment/agent_format_converter.py +1 -1
  171. claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +1 -5
  172. claude_mpm/services/agents/deployment/agent_metrics_collector.py +3 -3
  173. claude_mpm/services/agents/deployment/agent_restore_handler.py +1 -4
  174. claude_mpm/services/agents/deployment/agent_template_builder.py +238 -15
  175. claude_mpm/services/agents/deployment/agents_directory_resolver.py +101 -15
  176. claude_mpm/services/agents/deployment/async_agent_deployment.py +2 -1
  177. claude_mpm/services/agents/deployment/facade/deployment_facade.py +3 -3
  178. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +422 -31
  179. claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +2 -2
  180. claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +1 -4
  181. claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +841 -0
  182. claude_mpm/services/agents/deployment/single_agent_deployer.py +2 -2
  183. claude_mpm/services/agents/deployment/system_instructions_deployer.py +168 -46
  184. claude_mpm/services/agents/deployment/validation/deployment_validator.py +2 -2
  185. claude_mpm/services/agents/git_source_manager.py +663 -0
  186. claude_mpm/services/agents/loading/base_agent_manager.py +1 -13
  187. claude_mpm/services/agents/loading/framework_agent_loader.py +9 -12
  188. claude_mpm/services/agents/local_template_manager.py +50 -10
  189. claude_mpm/services/agents/recommender.py +5 -3
  190. claude_mpm/services/agents/single_tier_deployment_service.py +696 -0
  191. claude_mpm/services/agents/sources/__init__.py +13 -0
  192. claude_mpm/services/agents/sources/agent_sync_state.py +516 -0
  193. claude_mpm/services/agents/sources/git_source_sync_service.py +1094 -0
  194. claude_mpm/services/agents/startup_sync.py +259 -0
  195. claude_mpm/services/agents/toolchain_detector.py +478 -0
  196. claude_mpm/services/analysis/__init__.py +35 -0
  197. claude_mpm/services/analysis/clone_detector.py +1030 -0
  198. claude_mpm/services/analysis/postmortem_reporter.py +474 -0
  199. claude_mpm/services/analysis/postmortem_service.py +765 -0
  200. claude_mpm/services/cli/session_pause_manager.py +1 -1
  201. claude_mpm/services/command_deployment_service.py +271 -6
  202. claude_mpm/services/core/base.py +7 -2
  203. claude_mpm/services/core/interfaces/__init__.py +1 -3
  204. claude_mpm/services/core/interfaces/health.py +1 -4
  205. claude_mpm/services/core/models/__init__.py +2 -11
  206. claude_mpm/services/diagnostics/checks/__init__.py +4 -0
  207. claude_mpm/services/diagnostics/checks/agent_check.py +2 -4
  208. claude_mpm/services/diagnostics/checks/agent_sources_check.py +577 -0
  209. claude_mpm/services/diagnostics/checks/instructions_check.py +1 -2
  210. claude_mpm/services/diagnostics/checks/mcp_check.py +0 -1
  211. claude_mpm/services/diagnostics/checks/mcp_services_check.py +7 -15
  212. claude_mpm/services/diagnostics/checks/monitor_check.py +0 -1
  213. claude_mpm/services/diagnostics/checks/skill_sources_check.py +587 -0
  214. claude_mpm/services/diagnostics/diagnostic_runner.py +9 -0
  215. claude_mpm/services/diagnostics/doctor_reporter.py +40 -10
  216. claude_mpm/services/event_bus/config.py +3 -1
  217. claude_mpm/services/event_bus/direct_relay.py +3 -3
  218. claude_mpm/services/events/consumers/logging.py +1 -2
  219. claude_mpm/services/git/__init__.py +21 -0
  220. claude_mpm/services/git/git_operations_service.py +579 -0
  221. claude_mpm/services/github/__init__.py +21 -0
  222. claude_mpm/services/github/github_cli_service.py +397 -0
  223. claude_mpm/services/infrastructure/monitoring/__init__.py +1 -5
  224. claude_mpm/services/infrastructure/monitoring/aggregator.py +1 -6
  225. claude_mpm/services/instructions/__init__.py +9 -0
  226. claude_mpm/services/instructions/instruction_cache_service.py +374 -0
  227. claude_mpm/services/local_ops/__init__.py +3 -13
  228. claude_mpm/services/local_ops/health_checks/__init__.py +1 -3
  229. claude_mpm/services/local_ops/health_manager.py +1 -4
  230. claude_mpm/services/local_ops/resource_monitor.py +1 -1
  231. claude_mpm/services/mcp_config_manager.py +75 -145
  232. claude_mpm/services/mcp_service_verifier.py +6 -3
  233. claude_mpm/services/model/model_router.py +1 -2
  234. claude_mpm/services/monitor/daemon.py +38 -11
  235. claude_mpm/services/monitor/daemon_manager.py +134 -21
  236. claude_mpm/services/monitor/management/lifecycle.py +8 -1
  237. claude_mpm/services/monitor/server.py +700 -24
  238. claude_mpm/services/pm_skills_deployer.py +676 -0
  239. claude_mpm/services/port_manager.py +1 -1
  240. claude_mpm/services/pr/__init__.py +14 -0
  241. claude_mpm/services/pr/pr_template_service.py +329 -0
  242. claude_mpm/services/profile_manager.py +331 -0
  243. claude_mpm/services/project/documentation_manager.py +2 -1
  244. claude_mpm/services/project/project_organizer.py +4 -0
  245. claude_mpm/services/project/toolchain_analyzer.py +3 -1
  246. claude_mpm/services/runner_configuration_service.py +16 -3
  247. claude_mpm/services/self_upgrade_service.py +120 -12
  248. claude_mpm/services/session_management_service.py +16 -4
  249. claude_mpm/services/skills/__init__.py +21 -0
  250. claude_mpm/services/skills/git_skill_source_manager.py +1297 -0
  251. claude_mpm/services/skills/selective_skill_deployer.py +704 -0
  252. claude_mpm/services/skills/skill_discovery_service.py +568 -0
  253. claude_mpm/services/skills/skill_to_agent_mapper.py +406 -0
  254. claude_mpm/services/skills_config.py +547 -0
  255. claude_mpm/services/skills_deployer.py +1072 -0
  256. claude_mpm/services/socketio/dashboard_server.py +1 -0
  257. claude_mpm/services/socketio/event_normalizer.py +51 -6
  258. claude_mpm/services/socketio/handlers/connection.py +1 -1
  259. claude_mpm/services/socketio/handlers/git.py +1 -1
  260. claude_mpm/services/socketio/server/core.py +387 -112
  261. claude_mpm/services/socketio/server/main.py +1 -3
  262. claude_mpm/services/system_instructions_service.py +1 -3
  263. claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +0 -3
  264. claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +0 -1
  265. claude_mpm/services/unified/deployment_strategies/vercel.py +1 -5
  266. claude_mpm/services/unified/unified_deployment.py +1 -5
  267. claude_mpm/services/version_control/conflict_resolution.py +6 -4
  268. claude_mpm/services/version_control/git_operations.py +103 -0
  269. claude_mpm/services/visualization/__init__.py +1 -5
  270. claude_mpm/services/visualization/mermaid_generator.py +2 -3
  271. claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +2 -2
  272. claude_mpm/skills/skill_manager.py +92 -3
  273. claude_mpm/skills/skills_registry.py +0 -1
  274. claude_mpm/templates/questions/__init__.py +38 -0
  275. claude_mpm/templates/questions/base.py +193 -0
  276. claude_mpm/templates/questions/pr_strategy.py +311 -0
  277. claude_mpm/templates/questions/project_init.py +385 -0
  278. claude_mpm/templates/questions/ticket_mgmt.py +394 -0
  279. claude_mpm/tools/__main__.py +8 -8
  280. claude_mpm/utils/agent_dependency_loader.py +91 -12
  281. claude_mpm/utils/agent_filters.py +261 -0
  282. claude_mpm/utils/dependency_cache.py +3 -1
  283. claude_mpm/utils/gitignore.py +244 -0
  284. claude_mpm/utils/migration.py +372 -0
  285. claude_mpm/utils/progress.py +387 -0
  286. claude_mpm/utils/robust_installer.py +49 -7
  287. claude_mpm/utils/structured_questions.py +619 -0
  288. {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/METADATA +445 -122
  289. {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/RECORD +298 -503
  290. claude_mpm-5.4.41.dist-info/entry_points.txt +5 -0
  291. claude_mpm-5.4.41.dist-info/licenses/LICENSE +94 -0
  292. claude_mpm-5.4.41.dist-info/licenses/LICENSE-FAQ.md +153 -0
  293. claude_mpm/agents/BASE_AGENT_TEMPLATE.md +0 -292
  294. claude_mpm/agents/BASE_DOCUMENTATION.md +0 -53
  295. claude_mpm/agents/BASE_OPS.md +0 -219
  296. claude_mpm/agents/BASE_PM.md +0 -468
  297. claude_mpm/agents/BASE_PROMPT_ENGINEER.md +0 -787
  298. claude_mpm/agents/BASE_QA.md +0 -167
  299. claude_mpm/agents/BASE_RESEARCH.md +0 -53
  300. claude_mpm/agents/base_agent_loader.py +0 -626
  301. claude_mpm/agents/templates/.claude-mpm/memories/README.md +0 -17
  302. claude_mpm/agents/templates/.claude-mpm/memories/engineer_memories.md +0 -3
  303. claude_mpm/agents/templates/agent-manager.json +0 -273
  304. claude_mpm/agents/templates/agentic-coder-optimizer.json +0 -248
  305. claude_mpm/agents/templates/api_qa.json +0 -183
  306. claude_mpm/agents/templates/circuit_breakers.md +0 -638
  307. claude_mpm/agents/templates/clerk-ops.json +0 -235
  308. claude_mpm/agents/templates/code_analyzer.json +0 -101
  309. claude_mpm/agents/templates/content-agent.json +0 -358
  310. claude_mpm/agents/templates/dart_engineer.json +0 -307
  311. claude_mpm/agents/templates/data_engineer.json +0 -225
  312. claude_mpm/agents/templates/documentation.json +0 -238
  313. claude_mpm/agents/templates/engineer.json +0 -210
  314. claude_mpm/agents/templates/gcp_ops_agent.json +0 -253
  315. claude_mpm/agents/templates/golang_engineer.json +0 -270
  316. claude_mpm/agents/templates/imagemagick.json +0 -264
  317. claude_mpm/agents/templates/java_engineer.json +0 -346
  318. claude_mpm/agents/templates/javascript_engineer_agent.json +0 -380
  319. claude_mpm/agents/templates/local_ops_agent.json +0 -1840
  320. claude_mpm/agents/templates/logs/prompts/agent_engineer_20250826_014258_728.md +0 -39
  321. claude_mpm/agents/templates/logs/prompts/agent_engineer_20250901_010124_142.md +0 -400
  322. claude_mpm/agents/templates/memory_manager.json +0 -158
  323. claude_mpm/agents/templates/nextjs_engineer.json +0 -285
  324. claude_mpm/agents/templates/ops.json +0 -185
  325. claude_mpm/agents/templates/php-engineer.json +0 -287
  326. claude_mpm/agents/templates/product_owner.json +0 -338
  327. claude_mpm/agents/templates/project_organizer.json +0 -144
  328. claude_mpm/agents/templates/prompt-engineer.json +0 -737
  329. claude_mpm/agents/templates/python_engineer.json +0 -387
  330. claude_mpm/agents/templates/qa.json +0 -243
  331. claude_mpm/agents/templates/react_engineer.json +0 -239
  332. claude_mpm/agents/templates/refactoring_engineer.json +0 -276
  333. claude_mpm/agents/templates/research.json +0 -188
  334. claude_mpm/agents/templates/ruby-engineer.json +0 -280
  335. claude_mpm/agents/templates/rust_engineer.json +0 -275
  336. claude_mpm/agents/templates/security.json +0 -202
  337. claude_mpm/agents/templates/svelte-engineer.json +0 -225
  338. claude_mpm/agents/templates/tauri_engineer.json +0 -274
  339. claude_mpm/agents/templates/ticketing.json +0 -178
  340. claude_mpm/agents/templates/typescript_engineer.json +0 -285
  341. claude_mpm/agents/templates/vercel_ops_agent.json +0 -412
  342. claude_mpm/agents/templates/version_control.json +0 -159
  343. claude_mpm/agents/templates/web_qa.json +0 -400
  344. claude_mpm/agents/templates/web_ui.json +0 -189
  345. claude_mpm/cli/commands/agents_detect.py +0 -380
  346. claude_mpm/cli/commands/agents_recommend.py +0 -309
  347. claude_mpm/cli/ticket_cli.py +0 -35
  348. claude_mpm/commands/mpm-agents-detect.md +0 -168
  349. claude_mpm/commands/mpm-agents-recommend.md +0 -214
  350. claude_mpm/commands/mpm-agents.md +0 -122
  351. claude_mpm/commands/mpm-auto-configure.md +0 -269
  352. claude_mpm/commands/mpm-resume.md +0 -372
  353. claude_mpm/commands/mpm-tickets.md +0 -151
  354. claude_mpm/dashboard/.claude-mpm/socketio-instances.json +0 -1
  355. claude_mpm/dashboard/analysis_runner.py +0 -455
  356. claude_mpm/dashboard/index.html +0 -13
  357. claude_mpm/dashboard/open_dashboard.py +0 -66
  358. claude_mpm/dashboard/react/components/DataInspector/DataInspector.module.css +0 -188
  359. claude_mpm/dashboard/react/components/EventViewer/EventViewer.module.css +0 -156
  360. claude_mpm/dashboard/react/components/shared/ConnectionStatus.module.css +0 -38
  361. claude_mpm/dashboard/react/components/shared/FilterBar.module.css +0 -92
  362. claude_mpm/dashboard/static/archive/activity_dashboard_fixed.html +0 -248
  363. claude_mpm/dashboard/static/archive/activity_dashboard_test.html +0 -61
  364. claude_mpm/dashboard/static/archive/test_activity_connection.html +0 -179
  365. claude_mpm/dashboard/static/archive/test_claude_tree_tab.html +0 -68
  366. claude_mpm/dashboard/static/archive/test_dashboard.html +0 -409
  367. claude_mpm/dashboard/static/archive/test_dashboard_fixed.html +0 -519
  368. claude_mpm/dashboard/static/archive/test_dashboard_verification.html +0 -181
  369. claude_mpm/dashboard/static/archive/test_file_data.html +0 -315
  370. claude_mpm/dashboard/static/archive/test_file_tree_empty_state.html +0 -243
  371. claude_mpm/dashboard/static/archive/test_file_tree_fix.html +0 -234
  372. claude_mpm/dashboard/static/archive/test_file_tree_rename.html +0 -117
  373. claude_mpm/dashboard/static/archive/test_file_tree_tab.html +0 -115
  374. claude_mpm/dashboard/static/archive/test_file_viewer.html +0 -224
  375. claude_mpm/dashboard/static/archive/test_final_activity.html +0 -220
  376. claude_mpm/dashboard/static/archive/test_tab_fix.html +0 -139
  377. claude_mpm/dashboard/static/built/assets/events.DjpNxWNo.css +0 -1
  378. claude_mpm/dashboard/static/built/components/activity-tree.js +0 -2
  379. claude_mpm/dashboard/static/built/components/agent-hierarchy.js +0 -777
  380. claude_mpm/dashboard/static/built/components/agent-inference.js +0 -2
  381. claude_mpm/dashboard/static/built/components/build-tracker.js +0 -333
  382. claude_mpm/dashboard/static/built/components/code-simple.js +0 -857
  383. claude_mpm/dashboard/static/built/components/code-tree/tree-breadcrumb.js +0 -353
  384. claude_mpm/dashboard/static/built/components/code-tree/tree-constants.js +0 -235
  385. claude_mpm/dashboard/static/built/components/code-tree/tree-search.js +0 -409
  386. claude_mpm/dashboard/static/built/components/code-tree/tree-utils.js +0 -435
  387. claude_mpm/dashboard/static/built/components/code-tree.js +0 -2
  388. claude_mpm/dashboard/static/built/components/code-viewer.js +0 -2
  389. claude_mpm/dashboard/static/built/components/connection-debug.js +0 -654
  390. claude_mpm/dashboard/static/built/components/diff-viewer.js +0 -891
  391. claude_mpm/dashboard/static/built/components/event-processor.js +0 -2
  392. claude_mpm/dashboard/static/built/components/event-viewer.js +0 -2
  393. claude_mpm/dashboard/static/built/components/export-manager.js +0 -2
  394. claude_mpm/dashboard/static/built/components/file-change-tracker.js +0 -443
  395. claude_mpm/dashboard/static/built/components/file-change-viewer.js +0 -690
  396. claude_mpm/dashboard/static/built/components/file-tool-tracker.js +0 -2
  397. claude_mpm/dashboard/static/built/components/file-viewer.js +0 -2
  398. claude_mpm/dashboard/static/built/components/hud-library-loader.js +0 -2
  399. claude_mpm/dashboard/static/built/components/hud-manager.js +0 -2
  400. claude_mpm/dashboard/static/built/components/hud-visualizer.js +0 -2
  401. claude_mpm/dashboard/static/built/components/module-viewer.js +0 -2
  402. claude_mpm/dashboard/static/built/components/nav-bar.js +0 -145
  403. claude_mpm/dashboard/static/built/components/page-structure.js +0 -429
  404. claude_mpm/dashboard/static/built/components/session-manager.js +0 -2
  405. claude_mpm/dashboard/static/built/components/socket-manager.js +0 -2
  406. claude_mpm/dashboard/static/built/components/ui-state-manager.js +0 -2
  407. claude_mpm/dashboard/static/built/components/unified-data-viewer.js +0 -2
  408. claude_mpm/dashboard/static/built/components/working-directory.js +0 -2
  409. claude_mpm/dashboard/static/built/connection-manager.js +0 -536
  410. claude_mpm/dashboard/static/built/dashboard.js +0 -2
  411. claude_mpm/dashboard/static/built/extension-error-handler.js +0 -164
  412. claude_mpm/dashboard/static/built/react/events.js +0 -30
  413. claude_mpm/dashboard/static/built/shared/dom-helpers.js +0 -396
  414. claude_mpm/dashboard/static/built/shared/event-bus.js +0 -330
  415. claude_mpm/dashboard/static/built/shared/event-filter-service.js +0 -540
  416. claude_mpm/dashboard/static/built/shared/logger.js +0 -385
  417. claude_mpm/dashboard/static/built/shared/page-structure.js +0 -249
  418. claude_mpm/dashboard/static/built/shared/tooltip-service.js +0 -253
  419. claude_mpm/dashboard/static/built/socket-client.js +0 -2
  420. claude_mpm/dashboard/static/built/tab-isolation-fix.js +0 -185
  421. claude_mpm/dashboard/static/css/activity.css +0 -1958
  422. claude_mpm/dashboard/static/css/connection-status.css +0 -370
  423. claude_mpm/dashboard/static/css/dashboard.css +0 -4701
  424. claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +0 -1
  425. claude_mpm/dashboard/static/dist/components/activity-tree.js +0 -2
  426. claude_mpm/dashboard/static/dist/components/agent-inference.js +0 -2
  427. claude_mpm/dashboard/static/dist/components/code-tree.js +0 -2
  428. claude_mpm/dashboard/static/dist/components/code-viewer.js +0 -2
  429. claude_mpm/dashboard/static/dist/components/event-processor.js +0 -2
  430. claude_mpm/dashboard/static/dist/components/event-viewer.js +0 -2
  431. claude_mpm/dashboard/static/dist/components/export-manager.js +0 -2
  432. claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +0 -2
  433. claude_mpm/dashboard/static/dist/components/file-viewer.js +0 -2
  434. claude_mpm/dashboard/static/dist/components/hud-library-loader.js +0 -2
  435. claude_mpm/dashboard/static/dist/components/hud-manager.js +0 -2
  436. claude_mpm/dashboard/static/dist/components/hud-visualizer.js +0 -2
  437. claude_mpm/dashboard/static/dist/components/module-viewer.js +0 -2
  438. claude_mpm/dashboard/static/dist/components/session-manager.js +0 -2
  439. claude_mpm/dashboard/static/dist/components/socket-manager.js +0 -2
  440. claude_mpm/dashboard/static/dist/components/ui-state-manager.js +0 -2
  441. claude_mpm/dashboard/static/dist/components/unified-data-viewer.js +0 -2
  442. claude_mpm/dashboard/static/dist/components/working-directory.js +0 -2
  443. claude_mpm/dashboard/static/dist/dashboard.js +0 -2
  444. claude_mpm/dashboard/static/dist/react/events.js +0 -30
  445. claude_mpm/dashboard/static/dist/socket-client.js +0 -2
  446. claude_mpm/dashboard/static/events.html +0 -607
  447. claude_mpm/dashboard/static/index.html +0 -635
  448. claude_mpm/dashboard/static/js/components/activity-tree.js +0 -1871
  449. claude_mpm/dashboard/static/js/components/agent-hierarchy.js +0 -777
  450. claude_mpm/dashboard/static/js/components/agent-inference.js +0 -956
  451. claude_mpm/dashboard/static/js/components/build-tracker.js +0 -333
  452. claude_mpm/dashboard/static/js/components/code-simple.js +0 -857
  453. claude_mpm/dashboard/static/js/components/connection-debug.js +0 -654
  454. claude_mpm/dashboard/static/js/components/diff-viewer.js +0 -891
  455. claude_mpm/dashboard/static/js/components/event-processor.js +0 -542
  456. claude_mpm/dashboard/static/js/components/event-viewer.js +0 -1155
  457. claude_mpm/dashboard/static/js/components/export-manager.js +0 -368
  458. claude_mpm/dashboard/static/js/components/file-change-tracker.js +0 -443
  459. claude_mpm/dashboard/static/js/components/file-change-viewer.js +0 -690
  460. claude_mpm/dashboard/static/js/components/file-tool-tracker.js +0 -724
  461. claude_mpm/dashboard/static/js/components/file-viewer.js +0 -580
  462. claude_mpm/dashboard/static/js/components/hud-library-loader.js +0 -211
  463. claude_mpm/dashboard/static/js/components/hud-manager.js +0 -671
  464. claude_mpm/dashboard/static/js/components/hud-visualizer.js +0 -1718
  465. claude_mpm/dashboard/static/js/components/module-viewer.js +0 -2764
  466. claude_mpm/dashboard/static/js/components/session-manager.js +0 -579
  467. claude_mpm/dashboard/static/js/components/socket-manager.js +0 -368
  468. claude_mpm/dashboard/static/js/components/ui-state-manager.js +0 -749
  469. claude_mpm/dashboard/static/js/components/unified-data-viewer.js +0 -1824
  470. claude_mpm/dashboard/static/js/components/working-directory.js +0 -920
  471. claude_mpm/dashboard/static/js/connection-manager.js +0 -536
  472. claude_mpm/dashboard/static/js/dashboard.js +0 -1896
  473. claude_mpm/dashboard/static/js/extension-error-handler.js +0 -164
  474. claude_mpm/dashboard/static/js/shared/dom-helpers.js +0 -396
  475. claude_mpm/dashboard/static/js/shared/event-bus.js +0 -330
  476. claude_mpm/dashboard/static/js/shared/logger.js +0 -385
  477. claude_mpm/dashboard/static/js/shared/tooltip-service.js +0 -253
  478. claude_mpm/dashboard/static/js/socket-client.js +0 -1457
  479. claude_mpm/dashboard/static/js/stores/dashboard-store.js +0 -562
  480. claude_mpm/dashboard/static/js/tab-isolation-fix.js +0 -185
  481. claude_mpm/dashboard/static/legacy/activity.html +0 -736
  482. claude_mpm/dashboard/static/legacy/agents.html +0 -786
  483. claude_mpm/dashboard/static/legacy/files.html +0 -747
  484. claude_mpm/dashboard/static/legacy/tools.html +0 -831
  485. claude_mpm/dashboard/static/monitors.html +0 -431
  486. claude_mpm/dashboard/static/production/events.html +0 -659
  487. claude_mpm/dashboard/static/production/main.html +0 -698
  488. claude_mpm/dashboard/static/production/monitors.html +0 -483
  489. claude_mpm/dashboard/static/socket.io.min.js +0 -7
  490. claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +0 -7
  491. claude_mpm/dashboard/static/test-archive/dashboard.html +0 -635
  492. claude_mpm/dashboard/static/test-archive/debug-events.html +0 -147
  493. claude_mpm/dashboard/static/test-archive/test-navigation.html +0 -256
  494. claude_mpm/dashboard/static/test-archive/test-react-exports.html +0 -180
  495. claude_mpm/dashboard/static/test-archive/test_debug.html +0 -25
  496. claude_mpm/dashboard/templates/code_simple.html +0 -153
  497. claude_mpm/dashboard/templates/index.html +0 -606
  498. claude_mpm/dashboard/test_dashboard.html +0 -372
  499. claude_mpm/scripts/mcp_server.py +0 -75
  500. claude_mpm/scripts/mcp_wrapper.py +0 -39
  501. claude_mpm/services/mcp_gateway/__init__.py +0 -159
  502. claude_mpm/services/mcp_gateway/auto_configure.py +0 -369
  503. claude_mpm/services/mcp_gateway/config/__init__.py +0 -17
  504. claude_mpm/services/mcp_gateway/config/config_loader.py +0 -296
  505. claude_mpm/services/mcp_gateway/config/config_schema.py +0 -243
  506. claude_mpm/services/mcp_gateway/config/configuration.py +0 -429
  507. claude_mpm/services/mcp_gateway/core/__init__.py +0 -43
  508. claude_mpm/services/mcp_gateway/core/base.py +0 -312
  509. claude_mpm/services/mcp_gateway/core/exceptions.py +0 -253
  510. claude_mpm/services/mcp_gateway/core/interfaces.py +0 -443
  511. claude_mpm/services/mcp_gateway/core/process_pool.py +0 -971
  512. claude_mpm/services/mcp_gateway/core/singleton_manager.py +0 -315
  513. claude_mpm/services/mcp_gateway/core/startup_verification.py +0 -316
  514. claude_mpm/services/mcp_gateway/main.py +0 -589
  515. claude_mpm/services/mcp_gateway/registry/__init__.py +0 -12
  516. claude_mpm/services/mcp_gateway/registry/service_registry.py +0 -412
  517. claude_mpm/services/mcp_gateway/registry/tool_registry.py +0 -489
  518. claude_mpm/services/mcp_gateway/server/__init__.py +0 -15
  519. claude_mpm/services/mcp_gateway/server/mcp_gateway.py +0 -419
  520. claude_mpm/services/mcp_gateway/server/stdio_handler.py +0 -372
  521. claude_mpm/services/mcp_gateway/server/stdio_server.py +0 -714
  522. claude_mpm/services/mcp_gateway/tools/__init__.py +0 -36
  523. claude_mpm/services/mcp_gateway/tools/base_adapter.py +0 -485
  524. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +0 -789
  525. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +0 -654
  526. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +0 -456
  527. claude_mpm/services/mcp_gateway/tools/hello_world.py +0 -551
  528. claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +0 -551
  529. claude_mpm/services/mcp_gateway/utils/__init__.py +0 -14
  530. claude_mpm/services/mcp_gateway/utils/package_version_checker.py +0 -160
  531. claude_mpm/services/mcp_gateway/utils/update_preferences.py +0 -170
  532. claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +0 -79
  533. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +0 -178
  534. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +0 -577
  535. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +0 -467
  536. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +0 -537
  537. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +0 -730
  538. claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +0 -112
  539. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +0 -146
  540. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +0 -412
  541. claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +0 -81
  542. claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +0 -362
  543. claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +0 -312
  544. claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +0 -152
  545. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +0 -668
  546. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +0 -587
  547. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +0 -438
  548. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +0 -391
  549. claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +0 -119
  550. claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +0 -148
  551. claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +0 -483
  552. claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +0 -452
  553. claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +0 -449
  554. claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +0 -411
  555. claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +0 -14
  556. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +0 -58
  557. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +0 -68
  558. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +0 -69
  559. claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +0 -131
  560. claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +0 -325
  561. claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +0 -490
  562. claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +0 -425
  563. claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +0 -499
  564. claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +0 -86
  565. claude_mpm/skills/bundled/main/internal-comms/SKILL.md +0 -43
  566. claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +0 -47
  567. claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +0 -65
  568. claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +0 -30
  569. claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +0 -16
  570. claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +0 -160
  571. claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +0 -412
  572. claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +0 -602
  573. claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +0 -915
  574. claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +0 -916
  575. claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +0 -752
  576. claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +0 -1237
  577. claude_mpm/skills/bundled/main/skill-creator/SKILL.md +0 -189
  578. claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +0 -500
  579. claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +0 -464
  580. claude_mpm/skills/bundled/main/skill-creator/references/examples.md +0 -619
  581. claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +0 -437
  582. claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +0 -231
  583. claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +0 -170
  584. claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +0 -602
  585. claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +0 -821
  586. claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +0 -742
  587. claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +0 -726
  588. claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +0 -764
  589. claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +0 -831
  590. claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +0 -226
  591. claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +0 -901
  592. claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +0 -901
  593. claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +0 -775
  594. claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +0 -937
  595. claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +0 -770
  596. claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +0 -961
  597. claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +0 -119
  598. claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +0 -253
  599. claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +0 -145
  600. claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +0 -543
  601. claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +0 -741
  602. claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +0 -470
  603. claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +0 -458
  604. claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +0 -639
  605. claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +0 -140
  606. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +0 -572
  607. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +0 -411
  608. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +0 -569
  609. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +0 -695
  610. claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +0 -184
  611. claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +0 -459
  612. claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +0 -479
  613. claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +0 -687
  614. claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +0 -758
  615. claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +0 -868
  616. claude_mpm-4.24.0.dist-info/entry_points.txt +0 -10
  617. claude_mpm-4.24.0.dist-info/licenses/LICENSE +0 -21
  618. /claude_mpm/agents/templates/{git_file_tracking.md → git-file-tracking.md} +0 -0
  619. /claude_mpm/agents/templates/{pm_examples.md → pm-examples.md} +0 -0
  620. /claude_mpm/agents/templates/{response_format.md → response-format.md} +0 -0
  621. /claude_mpm/agents/templates/{validation_templates.md → validation-templates.md} +0 -0
  622. {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/WHEEL +0 -0
  623. {claude_mpm-4.24.0.dist-info → claude_mpm-5.4.41.dist-info}/top_level.txt +0 -0
@@ -1,1896 +0,0 @@
1
- /**
2
- * Refactored Dashboard Coordinator
3
- *
4
- * Main coordinator class that orchestrates all dashboard modules while maintaining
5
- * backward compatibility with the original dashboard interface.
6
- *
7
- * WHY: This refactored version breaks down the monolithic 4,133-line dashboard
8
- * into manageable, focused modules while preserving all existing functionality.
9
- * Each module handles a specific concern, improving maintainability and testability.
10
- *
11
- * DESIGN DECISION: Acts as a thin coordinator layer that initializes modules,
12
- * manages inter-module communication through events, and provides backward
13
- * compatibility for existing code that depends on the dashboard interface.
14
- */
15
-
16
- // NOTE: Components are loaded as ES6 modules via index.html
17
- // They expose their classes globally for backward compatibility
18
- // Commenting out ES6 imports to avoid module resolution errors
19
-
20
- // import { SocketManager } from './components/socket-manager.js';
21
- // import { EventViewer } from './components/event-viewer.js';
22
- // import { ModuleViewer } from './components/module-viewer.js';
23
- // import { SessionManager } from './components/session-manager.js';
24
- // import { AgentInference } from './components/agent-inference.js';
25
- // import { AgentHierarchy } from './components/agent-hierarchy.js';
26
- // import { UIStateManager } from './components/ui-state-manager.js';
27
- // import { EventProcessor } from './components/event-processor.js';
28
- // import { ExportManager } from './components/export-manager.js';
29
- // import { WorkingDirectoryManager } from './components/working-directory.js';
30
- // import { FileToolTracker } from './components/file-tool-tracker.js';
31
- // import { BuildTracker } from './components/build-tracker.js';
32
- // import { UnifiedDataViewer } from './components/unified-data-viewer.js';
33
-
34
- class Dashboard {
35
- constructor() {
36
- // Core components (existing)
37
- this.eventViewer = null;
38
- this.moduleViewer = null;
39
- this.sessionManager = null;
40
-
41
- // Retry prevention
42
- this.activityTreeRetryCount = 0;
43
- this.maxRetryAttempts = 10;
44
-
45
- // New modular components
46
- this.socketManager = null;
47
- this.agentInference = null;
48
- this.agentHierarchy = null;
49
- this.uiStateManager = null;
50
- this.eventProcessor = null;
51
- this.exportManager = null;
52
- this.workingDirectoryManager = null;
53
- this.fileToolTracker = null;
54
- this.buildTracker = null;
55
-
56
- // Initialize the dashboard
57
- this.init();
58
- }
59
-
60
- /**
61
- * Initialize the dashboard and all modules
62
- */
63
- init() {
64
- console.log('Initializing refactored Claude MPM Dashboard...');
65
-
66
- try {
67
- // Fetch server configuration first
68
- this.fetchServerConfig();
69
-
70
- // Initialize modules in dependency order
71
- this.initializeSocketManager();
72
- this.initializeCoreComponents();
73
- this.initializeBuildTracker();
74
- this.initializeAgentInference();
75
- this.initializeAgentHierarchy();
76
- this.initializeUIStateManager();
77
- this.initializeWorkingDirectoryManager();
78
- this.initializeFileToolTracker();
79
- this.initializeEventProcessor();
80
- this.initializeExportManager();
81
-
82
- // Set up inter-module communication
83
- this.setupModuleInteractions();
84
-
85
- // Initialize from URL parameters
86
- this.initializeFromURL();
87
-
88
- console.log('Claude MPM Dashboard initialized successfully');
89
- } catch (error) {
90
- console.error('Error during dashboard initialization:', error);
91
- // Re-throw to be caught by DOMContentLoaded handler
92
- throw error;
93
- }
94
- }
95
-
96
- /**
97
- * Fetch server configuration for dashboard initialization
98
- */
99
- fetchServerConfig() {
100
- fetch('/api/config')
101
- .then(response => response.json())
102
- .then(config => {
103
- // Store config globally for other components
104
- window.dashboardConfig = config;
105
-
106
- // Update initial UI elements if they exist
107
- const workingDirEl = document.getElementById('working-dir-path');
108
- if (workingDirEl && config.workingDirectory) {
109
- workingDirEl.textContent = config.workingDirectory;
110
- }
111
-
112
- const gitBranchEl = document.getElementById('footer-git-branch');
113
- if (gitBranchEl && config.gitBranch) {
114
- gitBranchEl.textContent = config.gitBranch;
115
- }
116
-
117
- console.log('Dashboard configuration loaded:', config);
118
- })
119
- .catch(error => {
120
- console.warn('Failed to fetch server config:', error);
121
- // Set default config as fallback
122
- window.dashboardConfig = {
123
- workingDirectory: '.',
124
- gitBranch: 'Unknown'
125
- };
126
- });
127
- }
128
-
129
- /**
130
- * Validate that all critical components are initialized
131
- * WHY: Ensures dashboard is in a valid state after initialization
132
- */
133
- validateInitialization() {
134
- const criticalComponents = [
135
- { name: 'socketManager', component: this.socketManager },
136
- { name: 'eventViewer', component: this.eventViewer },
137
- { name: 'agentHierarchy', component: this.agentHierarchy }
138
- ];
139
-
140
- const missing = criticalComponents.filter(c => !c.component);
141
- if (missing.length > 0) {
142
- console.warn('Missing critical components:', missing.map(c => c.name));
143
- }
144
- }
145
-
146
- /**
147
- * Post-initialization setup that requires window.dashboard to be set
148
- * WHY: Some components need to reference window.dashboard but it's not available
149
- * during constructor execution. This method is called after the Dashboard instance
150
- * is assigned to window.dashboard, ensuring proper initialization order.
151
- *
152
- * DESIGN DECISION: Separate post-init phase prevents "cannot read property of undefined"
153
- * errors when components try to access window.dashboard during construction.
154
- */
155
- postInit() {
156
- try {
157
- // Set global reference for agent hierarchy after dashboard is available
158
- if (this.agentHierarchy) {
159
- window.dashboard.agentHierarchy = this.agentHierarchy;
160
- }
161
-
162
- // Initialize any other components that need window.dashboard
163
- this.validateInitialization();
164
- } catch (error) {
165
- console.error('Error in dashboard postInit:', error);
166
- // Continue execution - non-critical error
167
- }
168
- }
169
-
170
- /**
171
- * Initialize socket manager
172
- */
173
- initializeSocketManager() {
174
- this.socketManager = new SocketManager();
175
-
176
- // Set up connection controls
177
- this.socketManager.setupConnectionControls();
178
-
179
- // Backward compatibility
180
- this.socketClient = this.socketManager.getSocketClient();
181
- window.socketClient = this.socketClient;
182
- }
183
-
184
- /**
185
- * Initialize core existing components
186
- */
187
- initializeCoreComponents() {
188
- // Initialize existing components with socket client
189
- this.eventViewer = new EventViewer('events-list', this.socketClient);
190
- this.moduleViewer = new ModuleViewer();
191
- this.sessionManager = new SessionManager(this.socketClient);
192
-
193
- // Backward compatibility
194
- window.eventViewer = this.eventViewer;
195
- window.moduleViewer = this.moduleViewer;
196
- window.sessionManager = this.sessionManager;
197
- }
198
-
199
- /**
200
- * Initialize build tracker
201
- */
202
- initializeBuildTracker() {
203
- this.buildTracker = new BuildTracker();
204
-
205
- // Set the socket client for receiving updates
206
- this.buildTracker.setSocketClient(this.socketClient);
207
-
208
- // Mount to header with retry logic for DOM readiness
209
- const mountBuildTracker = () => {
210
- const headerTitle = document.querySelector('.header-title');
211
- if (headerTitle) {
212
- // Insert after the title and status badge
213
- this.buildTracker.mount(headerTitle);
214
- console.log('BuildTracker mounted successfully');
215
- } else {
216
- console.warn('Header-title element not found for build tracker, will retry');
217
- // Retry after a short delay if DOM is still being constructed
218
- setTimeout(mountBuildTracker, 100);
219
- }
220
- };
221
-
222
- // Try to mount immediately, with retry logic if needed
223
- mountBuildTracker();
224
-
225
- // Make available globally for debugging
226
- window.buildTracker = this.buildTracker;
227
- }
228
-
229
- /**
230
- * Initialize agent inference system
231
- */
232
- initializeAgentInference() {
233
- this.agentInference = new AgentInference(this.eventViewer);
234
- this.agentInference.initialize();
235
- }
236
-
237
- /**
238
- * Initialize agent hierarchy component
239
- * WHY: Creates the agent hierarchy visualization component but defers global
240
- * reference setting to postInit() to avoid initialization order issues.
241
- */
242
- initializeAgentHierarchy() {
243
- try {
244
- this.agentHierarchy = new AgentHierarchy(this.agentInference, this.eventViewer);
245
- // Global reference will be set in postInit() after window.dashboard exists
246
- } catch (error) {
247
- console.error('Failed to initialize agent hierarchy:', error);
248
- // Create a stub to prevent further errors
249
- this.agentHierarchy = {
250
- render: () => '<div class="error">Agent hierarchy unavailable</div>',
251
- expandAllNodes: () => {},
252
- collapseAllNodes: () => {},
253
- updateWithNewEvents: () => {}
254
- };
255
- }
256
- }
257
-
258
- /**
259
- * Initialize UI state manager
260
- */
261
- initializeUIStateManager() {
262
- this.uiStateManager = new UIStateManager();
263
- this.setupTabFilters(); // Set up filters after UI state manager
264
- }
265
-
266
- /**
267
- * Initialize working directory manager
268
- */
269
- initializeWorkingDirectoryManager() {
270
- this.workingDirectoryManager = new WorkingDirectoryManager(this.socketManager);
271
- }
272
-
273
- /**
274
- * Initialize file-tool tracker
275
- */
276
- initializeFileToolTracker() {
277
- this.fileToolTracker = new FileToolTracker(this.agentInference, this.workingDirectoryManager);
278
- }
279
-
280
- /**
281
- * Initialize event processor
282
- */
283
- initializeEventProcessor() {
284
- this.eventProcessor = new EventProcessor(this.eventViewer, this.agentInference);
285
- }
286
-
287
-
288
- /**
289
- * Initialize export manager
290
- */
291
- initializeExportManager() {
292
- this.exportManager = new ExportManager(this.eventViewer);
293
- }
294
-
295
- /**
296
- * Set up interactions between modules
297
- */
298
- setupModuleInteractions() {
299
- // Socket events to update file operations and tool calls
300
- this.socketManager.onEventUpdate((events) => {
301
- console.log('[Dashboard] Processing event update with', events.length, 'events');
302
-
303
- // Debug: Log some sample events to see their structure
304
- if (events.length > 0) {
305
- console.log('[Dashboard] Sample event structure:', {
306
- first_event: events[0],
307
- has_tool_events: events.some(e => e.tool_name || (e.data && e.data.tool_name)),
308
- hook_events: events.filter(e => e.type === 'hook').length,
309
- tool_subtypes: events.filter(e => e.subtype === 'pre_tool' || e.subtype === 'post_tool').length
310
- });
311
- }
312
-
313
- this.fileToolTracker.updateFileOperations(events);
314
- this.fileToolTracker.updateToolCalls(events);
315
-
316
- // Debug: Check what was tracked
317
- const fileOps = this.fileToolTracker.getFileOperations();
318
- const toolCalls = this.fileToolTracker.getToolCalls();
319
- console.log('[Dashboard] After update - File operations:', fileOps.size, 'Tool calls:', toolCalls.size);
320
-
321
- // Process agent inference for new events
322
- this.agentInference.processAgentInference();
323
-
324
- // Update agent hierarchy with new events
325
- this.agentHierarchy.updateWithNewEvents(events);
326
-
327
- // Auto-scroll events list if on events tab
328
- if (this.uiStateManager.getCurrentTab() === 'events') {
329
- this.exportManager.scrollListToBottom('events-list');
330
- }
331
-
332
- // Re-render current tab
333
- this.renderCurrentTab();
334
- });
335
-
336
- // Connection status changes
337
- this.socketManager.onConnectionStatusChange((status, type) => {
338
- // Set up git branch listener when connected
339
- if (type === 'connected') {
340
- this.workingDirectoryManager.updateGitBranch(
341
- this.workingDirectoryManager.getCurrentWorkingDir()
342
- );
343
- }
344
- });
345
-
346
- // Tab changes
347
- document.addEventListener('tabChanged', (e) => {
348
- this.renderCurrentTab();
349
- this.uiStateManager.updateTabNavigationItems();
350
- });
351
-
352
- // Events clearing
353
- document.addEventListener('eventsClearing', () => {
354
- this.fileToolTracker.clear();
355
- this.agentInference.initialize();
356
- });
357
-
358
- // Card details requests
359
- document.addEventListener('showCardDetails', (e) => {
360
- this.showCardDetails(e.detail.tabName, e.detail.index);
361
- });
362
-
363
- // Session changes
364
- document.addEventListener('sessionFilterChanged', (e) => {
365
- this.renderCurrentTab();
366
- });
367
- }
368
-
369
- /**
370
- * Set up tab filters
371
- */
372
- setupTabFilters() {
373
- // Agents tab filters
374
- const agentsSearchInput = document.getElementById('agents-search-input');
375
- const agentsTypeFilter = document.getElementById('agents-type-filter');
376
-
377
- if (agentsSearchInput) {
378
- agentsSearchInput.addEventListener('input', () => {
379
- if (this.uiStateManager.getCurrentTab() === 'agents') this.renderCurrentTab();
380
- });
381
- }
382
-
383
- if (agentsTypeFilter) {
384
- agentsTypeFilter.addEventListener('change', () => {
385
- if (this.uiStateManager.getCurrentTab() === 'agents') this.renderCurrentTab();
386
- });
387
- }
388
-
389
- // Tools tab filters
390
- const toolsSearchInput = document.getElementById('tools-search-input');
391
- const toolsTypeFilter = document.getElementById('tools-type-filter');
392
-
393
- if (toolsSearchInput) {
394
- toolsSearchInput.addEventListener('input', () => {
395
- if (this.uiStateManager.getCurrentTab() === 'tools') this.renderCurrentTab();
396
- });
397
- }
398
-
399
- if (toolsTypeFilter) {
400
- toolsTypeFilter.addEventListener('change', () => {
401
- if (this.uiStateManager.getCurrentTab() === 'tools') this.renderCurrentTab();
402
- });
403
- }
404
-
405
- // Files tab filters
406
- const filesSearchInput = document.getElementById('files-search-input');
407
- const filesTypeFilter = document.getElementById('files-type-filter');
408
-
409
- if (filesSearchInput) {
410
- filesSearchInput.addEventListener('input', () => {
411
- if (this.uiStateManager.getCurrentTab() === 'files') this.renderCurrentTab();
412
- });
413
- }
414
-
415
- if (filesTypeFilter) {
416
- filesTypeFilter.addEventListener('change', () => {
417
- if (this.uiStateManager.getCurrentTab() === 'files') this.renderCurrentTab();
418
- });
419
- }
420
- }
421
-
422
- /**
423
- * Initialize from URL parameters
424
- */
425
- initializeFromURL() {
426
- const params = new URLSearchParams(window.location.search);
427
- this.socketManager.initializeFromURL(params);
428
- }
429
-
430
- /**
431
- * Render current tab content
432
- */
433
- renderCurrentTab() {
434
- const currentTab = this.uiStateManager.getCurrentTab();
435
-
436
- switch (currentTab) {
437
- case 'events':
438
- // Events tab is handled by EventViewer
439
- break;
440
- case 'activity':
441
- // Trigger Activity tab rendering through the component
442
- // Check if ActivityTree class is available (from built module)
443
- if (window.ActivityTree && typeof window.ActivityTree === 'function') {
444
- // Reset retry count on successful load
445
- this.activityTreeRetryCount = 0;
446
-
447
- // Create or get instance
448
- if (!window.activityTreeInstance) {
449
- window.activityTreeInstance = new window.ActivityTree();
450
- }
451
-
452
- // Initialize if needed and render
453
- if (window.activityTreeInstance) {
454
- if (!window.activityTreeInstance.initialized) {
455
- window.activityTreeInstance.initialize();
456
- }
457
-
458
- if (typeof window.activityTreeInstance.renderWhenVisible === 'function') {
459
- window.activityTreeInstance.renderWhenVisible();
460
- }
461
-
462
- // Force show to ensure the tree is visible
463
- if (typeof window.activityTreeInstance.forceShow === 'function') {
464
- window.activityTreeInstance.forceShow();
465
- }
466
- }
467
- } else if (window.activityTree && typeof window.activityTree === 'function') {
468
- // Fallback to legacy approach if available
469
- const activityTreeInstance = window.activityTree();
470
- if (activityTreeInstance) {
471
- if (typeof activityTreeInstance.renderWhenVisible === 'function') {
472
- activityTreeInstance.renderWhenVisible();
473
- }
474
- if (typeof activityTreeInstance.forceShow === 'function') {
475
- activityTreeInstance.forceShow();
476
- }
477
- }
478
- } else {
479
- // Module not loaded yet, retry after a delay (with retry limit)
480
- if (this.activityTreeRetryCount < this.maxRetryAttempts) {
481
- this.activityTreeRetryCount++;
482
- console.warn(`Activity tree component not available, retrying in 100ms... (attempt ${this.activityTreeRetryCount}/${this.maxRetryAttempts})`);
483
- setTimeout(() => {
484
- if (this.uiStateManager.getCurrentTab() === 'activity') {
485
- this.renderCurrentTab();
486
- }
487
- }, 100);
488
- } else {
489
- console.error('Maximum retry attempts reached for ActivityTree initialization. Giving up.');
490
- const activityContainer = document.getElementById('activity-tree-container') || document.getElementById('activity-tree');
491
- if (activityContainer) {
492
- activityContainer.innerHTML = '<div class="error-message">⚠️ Activity Tree failed to load. Please refresh the page.</div>';
493
- }
494
- }
495
- }
496
- break;
497
- case 'agents':
498
- this.renderAgents();
499
- break;
500
- case 'tools':
501
- this.renderTools();
502
- break;
503
- case 'files':
504
- this.renderFiles();
505
- break;
506
- }
507
-
508
- // Update selection UI if we have a selected card
509
- const selectedCard = this.uiStateManager.getSelectedCard();
510
- if (selectedCard.tab === currentTab) {
511
- this.uiStateManager.updateCardSelectionUI();
512
- }
513
-
514
- // Update unified selection UI to maintain consistency
515
- this.uiStateManager.updateUnifiedSelectionUI();
516
- }
517
-
518
- /**
519
- * Render agents tab with flat chronological view
520
- */
521
- renderAgents() {
522
- const agentsList = document.getElementById('agents-list');
523
- if (!agentsList) return;
524
-
525
- // Get filter values
526
- const searchText = document.getElementById('agents-search-input')?.value || '';
527
- const agentType = document.getElementById('agents-type-filter')?.value || '';
528
-
529
- // Generate flat HTML
530
- const flatHTML = this.renderAgentsFlat(searchText, agentType);
531
- agentsList.innerHTML = flatHTML;
532
-
533
- // Remove hierarchy controls if they exist
534
- this.removeHierarchyControls();
535
-
536
- // Update filter dropdowns with available agent types
537
- const uniqueInstances = this.agentInference.getUniqueAgentInstances();
538
- this.updateAgentsFilterDropdowns(uniqueInstances);
539
- }
540
-
541
- /**
542
- * Remove hierarchy control buttons (flat view doesn't need them)
543
- */
544
- removeHierarchyControls() {
545
- const existingControls = document.getElementById('hierarchy-controls');
546
- if (existingControls) {
547
- existingControls.remove();
548
- }
549
- }
550
-
551
- /**
552
- * Render agents as a flat chronological list
553
- * @param {string} searchText - Search filter
554
- * @param {string} agentType - Agent type filter
555
- * @returns {string} HTML for flat agent list
556
- */
557
- renderAgentsFlat(searchText, agentType) {
558
- const events = this.eventViewer.events;
559
- if (!events || events.length === 0) {
560
- return '<div class="no-events">No agent events found...</div>';
561
- }
562
-
563
- // Process agent inference to get agent mappings
564
- this.agentInference.processAgentInference();
565
- const eventAgentMap = this.agentInference.getEventAgentMap();
566
-
567
- // Collect all agent events with metadata
568
- const agentEvents = [];
569
- events.forEach((event, index) => {
570
- const inference = eventAgentMap.get(index);
571
- if (inference && (inference.type === 'subagent' || inference.type === 'main_agent')) {
572
- // Apply filters
573
- let includeEvent = true;
574
-
575
- if (searchText) {
576
- const searchLower = searchText.toLowerCase();
577
- includeEvent = includeEvent && (
578
- inference.agentName.toLowerCase().includes(searchLower) ||
579
- (event.tool_name && event.tool_name.toLowerCase().includes(searchLower)) ||
580
- (event.data && JSON.stringify(event.data).toLowerCase().includes(searchLower))
581
- );
582
- }
583
-
584
- if (agentType) {
585
- includeEvent = includeEvent && inference.agentName.includes(agentType);
586
- }
587
-
588
- if (includeEvent) {
589
- agentEvents.push({
590
- event,
591
- inference,
592
- index,
593
- timestamp: new Date(event.timestamp)
594
- });
595
- }
596
- }
597
- });
598
-
599
- if (agentEvents.length === 0) {
600
- return '<div class="no-events">No agent events match the current filters...</div>';
601
- }
602
-
603
- // Generate HTML for each event
604
- const html = agentEvents.map((item, listIndex) => {
605
- const { event, inference, index, timestamp } = item;
606
-
607
- // Determine action/tool
608
- let action = 'Activity';
609
- let actionIcon = '📋';
610
- let details = '';
611
-
612
- if (event.event_type === 'SubagentStart') {
613
- action = 'Started';
614
- actionIcon = '🟢';
615
- details = 'Agent session began';
616
- } else if (event.event_type === 'SubagentStop') {
617
- action = 'Stopped';
618
- actionIcon = '🔴';
619
- details = 'Agent session ended';
620
- } else if (event.tool_name) {
621
- action = `Tool: ${event.tool_name}`;
622
- actionIcon = this.getToolIcon(event.tool_name);
623
-
624
- // Add tool parameters as details
625
- if (event.data && event.data.tool_parameters) {
626
- const params = event.data.tool_parameters;
627
- if (params.file_path) {
628
- details = params.file_path;
629
- } else if (params.command) {
630
- details = params.command.substring(0, 50) + (params.command.length > 50 ? '...' : '');
631
- } else if (params.pattern) {
632
- details = `pattern="${params.pattern}"`;
633
- } else if (params.query) {
634
- details = `query="${params.query}"`;
635
- }
636
- }
637
- }
638
-
639
- // Status based on event type
640
- let status = 'completed';
641
- if (event.event_type === 'SubagentStart') {
642
- status = 'active';
643
- } else if (event.data && event.data.error) {
644
- status = 'error';
645
- }
646
-
647
- return `
648
- <div class="agent-event-item" data-index="${listIndex}" onclick="window.dashboard.showCardDetails('agents', ${index})">
649
- <div class="agent-event-header">
650
- <div class="agent-event-time">${this.formatTimestamp(timestamp)}</div>
651
- <div class="agent-event-agent">
652
- ${this.getAgentIcon(inference.agentName)} ${inference.agentName}
653
- </div>
654
- <div class="agent-event-action">
655
- ${actionIcon} ${action}
656
- </div>
657
- <div class="agent-event-status status-${status}">
658
- ${this.getStatusIcon(status)}
659
- </div>
660
- </div>
661
- ${details ? `<div class="agent-event-details">${this.escapeHtml(details)}</div>` : ''}
662
- </div>
663
- `;
664
- }).join('');
665
-
666
- return `<div class="agent-events-flat">${html}</div>`;
667
- }
668
-
669
- /**
670
- * Get icon for agent type
671
- */
672
- getAgentIcon(agentName) {
673
- const agentIcons = {
674
- 'PM': '🎯',
675
- 'Engineer Agent': '🔧',
676
- 'Research Agent': '🔍',
677
- 'QA Agent': '✅',
678
- 'Documentation Agent': '📝',
679
- 'Security Agent': '🔒',
680
- 'Ops Agent': '⚙️',
681
- 'Version Control Agent': '📦',
682
- 'Data Engineer Agent': '💾',
683
- 'Test Integration Agent': '🧪'
684
- };
685
- return agentIcons[agentName] || '🤖';
686
- }
687
-
688
- /**
689
- * Get icon for tool
690
- */
691
- getToolIcon(toolName) {
692
- const toolIcons = {
693
- 'Read': '📖',
694
- 'Write': '✏️',
695
- 'Edit': '📝',
696
- 'Bash': '💻',
697
- 'Grep': '🔍',
698
- 'Glob': '📂',
699
- 'LS': '📁',
700
- 'Task': '📋'
701
- };
702
- return toolIcons[toolName] || '🔧';
703
- }
704
-
705
- /**
706
- * Get icon for status
707
- */
708
- getStatusIcon(status) {
709
- const statusIcons = {
710
- 'active': '🟢',
711
- 'completed': '✅',
712
- 'error': '❌',
713
- 'pending': '🟡'
714
- };
715
- return statusIcons[status] || '❓';
716
- }
717
-
718
- /**
719
- * Format timestamp for display
720
- */
721
- formatTimestamp(timestamp) {
722
- return timestamp.toLocaleTimeString('en-US', {
723
- hour: '2-digit',
724
- minute: '2-digit',
725
- second: '2-digit',
726
- hour12: false
727
- });
728
- }
729
-
730
- /**
731
- * Escape HTML for safe display
732
- */
733
- escapeHtml(text) {
734
- if (!text) return '';
735
- const div = document.createElement('div');
736
- div.textContent = text;
737
- return div.innerHTML;
738
- }
739
-
740
- /**
741
- * Render tools tab with unique instance view (one row per unique tool call)
742
- */
743
- renderTools() {
744
- const toolsList = document.getElementById('tools-list');
745
- if (!toolsList) return;
746
-
747
- const toolCalls = this.fileToolTracker.getToolCalls();
748
- const toolCallsArray = Array.from(toolCalls.entries());
749
- const uniqueToolInstances = this.eventProcessor.getUniqueToolInstances(toolCallsArray);
750
- const toolHTML = this.eventProcessor.generateToolHTML(uniqueToolInstances);
751
-
752
- toolsList.innerHTML = toolHTML;
753
- this.exportManager.scrollListToBottom('tools-list');
754
-
755
- // Update filter dropdowns
756
- this.updateToolsFilterDropdowns(uniqueToolInstances);
757
- }
758
-
759
- /**
760
- * Render files tab with unique instance view (one row per unique file)
761
- */
762
- renderFiles() {
763
- const filesList = document.getElementById('files-list');
764
- if (!filesList) return;
765
-
766
- const fileOperations = this.fileToolTracker.getFileOperations();
767
- const filesArray = Array.from(fileOperations.entries());
768
-
769
- console.log('[renderFiles] File operations map size:', fileOperations.size);
770
- console.log('[renderFiles] Files array:', filesArray);
771
-
772
- const uniqueFileInstances = this.eventProcessor.getUniqueFileInstances(filesArray);
773
- const fileHTML = this.eventProcessor.generateFileHTML(uniqueFileInstances);
774
-
775
- if (filesArray.length === 0) {
776
- filesList.innerHTML = '<div class="empty-state">No file operations tracked yet. File operations will appear here when tools like Read, Write, Edit, or Grep are used.</div>';
777
- } else {
778
- filesList.innerHTML = fileHTML;
779
- }
780
-
781
- this.exportManager.scrollListToBottom('files-list');
782
-
783
- // Update filter dropdowns
784
- this.updateFilesFilterDropdowns(filesArray);
785
- }
786
-
787
- /**
788
- * Update agents filter dropdowns for unique instances
789
- */
790
- updateAgentsFilterDropdowns(uniqueInstances) {
791
- const agentTypes = new Set();
792
-
793
- // uniqueInstances is already an array of unique agent instances
794
- uniqueInstances.forEach(instance => {
795
- if (instance.agentName && instance.agentName !== 'Unknown') {
796
- agentTypes.add(instance.agentName);
797
- }
798
- });
799
-
800
- const sortedTypes = Array.from(agentTypes).filter(type => type && type.trim() !== '');
801
- this.populateFilterDropdown('agents-type-filter', sortedTypes, 'All Agent Types');
802
-
803
- // Agent filter types populated
804
- }
805
-
806
- /**
807
- * Update tools filter dropdowns
808
- */
809
- updateToolsFilterDropdowns(toolCallsArray) {
810
- const toolNames = [...new Set(toolCallsArray.map(([key, toolCall]) => toolCall.tool_name))]
811
- .filter(name => name);
812
-
813
- this.populateFilterDropdown('tools-type-filter', toolNames, 'All Tools');
814
- }
815
-
816
- /**
817
- * Update files filter dropdowns
818
- */
819
- updateFilesFilterDropdowns(filesArray) {
820
- const operations = [...new Set(filesArray.flatMap(([path, data]) =>
821
- data.operations.map(op => op.operation)
822
- ))].filter(op => op);
823
-
824
- this.populateFilterDropdown('files-type-filter', operations, 'All Operations');
825
- }
826
-
827
- /**
828
- * Populate filter dropdown with values
829
- */
830
- populateFilterDropdown(selectId, values, allOption = 'All') {
831
- const select = document.getElementById(selectId);
832
- if (!select) return;
833
-
834
- const currentValue = select.value;
835
- const sortedValues = values.sort((a, b) => a.localeCompare(b));
836
-
837
- // Clear existing options except the first "All" option
838
- select.innerHTML = `<option value="">${allOption}</option>`;
839
-
840
- // Add sorted values
841
- sortedValues.forEach(value => {
842
- const option = document.createElement('option');
843
- option.value = value;
844
- option.textContent = value;
845
- select.appendChild(option);
846
- });
847
-
848
- // Restore previous selection if it still exists
849
- if (currentValue && sortedValues.includes(currentValue)) {
850
- select.value = currentValue;
851
- }
852
- }
853
-
854
- /**
855
- * Show card details for specified tab and index
856
- */
857
- showCardDetails(tabName, index) {
858
- switch (tabName) {
859
- case 'events':
860
- if (this.eventViewer) {
861
- this.eventViewer.showEventDetails(index);
862
- }
863
- break;
864
- case 'agents':
865
- this.showAgentDetailsByIndex(index);
866
- break;
867
- case 'tools':
868
- this.showToolDetailsByIndex(index);
869
- break;
870
- case 'files':
871
- this.showFileDetailsByIndex(index);
872
- break;
873
- }
874
- }
875
-
876
- /**
877
- * Show agent details by index
878
- */
879
- showAgentDetailsByIndex(index) {
880
- const events = this.eventProcessor.getFilteredEventsForTab('agents');
881
-
882
- // Defensive checks
883
- if (!events || !Array.isArray(events) || index < 0 || index >= events.length) {
884
- console.warn('Dashboard: Invalid agent index or events array');
885
- return;
886
- }
887
-
888
- const filteredSingleEvent = this.eventProcessor.applyAgentsFilters([events[index]]);
889
-
890
- if (filteredSingleEvent.length > 0 && this.moduleViewer &&
891
- typeof this.moduleViewer.showAgentEvent === 'function') {
892
- const event = filteredSingleEvent[0];
893
- this.moduleViewer.showAgentEvent(event, index);
894
- }
895
- }
896
-
897
- /**
898
- * Show agent instance details for unique instance view
899
- * @param {string} instanceId - Agent instance ID
900
- */
901
- showAgentInstanceDetails(instanceId) {
902
- const pmDelegations = this.agentInference.getPMDelegations();
903
- const instance = pmDelegations.get(instanceId);
904
-
905
- if (!instance) {
906
- // Check if it's an implied delegation
907
- const uniqueInstances = this.agentInference.getUniqueAgentInstances();
908
- const impliedInstance = uniqueInstances.find(inst => inst.id === instanceId);
909
-
910
- if (!impliedInstance) {
911
- console.error('Agent instance not found:', instanceId);
912
- return;
913
- }
914
-
915
- // For implied instances, show basic info
916
- this.showImpliedAgentDetails(impliedInstance);
917
- return;
918
- }
919
-
920
- // Show full PM delegation details
921
- if (this.moduleViewer && typeof this.moduleViewer.showAgentInstance === 'function') {
922
- this.moduleViewer.showAgentInstance(instance);
923
- } else {
924
- // Fallback: show in console or basic modal
925
- console.log('Agent Instance Details:', {
926
- id: instanceId,
927
- agentName: instance.agentName,
928
- type: 'PM Delegation',
929
- eventCount: instance.agentEvents.length,
930
- startTime: instance.timestamp,
931
- pmCall: instance.pmCall
932
- });
933
- }
934
- }
935
-
936
- /**
937
- * Show implied agent details (agents without explicit PM delegation)
938
- * @param {Object} impliedInstance - Implied agent instance
939
- */
940
- showImpliedAgentDetails(impliedInstance) {
941
- if (this.moduleViewer && typeof this.moduleViewer.showImpliedAgent === 'function') {
942
- this.moduleViewer.showImpliedAgent(impliedInstance);
943
- } else {
944
- // Fallback: show in console or basic modal
945
- console.log('Implied Agent Details:', {
946
- id: impliedInstance.id,
947
- agentName: impliedInstance.agentName,
948
- type: 'Implied PM Delegation',
949
- eventCount: impliedInstance.eventCount,
950
- startTime: impliedInstance.timestamp,
951
- note: 'No explicit PM call found - inferred from agent activity'
952
- });
953
- }
954
- }
955
-
956
- /**
957
- * Show tool details by index
958
- */
959
- showToolDetailsByIndex(index) {
960
- const toolCalls = this.fileToolTracker.getToolCalls();
961
- const toolCallsArray = Array.from(toolCalls.entries());
962
- const filteredToolCalls = this.eventProcessor.applyToolCallFilters(toolCallsArray);
963
-
964
- if (index >= 0 && index < filteredToolCalls.length) {
965
- const [toolCallKey] = filteredToolCalls[index];
966
- this.showToolCallDetails(toolCallKey);
967
- }
968
- }
969
-
970
- /**
971
- * Show file details by index
972
- */
973
- showFileDetailsByIndex(index) {
974
- const fileOperations = this.fileToolTracker.getFileOperations();
975
- let filesArray = Array.from(fileOperations.entries());
976
- filesArray = this.eventProcessor.applyFilesFilters(filesArray);
977
-
978
- if (index >= 0 && index < filesArray.length) {
979
- const [filePath] = filesArray[index];
980
- this.showFileDetails(filePath);
981
- }
982
- }
983
-
984
- /**
985
- * Show tool call details
986
- */
987
- showToolCallDetails(toolCallKey) {
988
- const toolCall = this.fileToolTracker.getToolCall(toolCallKey);
989
- if (toolCall && this.moduleViewer) {
990
- this.moduleViewer.showToolCall(toolCall, toolCallKey);
991
- }
992
- }
993
-
994
- /**
995
- * Show file details
996
- */
997
- showFileDetails(filePath) {
998
- const fileData = this.fileToolTracker.getFileOperationsForFile(filePath);
999
- if (fileData && this.moduleViewer) {
1000
- this.moduleViewer.showFileOperations(fileData, filePath);
1001
- }
1002
- }
1003
-
1004
- // ====================================
1005
- // BACKWARD COMPATIBILITY METHODS
1006
- // ====================================
1007
-
1008
- /**
1009
- * Switch tab (backward compatibility)
1010
- */
1011
- switchTab(tabName) {
1012
- this.uiStateManager.switchTab(tabName);
1013
- }
1014
-
1015
- /**
1016
- * Select card (backward compatibility)
1017
- */
1018
- selectCard(tabName, index, type, data) {
1019
- this.uiStateManager.selectCard(tabName, index, type, data);
1020
- }
1021
-
1022
- /**
1023
- * Clear events (backward compatibility)
1024
- */
1025
- clearEvents() {
1026
- this.exportManager.clearEvents();
1027
- }
1028
-
1029
- /**
1030
- * Export events (backward compatibility)
1031
- */
1032
- exportEvents() {
1033
- this.exportManager.exportEvents();
1034
- }
1035
-
1036
- /**
1037
- * Clear selection (backward compatibility)
1038
- */
1039
- clearSelection() {
1040
- this.uiStateManager.clearSelection();
1041
- if (this.eventViewer) {
1042
- this.eventViewer.clearSelection();
1043
- }
1044
- if (this.moduleViewer) {
1045
- this.moduleViewer.clear();
1046
- }
1047
- }
1048
-
1049
-
1050
- /**
1051
- * Get current working directory (backward compatibility)
1052
- */
1053
- get currentWorkingDir() {
1054
- return this.workingDirectoryManager.getCurrentWorkingDir();
1055
- }
1056
-
1057
- /**
1058
- * Set current working directory (backward compatibility)
1059
- */
1060
- set currentWorkingDir(dir) {
1061
- this.workingDirectoryManager.setWorkingDirectory(dir);
1062
- }
1063
-
1064
- /**
1065
- * Get current tab (backward compatibility)
1066
- */
1067
- get currentTab() {
1068
- return this.uiStateManager.getCurrentTab();
1069
- }
1070
-
1071
- /**
1072
- * Get selected card (backward compatibility)
1073
- */
1074
- get selectedCard() {
1075
- return this.uiStateManager.getSelectedCard();
1076
- }
1077
-
1078
- /**
1079
- * Get file operations (backward compatibility)
1080
- */
1081
- get fileOperations() {
1082
- return this.fileToolTracker.getFileOperations();
1083
- }
1084
-
1085
- /**
1086
- * Get tool calls (backward compatibility)
1087
- */
1088
- get toolCalls() {
1089
- return this.fileToolTracker.getToolCalls();
1090
- }
1091
-
1092
-
1093
- /**
1094
- * Get tab navigation state (backward compatibility)
1095
- */
1096
- get tabNavigation() {
1097
- return this.uiStateManager ? this.uiStateManager.tabNavigation : null;
1098
- }
1099
- }
1100
-
1101
- // Global functions for backward compatibility
1102
- window.clearEvents = function() {
1103
- if (window.dashboard) {
1104
- window.dashboard.clearEvents();
1105
- }
1106
- };
1107
-
1108
- window.exportEvents = function() {
1109
- if (window.dashboard) {
1110
- window.dashboard.exportEvents();
1111
- }
1112
- };
1113
-
1114
- window.clearSelection = function() {
1115
- if (window.dashboard) {
1116
- window.dashboard.clearSelection();
1117
- }
1118
- };
1119
-
1120
- window.switchTab = function(tabName) {
1121
- if (window.dashboard) {
1122
- window.dashboard.switchTab(tabName);
1123
- }
1124
- };
1125
-
1126
- // File Viewer Modal Functions - Removed broken duplicate (using the one at line 1505)
1127
-
1128
- window.copyFileContent = function() {
1129
- const modal = document.getElementById('file-viewer-modal');
1130
- if (!modal) return;
1131
-
1132
- const codeElement = modal.querySelector('.file-content-code');
1133
- if (!codeElement) return;
1134
-
1135
- const text = codeElement.textContent;
1136
-
1137
- if (navigator.clipboard && navigator.clipboard.writeText) {
1138
- navigator.clipboard.writeText(text).then(() => {
1139
- // Show brief feedback
1140
- const button = modal.querySelector('.file-content-copy');
1141
- if (button) {
1142
- const originalText = button.textContent;
1143
- button.textContent = '✅ Copied!';
1144
- setTimeout(() => {
1145
- button.textContent = originalText;
1146
- }, 2000);
1147
- }
1148
- }).catch(err => {
1149
- console.error('Failed to copy text:', err);
1150
- });
1151
- } else {
1152
- // Fallback for older browsers
1153
- const textarea = document.createElement('textarea');
1154
- textarea.value = text;
1155
- document.body.appendChild(textarea);
1156
- textarea.select();
1157
- document.execCommand('copy');
1158
- document.body.removeChild(textarea);
1159
-
1160
- const button = modal.querySelector('.file-content-copy');
1161
- if (button) {
1162
- const originalText = button.textContent;
1163
- button.textContent = '✅ Copied!';
1164
- setTimeout(() => {
1165
- button.textContent = originalText;
1166
- }, 2000);
1167
- }
1168
- }
1169
- };
1170
-
1171
- function createFileViewerModal() {
1172
- const modal = document.createElement('div');
1173
- modal.id = 'file-viewer-modal';
1174
- modal.className = 'modal file-viewer-modal';
1175
-
1176
- modal.innerHTML = `
1177
- <div class="modal-content file-viewer-content">
1178
- <div class="file-viewer-header">
1179
- <h2 class="file-viewer-title">
1180
- <span class="file-viewer-icon">📄</span>
1181
- <span class="file-viewer-title-text">File Viewer</span>
1182
- </h2>
1183
- <div class="file-viewer-meta">
1184
- <span class="file-viewer-file-path"></span>
1185
- <span class="file-viewer-file-size"></span>
1186
- </div>
1187
- <button class="file-viewer-close" onclick="hideFileViewerModal()">
1188
- <span>&times;</span>
1189
- </button>
1190
- </div>
1191
- <div class="file-viewer-body">
1192
- <div class="file-viewer-loading">
1193
- <div class="loading-spinner"></div>
1194
- <span>Loading file content...</span>
1195
- </div>
1196
- <div class="file-viewer-error" style="display: none;">
1197
- <div class="error-icon">⚠️</div>
1198
- <div class="error-message"></div>
1199
- <div class="error-suggestions"></div>
1200
- </div>
1201
- <div class="file-viewer-content-area" style="display: none;">
1202
- <div class="file-viewer-toolbar">
1203
- <div class="file-viewer-info">
1204
- <span class="file-extension"></span>
1205
- <span class="file-encoding"></span>
1206
- </div>
1207
- <div class="file-viewer-actions">
1208
- <button class="file-content-copy" onclick="copyFileContent()">
1209
- 📋 Copy
1210
- </button>
1211
- </div>
1212
- </div>
1213
- <div class="file-viewer-scroll-wrapper">
1214
- <pre class="file-content-display"><code class="file-content-code"></code></pre>
1215
- </div>
1216
- </div>
1217
- </div>
1218
- </div>
1219
- `;
1220
-
1221
- // Close modal when clicking outside
1222
- modal.addEventListener('click', (e) => {
1223
- if (e.target === modal) {
1224
- hideFileViewerModal();
1225
- }
1226
- });
1227
-
1228
- // Close modal with Escape key
1229
- document.addEventListener('keydown', (e) => {
1230
- if (e.key === 'Escape' && modal.style.display === 'flex') {
1231
- hideFileViewerModal();
1232
- }
1233
- });
1234
-
1235
- return modal;
1236
- }
1237
-
1238
- async function updateFileViewerModal(modal, filePath, workingDir) {
1239
- // Update header info
1240
- const filePathElement = modal.querySelector('.file-viewer-file-path');
1241
- const fileSizeElement = modal.querySelector('.file-viewer-file-size');
1242
-
1243
- if (filePathElement) {
1244
- filePathElement.textContent = filePath;
1245
- }
1246
- if (fileSizeElement) {
1247
- fileSizeElement.textContent = '';
1248
- }
1249
-
1250
- // Show loading state
1251
- const loadingElement = modal.querySelector('.file-viewer-loading');
1252
- const errorElement = modal.querySelector('.file-viewer-error');
1253
- const contentArea = modal.querySelector('.file-viewer-content-area');
1254
-
1255
- if (loadingElement) {
1256
- loadingElement.style.display = 'flex';
1257
- }
1258
- if (errorElement) {
1259
- errorElement.style.display = 'none';
1260
- }
1261
- if (contentArea) {
1262
- contentArea.style.display = 'none';
1263
- }
1264
-
1265
- try {
1266
- // Get the Socket.IO client
1267
- const socket = window.socket || window.dashboard?.socketClient?.socket || window.socketClient?.socket;
1268
-
1269
- console.log('[FileViewer] Socket search results:', {
1270
- 'window.socket': !!window.socket,
1271
- 'window.socket.connected': window.socket?.connected,
1272
- 'dashboard.socketClient.socket': !!window.dashboard?.socketClient?.socket,
1273
- 'dashboard.socketClient.socket.connected': window.dashboard?.socketClient?.socket?.connected,
1274
- 'window.socketClient.socket': !!window.socketClient?.socket,
1275
- 'window.socketClient.socket.connected': window.socketClient?.socket?.connected
1276
- });
1277
-
1278
- if (!socket) {
1279
- throw new Error('No socket connection available. Please ensure the dashboard is connected.');
1280
- }
1281
-
1282
- if (!socket.connected) {
1283
- console.warn('[FileViewer] Socket found but not connected, attempting to use anyway...');
1284
- }
1285
-
1286
- console.log('[FileViewer] Socket found, setting up listener for file_content_response');
1287
-
1288
- // Set up one-time listener for file content response
1289
- const responsePromise = new Promise((resolve, reject) => {
1290
- const responseHandler = (data) => {
1291
- console.log('[FileViewer] Received file_content_response:', data);
1292
- if (data.file_path === filePath) {
1293
- socket.off('file_content_response', responseHandler);
1294
- if (data.success) {
1295
- console.log('[FileViewer] File content loaded successfully');
1296
- resolve(data);
1297
- } else {
1298
- console.error('[FileViewer] File read failed:', data.error);
1299
- reject(new Error(data.error || 'Failed to read file'));
1300
- }
1301
- }
1302
- };
1303
-
1304
- socket.on('file_content_response', responseHandler);
1305
- console.log('[FileViewer] Listener registered for file_content_response');
1306
-
1307
- // Timeout after 10 seconds
1308
- setTimeout(() => {
1309
- socket.off('file_content_response', responseHandler);
1310
- console.error('[FileViewer] Request timeout after 10 seconds');
1311
- reject(new Error('Request timeout - server did not respond'));
1312
- }, 10000);
1313
- });
1314
-
1315
- // Send file read request
1316
- const requestData = {
1317
- file_path: filePath,
1318
- working_dir: workingDir
1319
- };
1320
- console.log('[FileViewer] Emitting read_file event with data:', requestData);
1321
- socket.emit('read_file', requestData);
1322
-
1323
- // File viewer request sent
1324
-
1325
- // Wait for response
1326
- const result = await responsePromise;
1327
- // File content received successfully
1328
-
1329
- // Hide loading
1330
- const loadingEl = modal.querySelector('.file-viewer-loading');
1331
- if (loadingEl) {
1332
- loadingEl.style.display = 'none';
1333
- }
1334
-
1335
- // Show successful content
1336
- displayFileContent(modal, result);
1337
-
1338
- } catch (error) {
1339
- console.error('❌ Failed to fetch file content:', error);
1340
-
1341
- const loadingEl2 = modal.querySelector('.file-viewer-loading');
1342
- if (loadingEl2) {
1343
- loadingEl2.style.display = 'none';
1344
- }
1345
-
1346
- // Create detailed error message
1347
- let errorMessage = error.message || 'Unknown error occurred';
1348
- let suggestions = [];
1349
-
1350
- if (error.message.includes('No socket connection')) {
1351
- errorMessage = 'Failed to connect to the monitoring server';
1352
- suggestions = [
1353
- 'Check if the monitoring server is running',
1354
- 'Verify the socket connection in the dashboard',
1355
- 'Try refreshing the page and reconnecting'
1356
- ];
1357
- } else if (error.message.includes('timeout')) {
1358
- errorMessage = 'Request timed out';
1359
- suggestions = [
1360
- 'The file may be too large to load quickly',
1361
- 'Check your network connection',
1362
- 'Try again in a few moments'
1363
- ];
1364
- } else if (error.message.includes('File does not exist')) {
1365
- errorMessage = 'File not found';
1366
- suggestions = [
1367
- 'The file may have been moved or deleted',
1368
- 'Check the file path spelling',
1369
- 'Refresh the file list to see current files'
1370
- ];
1371
- } else if (error.message.includes('Access denied')) {
1372
- errorMessage = 'Access denied';
1373
- suggestions = [
1374
- 'The file is outside the allowed directories',
1375
- 'File access is restricted for security reasons'
1376
- ];
1377
- }
1378
-
1379
- displayFileError(modal, {
1380
- error: errorMessage,
1381
- file_path: filePath,
1382
- working_dir: workingDir,
1383
- suggestions: suggestions
1384
- });
1385
- }
1386
- }
1387
-
1388
- function displayFileContent(modal, result) {
1389
- // Display file content in modal
1390
- const contentArea = modal.querySelector('.file-viewer-content-area');
1391
- const extensionElement = modal.querySelector('.file-extension');
1392
- const encodingElement = modal.querySelector('.file-encoding');
1393
- const fileSizeElement = modal.querySelector('.file-viewer-file-size');
1394
- const codeElement = modal.querySelector('.file-content-code');
1395
-
1396
- // Update metadata
1397
- if (extensionElement) extensionElement.textContent = `Type: ${result.extension || 'unknown'}`;
1398
- if (encodingElement) encodingElement.textContent = `Encoding: ${result.encoding || 'unknown'}`;
1399
- if (fileSizeElement) fileSizeElement.textContent = `Size: ${formatFileSize(result.file_size)}`;
1400
-
1401
- // Update content with basic syntax highlighting
1402
- if (codeElement && result.content) {
1403
- // Setting file content
1404
- codeElement.innerHTML = highlightCode(result.content, result.extension);
1405
-
1406
- // Force scrolling to work by setting explicit heights
1407
- const wrapper = modal.querySelector('.file-viewer-scroll-wrapper');
1408
- if (wrapper) {
1409
- // Give it a moment for content to render
1410
- setTimeout(() => {
1411
- const modalContent = modal.querySelector('.modal-content');
1412
- const header = modal.querySelector('.file-viewer-header');
1413
- const toolbar = modal.querySelector('.file-viewer-toolbar');
1414
-
1415
- const modalHeight = modalContent?.offsetHeight || 0;
1416
- const headerHeight = header?.offsetHeight || 0;
1417
- const toolbarHeight = toolbar?.offsetHeight || 0;
1418
-
1419
- const availableHeight = modalHeight - headerHeight - toolbarHeight - 40; // 40px for padding
1420
-
1421
- // Setting file viewer scroll height
1422
-
1423
- wrapper.style.maxHeight = `${availableHeight}px`;
1424
- wrapper.style.overflowY = 'auto';
1425
- }, 50);
1426
- }
1427
- } else {
1428
- console.warn('⚠️ Missing codeElement or file content');
1429
- }
1430
-
1431
- // Show content area
1432
- if (contentArea) {
1433
- contentArea.style.display = 'block';
1434
- // File content area displayed
1435
- }
1436
- }
1437
-
1438
- function displayFileError(modal, result) {
1439
- const errorArea = modal.querySelector('.file-viewer-error');
1440
- const messageElement = modal.querySelector('.error-message');
1441
- const suggestionsElement = modal.querySelector('.error-suggestions');
1442
-
1443
- let errorMessage = result.error || 'Unknown error occurred';
1444
-
1445
- if (messageElement) {
1446
- messageElement.innerHTML = `
1447
- <div class="error-main">${errorMessage}</div>
1448
- ${result.file_path ? `<div class="error-file">File: ${result.file_path}</div>` : ''}
1449
- ${result.working_dir ? `<div class="error-dir">Working directory: ${result.working_dir}</div>` : ''}
1450
- `;
1451
- }
1452
-
1453
- if (suggestionsElement) {
1454
- if (result.suggestions && result.suggestions.length > 0) {
1455
- suggestionsElement.innerHTML = `
1456
- <h4>Suggestions:</h4>
1457
- <ul>
1458
- ${result.suggestions.map(s => `<li>${s}</li>`).join('')}
1459
- </ul>
1460
- `;
1461
- } else {
1462
- suggestionsElement.innerHTML = '';
1463
- }
1464
- }
1465
-
1466
- console.log('📋 Displaying file viewer error:', {
1467
- originalError: result.error,
1468
- processedMessage: errorMessage,
1469
- suggestions: result.suggestions
1470
- });
1471
-
1472
- if (errorArea) {
1473
- errorArea.style.display = 'block';
1474
- }
1475
- }
1476
-
1477
- function highlightCode(code, extension) {
1478
- /**
1479
- * Apply basic syntax highlighting to code content
1480
- * WHY: Provides basic highlighting for common file types to improve readability.
1481
- * This is a simple implementation that can be enhanced with full syntax highlighting
1482
- * libraries like highlight.js or Prism.js if needed.
1483
- */
1484
-
1485
- // Escape HTML entities first
1486
- const escaped = code
1487
- .replace(/&/g, '&amp;')
1488
- .replace(/</g, '&lt;')
1489
- .replace(/>/g, '&gt;');
1490
-
1491
- // Basic highlighting based on file extension
1492
- switch (extension) {
1493
- case '.js':
1494
- case '.jsx':
1495
- case '.ts':
1496
- case '.tsx':
1497
- return highlightJavaScript(escaped);
1498
- case '.py':
1499
- return highlightPython(escaped);
1500
- case '.json':
1501
- return highlightJSON(escaped);
1502
- case '.css':
1503
- return highlightCSS(escaped);
1504
- case '.html':
1505
- case '.htm':
1506
- return highlightHTML(escaped);
1507
- case '.md':
1508
- case '.markdown':
1509
- return highlightMarkdown(escaped);
1510
- default:
1511
- // Return with line numbers for plain text
1512
- return addLineNumbers(escaped);
1513
- }
1514
- }
1515
-
1516
- function highlightJavaScript(code) {
1517
- return addLineNumbers(code
1518
- .replace(/\b(function|const|let|var|if|else|for|while|return|import|export|class|extends)\b/g, '<span class="keyword">$1</span>')
1519
- .replace(/(\/\*[\s\S]*?\*\/|\/\/.*)/g, '<span class="comment">$1</span>')
1520
- .replace(/('[^']*'|"[^"]*"|`[^`]*`)/g, '<span class="string">$1</span>')
1521
- .replace(/\b(\d+)\b/g, '<span class="number">$1</span>'));
1522
- }
1523
-
1524
- function highlightPython(code) {
1525
- return addLineNumbers(code
1526
- .replace(/\b(def|class|if|elif|else|for|while|return|import|from|as|try|except|finally|with)\b/g, '<span class="keyword">$1</span>')
1527
- .replace(/(#.*)/g, '<span class="comment">$1</span>')
1528
- .replace(/('[^']*'|"[^"]*"|"""[\s\S]*?""")/g, '<span class="string">$1</span>')
1529
- .replace(/\b(\d+)\b/g, '<span class="number">$1</span>'));
1530
- }
1531
-
1532
- function highlightJSON(code) {
1533
- return addLineNumbers(code
1534
- .replace(/("[\w\s]*")\s*:/g, '<span class="property">$1</span>:')
1535
- .replace(/:\s*(".*?")/g, ': <span class="string">$1</span>')
1536
- .replace(/:\s*(\d+)/g, ': <span class="number">$1</span>')
1537
- .replace(/:\s*(true|false|null)/g, ': <span class="keyword">$1</span>'));
1538
- }
1539
-
1540
- function highlightCSS(code) {
1541
- return addLineNumbers(code
1542
- .replace(/([.#]?[\w-]+)\s*\{/g, '<span class="selector">$1</span> {')
1543
- .replace(/([\w-]+)\s*:/g, '<span class="property">$1</span>:')
1544
- .replace(/:\s*([^;]+);/g, ': <span class="value">$1</span>;')
1545
- .replace(/(\/\*[\s\S]*?\*\/)/g, '<span class="comment">$1</span>'));
1546
- }
1547
-
1548
- function highlightHTML(code) {
1549
- return addLineNumbers(code
1550
- .replace(/(&lt;\/?[\w-]+)/g, '<span class="tag">$1</span>')
1551
- .replace(/([\w-]+)=(['"][^'"]*['"])/g, '<span class="attribute">$1</span>=<span class="string">$2</span>')
1552
- .replace(/(&lt;!--[\s\S]*?--&gt;)/g, '<span class="comment">$1</span>'));
1553
- }
1554
-
1555
- function highlightMarkdown(code) {
1556
- return addLineNumbers(code
1557
- .replace(/^(#{1,6})\s+(.*)$/gm, '<span class="header">$1</span> <span class="header-text">$2</span>')
1558
- .replace(/\*\*(.*?)\*\*/g, '<span class="bold">**$1**</span>')
1559
- .replace(/\*(.*?)\*/g, '<span class="italic">*$1*</span>')
1560
- .replace(/`([^`]+)`/g, '<span class="code">`$1`</span>')
1561
- .replace(/^\s*[-*+]\s+(.*)$/gm, '<span class="list-marker">•</span> $1'));
1562
- }
1563
-
1564
- function addLineNumbers(code) {
1565
- const lines = code.split('\n');
1566
- return lines.map((line, index) =>
1567
- `<span class="line-number">${String(index + 1).padStart(3, ' ')}</span> ${line || ' '}`
1568
- ).join('\n');
1569
- }
1570
-
1571
- function formatFileSize(bytes) {
1572
- if (!bytes) return '0 B';
1573
- const k = 1024;
1574
- const sizes = ['B', 'KB', 'MB', 'GB'];
1575
- const i = Math.floor(Math.log(bytes) / Math.log(k));
1576
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
1577
- }
1578
-
1579
- // File Viewer Modal Functions
1580
- window.showFileViewerModal = async function(filePath) {
1581
- console.log('[FileViewer] Opening file:', filePath);
1582
-
1583
- // Use the dashboard's current working directory
1584
- let workingDir = '';
1585
- if (window.dashboard && window.dashboard.currentWorkingDir) {
1586
- workingDir = window.dashboard.currentWorkingDir;
1587
- console.log('[FileViewer] Using working directory:', workingDir);
1588
- }
1589
-
1590
- // Create modal if it doesn't exist
1591
- let modal = document.getElementById('file-viewer-modal');
1592
- if (!modal) {
1593
- console.log('[FileViewer] Creating new modal');
1594
- modal = createFileViewerModal();
1595
- document.body.appendChild(modal);
1596
-
1597
- // Small delay to ensure DOM is fully updated
1598
- await new Promise(resolve => setTimeout(resolve, 10));
1599
- }
1600
-
1601
- // Show the modal as flex container first (ensures proper rendering)
1602
- modal.style.display = 'flex';
1603
- document.body.style.overflow = 'hidden'; // Prevent background scrolling
1604
-
1605
- // Update modal content
1606
- updateFileViewerModal(modal, filePath, workingDir).catch(error => {
1607
- console.error('Error updating file viewer modal:', error);
1608
- // Show error in the modal
1609
- displayFileContentError(modal, { error: error.message });
1610
- });
1611
- };
1612
-
1613
- window.hideFileViewerModal = function() {
1614
- const modal = document.getElementById('file-viewer-modal');
1615
- if (modal) {
1616
- modal.style.display = 'none';
1617
- document.body.style.overflow = ''; // Restore background scrolling
1618
- }
1619
- };
1620
-
1621
- window.copyFileContent = function() {
1622
- const modal = document.getElementById('file-viewer-modal');
1623
- if (!modal) return;
1624
-
1625
- const codeElement = modal.querySelector('.file-content-code');
1626
- if (!codeElement) return;
1627
-
1628
- const text = codeElement.textContent;
1629
-
1630
- if (navigator.clipboard && navigator.clipboard.writeText) {
1631
- navigator.clipboard.writeText(text).then(() => {
1632
- // Show brief feedback
1633
- const button = modal.querySelector('.file-content-copy');
1634
- if (button) {
1635
- const originalText = button.textContent;
1636
- button.textContent = '✅ Copied!';
1637
- setTimeout(() => {
1638
- button.textContent = originalText;
1639
- }, 2000);
1640
- }
1641
- }).catch(err => {
1642
- console.error('Failed to copy text:', err);
1643
- });
1644
- } else {
1645
- // Fallback for older browsers
1646
- const textarea = document.createElement('textarea');
1647
- textarea.value = text;
1648
- document.body.appendChild(textarea);
1649
- textarea.select();
1650
- document.execCommand('copy');
1651
- document.body.removeChild(textarea);
1652
-
1653
- const button = modal.querySelector('.file-content-copy');
1654
- if (button) {
1655
- const originalText = button.textContent;
1656
- button.textContent = '✅ Copied!';
1657
- setTimeout(() => {
1658
- button.textContent = originalText;
1659
- }, 2000);
1660
- }
1661
- }
1662
- };
1663
-
1664
-
1665
-
1666
-
1667
- function displayFileContentError(modal, result) {
1668
- const errorArea = modal.querySelector('.file-viewer-error');
1669
- const messageElement = modal.querySelector('.error-message');
1670
- const suggestionsElement = modal.querySelector('.error-suggestions');
1671
- const loadingElement = modal.querySelector('.file-viewer-loading');
1672
- const contentArea = modal.querySelector('.file-viewer-content-area');
1673
-
1674
- // Hide loading and content areas, show error
1675
- if (loadingElement) {
1676
- loadingElement.style.display = 'none';
1677
- }
1678
- if (contentArea) {
1679
- contentArea.style.display = 'none';
1680
- }
1681
- if (errorArea) {
1682
- errorArea.style.display = 'flex';
1683
- }
1684
-
1685
- // Create user-friendly error messages
1686
- let errorMessage = result.error || 'Unknown error occurred';
1687
-
1688
- if (errorMessage.includes('not found')) {
1689
- errorMessage = '📁 File not found or not accessible';
1690
- } else if (errorMessage.includes('permission')) {
1691
- errorMessage = '🔒 Permission denied accessing this file';
1692
- } else if (errorMessage.includes('too large')) {
1693
- errorMessage = '📏 File is too large to display';
1694
- } else if (errorMessage.includes('socket connection')) {
1695
- errorMessage = '🔌 Not connected to the server. Please check your connection.';
1696
- } else if (errorMessage.includes('timeout')) {
1697
- errorMessage = '⏱️ Request timed out. The server may be busy or unresponsive.';
1698
- } else if (!errorMessage.includes('📁') && !errorMessage.includes('🔒') && !errorMessage.includes('📏')) {
1699
- errorMessage = `⚠️ ${errorMessage}`;
1700
- }
1701
-
1702
- if (messageElement) {
1703
- messageElement.textContent = errorMessage;
1704
- }
1705
-
1706
- // Add suggestions if available
1707
- if (suggestionsElement) {
1708
- if (result.suggestions && result.suggestions.length > 0) {
1709
- suggestionsElement.innerHTML = `
1710
- <h4>Suggestions:</h4>
1711
- <ul>
1712
- ${result.suggestions.map(suggestion => `<li>${suggestion}</li>`).join('')}
1713
- </ul>
1714
- `;
1715
- } else {
1716
- suggestionsElement.innerHTML = `
1717
- <h4>Try:</h4>
1718
- <ul>
1719
- <li>Check if the file exists and is readable</li>
1720
- <li>Verify file permissions</li>
1721
- <li>Ensure the monitoring server has access to this file</li>
1722
- </ul>
1723
- `;
1724
- }
1725
- }
1726
-
1727
- console.log('📋 Displaying file content error:', {
1728
- originalError: result.error,
1729
- processedMessage: errorMessage,
1730
- suggestions: result.suggestions
1731
- });
1732
-
1733
- if (errorArea) {
1734
- errorArea.style.display = 'block';
1735
- }
1736
- }
1737
-
1738
- // Search Viewer Modal Functions
1739
- window.showSearchViewerModal = function(searchParams, searchResults) {
1740
- // Create modal if it doesn't exist
1741
- let modal = document.getElementById('search-viewer-modal');
1742
- if (!modal) {
1743
- modal = createSearchViewerModal();
1744
- document.body.appendChild(modal);
1745
- }
1746
-
1747
- // Update modal content
1748
- updateSearchViewerModal(modal, searchParams, searchResults);
1749
-
1750
- // Show the modal as flex container
1751
- modal.style.display = 'flex';
1752
- document.body.style.overflow = 'hidden'; // Prevent background scrolling
1753
- };
1754
-
1755
- window.hideSearchViewerModal = function() {
1756
- const modal = document.getElementById('search-viewer-modal');
1757
- if (modal) {
1758
- modal.style.display = 'none';
1759
- document.body.style.overflow = ''; // Restore background scrolling
1760
- }
1761
- };
1762
-
1763
- function createSearchViewerModal() {
1764
- const modal = document.createElement('div');
1765
- modal.id = 'search-viewer-modal';
1766
- modal.className = 'modal search-viewer-modal';
1767
-
1768
- modal.innerHTML = `
1769
- <div class="modal-content search-viewer-content">
1770
- <div class="search-viewer-header">
1771
- <h2 class="search-viewer-title">
1772
- <span class="search-viewer-icon">🔍</span>
1773
- <span class="search-viewer-title-text">Search Results</span>
1774
- </h2>
1775
- <button class="search-viewer-close" onclick="hideSearchViewerModal()">
1776
- <span>&times;</span>
1777
- </button>
1778
- </div>
1779
- <div class="search-viewer-body">
1780
- <div class="search-params-section">
1781
- <h3>Search Parameters</h3>
1782
- <pre class="search-params-display"></pre>
1783
- </div>
1784
- <div class="search-results-section">
1785
- <h3>Search Results</h3>
1786
- <div class="search-results-display"></div>
1787
- </div>
1788
- </div>
1789
- </div>
1790
- `;
1791
-
1792
- // Close modal when clicking outside
1793
- modal.addEventListener('click', (e) => {
1794
- if (e.target === modal) {
1795
- hideSearchViewerModal();
1796
- }
1797
- });
1798
-
1799
- // Close modal on Escape key
1800
- document.addEventListener('keydown', (e) => {
1801
- if (e.key === 'Escape' && modal.style.display === 'flex') {
1802
- hideSearchViewerModal();
1803
- }
1804
- });
1805
-
1806
- return modal;
1807
- }
1808
-
1809
- function updateSearchViewerModal(modal, searchParams, searchResults) {
1810
- const paramsDisplay = modal.querySelector('.search-params-display');
1811
- const resultsDisplay = modal.querySelector('.search-results-display');
1812
-
1813
- // Display search parameters in formatted JSON
1814
- if (paramsDisplay && searchParams) {
1815
- paramsDisplay.textContent = JSON.stringify(searchParams, null, 2);
1816
- }
1817
-
1818
- // Display search results
1819
- if (resultsDisplay && searchResults) {
1820
- let resultsHTML = '';
1821
-
1822
- if (typeof searchResults === 'string') {
1823
- // If results are a string, display as preformatted text
1824
- resultsHTML = `<pre class="search-results-text">${escapeHtml(searchResults)}</pre>`;
1825
- } else if (Array.isArray(searchResults)) {
1826
- // If results are an array, display as a list
1827
- resultsHTML = '<ul class="search-results-list">';
1828
- searchResults.forEach(result => {
1829
- if (typeof result === 'object') {
1830
- resultsHTML += `<li><pre>${JSON.stringify(result, null, 2)}</pre></li>`;
1831
- } else {
1832
- resultsHTML += `<li>${escapeHtml(String(result))}</li>`;
1833
- }
1834
- });
1835
- resultsHTML += '</ul>';
1836
- } else if (typeof searchResults === 'object') {
1837
- // If results are an object, display as formatted JSON
1838
- resultsHTML = `<pre class="search-results-json">${JSON.stringify(searchResults, null, 2)}</pre>`;
1839
- } else {
1840
- // Fallback: display as text
1841
- resultsHTML = `<div class="search-results-text">${escapeHtml(String(searchResults))}</div>`;
1842
- }
1843
-
1844
- resultsDisplay.innerHTML = resultsHTML;
1845
- }
1846
- }
1847
-
1848
- function escapeHtml(text) {
1849
- const div = document.createElement('div');
1850
- div.textContent = text;
1851
- return div.innerHTML;
1852
- }
1853
-
1854
- // Global window functions for backward compatibility
1855
- window.showAgentInstanceDetails = function(instanceId) {
1856
- if (window.dashboard && typeof window.dashboard.showAgentInstanceDetails === 'function') {
1857
- window.dashboard.showAgentInstanceDetails(instanceId);
1858
- } else {
1859
- console.error('Dashboard not available or method not found');
1860
- }
1861
- };
1862
-
1863
- // Initialize dashboard when page loads
1864
- document.addEventListener('DOMContentLoaded', function() {
1865
- try {
1866
- // Create dashboard instance
1867
- window.dashboard = new Dashboard();
1868
-
1869
- // Call post-initialization setup that requires window.dashboard
1870
- // This must happen after window.dashboard is set
1871
- if (window.dashboard && typeof window.dashboard.postInit === 'function') {
1872
- window.dashboard.postInit();
1873
- }
1874
-
1875
- console.log('Dashboard loaded and initialized successfully');
1876
-
1877
- // Dispatch custom event to signal dashboard ready
1878
- document.dispatchEvent(new CustomEvent('dashboardReady', {
1879
- detail: { dashboard: window.dashboard }
1880
- }));
1881
- } catch (error) {
1882
- console.error('Failed to initialize dashboard:', error);
1883
- // Show user-friendly error message
1884
- document.body.innerHTML = `
1885
- <div style="padding: 20px; font-family: sans-serif;">
1886
- <h1>Dashboard Initialization Error</h1>
1887
- <p>The dashboard failed to load properly. Please refresh the page or check the console for details.</p>
1888
- <pre style="background: #f5f5f5; padding: 10px; border-radius: 4px;">${error.message}</pre>
1889
- </div>
1890
- `;
1891
- }
1892
- });
1893
-
1894
- // ES6 Module export
1895
- export { Dashboard };
1896
- export default Dashboard;