feat: add socket.io events for narration broadcast
Wire narration events through the socket layer so clients receive real-time narration updates. Server emits narration-event on creation, narration-update when LLM text arrives, and narration-history on connect. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { AccessorySlot, PortraitSlot } from './constants.js';
|
||||
import type { NarrationEvent } from './narration.js';
|
||||
|
||||
// Entity is just a numeric ID
|
||||
export type EntityId = number;
|
||||
@@ -171,6 +172,9 @@ export interface ServerEvents {
|
||||
'player-joined': (data: PlayerJoined) => void;
|
||||
'player-left': (data: PlayerLeft) => void;
|
||||
'npc-recomposed': (data: { entityId: EntityId; appearance: Appearance }) => void;
|
||||
'narration-event': (data: NarrationEvent) => void;
|
||||
'narration-update': (data: { id: number; narration: string }) => void;
|
||||
'narration-history': (data: NarrationEvent[]) => void;
|
||||
}
|
||||
|
||||
// Client -> Server events
|
||||
|
||||
Reference in New Issue
Block a user