Commit Graph

14 Commits

Author SHA1 Message Date
Alexej Wolff 63a6b740b4 fix: skip default rule reminder when story has custom narrativeRules 2026-05-06 00:21:32 +02:00
Alexej Wolff 9c43c9df2e fix: add OOC mode instructions to system prompt 2026-05-06 00:15:17 +02:00
Alexej Wolff c379074781 feat: add Inter font, extract useStoryGeneration hook, fix mobile menu 2026-05-06 00:11:33 +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 efd2332875 v1.0.0: Add version display in footer 2026-05-04 18:56:56 +02:00
Alexej Wolff f73a218745 Fix AI rule drift and add auto-save during streaming
- Add rule reminders after 10+ messages to prevent AI drift
- Add auto-save every 5 seconds during streaming
- Add beforeunload warning for unsaved changes
- Save user message immediately before generating AI response
- Use refs for latest session data in async operations
- Reduce summary threshold from 20 to 15 messages
2026-05-04 18:44:10 +02:00
Alexej Wolff 302b56bd5f Fix memory leak: throttle streaming updates, remove console.logs 2026-05-04 01:13:28 +02:00
Alexej Wolff ad2d27412f Fix dialogue format: explicitly require DOUBLE asterisks 2026-05-04 01:04:14 +02:00
Alexej Wolff 8949310162 Improve dialogue formatting rules with Russian examples 2026-05-04 01:02:41 +02:00
Alexej Wolff 1f7d13e44c Improve narrative rules, update temperature defaults, fix session character loading 2026-05-04 00:59:56 +02:00
Alexej Wolff eff60fbae8 Add 'Alive' field to character cards in story summary 2026-02-11 21:38:00 +01:00
Alexej Wolff a9d16f508f perf: reduce context to 6 messages for better cache hit 2026-02-11 02:14:13 +01:00
Alexej Wolff 161ecd661e feat: streaming AI responses with stop button 2026-02-11 01:30:56 +01:00
Alexej Wolff cc003ffbd5 first commit 2026-02-11 00:15:59 +01:00