Commit Graph

3 Commits

Author SHA1 Message Date
Dejvino
4c968f8096 fix llm config for ramalama, add safeguards, spinner animation
- Fix last_narrative -> last_prompt bug in generate() and generate_stream()
- Add **kwargs guard to build_user_message() to catch wrong param names
- Extract _set_llm_env() helper that always sets API key (fallback placeholder)
- Add 30s timeout to all litellm.completion() calls
- Update config model to openai/deepseek-r1 for ramalama
- Replace shifting dots spinner with fixed-character shape morph
2026-06-25 19:21:55 +02:00
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