Spaces:
Sleeping
Sleeping
| import HumanBehaviorEngine from './index.js'; | |
| import logger from './utils/logger.js'; | |
| import figlet from 'figlet'; | |
| import chalk from 'chalk'; | |
| async function main() { | |
| console.log( | |
| chalk.cyan( | |
| figlet.textSync('Human Sim', { font: 'Standard', horizontalLayout: 'default' }) | |
| ) | |
| ); | |
| const engine = new HumanBehaviorEngine(); | |
| process.on('SIGINT', async () => { | |
| console.log('\nShutting down...'); | |
| await engine.stop(); | |
| process.exit(0); | |
| }); | |
| process.on('SIGTERM', async () => { | |
| logger.info('Received SIGTERM, shutting down'); | |
| await engine.stop(); | |
| process.exit(0); | |
| }); | |
| try { | |
| await engine.start(); | |
| } catch (error) { | |
| logger.error(`Fatal error: ${error.message}`); | |
| process.exit(1); | |
| } | |
| } | |
| main(); | |