()
| 382 | * Check if a session exists for the current terminal |
| 383 | */ |
| 384 | export function hasSession(): boolean { |
| 385 | const manager = SessionManager.getInstance(); |
| 386 | if (!manager.hasSession()) { |
| 387 | return false; |
| 388 | } |
| 389 | const sessionFilePath = path.join( |
| 390 | getSessionDir(), |
| 391 | `${manager.getSessionId()}.json`, |
| 392 | ); |
| 393 | return fs.existsSync(sessionFilePath); |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Get metadata from a session file with first user message preview |
no test coverage detected