subh05sus refactored the chat API on main, adding session-validated GET routes, enhanced POST handling for user and assistant messages (with optimistic UI and attachment support), and updated types for clarity. They also introduced a ChatDirectoryProvider for real-time chat list management and revamped UI components like ChatSidebar, ChatDetailPage and NewChatPage for smoother message rendering and state synchronization.

feat: Refactor chat API and UI components for improved message handling and chat directory management - Updated GET route for chat to include session validation and return chat list. - Enhanced POST route for chat creation to handle user and assistant messages. - Introduced ChatDirectoryProvider for managing chat state and synchronization. - Refactored ChatSidebar to utilize the new chat directory context. - Improved message rendering in ChatDetailPage and NewChatPage with optimistic UI updates. - Added attachment handling in ChatComposer for better user experience. - Updated types for better clarity and maintainability. - subh05sus/ai-tutor