claude-mpm 4.2.44__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 (148) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_PM.md +43 -1
  3. claude_mpm/agents/INSTRUCTIONS.md +75 -1
  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/error_handler.py +2 -4
  17. claude_mpm/core/file_utils.py +4 -12
  18. claude_mpm/core/log_manager.py +8 -5
  19. claude_mpm/core/logger.py +1 -1
  20. claude_mpm/core/logging_utils.py +6 -6
  21. claude_mpm/core/unified_agent_registry.py +18 -4
  22. claude_mpm/dashboard/react/components/DataInspector/DataInspector.module.css +188 -0
  23. claude_mpm/dashboard/react/components/EventViewer/EventViewer.module.css +156 -0
  24. claude_mpm/dashboard/react/components/shared/ConnectionStatus.module.css +38 -0
  25. claude_mpm/dashboard/react/components/shared/FilterBar.module.css +92 -0
  26. claude_mpm/dashboard/static/archive/activity_dashboard_fixed.html +248 -0
  27. claude_mpm/dashboard/static/archive/activity_dashboard_test.html +61 -0
  28. claude_mpm/dashboard/static/archive/test_activity_connection.html +179 -0
  29. claude_mpm/dashboard/static/archive/test_claude_tree_tab.html +68 -0
  30. claude_mpm/dashboard/static/archive/test_dashboard.html +409 -0
  31. claude_mpm/dashboard/static/archive/test_dashboard_fixed.html +519 -0
  32. claude_mpm/dashboard/static/archive/test_dashboard_verification.html +181 -0
  33. claude_mpm/dashboard/static/archive/test_file_data.html +315 -0
  34. claude_mpm/dashboard/static/archive/test_file_tree_empty_state.html +243 -0
  35. claude_mpm/dashboard/static/archive/test_file_tree_fix.html +234 -0
  36. claude_mpm/dashboard/static/archive/test_file_tree_rename.html +117 -0
  37. claude_mpm/dashboard/static/archive/test_file_tree_tab.html +115 -0
  38. claude_mpm/dashboard/static/archive/test_file_viewer.html +224 -0
  39. claude_mpm/dashboard/static/archive/test_final_activity.html +220 -0
  40. claude_mpm/dashboard/static/archive/test_tab_fix.html +139 -0
  41. claude_mpm/dashboard/static/built/assets/events.DjpNxWNo.css +1 -0
  42. claude_mpm/dashboard/static/built/components/activity-tree.js +1 -1
  43. claude_mpm/dashboard/static/built/components/agent-hierarchy.js +777 -0
  44. claude_mpm/dashboard/static/built/components/agent-inference.js +1 -1
  45. claude_mpm/dashboard/static/built/components/build-tracker.js +333 -0
  46. claude_mpm/dashboard/static/built/components/code-simple.js +857 -0
  47. claude_mpm/dashboard/static/built/components/code-tree/tree-breadcrumb.js +353 -0
  48. claude_mpm/dashboard/static/built/components/code-tree/tree-constants.js +235 -0
  49. claude_mpm/dashboard/static/built/components/code-tree/tree-search.js +409 -0
  50. claude_mpm/dashboard/static/built/components/code-tree/tree-utils.js +435 -0
  51. claude_mpm/dashboard/static/built/components/code-viewer.js +2 -1076
  52. claude_mpm/dashboard/static/built/components/connection-debug.js +654 -0
  53. claude_mpm/dashboard/static/built/components/diff-viewer.js +891 -0
  54. claude_mpm/dashboard/static/built/components/event-processor.js +1 -1
  55. claude_mpm/dashboard/static/built/components/event-viewer.js +1 -1
  56. claude_mpm/dashboard/static/built/components/export-manager.js +1 -1
  57. claude_mpm/dashboard/static/built/components/file-change-tracker.js +443 -0
  58. claude_mpm/dashboard/static/built/components/file-change-viewer.js +690 -0
  59. claude_mpm/dashboard/static/built/components/file-tool-tracker.js +1 -1
  60. claude_mpm/dashboard/static/built/components/module-viewer.js +1 -1
  61. claude_mpm/dashboard/static/built/components/nav-bar.js +145 -0
  62. claude_mpm/dashboard/static/built/components/page-structure.js +429 -0
  63. claude_mpm/dashboard/static/built/components/session-manager.js +1 -1
  64. claude_mpm/dashboard/static/built/components/ui-state-manager.js +2 -465
  65. claude_mpm/dashboard/static/built/components/working-directory.js +1 -1
  66. claude_mpm/dashboard/static/built/connection-manager.js +536 -0
  67. claude_mpm/dashboard/static/built/dashboard.js +1 -1
  68. claude_mpm/dashboard/static/built/extension-error-handler.js +164 -0
  69. claude_mpm/dashboard/static/built/react/events.js +30 -0
  70. claude_mpm/dashboard/static/built/shared/dom-helpers.js +396 -0
  71. claude_mpm/dashboard/static/built/shared/event-bus.js +330 -0
  72. claude_mpm/dashboard/static/built/shared/event-filter-service.js +540 -0
  73. claude_mpm/dashboard/static/built/shared/logger.js +385 -0
  74. claude_mpm/dashboard/static/built/shared/page-structure.js +251 -0
  75. claude_mpm/dashboard/static/built/shared/tooltip-service.js +253 -0
  76. claude_mpm/dashboard/static/built/socket-client.js +1 -1
  77. claude_mpm/dashboard/static/built/tab-isolation-fix.js +185 -0
  78. claude_mpm/dashboard/static/css/dashboard.css +28 -5
  79. claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +1 -0
  80. claude_mpm/dashboard/static/dist/components/activity-tree.js +1 -1
  81. claude_mpm/dashboard/static/dist/components/agent-inference.js +1 -1
  82. claude_mpm/dashboard/static/dist/components/code-viewer.js +2 -0
  83. claude_mpm/dashboard/static/dist/components/event-processor.js +1 -1
  84. claude_mpm/dashboard/static/dist/components/event-viewer.js +1 -1
  85. claude_mpm/dashboard/static/dist/components/export-manager.js +1 -1
  86. claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +1 -1
  87. claude_mpm/dashboard/static/dist/components/module-viewer.js +1 -1
  88. claude_mpm/dashboard/static/dist/components/session-manager.js +1 -1
  89. claude_mpm/dashboard/static/dist/components/working-directory.js +1 -1
  90. claude_mpm/dashboard/static/dist/dashboard.js +1 -1
  91. claude_mpm/dashboard/static/dist/react/events.js +30 -0
  92. claude_mpm/dashboard/static/dist/socket-client.js +1 -1
  93. claude_mpm/dashboard/static/events.html +607 -0
  94. claude_mpm/dashboard/static/index.html +713 -0
  95. claude_mpm/dashboard/static/js/components/activity-tree.js +3 -17
  96. claude_mpm/dashboard/static/js/components/agent-hierarchy.js +4 -1
  97. claude_mpm/dashboard/static/js/components/agent-inference.js +3 -0
  98. claude_mpm/dashboard/static/js/components/build-tracker.js +8 -0
  99. claude_mpm/dashboard/static/js/components/code-viewer.js +306 -66
  100. claude_mpm/dashboard/static/js/components/event-processor.js +3 -0
  101. claude_mpm/dashboard/static/js/components/event-viewer.js +39 -2
  102. claude_mpm/dashboard/static/js/components/export-manager.js +3 -0
  103. claude_mpm/dashboard/static/js/components/file-tool-tracker.js +30 -10
  104. claude_mpm/dashboard/static/js/components/socket-manager.js +4 -0
  105. claude_mpm/dashboard/static/js/components/ui-state-manager.js +285 -85
  106. claude_mpm/dashboard/static/js/components/working-directory.js +3 -0
  107. claude_mpm/dashboard/static/js/dashboard.js +61 -33
  108. claude_mpm/dashboard/static/js/socket-client.js +12 -8
  109. claude_mpm/dashboard/static/js/stores/dashboard-store.js +562 -0
  110. claude_mpm/dashboard/static/js/tab-isolation-fix.js +185 -0
  111. claude_mpm/dashboard/static/legacy/activity.html +736 -0
  112. claude_mpm/dashboard/static/legacy/agents.html +786 -0
  113. claude_mpm/dashboard/static/legacy/files.html +747 -0
  114. claude_mpm/dashboard/static/legacy/tools.html +831 -0
  115. claude_mpm/dashboard/static/monitors-index.html +218 -0
  116. claude_mpm/dashboard/static/monitors.html +431 -0
  117. claude_mpm/dashboard/static/production/events.html +659 -0
  118. claude_mpm/dashboard/static/production/main.html +715 -0
  119. claude_mpm/dashboard/static/production/monitors.html +483 -0
  120. claude_mpm/dashboard/static/socket.io.min.js +7 -0
  121. claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +7 -0
  122. claude_mpm/dashboard/static/test-archive/dashboard.html +635 -0
  123. claude_mpm/dashboard/static/test-archive/debug-events.html +147 -0
  124. claude_mpm/dashboard/static/test-archive/test-navigation.html +256 -0
  125. claude_mpm/dashboard/static/test-archive/test-react-exports.html +180 -0
  126. claude_mpm/dashboard/templates/index.html +79 -9
  127. claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +1 -1
  128. claude_mpm/services/agents/deployment/agent_discovery_service.py +3 -0
  129. claude_mpm/services/agents/deployment/agent_template_builder.py +25 -8
  130. claude_mpm/services/agents/deployment/agent_validator.py +3 -0
  131. claude_mpm/services/agents/deployment/validation/template_validator.py +13 -4
  132. claude_mpm/services/agents/local_template_manager.py +2 -6
  133. claude_mpm/services/monitor/daemon.py +1 -2
  134. claude_mpm/services/monitor/daemon_manager.py +2 -5
  135. claude_mpm/services/monitor/event_emitter.py +2 -2
  136. claude_mpm/services/monitor/handlers/code_analysis.py +4 -6
  137. claude_mpm/services/monitor/handlers/hooks.py +2 -4
  138. claude_mpm/services/monitor/server.py +27 -4
  139. claude_mpm/tools/code_tree_analyzer.py +2 -2
  140. {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/METADATA +1 -1
  141. {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/RECORD +146 -81
  142. claude_mpm/dashboard/static/test-browser-monitor.html +0 -470
  143. claude_mpm/dashboard/static/test-simple.html +0 -97
  144. /claude_mpm/dashboard/static/{test_debug.html → test-archive/test_debug.html} +0 -0
  145. {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/WHEEL +0 -0
  146. {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/entry_points.txt +0 -0
  147. {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/licenses/LICENSE +0 -0
  148. {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,736 @@
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>Claude MPM - Activity Dashboard</title>
7
+
8
+ <!-- Load Socket.IO -->
9
+ <script src="/static/socket.io.min.js"></script>
10
+
11
+ <!-- Verify Socket.IO is loaded -->
12
+ <script>
13
+ // Check if Socket.IO is loaded and available
14
+ if (typeof io === 'undefined') {
15
+ console.error('Socket.IO not loaded, attempting to load from CDN...');
16
+ var script = document.createElement('script');
17
+ script.src = 'https://cdn.socket.io/4.8.1/socket.io.min.js';
18
+ script.onerror = function() {
19
+ console.error('Failed to load Socket.IO from CDN');
20
+ };
21
+ document.head.appendChild(script);
22
+ } else {
23
+ console.log('Socket.IO loaded successfully, version:', io.version || 'unknown');
24
+ }
25
+ </script>
26
+
27
+ <style>
28
+ * {
29
+ margin: 0;
30
+ padding: 0;
31
+ box-sizing: border-box;
32
+ }
33
+
34
+ body {
35
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
36
+ background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
37
+ color: #e0e0e0;
38
+ width: 100vw;
39
+ height: 100vh;
40
+ overflow: hidden;
41
+ display: flex;
42
+ flex-direction: column;
43
+ }
44
+
45
+ .container {
46
+ width: 100%;
47
+ height: 100%;
48
+ padding: 20px;
49
+ overflow-y: auto;
50
+ display: flex;
51
+ flex-direction: column;
52
+ }
53
+
54
+ .header {
55
+ background: rgba(255, 255, 255, 0.05);
56
+ backdrop-filter: blur(10px);
57
+ border-radius: 12px;
58
+ padding: 20px;
59
+ margin-bottom: 20px;
60
+ border: 1px solid rgba(255, 255, 255, 0.1);
61
+ }
62
+
63
+ .header h1 {
64
+ font-size: 24px;
65
+ margin-bottom: 10px;
66
+ background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
67
+ -webkit-background-clip: text;
68
+ -webkit-text-fill-color: transparent;
69
+ }
70
+
71
+ .status-bar {
72
+ display: flex;
73
+ gap: 20px;
74
+ align-items: center;
75
+ flex-wrap: wrap;
76
+ }
77
+
78
+ .status-indicator {
79
+ display: flex;
80
+ align-items: center;
81
+ gap: 8px;
82
+ padding: 8px 16px;
83
+ background: rgba(255, 255, 255, 0.05);
84
+ border-radius: 20px;
85
+ font-size: 14px;
86
+ }
87
+
88
+ .status-dot {
89
+ width: 10px;
90
+ height: 10px;
91
+ border-radius: 50%;
92
+ animation: pulse 2s infinite;
93
+ }
94
+
95
+ .status-dot.connected {
96
+ background: #4ade80;
97
+ box-shadow: 0 0 10px #4ade80;
98
+ }
99
+
100
+ .status-dot.disconnected {
101
+ background: #f87171;
102
+ box-shadow: 0 0 10px #f87171;
103
+ }
104
+
105
+ @keyframes pulse {
106
+ 0%, 100% { opacity: 1; }
107
+ 50% { opacity: 0.5; }
108
+ }
109
+
110
+ /* Navigation styles will be injected by nav-bar.js */
111
+
112
+ .main-panel {
113
+ display: grid;
114
+ grid-template-columns: 1fr;
115
+ gap: 20px;
116
+ }
117
+
118
+ .stats-panel {
119
+ display: grid;
120
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
121
+ gap: 15px;
122
+ margin-bottom: 20px;
123
+ }
124
+
125
+ .stat-card {
126
+ background: rgba(255, 255, 255, 0.05);
127
+ backdrop-filter: blur(10px);
128
+ border: 1px solid rgba(255, 255, 255, 0.1);
129
+ border-radius: 10px;
130
+ padding: 15px;
131
+ display: flex;
132
+ align-items: center;
133
+ gap: 15px;
134
+ }
135
+
136
+ .stat-icon {
137
+ font-size: 24px;
138
+ background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
139
+ -webkit-background-clip: text;
140
+ -webkit-text-fill-color: transparent;
141
+ }
142
+
143
+ .stat-info {
144
+ flex: 1;
145
+ }
146
+
147
+ .stat-label {
148
+ font-size: 12px;
149
+ color: #94a3b8;
150
+ text-transform: uppercase;
151
+ letter-spacing: 0.5px;
152
+ }
153
+
154
+ .stat-value {
155
+ font-size: 24px;
156
+ font-weight: 600;
157
+ color: #e0e0e0;
158
+ }
159
+
160
+ .controls-panel {
161
+ background: rgba(255, 255, 255, 0.05);
162
+ backdrop-filter: blur(10px);
163
+ border: 1px solid rgba(255, 255, 255, 0.1);
164
+ border-radius: 10px;
165
+ padding: 15px;
166
+ margin-bottom: 20px;
167
+ display: flex;
168
+ gap: 15px;
169
+ align-items: center;
170
+ flex-wrap: wrap;
171
+ }
172
+
173
+ .control-group {
174
+ display: flex;
175
+ align-items: center;
176
+ gap: 10px;
177
+ }
178
+
179
+ .control-label {
180
+ font-size: 14px;
181
+ color: #94a3b8;
182
+ }
183
+
184
+ select, input[type="text"] {
185
+ padding: 8px 12px;
186
+ background: rgba(255, 255, 255, 0.1);
187
+ border: 1px solid rgba(255, 255, 255, 0.2);
188
+ border-radius: 6px;
189
+ color: #e0e0e0;
190
+ font-size: 14px;
191
+ }
192
+
193
+ select option {
194
+ background: #1e293b;
195
+ }
196
+
197
+ .btn {
198
+ padding: 8px 16px;
199
+ background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
200
+ border: none;
201
+ border-radius: 6px;
202
+ color: white;
203
+ cursor: pointer;
204
+ font-size: 14px;
205
+ font-weight: 500;
206
+ transition: all 0.3s;
207
+ }
208
+
209
+ .btn:hover {
210
+ transform: translateY(-2px);
211
+ box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
212
+ }
213
+
214
+ .btn.btn-secondary {
215
+ background: rgba(255, 255, 255, 0.1);
216
+ }
217
+
218
+ .btn.btn-secondary:hover {
219
+ background: rgba(255, 255, 255, 0.15);
220
+ }
221
+
222
+ .activity-panel {
223
+ background: rgba(255, 255, 255, 0.05);
224
+ backdrop-filter: blur(10px);
225
+ border: 1px solid rgba(255, 255, 255, 0.1);
226
+ border-radius: 10px;
227
+ padding: 20px;
228
+ flex: 1;
229
+ display: flex;
230
+ flex-direction: column;
231
+ min-height: 0;
232
+ }
233
+
234
+ .activity-header {
235
+ margin-bottom: 20px;
236
+ padding-bottom: 15px;
237
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
238
+ }
239
+
240
+ .activity-header h2 {
241
+ font-size: 18px;
242
+ color: #e0e0e0;
243
+ display: flex;
244
+ align-items: center;
245
+ gap: 10px;
246
+ }
247
+
248
+ #activity-tree-container {
249
+ flex: 1;
250
+ overflow-y: auto;
251
+ min-height: 200px;
252
+ }
253
+
254
+ /* Linear Tree Styles */
255
+ .linear-tree {
256
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
257
+ font-size: 14px;
258
+ line-height: 1.6;
259
+ }
260
+
261
+ .tree-node {
262
+ margin-bottom: 2px;
263
+ }
264
+
265
+ .tree-node-content {
266
+ display: flex;
267
+ align-items: center;
268
+ padding: 8px 12px;
269
+ background: rgba(255, 255, 255, 0.03);
270
+ border-radius: 6px;
271
+ cursor: pointer;
272
+ transition: all 0.2s;
273
+ border: 1px solid transparent;
274
+ }
275
+
276
+ .tree-node-content:hover {
277
+ background: rgba(255, 255, 255, 0.08);
278
+ border-color: rgba(16, 185, 129, 0.3);
279
+ }
280
+
281
+ .tree-node.selected .tree-node-content {
282
+ background: rgba(16, 185, 129, 0.2);
283
+ border-color: rgba(16, 185, 129, 0.5);
284
+ }
285
+
286
+ .tree-expand-icon {
287
+ width: 20px;
288
+ text-align: center;
289
+ color: #64748b;
290
+ font-size: 12px;
291
+ user-select: none;
292
+ }
293
+
294
+ .tree-icon {
295
+ margin: 0 8px;
296
+ font-size: 16px;
297
+ }
298
+
299
+ .tree-label {
300
+ flex: 1;
301
+ color: #e0e0e0;
302
+ overflow: hidden;
303
+ text-overflow: ellipsis;
304
+ white-space: nowrap;
305
+ }
306
+
307
+ .tree-label.clickable {
308
+ cursor: pointer;
309
+ }
310
+
311
+ .tree-label.clickable:hover {
312
+ color: #10b981;
313
+ }
314
+
315
+ .tree-meta {
316
+ margin-left: 10px;
317
+ font-size: 12px;
318
+ color: #64748b;
319
+ }
320
+
321
+ .tree-params {
322
+ margin-left: 10px;
323
+ font-size: 12px;
324
+ color: #94a3b8;
325
+ font-family: 'Monaco', 'Menlo', monospace;
326
+ max-width: 300px;
327
+ overflow: hidden;
328
+ text-overflow: ellipsis;
329
+ white-space: nowrap;
330
+ }
331
+
332
+ .tree-status {
333
+ margin-left: 10px;
334
+ padding: 2px 8px;
335
+ border-radius: 12px;
336
+ font-size: 11px;
337
+ text-transform: uppercase;
338
+ font-weight: 600;
339
+ letter-spacing: 0.5px;
340
+ }
341
+
342
+ .tree-status.status-active {
343
+ background: rgba(16, 185, 129, 0.2);
344
+ color: #4ade80;
345
+ }
346
+
347
+ .tree-status.status-completed {
348
+ background: rgba(59, 130, 246, 0.2);
349
+ color: #60a5fa;
350
+ }
351
+
352
+ .tree-status.status-in_progress {
353
+ background: rgba(251, 191, 36, 0.2);
354
+ color: #fbbf24;
355
+ }
356
+
357
+ .tree-status.status-pending {
358
+ background: rgba(148, 163, 184, 0.2);
359
+ color: #94a3b8;
360
+ }
361
+
362
+ .tree-children {
363
+ margin-left: 20px;
364
+ border-left: 1px solid rgba(255, 255, 255, 0.1);
365
+ padding-left: 10px;
366
+ margin-top: 5px;
367
+ }
368
+
369
+ .tree-node[data-level="1"] .tree-node-content {
370
+ padding-left: 30px;
371
+ }
372
+
373
+ .tree-node[data-level="2"] .tree-node-content {
374
+ padding-left: 50px;
375
+ }
376
+
377
+ .tree-node[data-level="3"] .tree-node-content {
378
+ padding-left: 70px;
379
+ }
380
+
381
+ .tree-node.session > .tree-node-content {
382
+ background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
383
+ border: 1px solid rgba(16, 185, 129, 0.3);
384
+ font-weight: 600;
385
+ }
386
+
387
+ .tree-node.agent > .tree-node-content {
388
+ background: rgba(59, 130, 246, 0.1);
389
+ border-left: 3px solid #3b82f6;
390
+ }
391
+
392
+ .tree-node.tool > .tree-node-content {
393
+ background: rgba(251, 191, 36, 0.05);
394
+ border-left: 3px solid #fbbf24;
395
+ }
396
+
397
+ .tree-node.user-instruction > .tree-node-content {
398
+ background: rgba(168, 85, 247, 0.1);
399
+ border-left: 3px solid #a855f7;
400
+ font-style: italic;
401
+ }
402
+
403
+ .tree-node.todowrite > .tree-node-content {
404
+ background: rgba(236, 72, 153, 0.1);
405
+ border-left: 3px solid #ec4899;
406
+ }
407
+
408
+ .tree-node.todo-item {
409
+ font-size: 13px;
410
+ }
411
+
412
+ .tree-node.todo-item.status-completed .tree-label {
413
+ text-decoration: line-through;
414
+ opacity: 0.7;
415
+ }
416
+
417
+ .tree-node.todo-item.current-active > .tree-node-content {
418
+ background: rgba(251, 191, 36, 0.2);
419
+ animation: highlight 1.5s ease-in-out infinite;
420
+ }
421
+
422
+ @keyframes highlight {
423
+ 0%, 100% { background: rgba(251, 191, 36, 0.2); }
424
+ 50% { background: rgba(251, 191, 36, 0.3); }
425
+ }
426
+
427
+ .tree-status-icon {
428
+ margin-left: 5px;
429
+ font-size: 14px;
430
+ }
431
+
432
+ /* Empty state */
433
+ .empty-state {
434
+ text-align: center;
435
+ padding: 60px 20px;
436
+ color: #64748b;
437
+ }
438
+
439
+ .empty-state-icon {
440
+ font-size: 48px;
441
+ margin-bottom: 20px;
442
+ opacity: 0.5;
443
+ }
444
+
445
+ .empty-state-title {
446
+ font-size: 18px;
447
+ margin-bottom: 10px;
448
+ color: #94a3b8;
449
+ }
450
+
451
+ .empty-state-text {
452
+ font-size: 14px;
453
+ color: #64748b;
454
+ }
455
+
456
+ /* Loading indicator */
457
+ .loading {
458
+ text-align: center;
459
+ padding: 40px;
460
+ }
461
+
462
+ .loading-spinner {
463
+ display: inline-block;
464
+ width: 40px;
465
+ height: 40px;
466
+ border: 4px solid rgba(16, 185, 129, 0.2);
467
+ border-top-color: #10b981;
468
+ border-radius: 50%;
469
+ animation: spin 1s linear infinite;
470
+ }
471
+
472
+ @keyframes spin {
473
+ to { transform: rotate(360deg); }
474
+ }
475
+ </style>
476
+ </head>
477
+ <body>
478
+ <div class="container">
479
+ <!-- Header -->
480
+ <div class="header">
481
+ <h1>🎯 Activity Dashboard</h1>
482
+ <div class="status-bar">
483
+ <div class="status-indicator">
484
+ <span class="status-dot disconnected" id="connection-status"></span>
485
+ <span id="connection-text">Disconnected</span>
486
+ </div>
487
+ <div class="status-indicator">
488
+ <span>📊</span>
489
+ <span id="event-count">0 events</span>
490
+ </div>
491
+ <div class="status-indicator">
492
+ <span>🎯</span>
493
+ <span id="session-count">0 sessions</span>
494
+ </div>
495
+ <div class="status-indicator">
496
+ <span>⏱️</span>
497
+ <span id="uptime">00:00:00</span>
498
+ </div>
499
+ </div>
500
+ </div>
501
+
502
+ <!-- Navigation Tabs -->
503
+ <div id="navigation-container"></div>
504
+
505
+ <!-- Statistics Panel -->
506
+ <div class="stats-panel">
507
+ <div class="stat-card">
508
+ <div class="stat-icon">🌳</div>
509
+ <div class="stat-info">
510
+ <div class="stat-label">Total Nodes</div>
511
+ <div class="stat-value" id="node-count">0</div>
512
+ </div>
513
+ </div>
514
+ <div class="stat-card">
515
+ <div class="stat-icon">🔄</div>
516
+ <div class="stat-info">
517
+ <div class="stat-label">Active</div>
518
+ <div class="stat-value" id="active-count">0</div>
519
+ </div>
520
+ </div>
521
+ <div class="stat-card">
522
+ <div class="stat-icon">📊</div>
523
+ <div class="stat-info">
524
+ <div class="stat-label">Tree Depth</div>
525
+ <div class="stat-value" id="tree-depth">0</div>
526
+ </div>
527
+ </div>
528
+ <div class="stat-card">
529
+ <div class="stat-icon">🤖</div>
530
+ <div class="stat-info">
531
+ <div class="stat-label">Agents</div>
532
+ <div class="stat-value" id="agent-count">0</div>
533
+ </div>
534
+ </div>
535
+ </div>
536
+
537
+ <!-- Controls Panel -->
538
+ <div class="controls-panel">
539
+ <div class="control-group">
540
+ <label class="control-label">Session:</label>
541
+ <select id="session-filter">
542
+ <option value="all">All Sessions</option>
543
+ </select>
544
+ </div>
545
+ <div class="control-group">
546
+ <label class="control-label">Time Range:</label>
547
+ <select id="time-range">
548
+ <option value="5min">Last 5 minutes</option>
549
+ <option value="30min" selected>Last 30 minutes</option>
550
+ <option value="1hour">Last hour</option>
551
+ <option value="all">All time</option>
552
+ </select>
553
+ </div>
554
+ <div class="control-group">
555
+ <input type="text" id="activity-search" placeholder="Search activities...">
556
+ </div>
557
+ <button class="btn btn-secondary" id="expand-all">Expand All</button>
558
+ <button class="btn btn-secondary" id="collapse-all">Collapse All</button>
559
+ <button class="btn btn-secondary" id="reset-zoom">Reset View</button>
560
+ <button class="btn" id="clear-activities">Clear All</button>
561
+ </div>
562
+
563
+ <!-- Main Activity Panel -->
564
+ <div class="activity-panel">
565
+ <div class="activity-header">
566
+ <h2>
567
+ <span>🌳</span>
568
+ <span>Activity Tree</span>
569
+ <span style="font-size: 14px; color: #64748b; margin-left: auto;">
570
+ Hierarchical view of PM → Agent → Tool activities
571
+ </span>
572
+ </h2>
573
+ </div>
574
+ <div id="activity-tree-container">
575
+ <div class="empty-state">
576
+ <div class="empty-state-icon">🎯</div>
577
+ <div class="empty-state-title">No Activities Yet</div>
578
+ <div class="empty-state-text">
579
+ Waiting for PM activity events...<br>
580
+ Activities will appear here as they occur.
581
+ </div>
582
+ </div>
583
+ </div>
584
+ </div>
585
+ </div>
586
+
587
+ <!-- Load components -->
588
+ <script type="module">
589
+ // Import modules at the top level (ES6 requirement)
590
+ import { SocketClient } from '/static/built/socket-client.js';
591
+ import { ActivityTree } from '/static/built/components/activity-tree.js';
592
+ import { SessionManager } from '/static/built/components/session-manager.js';
593
+ import { NavBar } from '/static/built/components/nav-bar.js';
594
+
595
+ // Wait for Socket.IO to be available
596
+ function waitForSocketIO() {
597
+ return new Promise((resolve) => {
598
+ if (typeof io !== 'undefined') {
599
+ console.log('Socket.IO is ready, version:', io.version || 'unknown');
600
+ resolve();
601
+ } else {
602
+ console.log('Waiting for Socket.IO...');
603
+ setTimeout(() => waitForSocketIO().then(resolve), 100);
604
+ }
605
+ });
606
+ }
607
+
608
+ // Initialize after Socket.IO is ready
609
+ await waitForSocketIO();
610
+ console.log('Starting dashboard initialization...');
611
+
612
+ // Initialize navigation
613
+ const navBar = new NavBar();
614
+ navBar.initialize('navigation-container');
615
+
616
+ // Initialize socket client
617
+ const socketClient = new SocketClient();
618
+ window.socketClient = socketClient;
619
+ console.log('Socket client created');
620
+
621
+ // Initialize session manager
622
+ const sessionManager = new SessionManager();
623
+ window.sessionManager = sessionManager;
624
+
625
+ // Initialize activity tree
626
+ const activityTree = new ActivityTree();
627
+ window.activityTreeInstance = activityTree;
628
+
629
+ // Connection status management
630
+ let startTime = Date.now();
631
+ let connectionAttempts = 0;
632
+
633
+ function updateConnectionStatus(connected) {
634
+ const statusDot = document.getElementById('connection-status');
635
+ const statusText = document.getElementById('connection-text');
636
+
637
+ if (connected) {
638
+ statusDot.className = 'status-dot connected';
639
+ statusText.textContent = 'Connected';
640
+ connectionAttempts = 0;
641
+ } else {
642
+ statusDot.className = 'status-dot disconnected';
643
+ statusText.textContent = connectionAttempts > 0 ?
644
+ `Reconnecting... (${connectionAttempts})` : 'Disconnected';
645
+ }
646
+ }
647
+
648
+ // Update uptime
649
+ setInterval(() => {
650
+ const uptime = Date.now() - startTime;
651
+ const hours = Math.floor(uptime / 3600000);
652
+ const minutes = Math.floor((uptime % 3600000) / 60000);
653
+ const seconds = Math.floor((uptime % 60000) / 1000);
654
+ document.getElementById('uptime').textContent =
655
+ `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
656
+ }, 1000);
657
+
658
+ // Socket event handlers
659
+ console.log('Setting up socket event handlers...');
660
+ socketClient.onConnection('connect', () => {
661
+ console.log('✅ Socket connected!');
662
+ updateConnectionStatus(true);
663
+ });
664
+
665
+ socketClient.onConnection('disconnect', (reason) => {
666
+ console.log('❌ Socket disconnected:', reason);
667
+ updateConnectionStatus(false);
668
+ });
669
+
670
+ socketClient.onConnection('error', (error) => {
671
+ console.error('Socket error:', error);
672
+ connectionAttempts++;
673
+ updateConnectionStatus(false);
674
+ });
675
+
676
+ // Note: reconnecting is handled internally by SocketClient
677
+ // We'll get disconnect/connect events instead
678
+
679
+ // Update statistics from socket data
680
+ socketClient.onEventUpdate((events, sessions) => {
681
+ console.log(`📊 Event update: ${events.length} events, ${sessions.size} sessions`);
682
+ document.getElementById('event-count').textContent = `${events.length} events`;
683
+ document.getElementById('session-count').textContent = `${sessions.size} sessions`;
684
+
685
+ // Update agent count
686
+ let agentCount = 0;
687
+ for (const session of sessions.values()) {
688
+ if (session.agents) {
689
+ agentCount += session.agents.size || 0;
690
+ }
691
+ }
692
+ document.getElementById('agent-count').textContent = agentCount.toString();
693
+ });
694
+
695
+ // Clear activities button
696
+ document.getElementById('clear-activities').addEventListener('click', () => {
697
+ if (confirm('Clear all activity data? This cannot be undone.')) {
698
+ socketClient.clearEvents();
699
+ activityTree.events = [];
700
+ activityTree.sessions.clear();
701
+ activityTree.processedEventIds.clear();
702
+ activityTree.renderTree();
703
+ }
704
+ });
705
+
706
+ // Connect to server
707
+ console.log('🚀 Initiating connection to Socket.IO server...');
708
+ socketClient.connect();
709
+
710
+ // Check connection status after a moment
711
+ setTimeout(() => {
712
+ if (socketClient.socket) {
713
+ console.log('Socket object exists:', {
714
+ connected: socketClient.socket.connected,
715
+ connecting: socketClient.socket.connecting,
716
+ id: socketClient.socket.id
717
+ });
718
+ } else {
719
+ console.error('❌ Socket object not created!');
720
+ }
721
+ }, 1000);
722
+
723
+ // Initialize activity tree after a short delay
724
+ setTimeout(() => {
725
+ activityTree.initialize();
726
+
727
+ // Remove empty state once tree is initialized
728
+ const container = document.getElementById('activity-tree-container');
729
+ if (container && activityTree.initialized) {
730
+ // The activity tree will handle its own rendering
731
+ console.log('Activity tree initialized and ready');
732
+ }
733
+ }, 100);
734
+ </script>
735
+ </body>
736
+ </html>