-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdemo-enhanced-ui.js
More file actions
53 lines (45 loc) · 1.61 KB
/
Copy pathdemo-enhanced-ui.js
File metadata and controls
53 lines (45 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env node
// Demo script to showcase the enhanced UI features like Claude Code
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
console.log('🚀 Starting OpenAgent with Enhanced UI Demo...');
console.log('');
console.log('✨ New Features Implemented:');
console.log(' • Tool approval with clear parameter display');
console.log(' • File diff visualization for edits');
console.log(' • Step-by-step execution display');
console.log(' • Task planning with progress tracking');
console.log(' • Claude Code-like interface');
console.log('');
console.log('📝 Try these commands to see the enhanced UI:');
console.log(' 1. "Create a simple hello.txt file"');
console.log(' 2. "Edit the package.json file to add a new script"');
console.log(' 3. "Run a shell command to list files"');
console.log('');
console.log('⚠️ Tool approval is now enabled - you\'ll see approval prompts before execution');
console.log('');
// Start the main application
const child = spawn('npm', ['run', 'dev'], {
cwd: __dirname,
stdio: 'inherit',
shell: true
});
child.on('error', (error) => {
console.error('Failed to start OpenAgent:', error);
process.exit(1);
});
child.on('exit', (code) => {
console.log(`OpenAgent exited with code ${code}`);
process.exit(code);
});
// Handle graceful shutdown
process.on('SIGINT', () => {
console.log('\n👋 Shutting down OpenAgent...');
child.kill('SIGINT');
});
process.on('SIGTERM', () => {
child.kill('SIGTERM');
});