import { PORT_HTTP, WORKING_DIR } from './config'
import { initDatabase } from './db'
import { handleRequest } from './routes'

// Initialize database
initDatabase()

// Start HTTP API server
Bun.serve({
  port: PORT_HTTP,
  fetch: handleRequest
})

// Startup summary
console.log('')
console.log('='.repeat(50))
console.log('Agent UI API Server (hot-reload enabled)')
console.log(`  API: http://localhost:${PORT_HTTP}`)
console.log(`  Working Dir: ${WORKING_DIR}`)
console.log('='.repeat(50))
