Spaces:
Running

RayMelius Claude Sonnet 4.6 commited on
Commit
c72bb17
Β·
1 Parent(s): afde232

Add player login, agent creation, and NPC chat

Browse files

Backend:
- database.py: users table with sha256+salt auth, session tokens
- routes.py: /auth/register, /auth/login, /auth/me, /auth/logout
+ /player/create, /player/update, /player/move, /player/plan, /player/talk
- Registration auto-creates player agent at town_square
- /player/talk feeds player message to NPC, returns LLM reply

Frontend:
- Login/register modal on page load (skip button for observers)
- Player panel in sidebar: location, move dropdown, Edit Profile, My Plans
- Agent profile editor modal (name, age, occupation, background, traits)
- Plans modal: view + add items to daily plan
- Talk button on NPC detail panel opens inline chat window
- Multi-turn chat: send message, NPC replies via LLM
- Gold ring drawn around player-controlled agent on map
- Session persisted in localStorage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

3 files changed +789 -1
Files changed (3)
src/soci/api/routes.py+307-1
src/soci/persistence/database.py+80
web/index.html+402