Commit Graph

5 Commits

Author SHA1 Message Date
itsamejms 3c599553fc feat: session auto-capture + NPC→Initiative push + lore grounding everywhere
CI / frontend (push) Successful in 31s
CI / rust (push) Successful in 6m3s
- SessionLogger listens for a new LogEntry bus event; dice rolls,
  initiative turns/rounds, generated encounters and calendar day
  advances land in the active session as timestamped entries — the
  raw material the AI summary actually needs. Mute toggle in the
  toolbar (persisted, default on).
- NPC Generator: '⚔ to initiative' button pushes the generated stat
  block (HP) into the tracker via the existing AddCombatants bus event.
- ragQuery now set on Encounter, Quest and Session summary too
  (NPC/Item/World already had it) — every generator is world-grounded.
2026-09-07 10:25:38 +01:00
itsamejms a6171a8158 minor UI fixes 2026-07-13 10:39:51 +01:00
itsamejms a24f3615e0 working through the plan + UI/ UX 2026-07-12 22:13:43 +01:00
itsamejms b23ab61841 fix: robust LLM JSON parsing across all AI components
- Created shared lib/llm-parse.ts with extractJson(), parseLlmJson(),
  flattenValue(), and ensureArray() utilities
- Strips markdown code fences (\`\`\`json ... \`\`\`) before parsing
- Handles nested objects where strings were expected (flattens them)
- Handles arrays that come back as strings or objects
- Updated all AI prompts to explicitly request raw JSON with no fences
- All 5 AI components now use parseLlmJson() instead of raw regex
- ItemForge shows raw LLM response in expandable <details> when parsing fails
- Added 'IMPORTANT: Return ONLY raw JSON' instruction to all prompts
- Full production build passing
2026-06-28 23:03:10 +01:00
itsamejms 5ce2686ced v0.5.0-dm-tools: Initiative tracker, random tables, encounter builder, calendar
- Initiative Tracker: add/remove combatants, roll initiative, HP bars with
  color transitions (green→gold→red), condition badges, round counter,
  next-turn cycling, gold active-state border
- Random Tables: 4 built-in tables (Tavern Names, Weather, NPC Quirks,
  Treasure), dice notation parser, roll history, highlight matching result
- Encounter Builder: AI-generated encounters via LLM, party level/size,
  terrain selector, JSON response parsing, difficulty badge
- Calendar Widget: Faerûn calendar (Hammer–Nightal), event creation per
  day, event indicators, month navigation, year display
- All glass-card wrapped with framer-motion hover/tap animations
- Full production build clean: tsc, vite, cargo, tauri build
2026-06-28 22:40:11 +01:00