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.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/BASE_PM.md +43 -1
- claude_mpm/agents/INSTRUCTIONS.md +75 -1
- claude_mpm/agents/WORKFLOW.md +46 -1
- claude_mpm/agents/frontmatter_validator.py +20 -12
- claude_mpm/agents/templates/nextjs_engineer.json +277 -0
- claude_mpm/agents/templates/python_engineer.json +289 -0
- claude_mpm/agents/templates/react_engineer.json +11 -3
- claude_mpm/agents/templates/security.json +50 -9
- claude_mpm/cli/commands/agents.py +2 -2
- claude_mpm/cli/commands/uninstall.py +1 -2
- claude_mpm/cli/interactive/agent_wizard.py +3 -3
- claude_mpm/cli/parsers/agent_manager_parser.py +3 -3
- claude_mpm/cli/parsers/agents_parser.py +1 -1
- claude_mpm/constants.py +1 -1
- claude_mpm/core/error_handler.py +2 -4
- claude_mpm/core/file_utils.py +4 -12
- claude_mpm/core/log_manager.py +8 -5
- claude_mpm/core/logger.py +1 -1
- claude_mpm/core/logging_utils.py +6 -6
- claude_mpm/core/unified_agent_registry.py +18 -4
- claude_mpm/dashboard/react/components/DataInspector/DataInspector.module.css +188 -0
- claude_mpm/dashboard/react/components/EventViewer/EventViewer.module.css +156 -0
- claude_mpm/dashboard/react/components/shared/ConnectionStatus.module.css +38 -0
- claude_mpm/dashboard/react/components/shared/FilterBar.module.css +92 -0
- claude_mpm/dashboard/static/archive/activity_dashboard_fixed.html +248 -0
- claude_mpm/dashboard/static/archive/activity_dashboard_test.html +61 -0
- claude_mpm/dashboard/static/archive/test_activity_connection.html +179 -0
- claude_mpm/dashboard/static/archive/test_claude_tree_tab.html +68 -0
- claude_mpm/dashboard/static/archive/test_dashboard.html +409 -0
- claude_mpm/dashboard/static/archive/test_dashboard_fixed.html +519 -0
- claude_mpm/dashboard/static/archive/test_dashboard_verification.html +181 -0
- claude_mpm/dashboard/static/archive/test_file_data.html +315 -0
- claude_mpm/dashboard/static/archive/test_file_tree_empty_state.html +243 -0
- claude_mpm/dashboard/static/archive/test_file_tree_fix.html +234 -0
- claude_mpm/dashboard/static/archive/test_file_tree_rename.html +117 -0
- claude_mpm/dashboard/static/archive/test_file_tree_tab.html +115 -0
- claude_mpm/dashboard/static/archive/test_file_viewer.html +224 -0
- claude_mpm/dashboard/static/archive/test_final_activity.html +220 -0
- claude_mpm/dashboard/static/archive/test_tab_fix.html +139 -0
- claude_mpm/dashboard/static/built/assets/events.DjpNxWNo.css +1 -0
- claude_mpm/dashboard/static/built/components/activity-tree.js +1 -1
- claude_mpm/dashboard/static/built/components/agent-hierarchy.js +777 -0
- claude_mpm/dashboard/static/built/components/agent-inference.js +1 -1
- claude_mpm/dashboard/static/built/components/build-tracker.js +333 -0
- claude_mpm/dashboard/static/built/components/code-simple.js +857 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-breadcrumb.js +353 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-constants.js +235 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-search.js +409 -0
- claude_mpm/dashboard/static/built/components/code-tree/tree-utils.js +435 -0
- claude_mpm/dashboard/static/built/components/code-viewer.js +2 -1076
- claude_mpm/dashboard/static/built/components/connection-debug.js +654 -0
- claude_mpm/dashboard/static/built/components/diff-viewer.js +891 -0
- claude_mpm/dashboard/static/built/components/event-processor.js +1 -1
- claude_mpm/dashboard/static/built/components/event-viewer.js +1 -1
- claude_mpm/dashboard/static/built/components/export-manager.js +1 -1
- claude_mpm/dashboard/static/built/components/file-change-tracker.js +443 -0
- claude_mpm/dashboard/static/built/components/file-change-viewer.js +690 -0
- claude_mpm/dashboard/static/built/components/file-tool-tracker.js +1 -1
- claude_mpm/dashboard/static/built/components/module-viewer.js +1 -1
- claude_mpm/dashboard/static/built/components/nav-bar.js +145 -0
- claude_mpm/dashboard/static/built/components/page-structure.js +429 -0
- claude_mpm/dashboard/static/built/components/session-manager.js +1 -1
- claude_mpm/dashboard/static/built/components/ui-state-manager.js +2 -465
- claude_mpm/dashboard/static/built/components/working-directory.js +1 -1
- claude_mpm/dashboard/static/built/connection-manager.js +536 -0
- claude_mpm/dashboard/static/built/dashboard.js +1 -1
- claude_mpm/dashboard/static/built/extension-error-handler.js +164 -0
- claude_mpm/dashboard/static/built/react/events.js +30 -0
- claude_mpm/dashboard/static/built/shared/dom-helpers.js +396 -0
- claude_mpm/dashboard/static/built/shared/event-bus.js +330 -0
- claude_mpm/dashboard/static/built/shared/event-filter-service.js +540 -0
- claude_mpm/dashboard/static/built/shared/logger.js +385 -0
- claude_mpm/dashboard/static/built/shared/page-structure.js +251 -0
- claude_mpm/dashboard/static/built/shared/tooltip-service.js +253 -0
- claude_mpm/dashboard/static/built/socket-client.js +1 -1
- claude_mpm/dashboard/static/built/tab-isolation-fix.js +185 -0
- claude_mpm/dashboard/static/css/dashboard.css +28 -5
- claude_mpm/dashboard/static/dist/assets/events.DjpNxWNo.css +1 -0
- claude_mpm/dashboard/static/dist/components/activity-tree.js +1 -1
- claude_mpm/dashboard/static/dist/components/agent-inference.js +1 -1
- claude_mpm/dashboard/static/dist/components/code-viewer.js +2 -0
- claude_mpm/dashboard/static/dist/components/event-processor.js +1 -1
- claude_mpm/dashboard/static/dist/components/event-viewer.js +1 -1
- claude_mpm/dashboard/static/dist/components/export-manager.js +1 -1
- claude_mpm/dashboard/static/dist/components/file-tool-tracker.js +1 -1
- claude_mpm/dashboard/static/dist/components/module-viewer.js +1 -1
- claude_mpm/dashboard/static/dist/components/session-manager.js +1 -1
- claude_mpm/dashboard/static/dist/components/working-directory.js +1 -1
- claude_mpm/dashboard/static/dist/dashboard.js +1 -1
- claude_mpm/dashboard/static/dist/react/events.js +30 -0
- claude_mpm/dashboard/static/dist/socket-client.js +1 -1
- claude_mpm/dashboard/static/events.html +607 -0
- claude_mpm/dashboard/static/index.html +713 -0
- claude_mpm/dashboard/static/js/components/activity-tree.js +3 -17
- claude_mpm/dashboard/static/js/components/agent-hierarchy.js +4 -1
- claude_mpm/dashboard/static/js/components/agent-inference.js +3 -0
- claude_mpm/dashboard/static/js/components/build-tracker.js +8 -0
- claude_mpm/dashboard/static/js/components/code-viewer.js +306 -66
- claude_mpm/dashboard/static/js/components/event-processor.js +3 -0
- claude_mpm/dashboard/static/js/components/event-viewer.js +39 -2
- claude_mpm/dashboard/static/js/components/export-manager.js +3 -0
- claude_mpm/dashboard/static/js/components/file-tool-tracker.js +30 -10
- claude_mpm/dashboard/static/js/components/socket-manager.js +4 -0
- claude_mpm/dashboard/static/js/components/ui-state-manager.js +285 -85
- claude_mpm/dashboard/static/js/components/working-directory.js +3 -0
- claude_mpm/dashboard/static/js/dashboard.js +61 -33
- claude_mpm/dashboard/static/js/socket-client.js +12 -8
- claude_mpm/dashboard/static/js/stores/dashboard-store.js +562 -0
- claude_mpm/dashboard/static/js/tab-isolation-fix.js +185 -0
- claude_mpm/dashboard/static/legacy/activity.html +736 -0
- claude_mpm/dashboard/static/legacy/agents.html +786 -0
- claude_mpm/dashboard/static/legacy/files.html +747 -0
- claude_mpm/dashboard/static/legacy/tools.html +831 -0
- claude_mpm/dashboard/static/monitors-index.html +218 -0
- claude_mpm/dashboard/static/monitors.html +431 -0
- claude_mpm/dashboard/static/production/events.html +659 -0
- claude_mpm/dashboard/static/production/main.html +715 -0
- claude_mpm/dashboard/static/production/monitors.html +483 -0
- claude_mpm/dashboard/static/socket.io.min.js +7 -0
- claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +7 -0
- claude_mpm/dashboard/static/test-archive/dashboard.html +635 -0
- claude_mpm/dashboard/static/test-archive/debug-events.html +147 -0
- claude_mpm/dashboard/static/test-archive/test-navigation.html +256 -0
- claude_mpm/dashboard/static/test-archive/test-react-exports.html +180 -0
- claude_mpm/dashboard/templates/index.html +79 -9
- claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +1 -1
- claude_mpm/services/agents/deployment/agent_discovery_service.py +3 -0
- claude_mpm/services/agents/deployment/agent_template_builder.py +25 -8
- claude_mpm/services/agents/deployment/agent_validator.py +3 -0
- claude_mpm/services/agents/deployment/validation/template_validator.py +13 -4
- claude_mpm/services/agents/local_template_manager.py +2 -6
- claude_mpm/services/monitor/daemon.py +1 -2
- claude_mpm/services/monitor/daemon_manager.py +2 -5
- claude_mpm/services/monitor/event_emitter.py +2 -2
- claude_mpm/services/monitor/handlers/code_analysis.py +4 -6
- claude_mpm/services/monitor/handlers/hooks.py +2 -4
- claude_mpm/services/monitor/server.py +27 -4
- claude_mpm/tools/code_tree_analyzer.py +2 -2
- {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/METADATA +1 -1
- {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/RECORD +146 -81
- claude_mpm/dashboard/static/test-browser-monitor.html +0 -470
- claude_mpm/dashboard/static/test-simple.html +0 -97
- /claude_mpm/dashboard/static/{test_debug.html → test-archive/test_debug.html} +0 -0
- {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/WHEEL +0 -0
- {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.2.44.dist-info → claude_mpm-4.2.51.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,409 @@
|
|
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>Dashboard Test - Claude MPM</title>
|
7
|
+
<style>
|
8
|
+
body {
|
9
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
10
|
+
max-width: 1200px;
|
11
|
+
margin: 0 auto;
|
12
|
+
padding: 20px;
|
13
|
+
background: #f5f5f5;
|
14
|
+
}
|
15
|
+
.test-section {
|
16
|
+
background: white;
|
17
|
+
border-radius: 8px;
|
18
|
+
padding: 20px;
|
19
|
+
margin-bottom: 20px;
|
20
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
21
|
+
}
|
22
|
+
h1 {
|
23
|
+
color: #333;
|
24
|
+
border-bottom: 2px solid #007bff;
|
25
|
+
padding-bottom: 10px;
|
26
|
+
}
|
27
|
+
h2 {
|
28
|
+
color: #555;
|
29
|
+
margin-top: 0;
|
30
|
+
}
|
31
|
+
.test-result {
|
32
|
+
padding: 10px;
|
33
|
+
margin: 10px 0;
|
34
|
+
border-radius: 4px;
|
35
|
+
font-family: 'Courier New', monospace;
|
36
|
+
}
|
37
|
+
.success {
|
38
|
+
background: #d4edda;
|
39
|
+
border: 1px solid #c3e6cb;
|
40
|
+
color: #155724;
|
41
|
+
}
|
42
|
+
.error {
|
43
|
+
background: #f8d7da;
|
44
|
+
border: 1px solid #f5c6cb;
|
45
|
+
color: #721c24;
|
46
|
+
}
|
47
|
+
.warning {
|
48
|
+
background: #fff3cd;
|
49
|
+
border: 1px solid #ffeeba;
|
50
|
+
color: #856404;
|
51
|
+
}
|
52
|
+
.info {
|
53
|
+
background: #d1ecf1;
|
54
|
+
border: 1px solid #bee5eb;
|
55
|
+
color: #0c5460;
|
56
|
+
}
|
57
|
+
button {
|
58
|
+
background: #007bff;
|
59
|
+
color: white;
|
60
|
+
border: none;
|
61
|
+
padding: 10px 20px;
|
62
|
+
border-radius: 4px;
|
63
|
+
cursor: pointer;
|
64
|
+
margin: 5px;
|
65
|
+
}
|
66
|
+
button:hover {
|
67
|
+
background: #0056b3;
|
68
|
+
}
|
69
|
+
.event-list {
|
70
|
+
max-height: 300px;
|
71
|
+
overflow-y: auto;
|
72
|
+
border: 1px solid #ddd;
|
73
|
+
padding: 10px;
|
74
|
+
margin-top: 10px;
|
75
|
+
background: #f9f9f9;
|
76
|
+
}
|
77
|
+
.event-item {
|
78
|
+
padding: 5px;
|
79
|
+
margin: 2px 0;
|
80
|
+
background: white;
|
81
|
+
border-left: 3px solid #007bff;
|
82
|
+
font-size: 12px;
|
83
|
+
}
|
84
|
+
</style>
|
85
|
+
</head>
|
86
|
+
<body>
|
87
|
+
<h1>Dashboard Component Test Suite</h1>
|
88
|
+
|
89
|
+
<div class="test-section">
|
90
|
+
<h2>🔌 Connection Test</h2>
|
91
|
+
<button onclick="testConnection()">Test Socket Connection</button>
|
92
|
+
<div id="connection-result"></div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div class="test-section">
|
96
|
+
<h2>📊 Event Generation Test</h2>
|
97
|
+
<button onclick="generateTestEvents()">Generate Test Events</button>
|
98
|
+
<button onclick="clearTestEvents()">Clear Events</button>
|
99
|
+
<div id="event-result"></div>
|
100
|
+
<div id="event-list" class="event-list" style="display:none;"></div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div class="test-section">
|
104
|
+
<h2>🔧 Tool Detection Test</h2>
|
105
|
+
<button onclick="testToolDetection()">Test Tool Detection</button>
|
106
|
+
<div id="tool-result"></div>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div class="test-section">
|
110
|
+
<h2>📁 File Detection Test</h2>
|
111
|
+
<button onclick="testFileDetection()">Test File Detection</button>
|
112
|
+
<div id="file-result"></div>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="test-section">
|
116
|
+
<h2>🤖 Agent Detection Test</h2>
|
117
|
+
<button onclick="testAgentDetection()">Test Agent Detection</button>
|
118
|
+
<div id="agent-result"></div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div class="test-section">
|
122
|
+
<h2>📈 Dashboard Integration Test</h2>
|
123
|
+
<button onclick="testDashboardIntegration()">Run Full Integration Test</button>
|
124
|
+
<div id="integration-result"></div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<script>
|
128
|
+
// Test data
|
129
|
+
const testEvents = [
|
130
|
+
// Tool events
|
131
|
+
{
|
132
|
+
type: 'hook',
|
133
|
+
subtype: 'pre_tool',
|
134
|
+
tool_name: 'Read',
|
135
|
+
tool_parameters: { file_path: '/test/file1.py' },
|
136
|
+
agent_type: 'Engineer',
|
137
|
+
timestamp: new Date().toISOString(),
|
138
|
+
session_id: 'test-session-1'
|
139
|
+
},
|
140
|
+
{
|
141
|
+
type: 'hook',
|
142
|
+
subtype: 'post_tool',
|
143
|
+
tool_name: 'Read',
|
144
|
+
tool_parameters: { file_path: '/test/file1.py' },
|
145
|
+
agent_type: 'Engineer',
|
146
|
+
timestamp: new Date().toISOString(),
|
147
|
+
session_id: 'test-session-1',
|
148
|
+
success: true,
|
149
|
+
duration_ms: 100
|
150
|
+
},
|
151
|
+
{
|
152
|
+
type: 'tool_use',
|
153
|
+
tool_name: 'Write',
|
154
|
+
tool_parameters: { file_path: '/test/file2.js', content: 'test content' },
|
155
|
+
agent_type: 'PM',
|
156
|
+
timestamp: new Date().toISOString(),
|
157
|
+
session_id: 'test-session-1'
|
158
|
+
},
|
159
|
+
{
|
160
|
+
type: 'hook',
|
161
|
+
subtype: 'pre_tool',
|
162
|
+
tool_name: 'Bash',
|
163
|
+
tool_parameters: { command: 'ls -la /test' },
|
164
|
+
agent_type: 'DevOps',
|
165
|
+
timestamp: new Date().toISOString(),
|
166
|
+
session_id: 'test-session-2'
|
167
|
+
},
|
168
|
+
// Agent events
|
169
|
+
{
|
170
|
+
type: 'agent',
|
171
|
+
subtype: 'subagent_start',
|
172
|
+
agent_type: 'Engineer',
|
173
|
+
timestamp: new Date().toISOString(),
|
174
|
+
session_id: 'test-session-1'
|
175
|
+
},
|
176
|
+
{
|
177
|
+
type: 'agent',
|
178
|
+
subtype: 'subagent_stop',
|
179
|
+
agent_type: 'Engineer',
|
180
|
+
timestamp: new Date().toISOString(),
|
181
|
+
session_id: 'test-session-1'
|
182
|
+
},
|
183
|
+
// File operations in bash
|
184
|
+
{
|
185
|
+
type: 'hook',
|
186
|
+
subtype: 'pre_tool',
|
187
|
+
tool_name: 'Bash',
|
188
|
+
tool_parameters: { command: 'cat /test/config.json' },
|
189
|
+
agent_type: 'QA',
|
190
|
+
timestamp: new Date().toISOString(),
|
191
|
+
session_id: 'test-session-3'
|
192
|
+
},
|
193
|
+
{
|
194
|
+
type: 'hook',
|
195
|
+
subtype: 'pre_tool',
|
196
|
+
tool_name: 'Grep',
|
197
|
+
tool_parameters: { pattern: 'TODO', path: '/test' },
|
198
|
+
agent_type: 'QA',
|
199
|
+
timestamp: new Date().toISOString(),
|
200
|
+
session_id: 'test-session-3'
|
201
|
+
}
|
202
|
+
];
|
203
|
+
|
204
|
+
function testConnection() {
|
205
|
+
const resultDiv = document.getElementById('connection-result');
|
206
|
+
resultDiv.innerHTML = '<div class="info">Testing socket connection...</div>';
|
207
|
+
|
208
|
+
// Check if dashboard components are loaded
|
209
|
+
const checks = {
|
210
|
+
'Dashboard': typeof window.Dashboard !== 'undefined',
|
211
|
+
'FileToolTracker': typeof window.FileToolTracker !== 'undefined',
|
212
|
+
'AgentInference': typeof window.AgentInference !== 'undefined',
|
213
|
+
'EventProcessor': typeof window.EventProcessor !== 'undefined'
|
214
|
+
};
|
215
|
+
|
216
|
+
let allLoaded = true;
|
217
|
+
let html = '';
|
218
|
+
|
219
|
+
for (const [component, loaded] of Object.entries(checks)) {
|
220
|
+
if (loaded) {
|
221
|
+
html += `<div class="success">✅ ${component} loaded</div>`;
|
222
|
+
} else {
|
223
|
+
html += `<div class="error">❌ ${component} not loaded</div>`;
|
224
|
+
allLoaded = false;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
if (allLoaded) {
|
229
|
+
html += '<div class="success"><strong>All dashboard components loaded successfully!</strong></div>';
|
230
|
+
} else {
|
231
|
+
html += '<div class="warning"><strong>Some components are missing. Check if dashboard is properly loaded.</strong></div>';
|
232
|
+
}
|
233
|
+
|
234
|
+
resultDiv.innerHTML = html;
|
235
|
+
}
|
236
|
+
|
237
|
+
function generateTestEvents() {
|
238
|
+
const resultDiv = document.getElementById('event-result');
|
239
|
+
const listDiv = document.getElementById('event-list');
|
240
|
+
|
241
|
+
resultDiv.innerHTML = '<div class="info">Generating test events...</div>';
|
242
|
+
listDiv.style.display = 'block';
|
243
|
+
listDiv.innerHTML = '';
|
244
|
+
|
245
|
+
testEvents.forEach((event, index) => {
|
246
|
+
const eventDiv = document.createElement('div');
|
247
|
+
eventDiv.className = 'event-item';
|
248
|
+
eventDiv.innerHTML = `
|
249
|
+
<strong>Event ${index + 1}:</strong>
|
250
|
+
Type: ${event.type},
|
251
|
+
Tool: ${event.tool_name || 'N/A'},
|
252
|
+
Agent: ${event.agent_type || 'N/A'}
|
253
|
+
`;
|
254
|
+
listDiv.appendChild(eventDiv);
|
255
|
+
});
|
256
|
+
|
257
|
+
resultDiv.innerHTML = `<div class="success">Generated ${testEvents.length} test events</div>`;
|
258
|
+
}
|
259
|
+
|
260
|
+
function clearTestEvents() {
|
261
|
+
document.getElementById('event-list').style.display = 'none';
|
262
|
+
document.getElementById('event-result').innerHTML = '<div class="info">Events cleared</div>';
|
263
|
+
}
|
264
|
+
|
265
|
+
function testToolDetection() {
|
266
|
+
const resultDiv = document.getElementById('tool-result');
|
267
|
+
|
268
|
+
if (typeof window.FileToolTracker === 'undefined') {
|
269
|
+
resultDiv.innerHTML = '<div class="error">FileToolTracker not loaded</div>';
|
270
|
+
return;
|
271
|
+
}
|
272
|
+
|
273
|
+
// Create a test instance
|
274
|
+
const tracker = new window.FileToolTracker();
|
275
|
+
|
276
|
+
// Test tool detection
|
277
|
+
const toolEvents = testEvents.filter(e => tracker.isToolOperation(e));
|
278
|
+
|
279
|
+
resultDiv.innerHTML = `
|
280
|
+
<div class="success">Tool Detection Results:</div>
|
281
|
+
<div class="info">Found ${toolEvents.length} tool operations out of ${testEvents.length} events</div>
|
282
|
+
${toolEvents.map(e => `
|
283
|
+
<div class="test-result success">
|
284
|
+
✅ Detected: ${e.tool_name} (${e.type}/${e.subtype})
|
285
|
+
</div>
|
286
|
+
`).join('')}
|
287
|
+
`;
|
288
|
+
|
289
|
+
// Update tool calls
|
290
|
+
tracker.updateToolCalls(testEvents);
|
291
|
+
const toolCalls = tracker.getToolCalls();
|
292
|
+
|
293
|
+
resultDiv.innerHTML += `
|
294
|
+
<div class="info">Tool calls map size: ${toolCalls.size}</div>
|
295
|
+
`;
|
296
|
+
}
|
297
|
+
|
298
|
+
function testFileDetection() {
|
299
|
+
const resultDiv = document.getElementById('file-result');
|
300
|
+
|
301
|
+
if (typeof window.FileToolTracker === 'undefined') {
|
302
|
+
resultDiv.innerHTML = '<div class="error">FileToolTracker not loaded</div>';
|
303
|
+
return;
|
304
|
+
}
|
305
|
+
|
306
|
+
// Create a test instance
|
307
|
+
const tracker = new window.FileToolTracker();
|
308
|
+
|
309
|
+
// Test file detection
|
310
|
+
const fileEvents = testEvents.filter(e => tracker.isFileOperation(e));
|
311
|
+
|
312
|
+
resultDiv.innerHTML = `
|
313
|
+
<div class="success">File Detection Results:</div>
|
314
|
+
<div class="info">Found ${fileEvents.length} file operations out of ${testEvents.length} events</div>
|
315
|
+
${fileEvents.map(e => `
|
316
|
+
<div class="test-result success">
|
317
|
+
✅ Detected: ${e.tool_name} - ${e.tool_parameters?.file_path || e.tool_parameters?.command || 'N/A'}
|
318
|
+
</div>
|
319
|
+
`).join('')}
|
320
|
+
`;
|
321
|
+
|
322
|
+
// Update file operations
|
323
|
+
tracker.updateFileOperations(testEvents);
|
324
|
+
const fileOps = tracker.getFileOperations();
|
325
|
+
|
326
|
+
resultDiv.innerHTML += `
|
327
|
+
<div class="info">File operations map size: ${fileOps.size}</div>
|
328
|
+
${Array.from(fileOps.entries()).map(([path, data]) => `
|
329
|
+
<div class="test-result info">
|
330
|
+
📁 ${path}: ${data.operations.length} operations
|
331
|
+
</div>
|
332
|
+
`).join('')}
|
333
|
+
`;
|
334
|
+
}
|
335
|
+
|
336
|
+
function testAgentDetection() {
|
337
|
+
const resultDiv = document.getElementById('agent-result');
|
338
|
+
|
339
|
+
if (typeof window.AgentInference === 'undefined') {
|
340
|
+
resultDiv.innerHTML = '<div class="error">AgentInference not loaded</div>';
|
341
|
+
return;
|
342
|
+
}
|
343
|
+
|
344
|
+
// Create a test instance with mock event viewer
|
345
|
+
const mockEventViewer = { events: testEvents };
|
346
|
+
const inference = new window.AgentInference(mockEventViewer);
|
347
|
+
|
348
|
+
// Test agent inference
|
349
|
+
const results = testEvents.map(e => {
|
350
|
+
const result = inference.inferAgentFromEvent(e);
|
351
|
+
return { event: e, inference: result };
|
352
|
+
});
|
353
|
+
|
354
|
+
resultDiv.innerHTML = `
|
355
|
+
<div class="success">Agent Detection Results:</div>
|
356
|
+
${results.map(r => `
|
357
|
+
<div class="test-result ${r.inference.type === 'subagent' ? 'success' : 'info'}">
|
358
|
+
${r.inference.type === 'subagent' ? '🤖' : '🎯'}
|
359
|
+
${r.inference.agentName}
|
360
|
+
(${r.inference.confidence}) -
|
361
|
+
${r.event.type}/${r.event.subtype || 'N/A'}
|
362
|
+
</div>
|
363
|
+
`).join('')}
|
364
|
+
`;
|
365
|
+
}
|
366
|
+
|
367
|
+
function testDashboardIntegration() {
|
368
|
+
const resultDiv = document.getElementById('integration-result');
|
369
|
+
|
370
|
+
resultDiv.innerHTML = '<div class="info">Running full integration test...</div>';
|
371
|
+
|
372
|
+
// Run all tests
|
373
|
+
const tests = [
|
374
|
+
{ name: 'Connection', fn: testConnection },
|
375
|
+
{ name: 'Event Generation', fn: generateTestEvents },
|
376
|
+
{ name: 'Tool Detection', fn: testToolDetection },
|
377
|
+
{ name: 'File Detection', fn: testFileDetection },
|
378
|
+
{ name: 'Agent Detection', fn: testAgentDetection }
|
379
|
+
];
|
380
|
+
|
381
|
+
let allPassed = true;
|
382
|
+
let results = [];
|
383
|
+
|
384
|
+
tests.forEach(test => {
|
385
|
+
try {
|
386
|
+
test.fn();
|
387
|
+
results.push(`<div class="success">✅ ${test.name} passed</div>`);
|
388
|
+
} catch (error) {
|
389
|
+
results.push(`<div class="error">❌ ${test.name} failed: ${error.message}</div>`);
|
390
|
+
allPassed = false;
|
391
|
+
}
|
392
|
+
});
|
393
|
+
|
394
|
+
resultDiv.innerHTML = `
|
395
|
+
<h3>Integration Test Results:</h3>
|
396
|
+
${results.join('')}
|
397
|
+
<div class="${allPassed ? 'success' : 'warning'}">
|
398
|
+
<strong>${allPassed ? '✅ All tests passed!' : '⚠️ Some tests failed'}</strong>
|
399
|
+
</div>
|
400
|
+
`;
|
401
|
+
}
|
402
|
+
|
403
|
+
// Auto-run connection test on load
|
404
|
+
window.addEventListener('DOMContentLoaded', () => {
|
405
|
+
setTimeout(testConnection, 500);
|
406
|
+
});
|
407
|
+
</script>
|
408
|
+
</body>
|
409
|
+
</html>
|