()
| 336 | } |
| 337 | |
| 338 | async run() { |
| 339 | debugLog('🚀 Starting debug server...'); |
| 340 | this.transport = new StdioServerTransport(); |
| 341 | |
| 342 | try { |
| 343 | await this.server.connect(this.transport); |
| 344 | debugLog('✅ Server connected to transport'); |
| 345 | |
| 346 | // 保持进程运行 |
| 347 | process.stdin.resume(); |
| 348 | |
| 349 | // 处理进程退出 |
| 350 | process.on('SIGINT', () => this.cleanup()); |
| 351 | process.on('SIGTERM', () => this.cleanup()); |
| 352 | } catch (error) { |
| 353 | debugLog('💥 Server error:', error); |
| 354 | console.error('❌ Fatal error:', error.message); |
| 355 | process.exit(1); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | cleanup() { |
| 360 | debugLog('🧹 Cleaning up...'); |
no test coverage detected