Broadcast a "rolling" WS event when the DM invokes roll_dice, and show
a cycling dice-emoji animation with the roll notation in the chat while
waiting for the result, instead of just the generic typing indicator.
Also split the dice-roll prompt rule into skill/save checks (DC shown
to the player) vs. attack rolls (AC stays secret but must still be
labeled as a roll), and made the "always roll yourself, never ask the
player to roll" instruction unconditional.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Character sheets gain structured combat_stats, abilities (name +
plain-language explanation), and equipment fields, populated by the
upsert_character_sheet tool; the detail page renders them as their
own sections instead of one prose block, with a player-card-style
attribute grid (full ability names + modifiers).
- Fix double-escaped unicode occasionally left in tool-call JSON
arguments (a model quirk) and stop the app's own json.dumps calls
from re-introducing it (ensure_ascii=False).
- Render chat messages as markdown (react-markdown + Tailwind
typography) instead of raw text, and widen the games/characters/
chat layout to use more of the screen on desktop.
- Sharpen the DM system prompt: state the ability + DC for each
offered action option before the player commits, and narrate rolls
as DC → result → pass/fail before the story consequence; also stop
re-asking Session-0 questions already answered in the game's
name/description.
- Make the DM's LLM provider configurable (xai default, lmstudio for
a local OpenAI-compatible server via host.docker.internal) instead
of hardcoded to x.ai.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The server broadcasts a "typing" event to the whole room right when
it starts the DM turn, and broadcasts turn failures to everyone too
(previously only the sender saw them, which would've left other
players' indicators stuck forever). The frontend shows a pulsing
"Dungeon Master schreibt …" line that clears once the real reply or
an error arrives.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
run_dm_turn now loads the game's name/description into the system
prompt on every turn, and the Session-0 instructions tell the DM to
check those framing details first and skip re-asking genre/world,
scope, or experience level when they're already covered there —
only the still-open points (player count, characters, rule-depth
preference, content boundaries) get asked.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
RAG: switch Postgres to pgvector, chunk and embed the three D&D
rulebooks locally via sentence-transformers, and retrieve relevant
excerpts per DM turn (query = latest player message) to ground the
system prompt. Retrieval runs off the event loop and is capped by a
relevance threshold and a max character budget so it can't blow up
context size or cost.
Game setup wizard: creating a game now opens a short chat where the
DM asks about genre, length, and the player's experience level, then
proposes a name and description via a tool call. The player can edit
both before creating the game. Stateless endpoint — the frontend
carries the conversation, no DB needed since the game doesn't exist
yet.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
FastAPI + Postgres backend with fastapi-users auth, games/characters
CRUD, and a WebSocket chat endpoint where an x.ai Grok DM narrates
play, rolls dice, and maintains character sheets via tool calls.
React + Tailwind frontend covers registration/login, game list and
creation, participation-code join flow, character viewer, and a
real-time chat session view. Docker Compose skeleton (Postgres +
backend) included; Caddy/frontend container wiring is deferred to
the deploy milestone.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>