feat: session auto-capture + NPC→Initiative push + lore grounding everywhere
- 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.
This commit is contained in:
@@ -44,6 +44,7 @@ export const bus = new EventBus();
|
||||
export const Events = {
|
||||
AddCombatants: "add-combatants",
|
||||
PlayAmbient: "play-ambient",
|
||||
LogEntry: "log-entry",
|
||||
} as const;
|
||||
|
||||
export type AddCombatantsPayload = {
|
||||
@@ -52,6 +53,15 @@ export type AddCombatantsPayload = {
|
||||
source: string;
|
||||
};
|
||||
|
||||
/** One auto-captured line for the active session log (dice rolls, initiative
|
||||
* turns, encounters, calendar days). SessionLogger owns the mute toggle. */
|
||||
export type LogEntryPayload = {
|
||||
/** Pre-formatted line, e.g. "🎲 2d6+3 → 11 [4,5]". */
|
||||
text: string;
|
||||
/** One of SessionLogger's TAGS; omit for untagged. */
|
||||
tag?: string;
|
||||
};
|
||||
|
||||
export type PlayAmbientPayload = {
|
||||
/** Ambient sound id from the Soundboard (rain, wind, fire, …). */
|
||||
id: string;
|
||||
|
||||
Reference in New Issue
Block a user