/** * SKAI Stream Parser Utilities */ import { SkaiMetadataToken, SkaiStreamLineParseResult, SkaiStreamParsingResult } from '../types/streaming'; /** * Custom errors for SKAI streaming */ export declare class SkaiStreamError extends Error { readonly tokenData?: unknown; constructor(message: string, tokenData?: unknown); } export declare class SkaiStreamTimeoutError extends Error { constructor(inactivityMs: number); } export declare class SkaiStreamValidationError extends Error { constructor(message: string); } /** * Parse a streaming line and determine its type */ export declare function parseStreamLine(line: string): SkaiStreamLineParseResult; /** * Parse and validate metadata token content */ export declare function parseMetadataToken(tokenJson: string): SkaiMetadataToken[]; /** * Check if metadata token indicates an error condition */ export declare function checkForErrorToken(token: SkaiMetadataToken): string | null; /** * Process content token and extract text */ export declare function processContentToken(tokenJson: string): string; /** * Process a batch of streaming lines */ export declare function processStreamLines(lines: string[]): SkaiStreamParsingResult; /** * Create a preview of content for logging */ export declare function createContentPreview(content: string, maxLength?: number): string; /** * Check if stream has been inactive for too long */ export declare function checkStreamTimeout(lastActivityTime: number, currentTime?: number): void; /** * Validate stream completion */ export declare function validateStreamCompletion(tokens: number, contentLength: number): void;