import { Extension, User } from '../common/data_structures'; import { Character } from '../entities/character.entity'; import { Actor, EmotionEvent, InworldPacket, TriggerParameter } from '../entities/inworld_packet.entity'; import { GrpcAudioPlayback } from './sound/grpc_audio.playback'; interface InworldHistoryAddProps { characters: Character[]; grpcAudioPlayer: GrpcAudioPlayback; packet: InworldPacketT; outgoing?: boolean; } export declare enum CHAT_HISTORY_TYPE { ACTOR = "actor", NARRATED_ACTION = "narrated_action", TRIGGER_EVENT = "trigger_event", INTERACTION_END = "interaction_end" } export interface HistoryItemBase { date: Date; id: string; interactionId?: string; source: Actor; type: CHAT_HISTORY_TYPE; } export interface HistoryItemActor extends HistoryItemBase { type: CHAT_HISTORY_TYPE.ACTOR; text?: string; emotions?: EmotionEvent; isRecognizing?: boolean; character?: Character; correlationId?: string; } export interface HistoryItemTriggerEvent extends HistoryItemBase { type: CHAT_HISTORY_TYPE.TRIGGER_EVENT; name: string; parameters: TriggerParameter[]; outgoing?: boolean; correlationId?: string; } export interface HistoryInteractionEnd extends HistoryItemBase { type: CHAT_HISTORY_TYPE.INTERACTION_END; } export interface HistoryItemNarratedAction extends HistoryItemBase { type: CHAT_HISTORY_TYPE.NARRATED_ACTION; text?: string; character?: Character; } export type HistoryItem = HistoryItemActor | HistoryItemTriggerEvent | HistoryInteractionEnd | HistoryItemNarratedAction; interface InworldHistoryProps { extension?: Extension; } export declare class InworldHistory { private history; private queue; private emotions; private extension; constructor(props?: InworldHistoryProps); addOrUpdate({ characters, grpcAudioPlayer, packet, outgoing, }: InworldHistoryAddProps): boolean; update(packet: InworldPacketT): boolean; display(packet: InworldPacketT, type: CHAT_HISTORY_TYPE.ACTOR | CHAT_HISTORY_TYPE.INTERACTION_END | CHAT_HISTORY_TYPE.NARRATED_ACTION): boolean | HistoryItem; get(): HistoryItem[]; filter(props: { utteranceId: string[]; interactionId: string; }): void; clear(): void; getTranscript(user?: User): string; private combineTextItem; private combineNarratedActionItem; private combineTriggerItem; private combineInteractionEndItem; private convertToExtendedType; } export {};