export type VendorId = 'claude-code' | 'gemini-cli' | 'codex' | 'cursor'; export interface CacheCreation { ephemeral_5m_input_tokens: number; ephemeral_1h_input_tokens: number; } export interface Usage { input_tokens: number; cache_creation_input_tokens: number; cache_read_input_tokens: number; cache_creation?: CacheCreation; output_tokens: number; service_tier?: string; inference_geo?: string; } export interface TextBlock { type: 'text'; text: string; } export interface ThinkingBlock { type: 'thinking'; thinking: string; signature?: string; } export interface ToolUseBlock { type: 'tool_use'; id: string; name: string; input: Record; caller?: string; } export interface ToolResultBlock { type: 'tool_result'; tool_use_id: string; content: string | Array<{ type: string; text?: string; [key: string]: unknown; }>; is_error?: boolean; } export type ContentBlock = TextBlock | ThinkingBlock | ToolUseBlock | ToolResultBlock; export interface AssistantMessage { id?: string; type: 'message'; role: 'assistant'; model: string; content: ContentBlock[]; stop_reason?: string; stop_sequence?: string | null; stop_details?: unknown; usage: Usage; } export interface UserMessage { type?: 'message'; role: 'user'; content: string | ContentBlock[]; } interface RecordBase { uuid?: string; parentUuid?: string | null; sessionId: string; timestamp: string; isSidechain?: boolean; userType?: string; entrypoint?: string; cwd?: string; version?: string; gitBranch?: string | null; } export interface AssistantRecord extends RecordBase { type: 'assistant'; message: AssistantMessage; requestId?: string; } export interface UserRecord extends RecordBase { type: 'user'; message: UserMessage; promptId?: string; toolUseResult?: { tool_use_id?: string; content?: unknown; is_error?: boolean; [key: string]: unknown; }; sourceToolAssistantUUID?: string; } export interface QueueOperationRecord { type: 'queue-operation'; operation: string; timestamp: string; sessionId: string; } export interface AttachmentRecord extends RecordBase { type: 'attachment'; attachment: { type?: string; addedNames?: string[]; addedLines?: number; removedNames?: string[]; removedLines?: number; [key: string]: unknown; }; } export interface FileHistorySnapshotRecord { type: 'file-history-snapshot'; messageId?: string; snapshot?: unknown; isSnapshotUpdate?: boolean; } export interface AiTitleRecord { type: 'ai-title'; sessionId: string; aiTitle: string; } export interface SystemRecord extends RecordBase { type: 'system'; subtype?: string; level?: 'error' | 'warn' | 'info' | string; cause?: { code?: string; path?: string; errno?: number; [key: string]: unknown; }; error?: { type?: string; cause?: unknown; [key: string]: unknown; }; retryInMs?: number; retryAttempt?: number; maxRetries?: number; slug?: string; } export type SessionRecord = AssistantRecord | UserRecord | QueueOperationRecord | AttachmentRecord | FileHistorySnapshotRecord | AiTitleRecord | SystemRecord; export declare function isAssistant(r: SessionRecord): r is AssistantRecord; export declare function isUser(r: SessionRecord): r is UserRecord; export declare function isSystem(r: SessionRecord): r is SystemRecord; export declare function isFileHistorySnapshot(r: SessionRecord): r is FileHistorySnapshotRecord; export declare function isSynthetic(r: AssistantRecord): boolean; export declare function isToolUse(b: ContentBlock): b is ToolUseBlock; export declare function isToolResult(b: ContentBlock): b is ToolResultBlock; export {}; //# sourceMappingURL=types.d.ts.map