From 6cffb87a6361e67b21b96c175d9b6247c5aa5468 Mon Sep 17 00:00:00 2001 From: Ethan J Lewis Date: Sat, 9 May 2026 13:28:14 -0500 Subject: [PATCH] feat(engine): widen state value unions and add 'ending' transcript kind Drops redundant string[] casts in dispatcher paths and prepares the TranscriptLine kind for the ending-screen render path. Co-Authored-By: Claude Opus 4.7 --- src/engine/types.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/types.ts b/src/engine/types.ts index ad20157..b28349f 100644 --- a/src/engine/types.ts +++ b/src/engine/types.ts @@ -35,13 +35,13 @@ export type Theme = 'amber' | 'ansi' export interface ItemInstance { id: ItemId /** Per-instance state: lit/unlit, broken/whole, etc. */ - state: Record + state: Record } export type EncounterPhase = string // phase names are encounter-specific export interface TranscriptLine { - kind: 'narration' | 'player' | 'system' + kind: 'narration' | 'player' | 'system' | 'ending' text: string } @@ -56,9 +56,9 @@ export interface GameState { location: RoomId inventory: ItemInstance[] /** Per-room state: visited, items dropped, descriptive flags. */ - roomState: Record> + roomState: Record> /** Story-wide flags (e.g. 'gateOpened', 'mirrorTarnished'). */ - flags: Record + flags: Record resolveLevel: ResolveLevel /** Active encounter phase by encounter id, or null if no encounter is mid-flight. */ encounterState: Record