Commit Graph

13 Commits

Author SHA1 Message Date
Dejvino
7f69bf6349 Add thinking indicator and fix input visibility
- LLM progress indicator: animated status bar ('✦ LLM is weaving the
  narrative ✦') with rotating dots, shown during processing, hidden on
  completion. Disabled input shows 'LLM is thinking...' placeholder.
- Fix input not visible: added 'height: 1fr' to TabbedContent so the PLAY
  tab and its input widget fill available vertical space.
- Replace @work(thread=True) with threading.Thread for reliable worker
  execution across all environments (headless, test, TUI).
2026-06-25 12:18:56 +02:00
Dejvino
4b9078d41f TUI now owns the full game loop with embedded LLM engine
The game is now self-contained: run.sh starts the TUI, which calls the
LLM directly via engine.py. No external agent (OpenCode) needed.

- tools/engine.py: Game engine with prompt builder, litellm client,
  response parser (JSON block extraction), and state persistence
- tools/run.py: Refactored TUI with PLAY/CHAR/LOG/BOOK tabs. PLAY tab
  has streaming narrative pane, dynamic choice buttons, and text input.
  Game loop: scene -> input -> resolve -> archive -> apply -> scene
- session/config.json: LLM provider configuration (model, api_key, etc.)
- AGENTS.md: Updated to document the new architecture
- tools/__init__.py: Package marker for clean imports
- session/turn_description.md, turn_reaction.md: Deprecated - no longer
  needed now that the TUI drives the game loop internally
2026-06-25 12:12:04 +02:00
Dejvino
9f8db6e64c drop turn_prompt.md — prompt is implicit in the DM asking the player 2026-06-25 08:34:17 +02:00
Dejvino
8a5072dcbd drop turn_reaction.md: store_turn.py takes no args, outcome captured in next turn description 2026-06-25 08:33:48 +02:00
Dejvino
634e84b08b vibrant markdown theme: colored headings, emphasis, links, code, block quotes 2026-06-25 08:26:36 +02:00
Dejvino
346de4a4f8 virtual last page: append turn_description.md as current turn preview 2026-06-25 08:24:54 +02:00
Dejvino
9e467d01c4 auto-jump to last page when new pages are added 2026-06-25 08:22:51 +02:00
Dejvino
8ee5bc4979 book viewer: three-line nav center with page label, hints, progress bar 2026-06-25 08:20:35 +02:00
Dejvino
2cfd32ca55 formalize game loop, build store_turn.py, redesign TUI
- AGENTS.md: formalized game loop (print turn → wait for reaction →
  process → generate next turn), fixed project layout paths
- tools/store_turn.py: new script to append turn to book.md and clear
  temp files
- tools/run.py: TUI redesign — TODO always on top, CHARACTER/LOG tabs,
  TURN section with rendered markdown, input writes to turn_reaction.md,
  scrolling via VerticalScroll, log auto-populates from previous day,
  >>--- NOW ---> marker at log end with auto-scroll
- session/book.md: story book (append-only narrative)
- session/log/2026-06-25.md: today's log seeded from previous session
2026-06-25 07:35:30 +02:00
Dejvino
b614114286 swap pygame for miniaudio — zero system deps, pip install miniaudio 2026-06-24 22:17:47 +02:00
Dejvino
fdb9d4afc2 music-fetch: duration filter (11 min default, --allow-long-songs); populate dungeon-synth themed ambience tracks (9 tracks across 8 ambiences) 2026-06-24 21:56:42 +02:00
Dejvino
a2a6b1cb26 add ambience music system: TUI crossfade, yt-dlp fetch, source tracking
- tools/run.py: pygame.mixer subsystem — polls session/ambience.md,
  crossfades tracks, shows ♫ in status bar
- tools/music-fetch.py: search/download from YouTube via yt-dlp,
  auto-increment filenames, --replace and --dry-run modes
- tools/ambience.py: companion CLI to set ambience state
- session/ambience.md: current ambience state file (DM writes here)
- session/ambience_options.md: ambience → file mapping table
- session/ambience_sources.md: file → YouTube URL tracking for re-download
- session/audio/ added to .gitignore (audio files not tracked in git)
2026-06-24 21:44:18 +02:00
Dejvino
d4a19ef438 Initial commit: The Chaos TTRPG solo campaign skeleton
Locked: rules/ (deck cards + mechanics), tools/ (draw, roll, run)
Unlocked: session/ (character, world, tweaks, log)
Entry: run.sh launches the Textual TUI
2026-06-23 23:15:17 +02:00