/** * SKAI Streaming API Types and Constants */ /** * SKAI streaming token prefixes */ export declare enum SkaiTokenType { CONTENT = "0",// Content tokens containing actual response text METADATA = "8" } /** * SKAI metadata token types */ export declare enum SkaiMetadataType { HEARTBEAT = "heartbeat", ERROR = "error", EVENTS = "events", TOOLS = "tools" } /** * Stream line parsing result types */ export declare enum SkaiStreamLineType { CONTENT = "content", METADATA = "metadata", UNKNOWN = "unknown" } /** * Stream processing constants */ export declare const SKAI_STREAM_CONFIG: { /** * Maximum time to wait without receiving any data before timing out (ms) */ readonly INACTIVITY_TIMEOUT_MS: 120000; /** * Keywords in event titles that indicate exceptions */ readonly EXCEPTION_KEYWORDS: readonly ["exception", "error", "failed", "timeout"]; /** * Maximum token preview length for logging */ readonly TOKEN_PREVIEW_LENGTH: 100; /** * Maximum chunk preview length for logging */ readonly CHUNK_PREVIEW_LENGTH: 200; }; /** * SKAI metadata token structure */ export type SkaiMetadataToken = { type: string; data?: Record; }; /** * SKAI error token data */ export type SkaiErrorTokenData = { message: string; code?: string; details?: Record; }; /** * SKAI events token data */ export type SkaiEventsTokenData = { title: string; description?: string; timestamp?: string; }; /** * Stream processing metrics */ export type SkaiStreamMetrics = { startTime: number; endTime: number; totalChunks: number; totalBytes: number; totalTokens: number; contentLength: number; firstChunkTime: number | null; lastActivityTime: number; }; /** * Stream validation result */ export type SkaiStreamValidationResult = { isValid: boolean; errorMessage?: string; metrics: SkaiStreamMetrics; }; /** * Stream line parsing result */ export type SkaiStreamLineParseResult = { type: SkaiStreamLineType; content?: string; }; /** * Stream parsing result */ export type SkaiStreamParsingResult = { content: string; tokens: number; isComplete: boolean; hasErrors: boolean; errors: string[]; };