Commit Graph

57 Commits

Author SHA1 Message Date
Alexej Wolff 4346bcce40 feat: auto-save story characters as global NPCs on save 2026-05-07 00:32:51 +02:00
Alexej Wolff 28922fec29 fix: restore messages variable in deepseek endpoints 2026-05-07 00:25:44 +02:00
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 0b62e73111 chore: formatting and minor improvements 2026-05-06 00:24:25 +02:00
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 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 bbefa114f8 feat: Show character avatar in chat - split view on desktop, background on mobile 2026-05-05 00:48:39 +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 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 5e98c60e3e Clean up README 2026-05-04 01:38:23 +02:00
Alexej Wolff 97c6db6c80 Update README with project description 2026-05-04 01:37:32 +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 f52c86b049 Increase mobile chat font size 2026-02-11 21:38:51 +01:00
Alexej Wolff eff60fbae8 Add 'Alive' field to character cards in story summary 2026-02-11 21:38:00 +01:00
Alexej Wolff 1a3f9af9c3 Add session delete button 2026-02-11 21:12:58 +01:00
Alexej Wolff c1fe0eaeba Fix mobile font size and enable smart keyboard features 2026-02-11 21:05:16 +01:00
Alexej Wolff e51fdd4e64 Add AI usage indicators to story creation form 2026-02-11 18:53:12 +01:00
Alexej Wolff 171db2790a An other fix for edit buttom style 2026-02-11 17:59:56 +01:00
Alexej Wolff 323932ce83 An other fix for edit buttom style 2026-02-11 17:52:50 +01:00
Alexej Wolff 3e272d0f8e Fix edit buttom style 2026-02-11 17:51:27 +01:00
Alexej Wolff b86b6cdc7a Fix mobile padding on StoryDetailPage 2026-02-11 17:48:23 +01:00
Alexej Wolff c01f4780c9 feat: increase mobile chat font to 19px 2026-02-11 17:13:19 +01:00
Alexej Wolff d2b95d4ca4 fix: remove delete buttons from story cards and game page 2026-02-11 16:56:50 +01:00
Alexej Wolff 764c8c9e9f feat: move delete session to settings with confirmation, increase mobile font 2026-02-11 16:51:17 +01:00
Alexej Wolff f0e8a947ba fix: save AI response before switching versions, increase mobile font to 17px 2026-02-11 16:48:46 +01:00
Alexej Wolff 2933225d59 feat: increase chat font size for mobile 2026-02-11 16:45:39 +01:00
Alexej Wolff dccc94132e feat: sync AI responses with message versions, increase font size 2026-02-11 16:43:44 +01:00
Alexej Wolff c9a0236be6 fix: remove unused variable 2026-02-11 16:35:42 +01:00
Alexej Wolff a0827caabd feat: message editing with version history and AI regeneration 2026-02-11 16:34:25 +01:00
Alexej Wolff dae3c88020 feat: add scroll to bottom button and auto-scroll on session load 2026-02-11 16:29:50 +01:00
Alexej Wolff e5c7bd1b0d fix: attempt to disable iOS QuickType bar with form wrapper 2026-02-11 16:26:15 +01:00
Alexej Wolff e2e7e211d5 fix: disable autocorrect/autocomplete on chat textarea 2026-02-11 16:24:22 +01:00
Alexej Wolff da98a7f6b1 fix: fixed header on desktop PWA with flex-shrink and min-height 2026-02-11 16:22:46 +01:00
Alexej Wolff a0f1d9709b fix: disable zoom in game chat with touch-action 2026-02-11 16:20:34 +01:00
Alexej Wolff ae595ca8ce design: floating input container like DeepSeek 2026-02-11 16:18:50 +01:00
Alexej Wolff dc3fca5cc6 fix: disable iOS zoom with CSS touch-action 2026-02-11 16:17:06 +01:00
Alexej Wolff 0383a568fe fix: fixed header, disable zoom, prevent overscroll bounce 2026-02-11 16:13:44 +01:00
Alexej Wolff f6e2ef5dcb design: mobile-friendly DeepSeek-style chat UI 2026-02-11 16:08:54 +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 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 161ecd661e feat: streaming AI responses with stop button 2026-02-11 01:30:56 +01:00
Alexej Wolff 715f2a9bcf fix: iOS safe area for all pages 2026-02-11 01:15:31 +01:00