interface TextPart { type: 'text'; text: string; /** If true this text was synthesised client-side (e.g. echo of user input). */ synthetic?: boolean; } type ToolStatus = 'pending' | 'running' | 'completed' | 'error'; interface ToolTime { start?: number; end?: number; } interface ToolState { status: ToolStatus; input?: unknown; output?: unknown; error?: string; metadata?: Record; time?: ToolTime; } interface ToolPart { type: 'tool'; /** Unique ID for this tool invocation. */ id: string; /** Tool name (e.g. "bash", "read", "write", "grep", "glob"). */ tool: string; state: ToolState; callID?: string; } interface ReasoningPart { type: 'reasoning'; text: string; time?: ToolTime; } type SessionPart = TextPart | ToolPart | ReasoningPart; export type { ReasoningPart as R, SessionPart as S, TextPart as T, ToolPart as a, ToolState as b, ToolStatus as c, ToolTime as d };