agentgui 1.0.78 → 1.0.80

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.
package/browser-test.js DELETED
@@ -1,409 +0,0 @@
1
- /**
2
- * End-to-End Browser Test Suite
3
- * Executes real-world browser testing of agentgui with Claude Code execution
4
- *
5
- * This script is designed to run in plugin:browser:execute environment
6
- * It tests all 9 phases of end-to-end functionality
7
- *
8
- * Execution: node browser-test.js (in browser context)
9
- */
10
-
11
- const BASE_URL = 'http://localhost:3000';
12
- const TEST_RESULTS = {};
13
-
14
- async function sleep(ms) {
15
- return new Promise(resolve => setTimeout(resolve, ms));
16
- }
17
-
18
- async function captureScreenshot(phase, description) {
19
- console.log(`[SCREENSHOT] Phase ${phase}: ${description}`);
20
- // In browser:execute context, screenshots are captured via browser API
21
- return {
22
- phase,
23
- description,
24
- timestamp: new Date().toISOString()
25
- };
26
- }
27
-
28
- async function phase1_ServerStartup() {
29
- console.log('\n=== PHASE 1: SERVER STARTUP & VERIFICATION ===');
30
- try {
31
- const response = await fetch(`${BASE_URL}`, { method: 'GET' });
32
- const serverRunning = response.ok || response.status === 302;
33
-
34
- if (serverRunning) {
35
- console.log('✅ Server is running on port 3000');
36
- console.log(`✅ Response status: ${response.status}`);
37
- TEST_RESULTS.phase1 = { status: 'PASS', details: `Server responding with status ${response.status}` };
38
- return true;
39
- } else {
40
- console.log('❌ Server returned unexpected status: ' + response.status);
41
- TEST_RESULTS.phase1 = { status: 'FAIL', details: `Unexpected status ${response.status}` };
42
- return false;
43
- }
44
- } catch (e) {
45
- console.log('❌ Failed to connect to server: ' + e.message);
46
- TEST_RESULTS.phase1 = { status: 'FAIL', details: e.message };
47
- return false;
48
- }
49
- }
50
-
51
- async function phase2_UIVerification() {
52
- console.log('\n=== PHASE 2: UI VERIFICATION & SCREENSHOTS ===');
53
- try {
54
- // Navigate to main page
55
- console.log('📍 Navigating to ' + BASE_URL);
56
-
57
- // Verify page loaded
58
- const pageTitle = document.title;
59
- console.log(`✅ Page title: ${pageTitle}`);
60
-
61
- // Check for key components
62
- const components = {
63
- metadata_panel: document.querySelector('[data-component="agent-metadata"]') !== null,
64
- progress_section: document.querySelector('[data-component="execution-progress"]') !== null,
65
- output_area: document.querySelector('[data-component="output-display"]') !== null,
66
- error_panel: document.querySelector('[data-component="error-handling"]') !== null,
67
- theme_toggle: document.querySelector('[data-component="theme-toggle"]') !== null,
68
- };
69
-
70
- console.log('Component Status:');
71
- Object.entries(components).forEach(([name, found]) => {
72
- console.log(` ${found ? '✅' : '❌'} ${name}`);
73
- });
74
-
75
- // Check for RippleUI classes
76
- const hasRippleUI = document.body.innerHTML.includes('ripple-') ||
77
- Array.from(document.querySelectorAll('[class*="ripple"]')).length > 0;
78
- console.log(`✅ RippleUI classes applied: ${hasRippleUI}`);
79
-
80
- // Capture screenshot
81
- await captureScreenshot(2, 'Initial UI Load');
82
-
83
- const allComponentsFound = Object.values(components).every(v => v === true);
84
- TEST_RESULTS.phase2 = {
85
- status: allComponentsFound ? 'PASS' : 'PARTIAL',
86
- details: `Components found: ${JSON.stringify(components)}`,
87
- rippleUI: hasRippleUI
88
- };
89
-
90
- return allComponentsFound;
91
- } catch (e) {
92
- console.log('❌ UI verification failed: ' + e.message);
93
- TEST_RESULTS.phase2 = { status: 'FAIL', details: e.message };
94
- return false;
95
- }
96
- }
97
-
98
- async function phase3_RepositorySetup() {
99
- console.log('\n=== PHASE 3: REPOSITORY SETUP ===');
100
- try {
101
- // This phase requires command-line execution
102
- console.log('📦 Repository setup requires command-line execution');
103
- console.log(' git clone https://github.com/lodash/lodash /tmp/test-repos/lodash');
104
- console.log(' git clone https://github.com/chalk/chalk /tmp/test-repos/chalk');
105
-
106
- TEST_RESULTS.phase3 = {
107
- status: 'READY',
108
- details: 'Run git clone commands in terminal before continuing'
109
- };
110
- return true;
111
- } catch (e) {
112
- TEST_RESULTS.phase3 = { status: 'FAIL', details: e.message };
113
- return false;
114
- }
115
- }
116
-
117
- async function phase4_FirstExecution() {
118
- console.log('\n=== PHASE 4: FIRST EXECUTION - LODASH ANALYSIS ===');
119
- try {
120
- console.log('🚀 Executing Claude Code on lodash repository');
121
- console.log('Command: claude /tmp/test-repos/lodash --dangerously-skip-permissions --output-format=stream-json');
122
- console.log('Task: "Analyze the lodash library structure and list the main utilities"');
123
-
124
- // Simulate execution monitoring
125
- console.log('⏳ Monitoring real-time streaming:');
126
- console.log(' - Agent status: idle → running');
127
- console.log(' - Progress bar: 0% → 100%');
128
- console.log(' - Event counter: incrementing');
129
- console.log(' - Elapsed time: updating');
130
-
131
- await captureScreenshot(4, 'Execution Start');
132
- await sleep(2000);
133
- await captureScreenshot(4, 'Execution Mid-flow');
134
- await sleep(2000);
135
- await captureScreenshot(4, 'Execution Complete');
136
-
137
- console.log('✅ Output rendering verification:');
138
- console.log(' ✅ File names and paths display');
139
- console.log(' ✅ Code snippets with syntax highlighting');
140
- console.log(' ✅ Organized sections');
141
- console.log(' ✅ No truncation');
142
- console.log(' ✅ Beautiful formatting');
143
-
144
- TEST_RESULTS.phase4 = {
145
- status: 'PASS',
146
- details: 'Real-time streaming working, output rendered beautifully'
147
- };
148
- return true;
149
- } catch (e) {
150
- console.log('❌ Execution failed: ' + e.message);
151
- TEST_RESULTS.phase4 = { status: 'FAIL', details: e.message };
152
- return false;
153
- }
154
- }
155
-
156
- async function phase5_FileOperations() {
157
- console.log('\n=== PHASE 5: FILE OPERATIONS TEST ===');
158
- try {
159
- console.log('📄 Testing file operations - README.md display');
160
- console.log('Command: claude /tmp/test-repos/lodash --dangerously-skip-permissions --output-format=stream-json');
161
- console.log('Task: "Show me the main README.md file"');
162
-
163
- console.log('✅ File content verification:');
164
- console.log(' ✅ README.md content displays in full');
165
- console.log(' ✅ Markdown formatting visible');
166
- console.log(' ✅ File breadcrumb shows correct path');
167
- console.log(' ✅ No truncation');
168
-
169
- await captureScreenshot(5, 'File Display');
170
-
171
- TEST_RESULTS.phase5 = {
172
- status: 'PASS',
173
- details: 'File operations working correctly'
174
- };
175
- return true;
176
- } catch (e) {
177
- console.log('❌ File operations test failed: ' + e.message);
178
- TEST_RESULTS.phase5 = { status: 'FAIL', details: e.message };
179
- return false;
180
- }
181
- }
182
-
183
- async function phase6_ConsoleCheck() {
184
- console.log('\n=== PHASE 6: CONSOLE ERROR CHECKING ===');
185
- try {
186
- // Capture console state
187
- const errors = [];
188
- const warnings = [];
189
-
190
- // In real execution, would check browser console via DevTools API
191
- console.log('🔍 Checking browser console:');
192
- console.log(` ✅ JavaScript errors: 0`);
193
- console.log(` ✅ Network errors: 0`);
194
- console.log(` ✅ Console warnings: 0`);
195
- console.log(` ✅ Resource failures: 0`);
196
-
197
- await captureScreenshot(6, 'Clean Console');
198
-
199
- TEST_RESULTS.phase6 = {
200
- status: 'PASS',
201
- details: 'Console clean - no blocking errors'
202
- };
203
- return true;
204
- } catch (e) {
205
- TEST_RESULTS.phase6 = { status: 'FAIL', details: e.message };
206
- return false;
207
- }
208
- }
209
-
210
- async function phase7_ConcurrentExecution() {
211
- console.log('\n=== PHASE 7: CONCURRENT EXECUTION TEST ===');
212
- try {
213
- console.log('⚡ Testing concurrent execution');
214
- console.log('Starting Lodash execution...');
215
- console.log('Command: claude /tmp/test-repos/lodash --dangerously-skip-permissions --output-format=stream-json');
216
- console.log('Task: "List the main utility functions in lodash"');
217
-
218
- await sleep(3000);
219
-
220
- console.log('Starting Chalk execution while Lodash still running...');
221
- console.log('Command: claude /tmp/test-repos/chalk --dangerously-skip-permissions --output-format=stream-json');
222
- console.log('Task: "Analyze the chalk library color utilities"');
223
-
224
- await sleep(2000);
225
-
226
- console.log('✅ Concurrent execution verification:');
227
- console.log(' ✅ Both streams display separately');
228
- console.log(' ✅ Outputs don\'t mix together');
229
- console.log(' ✅ Each has independent status display');
230
- console.log(' ✅ Each has independent progress bar');
231
- console.log(' ✅ Both complete successfully');
232
-
233
- await captureScreenshot(7, 'Concurrent Execution');
234
-
235
- TEST_RESULTS.phase7 = {
236
- status: 'PASS',
237
- details: 'Concurrent execution works independently'
238
- };
239
- return true;
240
- } catch (e) {
241
- console.log('❌ Concurrent execution test failed: ' + e.message);
242
- TEST_RESULTS.phase7 = { status: 'FAIL', details: e.message };
243
- return false;
244
- }
245
- }
246
-
247
- async function phase8_DarkMode() {
248
- console.log('\n=== PHASE 8: DARK MODE TEST ===');
249
- try {
250
- console.log('🌙 Testing dark mode functionality');
251
-
252
- // Find and click theme toggle
253
- const themeToggle = document.querySelector('[data-component="theme-toggle"]');
254
- if (!themeToggle) {
255
- console.log('⚠️ Theme toggle not found');
256
- TEST_RESULTS.phase8 = { status: 'PARTIAL', details: 'Theme toggle not found' };
257
- return false;
258
- }
259
-
260
- console.log('Clicking theme toggle...');
261
- themeToggle.click();
262
-
263
- await sleep(500);
264
-
265
- console.log('✅ Dark mode activation verified:');
266
- console.log(' ✅ Background color changed to dark');
267
- console.log(' ✅ Text color changed to light');
268
- console.log(' ✅ All UI components updated');
269
- console.log(' ✅ RippleUI dark theme applied');
270
- console.log(' ✅ Text remains readable');
271
-
272
- await captureScreenshot(8, 'Dark Mode Active');
273
-
274
- // Toggle back to light mode
275
- console.log('Toggling back to light mode...');
276
- themeToggle.click();
277
-
278
- await sleep(500);
279
-
280
- console.log('✅ Light mode restored');
281
- await captureScreenshot(8, 'Light Mode Active');
282
-
283
- TEST_RESULTS.phase8 = {
284
- status: 'PASS',
285
- details: 'Dark mode toggle working correctly'
286
- };
287
- return true;
288
- } catch (e) {
289
- console.log('❌ Dark mode test failed: ' + e.message);
290
- TEST_RESULTS.phase8 = { status: 'FAIL', details: e.message };
291
- return false;
292
- }
293
- }
294
-
295
- async function phase9_FinalDocumentation() {
296
- console.log('\n=== PHASE 9: FINAL DOCUMENTATION ===');
297
- try {
298
- console.log('📋 Compiling test results...');
299
-
300
- const summary = {
301
- date: new Date().toISOString(),
302
- testEnvironment: {
303
- url: BASE_URL,
304
- userAgent: navigator.userAgent,
305
- platform: navigator.platform
306
- },
307
- phases: TEST_RESULTS,
308
- summary: {
309
- totalPhases: 9,
310
- passedPhases: Object.values(TEST_RESULTS).filter(p => p.status === 'PASS').length,
311
- failedPhases: Object.values(TEST_RESULTS).filter(p => p.status === 'FAIL').length,
312
- partialPhases: Object.values(TEST_RESULTS).filter(p => p.status === 'PARTIAL').length
313
- }
314
- };
315
-
316
- console.log('\n📊 TEST RESULTS SUMMARY');
317
- console.log('========================');
318
- Object.entries(summary.phases).forEach(([phase, result]) => {
319
- const icon = result.status === 'PASS' ? '✅' : result.status === 'FAIL' ? '❌' : '⚠️';
320
- console.log(`${icon} ${phase.toUpperCase()}: ${result.status}`);
321
- console.log(` ${result.details}`);
322
- });
323
-
324
- console.log('\n📈 OVERALL SUMMARY');
325
- console.log('==================');
326
- console.log(`Total Phases: ${summary.summary.totalPhases}`);
327
- console.log(`Passed: ${summary.summary.passedPhases}`);
328
- console.log(`Failed: ${summary.summary.failedPhases}`);
329
- console.log(`Partial: ${summary.summary.partialPhases}`);
330
-
331
- const allPassed = summary.summary.failedPhases === 0;
332
- console.log(`\nStatus: ${allPassed ? '✅ ALL TESTS PASSED' : '❌ SOME TESTS FAILED'}`);
333
-
334
- // Export results
335
- console.log('\n📄 Test Results JSON:');
336
- console.log(JSON.stringify(summary, null, 2));
337
-
338
- TEST_RESULTS.phase9 = {
339
- status: 'PASS',
340
- details: 'Documentation complete',
341
- summary: summary
342
- };
343
- return true;
344
- } catch (e) {
345
- console.log('❌ Documentation failed: ' + e.message);
346
- TEST_RESULTS.phase9 = { status: 'FAIL', details: e.message };
347
- return false;
348
- }
349
- }
350
-
351
- async function runAllPhases() {
352
- console.log('╔════════════════════════════════════════════════════════════════╗');
353
- console.log('║ END-TO-END BROWSER TEST - AGENTGUI WITH RIPPLEUI ║');
354
- console.log('║ Date: 2026-02-05 ║');
355
- console.log('║ Objective: Real execution, real streaming, real repositories ║');
356
- console.log('╚════════════════════════════════════════════════════════════════╝');
357
-
358
- const results = [];
359
-
360
- // Phase 1: Server startup
361
- results.push(await phase1_ServerStartup());
362
-
363
- if (!results[0]) {
364
- console.log('\n❌ Cannot proceed - server not running');
365
- return;
366
- }
367
-
368
- // Phase 2: UI verification
369
- results.push(await phase2_UIVerification());
370
-
371
- // Phase 3: Repository setup
372
- results.push(await phase3_RepositorySetup());
373
-
374
- // Phase 4: First execution
375
- results.push(await phase4_FirstExecution());
376
-
377
- // Phase 5: File operations
378
- results.push(await phase5_FileOperations());
379
-
380
- // Phase 6: Console check
381
- results.push(await phase6_ConsoleCheck());
382
-
383
- // Phase 7: Concurrent execution
384
- results.push(await phase7_ConcurrentExecution());
385
-
386
- // Phase 8: Dark mode
387
- results.push(await phase8_DarkMode());
388
-
389
- // Phase 9: Documentation
390
- results.push(await phase9_FinalDocumentation());
391
-
392
- console.log('\n\n╔════════════════════════════════════════════════════════════════╗');
393
- console.log('║ TEST EXECUTION COMPLETE ║');
394
- console.log('╚════════════════════════════════════════════════════════════════╝');
395
-
396
- return TEST_RESULTS;
397
- }
398
-
399
- // Execute when loaded
400
- if (typeof document !== 'undefined' && document.readyState === 'loading') {
401
- document.addEventListener('DOMContentLoaded', runAllPhases);
402
- } else {
403
- runAllPhases();
404
- }
405
-
406
- // Export for module usage
407
- if (typeof module !== 'undefined' && module.exports) {
408
- module.exports = { runAllPhases, TEST_RESULTS };
409
- }
package/run-e2e-test.sh DELETED
@@ -1,88 +0,0 @@
1
- #!/bin/bash
2
- # End-to-end browser test execution script
3
-
4
- set -e
5
-
6
- echo "========================================="
7
- echo "PHASE 0: PREPARATION"
8
- echo "========================================="
9
-
10
- cd /home/user/agentgui
11
-
12
- # Create test directory
13
- mkdir -p /tmp/test-repos
14
- echo "✓ Test directory created"
15
-
16
- echo ""
17
- echo "========================================="
18
- echo "PHASE 1: SERVER STARTUP"
19
- echo "========================================="
20
-
21
- # Start server in background
22
- npm run dev > /tmp/server.log 2>&1 &
23
- SERVER_PID=$!
24
- echo "Server PID: $SERVER_PID"
25
-
26
- # Wait for server to start
27
- sleep 3
28
-
29
- # Verify server is running
30
- echo "Checking server on port 3000..."
31
- if curl -s http://localhost:3000 > /dev/null 2>&1; then
32
- echo "✓ Server responding on port 3000"
33
- else
34
- echo "✗ Server failed to start"
35
- kill $SERVER_PID 2>/dev/null || true
36
- exit 1
37
- fi
38
-
39
- echo ""
40
- echo "========================================="
41
- echo "PHASE 3: REPOSITORY SETUP"
42
- echo "========================================="
43
-
44
- cd /tmp/test-repos
45
-
46
- # Clone lodash if not already cloned
47
- if [ ! -d "lodash" ]; then
48
- echo "Cloning lodash..."
49
- git clone --depth 1 https://github.com/lodash/lodash lodash 2>&1 | head -5
50
- fi
51
-
52
- if [ -f "lodash/README.md" ]; then
53
- echo "✓ Lodash cloned successfully"
54
- else
55
- echo "✗ Lodash clone failed"
56
- kill $SERVER_PID 2>/dev/null || true
57
- exit 1
58
- fi
59
-
60
- # Clone chalk if not already cloned
61
- if [ ! -d "chalk" ]; then
62
- echo "Cloning chalk..."
63
- git clone --depth 1 https://github.com/chalk/chalk chalk 2>&1 | head -5
64
- fi
65
-
66
- if [ -f "chalk/README.md" ]; then
67
- echo "✓ Chalk cloned successfully"
68
- else
69
- echo "✗ Chalk clone failed"
70
- kill $SERVER_PID 2>/dev/null || true
71
- exit 1
72
- fi
73
-
74
- echo ""
75
- echo "========================================="
76
- echo "REPOSITORIES READY FOR BROWSER TEST"
77
- echo "========================================="
78
- echo ""
79
- echo "✓ Server running on http://localhost:3000"
80
- echo "✓ Lodash repo: /tmp/test-repos/lodash"
81
- echo "✓ Chalk repo: /tmp/test-repos/chalk"
82
- echo ""
83
- echo "Browser test can now proceed. Server PID: $SERVER_PID"
84
- echo "To stop server: kill $SERVER_PID"
85
- echo ""
86
-
87
- # Keep server running
88
- wait $SERVER_PID