import type { Conversation, Message } from '../../types/schemas/chat/conversations.js'; export type ChatDebugEventTone = 'neutral' | 'user' | 'assistant' | 'reasoning' | 'tool' | 'error'; type ChatDebugEventBase = { id: string; atMs: number; label: string; tone: ChatDebugEventTone; }; export type ChatDebugEvent = ChatDebugEventBase & ({ type: 'message.upsert'; message: Message; } | { type: 'message.patch'; messageId: string; patch: Partial; } | { type: 'playback.patch'; patch: Partial>; } | { type: 'conversation.switch'; conversationId: string; messages: Message[]; }); /** One switchable conversation of a sidebar fixture: identity plus its full history. */ export type ChatDebugConversationFixture = { conversation: Conversation; messages: Message[]; }; /** * Sidebar fixture for switch scenarios. Only `defaultCount` items mount until * the stress control is engaged, so a field-scale fixture never makes the * workbench itself unusable. */ export type ChatDebugSidebarFixture = { defaultCount: number; stressCount: number; conversations: ChatDebugConversationFixture[]; }; export type ChatDebugScenario = { id: string; name: string; intent: string; durationMs: number; events: ChatDebugEvent[]; /** Present on switch scenarios: mounts the conversation rail around the stage. */ sidebar?: ChatDebugSidebarFixture; /** * `raw` marks fixtures whose reasoningData is the polling wire format, to be * routed through `resolveReasoningDisplayMessages` (and its cache) exactly * like production. Absent means the fixture ships pre-parsed steps. */ reasoningFormat?: 'raw'; }; export type ChatDebugPlaybackState = { messages: Message[]; loading: boolean; streamingActiveMessageId: string | null; preparingSteps: string[] | null; activeConversationId: string | null; }; export declare const EMPTY_CHAT_DEBUG_PLAYBACK_STATE: ChatDebugPlaybackState; export declare function applyChatDebugEvent(state: ChatDebugPlaybackState, event: ChatDebugEvent): ChatDebugPlaybackState; export declare function resolveChatDebugPlayback(scenario: ChatDebugScenario, elapsedMs: number): ChatDebugPlaybackState; export declare function countAppliedChatDebugEvents(scenario: ChatDebugScenario, elapsedMs: number): number; export declare function createChatDebugScenarios(baseTime?: number): ChatDebugScenario[]; export {};