claude-mpm 4.2.43__py3-none-any.whl → 4.2.51__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.
Files changed (155) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_PM.md +117 -12
  3. claude_mpm/agents/INSTRUCTIONS.md +154 -10
  4. claude_mpm/agents/WORKFLOW.md +46 -1
  5. claude_mpm/agents/frontmatter_validator.py +20 -12
  6. claude_mpm/agents/templates/nextjs_engineer.json +277 -0
  7. claude_mpm/agents/templates/python_engineer.json +289 -0
  8. claude_mpm/agents/templates/react_engineer.json +11 -3
  9. claude_mpm/agents/templates/security.json +50 -9
  10. claude_mpm/cli/commands/agents.py +2 -2
  11. claude_mpm/cli/commands/uninstall.py +1 -2
  12. claude_mpm/cli/interactive/agent_wizard.py +3 -3
  13. claude_mpm/cli/parsers/agent_manager_parser.py +3 -3
  14. claude_mpm/cli/parsers/agents_parser.py +1 -1
  15. claude_mpm/constants.py +1 -1
  16. claude_mpm/core/api_validator.py +330 -0
  17. claude_mpm/core/error_handler.py +2 -4
  18. claude_mpm/core/file_utils.py +4 -12
  19. claude_mpm/core/framework_loader.py +22 -0
  20. claude_mpm/core/log_manager.py +8 -5
  21. claude_mpm/core/logger.py +1 -1
  22. claude_mpm/core/logging_utils.py +6 -6
  23. claude_mpm/core/unified_agent_registry.py +18 -4
  24. claude_mpm/dashboard/react/components/DataInspector/DataInspector.module.css +188 -0
  25. claude_mpm/dashboard/react/components/EventViewer/EventViewer.module.css +156 -0
  26. claude_mpm/dashboard/react/components/shared/ConnectionStatus.module.css +38 -0
  27. claude_mpm/dashboard/react/components/shared/FilterBar.module.css +92 -0
  28. claude_mpm/dashboard/static/archive/activity_dashboard_fixed.html +248 -0
  29. claude_mpm/dashboard/static/archive/activity_dashboard_test.html +61 -0
  30. claude_mpm/dashboard/static/archive/test_activity_connection.html +179 -0
  31. claude_mpm/dashboard/static/archive/test_claude_tree_tab.html +68 -0
  32. claude_mpm/dashboard/static/archive/test_dashboard.html +409 -0
  33. claude_mpm/dashboard/static/archive/test_dashboard_fixed.html +519 -0
  34. claude_mpm/dashboard/static/archive/test_dashboard_verification.html +181 -0
  35. claude_mpm/dashboard/static/archive/test_file_data.html +315 -0
  36. claude_mpm/dashboard/static/archive/test_file_tree_empty_state.html +243 -0
  37. claude_mpm/dashboard/static/archive/test_file_tree_fix.html +234 -0
  38. claude_mpm/dashboard/static/archive/test_file_tree_rename.html +117 -0
  39. claude_mpm/dashboard/static/archive/test_file_tree_tab.html +115 -0
  40. claude_mpm/dashboard/static/archive/test_file_viewer.html +224 -0
  41. claude_mpm/dashboard/static/archive/test_final_activity.html +220 -0
  42. claude_mpm/dashboard/static/archive/test_tab_fix.html +139 -0
  43. claude_mpm/dashboard/static/built/assets/events.DjpNxWNo.css +1 -0
  44. claude_mpm/dashboard/static/built/components/activity-tree.js +1 -1
  45. claude_mpm/dashboard/static/built/components/agent-hierarchy.js +777 -0
  46. claude_mpm/dashboard/static/built/components/agent-inference.js +1 -1
  47. claude_mpm/dashboard/static/built/components/build-tracker.js +333 -0
  48. claude_mpm/dashboard/static/built/components/code-simple.js +857 -0
  49. claude_mpm/dashboard/static/built/components/code-tree/tree-breadcrumb.js +353 -0
  50. claude_mpm/dashboard/static/built/components/code-tree/tree-constants.js +235 -0
  51. claude_mpm/dashboard/static/built/components/code-tree/tree-search.js +409 -0
  52. claude_mpm/dashboard/static/built/components/code-tree/tree-utils.js +435 -0
  53. claude_mpm/dashboard/static/built/components/code-viewer.js +2 -1076
  54. claude_mpm/dashboard/static/built/components/connection-debug.js +654 -0
  55. claude_mpm/dashboard/static/built/components/diff-viewer.js +891 -0
  56. claude_mpm/dashboard/static/built/components/event-processor.js +1 -1
  57. claude_mpm/dashboard/static/built/components/event-viewer.js +1 -1
  58. claude_mpm/dashboard/static/built/components/export-manager.js +1 -1
  59. claude_mpm/dashboard/static/built/components/file-change-tracker.js +443 -0
  60. claude_mpm/dashboard/static/built/components/file-change-viewer.js +690 -0
  61. claude_mpm/dashboard/static/built/components/file-tool-tracker.js +1 -1
  62. claude_mpm/dashboard/static/built/components/module-viewer.js +1 -1
  63. claude_mpm/dashboard/static/built/components/nav-bar.js +145 -0
  64. claude_mpm/dashboard/static/built/components/page-structure.js +429 -0
  65. claude_mpm/dashboard/static/built/components/session-manager.js +1 -1
  66. claude_mpm/dashboard/static/built/components/ui-state-manager.js +2 -465
  67. claude_mpm/dashboard/static/built/components/working-directory.js +1 -1
  68. claude_mpm/dashboard/static/built/connection-manager.js +536 -0
  69. claude_mpm/dashboard/static/built/dashboard.js +1 -1
  70. claude_mpm/dashboard/static/built/extension-error-handler.js +164 -0
  71. claude_mpm/dashboard/static/built/react/events.js +30 -0
  72. claude_mpm/dashboard/static/built/shared/dom-helpers.js +396 -0
  73. claude_mpm/dashboard/static/built/shared/event-bus.js +330 -0
  74. claude_mpm/dashboard/static/built/shared/event-filter-service.js +540 -0
  75. claude_mpm/dashboard/static/built/shared/logger.js +385 -0
  76. claude_mpm/dashboard/static/built/shared/page-structure.js +251 -0
  77. claude_mpm/dashboard/static/built/shared/tooltip-service.js +253 -0
  78. claude_mpm/dashboard/static/built/socket-client.js +1 -1
  79. claude_mpm/dashboard/static/built/tab-isolation-fix.js +185 -0
  80. claude_mpm/dashboard/static/css/dashboard.css +28 -5
  81. claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +1 -0
  82. claude_mpm/dashboard/static/dist/components/activity-tree.js +1 -1
  83. claude_mpm/dashboard/static/dist/components/agent-inference.js +1 -1
  84. claude_mpm/dashboard/static/dist/components/code-viewer.js +2 -0
  85. claude_mpm/dashboard/static/dist/components/event-processor.js +1 -1
  86. claude_mpm/dashboard/static/dist/components/event-viewer.js +1 -1
  87. claude_mpm/dashboard/static/dist/components/export-manager.js +1 -1
  88. claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +1 -1
  89. claude_mpm/dashboard/static/dist/components/module-viewer.js +1 -1
  90. claude_mpm/dashboard/static/dist/components/session-manager.js +1 -1
  91. claude_mpm/dashboard/static/dist/components/working-directory.js +1 -1
  92. claude_mpm/dashboard/static/dist/dashboard.js +1 -1
  93. claude_mpm/dashboard/static/dist/react/events.js +30 -0
  94. claude_mpm/dashboard/static/dist/socket-client.js +1 -1
  95. claude_mpm/dashboard/static/events.html +607 -0
  96. claude_mpm/dashboard/static/index.html +713 -0
  97. claude_mpm/dashboard/static/js/components/activity-tree.js +3 -17
  98. claude_mpm/dashboard/static/js/components/agent-hierarchy.js +4 -1
  99. claude_mpm/dashboard/static/js/components/agent-inference.js +3 -0
  100. claude_mpm/dashboard/static/js/components/build-tracker.js +8 -0
  101. claude_mpm/dashboard/static/js/components/code-viewer.js +387 -72
  102. claude_mpm/dashboard/static/js/components/event-processor.js +3 -0
  103. claude_mpm/dashboard/static/js/components/event-viewer.js +39 -2
  104. claude_mpm/dashboard/static/js/components/export-manager.js +3 -0
  105. claude_mpm/dashboard/static/js/components/file-tool-tracker.js +30 -10
  106. claude_mpm/dashboard/static/js/components/socket-manager.js +4 -0
  107. claude_mpm/dashboard/static/js/components/ui-state-manager.js +286 -108
  108. claude_mpm/dashboard/static/js/components/working-directory.js +3 -0
  109. claude_mpm/dashboard/static/js/dashboard.js +61 -49
  110. claude_mpm/dashboard/static/js/socket-client.js +12 -8
  111. claude_mpm/dashboard/static/js/stores/dashboard-store.js +562 -0
  112. claude_mpm/dashboard/static/js/tab-isolation-fix.js +185 -0
  113. claude_mpm/dashboard/static/legacy/activity.html +736 -0
  114. claude_mpm/dashboard/static/legacy/agents.html +786 -0
  115. claude_mpm/dashboard/static/legacy/files.html +747 -0
  116. claude_mpm/dashboard/static/legacy/tools.html +831 -0
  117. claude_mpm/dashboard/static/monitors-index.html +218 -0
  118. claude_mpm/dashboard/static/monitors.html +431 -0
  119. claude_mpm/dashboard/static/production/events.html +659 -0
  120. claude_mpm/dashboard/static/production/main.html +715 -0
  121. claude_mpm/dashboard/static/production/monitors.html +483 -0
  122. claude_mpm/dashboard/static/socket.io.min.js +7 -0
  123. claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +7 -0
  124. claude_mpm/dashboard/static/test-archive/dashboard.html +635 -0
  125. claude_mpm/dashboard/static/test-archive/debug-events.html +147 -0
  126. claude_mpm/dashboard/static/test-archive/test-navigation.html +256 -0
  127. claude_mpm/dashboard/static/test-archive/test-react-exports.html +180 -0
  128. claude_mpm/dashboard/templates/index.html +82 -38
  129. claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +1 -1
  130. claude_mpm/services/agents/deployment/agent_discovery_service.py +3 -0
  131. claude_mpm/services/agents/deployment/agent_template_builder.py +25 -8
  132. claude_mpm/services/agents/deployment/agent_validator.py +3 -0
  133. claude_mpm/services/agents/deployment/validation/template_validator.py +13 -4
  134. claude_mpm/services/agents/local_template_manager.py +2 -6
  135. claude_mpm/services/monitor/daemon.py +1 -2
  136. claude_mpm/services/monitor/daemon_manager.py +2 -5
  137. claude_mpm/services/monitor/event_emitter.py +2 -2
  138. claude_mpm/services/monitor/handlers/code_analysis.py +4 -6
  139. claude_mpm/services/monitor/handlers/hooks.py +2 -4
  140. claude_mpm/services/monitor/server.py +23 -226
  141. claude_mpm/tools/code_tree_analyzer.py +2 -2
  142. {claude_mpm-4.2.43.dist-info → claude_mpm-4.2.51.dist-info}/METADATA +1 -1
  143. {claude_mpm-4.2.43.dist-info → claude_mpm-4.2.51.dist-info}/RECORD +148 -87
  144. claude_mpm/commands/mpm-browser-monitor.md +0 -370
  145. claude_mpm/commands/mpm-monitor.md +0 -177
  146. claude_mpm/dashboard/static/js/browser-console-monitor.js +0 -495
  147. claude_mpm/dashboard/static/js/components/browser-log-viewer.js +0 -763
  148. claude_mpm/dashboard/static/test-browser-monitor.html +0 -470
  149. claude_mpm/dashboard/static/test-simple.html +0 -97
  150. claude_mpm/services/monitor/handlers/browser.py +0 -451
  151. /claude_mpm/dashboard/static/{test_debug.html → test-archive/test_debug.html} +0 -0
  152. {claude_mpm-4.2.43.dist-info → claude_mpm-4.2.51.dist-info}/WHEEL +0 -0
  153. {claude_mpm-4.2.43.dist-info → claude_mpm-4.2.51.dist-info}/entry_points.txt +0 -0
  154. {claude_mpm-4.2.43.dist-info → claude_mpm-4.2.51.dist-info}/licenses/LICENSE +0 -0
  155. {claude_mpm-4.2.43.dist-info → claude_mpm-4.2.51.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,248 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Activity Dashboard - Fixed</title>
7
+
8
+ <!-- Load Socket.IO first -->
9
+ <script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
10
+
11
+ <style>
12
+ body {
13
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
14
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
15
+ color: #e0e0e0;
16
+ padding: 20px;
17
+ }
18
+
19
+ .header {
20
+ background: rgba(255, 255, 255, 0.05);
21
+ backdrop-filter: blur(10px);
22
+ border-radius: 12px;
23
+ padding: 20px;
24
+ margin-bottom: 20px;
25
+ border: 1px solid rgba(255, 255, 255, 0.1);
26
+ }
27
+
28
+ .header h1 {
29
+ font-size: 24px;
30
+ margin-bottom: 10px;
31
+ background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
32
+ -webkit-background-clip: text;
33
+ -webkit-text-fill-color: transparent;
34
+ }
35
+
36
+ .status-bar {
37
+ display: flex;
38
+ gap: 20px;
39
+ align-items: center;
40
+ }
41
+
42
+ .status-indicator {
43
+ display: flex;
44
+ align-items: center;
45
+ gap: 8px;
46
+ padding: 8px 16px;
47
+ background: rgba(255, 255, 255, 0.05);
48
+ border-radius: 20px;
49
+ font-size: 14px;
50
+ }
51
+
52
+ .status-dot {
53
+ width: 10px;
54
+ height: 10px;
55
+ border-radius: 50%;
56
+ animation: pulse 2s infinite;
57
+ }
58
+
59
+ .status-dot.connected {
60
+ background: #4ade80;
61
+ box-shadow: 0 0 10px #4ade80;
62
+ }
63
+
64
+ .status-dot.disconnected {
65
+ background: #f87171;
66
+ box-shadow: 0 0 10px #f87171;
67
+ }
68
+
69
+ @keyframes pulse {
70
+ 0%, 100% { opacity: 1; }
71
+ 50% { opacity: 0.5; }
72
+ }
73
+
74
+ .content {
75
+ background: rgba(255, 255, 255, 0.05);
76
+ backdrop-filter: blur(10px);
77
+ border-radius: 12px;
78
+ padding: 20px;
79
+ border: 1px solid rgba(255, 255, 255, 0.1);
80
+ }
81
+
82
+ .log {
83
+ background: rgba(0, 0, 0, 0.3);
84
+ padding: 15px;
85
+ border-radius: 8px;
86
+ max-height: 400px;
87
+ overflow-y: auto;
88
+ font-family: monospace;
89
+ font-size: 13px;
90
+ }
91
+
92
+ .log-entry {
93
+ margin: 2px 0;
94
+ padding: 2px;
95
+ }
96
+
97
+ .error { color: #f87171; }
98
+ .success { color: #4ade80; }
99
+ .info { color: #60a5fa; }
100
+ </style>
101
+ </head>
102
+ <body>
103
+ <div class="header">
104
+ <h1>🎯 Activity Dashboard - Fixed Version</h1>
105
+ <div class="status-bar">
106
+ <div class="status-indicator">
107
+ <span class="status-dot disconnected" id="connection-status"></span>
108
+ <span id="connection-text">Disconnected</span>
109
+ </div>
110
+ <div class="status-indicator">
111
+ <span>📊</span>
112
+ <span id="event-count">0 events</span>
113
+ </div>
114
+ <div class="status-indicator">
115
+ <span>🎯</span>
116
+ <span id="session-count">0 sessions</span>
117
+ </div>
118
+ </div>
119
+ </div>
120
+
121
+ <div class="content">
122
+ <h2>Connection Log</h2>
123
+ <div class="log" id="log"></div>
124
+ </div>
125
+
126
+ <script type="module">
127
+ // Import SocketClient
128
+ import { SocketClient } from 'http://localhost:8765/static/built/socket-client.js';
129
+ import { ActivityTree } from 'http://localhost:8765/static/built/components/activity-tree.js';
130
+ import { SessionManager } from 'http://localhost:8765/static/built/components/session-manager.js';
131
+
132
+ const logEl = document.getElementById('log');
133
+
134
+ function log(message, type = 'info') {
135
+ const entry = document.createElement('div');
136
+ entry.className = `log-entry ${type}`;
137
+ entry.textContent = `[${new Date().toLocaleTimeString()}] ${message}`;
138
+ logEl.appendChild(entry);
139
+ logEl.scrollTop = logEl.scrollHeight;
140
+ console.log(`[${type}] ${message}`);
141
+ }
142
+
143
+ function updateConnectionStatus(connected) {
144
+ const statusDot = document.getElementById('connection-status');
145
+ const statusText = document.getElementById('connection-text');
146
+
147
+ if (connected) {
148
+ statusDot.className = 'status-dot connected';
149
+ statusText.textContent = 'Connected';
150
+ } else {
151
+ statusDot.className = 'status-dot disconnected';
152
+ statusText.textContent = 'Disconnected';
153
+ }
154
+ }
155
+
156
+ // Wait for Socket.IO to load
157
+ function waitForSocketIO() {
158
+ return new Promise((resolve) => {
159
+ if (typeof io !== 'undefined') {
160
+ log(`Socket.IO loaded: version ${io.version || 'unknown'}`, 'success');
161
+ resolve();
162
+ } else {
163
+ log('Waiting for Socket.IO...', 'info');
164
+ setTimeout(() => waitForSocketIO().then(resolve), 100);
165
+ }
166
+ });
167
+ }
168
+
169
+ // Initialize
170
+ async function initialize() {
171
+ log('Starting initialization...', 'info');
172
+
173
+ // Wait for Socket.IO
174
+ await waitForSocketIO();
175
+
176
+ try {
177
+ // Create instances
178
+ log('Creating SocketClient instance...', 'info');
179
+ const socketClient = new SocketClient();
180
+ window.socketClient = socketClient;
181
+
182
+ log('Creating SessionManager instance...', 'info');
183
+ const sessionManager = new SessionManager();
184
+ window.sessionManager = sessionManager;
185
+
186
+ log('Creating ActivityTree instance...', 'info');
187
+ const activityTree = new ActivityTree();
188
+ window.activityTree = activityTree;
189
+
190
+ // Set up event handlers
191
+ log('Setting up event handlers...', 'info');
192
+
193
+ socketClient.onConnection('connect', () => {
194
+ log('✅ CONNECTED to Socket.IO server!', 'success');
195
+ updateConnectionStatus(true);
196
+ });
197
+
198
+ socketClient.onConnection('disconnect', (reason) => {
199
+ log(`❌ DISCONNECTED: ${reason}`, 'error');
200
+ updateConnectionStatus(false);
201
+ });
202
+
203
+ socketClient.onConnection('error', (error) => {
204
+ log(`Socket error: ${error}`, 'error');
205
+ });
206
+
207
+ socketClient.onEventUpdate((events, sessions) => {
208
+ const eventCount = events.length;
209
+ const sessionCount = sessions.size;
210
+ log(`Event update: ${eventCount} events, ${sessionCount} sessions`, 'info');
211
+ document.getElementById('event-count').textContent = `${eventCount} events`;
212
+ document.getElementById('session-count').textContent = `${sessionCount} sessions`;
213
+ });
214
+
215
+ // Connect
216
+ log('Calling socketClient.connect()...', 'info');
217
+ socketClient.connect();
218
+
219
+ // Check status after a moment
220
+ setTimeout(() => {
221
+ if (socketClient.socket) {
222
+ const status = {
223
+ connected: socketClient.socket.connected,
224
+ connecting: socketClient.socket.connecting,
225
+ id: socketClient.socket.id || 'none'
226
+ };
227
+ log(`Socket status: connected=${status.connected}, id=${status.id}`,
228
+ status.connected ? 'success' : 'error');
229
+
230
+ if (!status.connected && !status.connecting) {
231
+ log('Connection failed. Check browser console for errors.', 'error');
232
+ }
233
+ } else {
234
+ log('Socket object was not created!', 'error');
235
+ }
236
+ }, 2000);
237
+
238
+ } catch (error) {
239
+ log(`Initialization error: ${error.message}`, 'error');
240
+ console.error(error);
241
+ }
242
+ }
243
+
244
+ // Start initialization
245
+ initialize();
246
+ </script>
247
+ </body>
248
+ </html>
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Activity Dashboard Test</title>
6
+ </head>
7
+ <body>
8
+ <h1>Activity Dashboard Test Results</h1>
9
+
10
+ <h2>Dashboard Accessibility Check:</h2>
11
+ <iframe id="dashboard-frame" src="http://localhost:8765/static/activity.html"
12
+ width="100%" height="600" style="border: 2px solid #333;"></iframe>
13
+
14
+ <h2>Test Status:</h2>
15
+ <div id="test-status">
16
+ <p>✅ Monitor server is running on port 8765</p>
17
+ <p>✅ Activity dashboard HTML file created at: /src/claude_mpm/dashboard/static/activity.html</p>
18
+ <p>✅ Dashboard is being served at: http://localhost:8765/static/activity.html</p>
19
+ <p>✅ Navigation links to other dashboards are included</p>
20
+ <p>✅ Activity tree component is integrated</p>
21
+ <p>✅ Real-time WebSocket connection is configured</p>
22
+ </div>
23
+
24
+ <h2>Dashboard Features:</h2>
25
+ <ul>
26
+ <li>🎯 Hierarchical tree view of PM → Agent → Tool activities</li>
27
+ <li>🔄 Real-time updates via WebSocket</li>
28
+ <li>📊 Session-based organization</li>
29
+ <li>🔍 Search and filtering capabilities</li>
30
+ <li>📈 Statistics panel showing nodes, active items, tree depth</li>
31
+ <li>🎨 Dark theme consistent with other monitors</li>
32
+ <li>🔗 Navigation tabs to other dashboards</li>
33
+ <li>⚡ Connection status indicator</li>
34
+ <li>⏱️ Uptime counter</li>
35
+ <li>🌳 Expandable/collapsible tree nodes</li>
36
+ </ul>
37
+
38
+ <h2>Visual Hierarchy:</h2>
39
+ <ul>
40
+ <li>Level 0: PM Sessions (gradient background)</li>
41
+ <li>Level 1: User Instructions (purple border)</li>
42
+ <li>Level 1: TodoWrite (pink border)</li>
43
+ <li>Level 1: Agents (blue border)</li>
44
+ <li>Level 2: Tools (yellow border)</li>
45
+ <li>Level 3: Todo items (checkbox icons)</li>
46
+ </ul>
47
+
48
+ <script>
49
+ // Try to check if the dashboard loads
50
+ window.addEventListener('load', () => {
51
+ const iframe = document.getElementById('dashboard-frame');
52
+ iframe.addEventListener('load', () => {
53
+ console.log('Dashboard loaded successfully!');
54
+ });
55
+ iframe.addEventListener('error', () => {
56
+ console.error('Failed to load dashboard');
57
+ });
58
+ });
59
+ </script>
60
+ </body>
61
+ </html>
@@ -0,0 +1,179 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Activity Dashboard Connection Test</title>
7
+
8
+ <!-- Load Socket.IO from CDN directly -->
9
+ <script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
10
+
11
+ <style>
12
+ body {
13
+ font-family: monospace;
14
+ background: #1e293b;
15
+ color: #e0e0e0;
16
+ padding: 20px;
17
+ }
18
+ .status {
19
+ padding: 10px;
20
+ border: 1px solid #333;
21
+ margin: 10px 0;
22
+ border-radius: 5px;
23
+ }
24
+ .connected { background: #065f46; }
25
+ .disconnected { background: #7f1d1d; }
26
+ .log {
27
+ background: #0f172a;
28
+ padding: 10px;
29
+ margin: 10px 0;
30
+ border-radius: 5px;
31
+ max-height: 400px;
32
+ overflow-y: auto;
33
+ }
34
+ .log-entry {
35
+ margin: 2px 0;
36
+ padding: 2px;
37
+ }
38
+ .error { color: #f87171; }
39
+ .success { color: #4ade80; }
40
+ .info { color: #60a5fa; }
41
+ </style>
42
+ </head>
43
+ <body>
44
+ <h1>Activity Dashboard Connection Test</h1>
45
+
46
+ <div id="status" class="status disconnected">
47
+ Status: <span id="status-text">Initializing...</span>
48
+ </div>
49
+
50
+ <div class="log" id="log">
51
+ <div class="log-entry info">Starting connection test...</div>
52
+ </div>
53
+
54
+ <button onclick="testConnection()">Test Connection</button>
55
+ <button onclick="clearLog()">Clear Log</button>
56
+
57
+ <script>
58
+ const logEl = document.getElementById('log');
59
+ const statusEl = document.getElementById('status');
60
+ const statusTextEl = document.getElementById('status-text');
61
+
62
+ function log(message, type = 'info') {
63
+ const entry = document.createElement('div');
64
+ entry.className = `log-entry ${type}`;
65
+ entry.textContent = `[${new Date().toLocaleTimeString()}] ${message}`;
66
+ logEl.appendChild(entry);
67
+ logEl.scrollTop = logEl.scrollHeight;
68
+ console.log(`[${type}] ${message}`);
69
+ }
70
+
71
+ function updateStatus(connected, text) {
72
+ statusEl.className = `status ${connected ? 'connected' : 'disconnected'}`;
73
+ statusTextEl.textContent = text;
74
+ }
75
+
76
+ function clearLog() {
77
+ logEl.innerHTML = '';
78
+ log('Log cleared', 'info');
79
+ }
80
+
81
+ function testConnection() {
82
+ log('Testing connection to Socket.IO server...', 'info');
83
+
84
+ // Check if Socket.IO is loaded
85
+ if (typeof io === 'undefined') {
86
+ log('ERROR: Socket.IO library not loaded!', 'error');
87
+ updateStatus(false, 'Socket.IO not loaded');
88
+ return;
89
+ }
90
+
91
+ log(`Socket.IO version: ${io.version || 'unknown'}`, 'info');
92
+
93
+ // Try to connect
94
+ const url = 'http://localhost:8765';
95
+ log(`Attempting to connect to ${url}`, 'info');
96
+ updateStatus(false, 'Connecting...');
97
+
98
+ try {
99
+ const socket = io(url, {
100
+ autoConnect: true,
101
+ reconnection: true,
102
+ reconnectionDelay: 1000,
103
+ reconnectionDelayMax: 10000,
104
+ reconnectionAttempts: 3,
105
+ timeout: 5000,
106
+ forceNew: true,
107
+ transports: ['polling', 'websocket'],
108
+ withCredentials: false,
109
+ path: '/socket.io/'
110
+ });
111
+
112
+ socket.on('connect', () => {
113
+ log(`SUCCESS: Connected! Socket ID: ${socket.id}`, 'success');
114
+ updateStatus(true, `Connected (ID: ${socket.id})`);
115
+
116
+ // Request server status
117
+ socket.emit('request_status');
118
+ });
119
+
120
+ socket.on('disconnect', (reason) => {
121
+ log(`Disconnected: ${reason}`, 'error');
122
+ updateStatus(false, `Disconnected: ${reason}`);
123
+ });
124
+
125
+ socket.on('connect_error', (error) => {
126
+ log(`Connection error: ${error.message}`, 'error');
127
+ updateStatus(false, `Error: ${error.message}`);
128
+ });
129
+
130
+ socket.on('server_status', (status) => {
131
+ log(`Server status received: ${JSON.stringify(status)}`, 'success');
132
+ });
133
+
134
+ socket.on('event', (data) => {
135
+ log(`Event received: ${data.type}`, 'info');
136
+ });
137
+
138
+ // Socket.IO manager events
139
+ socket.io.on('error', (error) => {
140
+ log(`Manager error: ${error}`, 'error');
141
+ });
142
+
143
+ socket.io.on('reconnect', (attempt) => {
144
+ log(`Reconnected after ${attempt} attempts`, 'success');
145
+ updateStatus(true, 'Reconnected');
146
+ });
147
+
148
+ socket.io.on('reconnect_attempt', (attempt) => {
149
+ log(`Reconnection attempt ${attempt}`, 'info');
150
+ updateStatus(false, `Reconnecting... (attempt ${attempt})`);
151
+ });
152
+
153
+ socket.io.on('reconnect_error', (error) => {
154
+ log(`Reconnection error: ${error.message}`, 'error');
155
+ });
156
+
157
+ socket.io.on('reconnect_failed', () => {
158
+ log('Reconnection failed after all attempts', 'error');
159
+ updateStatus(false, 'Reconnection failed');
160
+ });
161
+
162
+ // Store socket for debugging
163
+ window.debugSocket = socket;
164
+ log('Socket stored as window.debugSocket for debugging', 'info');
165
+
166
+ } catch (error) {
167
+ log(`Exception: ${error.message}`, 'error');
168
+ updateStatus(false, 'Connection failed');
169
+ }
170
+ }
171
+
172
+ // Auto-test on load
173
+ setTimeout(() => {
174
+ log('Auto-testing connection...', 'info');
175
+ testConnection();
176
+ }, 500);
177
+ </script>
178
+ </body>
179
+ </html>
@@ -0,0 +1,68 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Claude Tree Tab Debug Test</title>
5
+ </head>
6
+ <body>
7
+ <h1>Claude Tree Tab Debug Test</h1>
8
+ <p>This test will help diagnose why the Claude Tree tab is showing events instead of the D3.js tree.</p>
9
+
10
+ <h2>Steps to debug:</h2>
11
+ <ol>
12
+ <li>Open the dashboard at http://localhost:8080</li>
13
+ <li>Open browser developer console</li>
14
+ <li>Run these commands in console:</li>
15
+ </ol>
16
+
17
+ <pre>
18
+ // 1. Check if CodeViewer is initialized
19
+ console.log('CodeViewer exists?', window.CodeViewer);
20
+
21
+ // 2. Check the Claude Tree tab content
22
+ const claudeTreeTab = document.getElementById('claude-tree-tab');
23
+ console.log('Claude Tree Tab HTML:', claudeTreeTab?.innerHTML);
24
+
25
+ // 3. Check the Claude Tree container
26
+ const claudeTreeContainer = document.getElementById('claude-tree-container');
27
+ console.log('Claude Tree Container HTML:', claudeTreeContainer?.innerHTML);
28
+
29
+ // 4. Manually trigger CodeViewer
30
+ if (window.CodeViewer) {
31
+ window.CodeViewer.show();
32
+ console.log('CodeViewer.show() called');
33
+
34
+ // Check container after show()
35
+ setTimeout(() => {
36
+ const container = document.getElementById('claude-tree-container');
37
+ console.log('Container after show():', container?.innerHTML.substring(0, 500));
38
+ }, 1000);
39
+ }
40
+
41
+ // 5. Check for event-item elements in Claude Tree tab
42
+ const eventItems = claudeTreeTab?.querySelectorAll('.event-item');
43
+ console.log('Event items found in Claude Tree tab:', eventItems?.length || 0);
44
+
45
+ // 6. Check what's rendering events
46
+ const allEventLists = document.querySelectorAll('.events-list');
47
+ console.log('All elements with class "events-list":', allEventLists.length);
48
+ allEventLists.forEach((el, i) => {
49
+ console.log(` List ${i}: ID="${el.id}", Parent ID="${el.parentElement?.id}"`);
50
+ });
51
+ </pre>
52
+
53
+ <h2>Expected vs Actual:</h2>
54
+ <ul>
55
+ <li><strong>Expected:</strong> Claude Tree tab should contain a D3.js SVG tree visualization</li>
56
+ <li><strong>Actual:</strong> Claude Tree tab is showing event entries like "[hook] hook.user_prompt"</li>
57
+ </ul>
58
+
59
+ <h2>Hypothesis:</h2>
60
+ <p>The issue might be one of:</p>
61
+ <ul>
62
+ <li>CodeViewer is not being initialized properly</li>
63
+ <li>The container is being overwritten after CodeViewer renders</li>
64
+ <li>There's a CSS issue causing wrong content to be displayed</li>
65
+ <li>Events are being rendered into the wrong container</li>
66
+ </ul>
67
+ </body>
68
+ </html>