Commit Graph

9 Commits

Author SHA1 Message Date
Alexej Wolff 77b2794eb1 feat: WorldState memory, increased context, better error handling
- Added WorldState types for character location tracking
- Increased RECENT_MESSAGES_COUNT from 6 to 15
- Increased server limits (50k/200k chars)
- Added language reminders to system prompts
- Better error logging for 400 errors
2026-05-06 21:57:22 +02:00
Alexej Wolff c9a7144960 Fix: trust proxy for cookies behind nginx, sameSite=lax for OAuth 2026-05-05 23:47:42 +02:00
Alexej Wolff 68c2b129fa Major refactor: security, performance, and code organization
Security:
- DeepSeek API moved to server-side proxy with rate limiting (20 req/min)
- Whitelist validation for all POST/PUT routes
- Cookie security (secure, sameSite, httpOnly in production)
- Input validation for messages, tokens, temperature
- Sanitized hasOwnProperty to prevent prototype pollution

Performance:
- Lazy loading for chat messages (sliding window of 20)
- Streaming response throttling (50ms batches)
- Scroll optimization (only scroll on new messages)
- AbortController fix for stop button

Code organization:
- GamePage refactored from ~1170 to ~750 lines
- New hooks: useGameSession, useStreamingResponse, useCharacterDetection, useLazyMessages
- New components: MessageList, ChatInput, SessionSelector, CharacterPanel
- Fixed ESLint errors

Features:
- OOC mode button for direct AI instructions
- Message versions (aiResponse) now persist to DB
- playerId saved in sessions
2026-05-05 23:41:52 +02:00
Alexej Wolff dad5aa47cb feat: NPC system improvements - custom prompt, NSFW, full body generation 2026-05-05 00:11:43 +02:00
Alexej Wolff 863cf7f6b6 feat: auto-resize textarea, persistent token stats 2026-02-11 02:05:28 +01:00
Alexej Wolff 8c6d6591f8 feat: multiple sessions per story with streaming AI responses 2026-02-11 01:47:24 +01:00
Alexej Wolff 2bfe8d95cc fix: input alignment 2026-02-11 01:07:43 +01:00
Alexej Wolff c404b1e17c feat: add admin stats page with token usage 2026-02-11 01:00:02 +01:00
Alexej Wolff cc003ffbd5 first commit 2026-02-11 00:15:59 +01:00