476f81ceca
Extracted SQL query from handleSessionInit route handler into SessionStore.getLatestUserPrompt() method to fix abstraction leak and improve type safety. Changes: - Added getLatestUserPrompt() method to SessionStore with proper return type - Replaced raw SQL query in SessionRoutes with type-safe method call - Removed direct database access through dbManager.getSessionStore().db - Improved separation of concerns (data layer vs HTTP layer) Benefits: - Type safety: Explicit return type instead of 'as any' cast - Maintainability: SQL query logic belongs in data layer - Testability: Can test query logic independently from HTTP layer - Consistency: Follows existing pattern of query methods in SessionStore Phase 3 Complete: SQL abstraction leak fixed in session init endpoint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>