import type { ReasoningItem } from '../../types/schemas/integrations/agent-api.js'; import type { MessageFile } from '../../types/schemas/chat/files.js'; import type { SendMessageResponse } from '../../types/schemas/chat/messages.js'; export type DirectStreamActivity = 'idle' | 'connected' | 'active'; export type DirectStreamResultStatus = 'completed' | 'waiting_messages'; export type DirectStreamResult = { status: DirectStreamResultStatus; text: string; }; export type SseFrame = { event?: string; data: string; }; export type MessagePartsEvent = { kind: 'message-parts'; harness?: string; sessionId?: string; timestamp?: number; runId: string; deltaSeq: number; parentToolUseId?: string | null; event: Record; }; export type MessagePartsAccumulator = { runId: string | null; lastDeltaSeq: number; textByIndex: Record; thinkingByIndex: Record; }; export declare function parseSseFrames(source: string): { frames: SseFrame[]; rest: string; }; export declare function createMessagePartsAccumulator(runId?: string | null): MessagePartsAccumulator; export declare function applyMessagePartsEvent(accumulator: MessagePartsAccumulator, input: MessagePartsEvent): { text: string; thinking: string; changed: boolean; }; export type DirectStreamOptions = { onOptimisticResult?: (result: DirectStreamResult) => void; onResult?: (result: DirectStreamResult) => void; onTerminal?: () => void; onDisconnect?: () => void; }; type MessagePartsUpdate = { text: string; thinking: string; changed: boolean; reasoning?: ReasoningItem[]; files?: MessageFile[]; }; export declare function useDirectStream(options?: DirectStreamOptions): { activity: any; streamingText: any; streamingThinking: any; activeRunId: any; streamingReasoning: any; streamingFiles: any; connectMessage: (url: string, init: RequestInit, onAccepted: (response: SendMessageResponse) => void) => Promise; connectConversation: (url: string, init: RequestInit, expectedAssistantMessageId?: string) => Promise; beginMessage: () => void; disconnect: (reset?: boolean) => void; }; export declare function useDirectStreamWithProtocol(protocol: { create: (runId?: string | null) => T; apply: (accumulator: T, event: MessagePartsEvent) => MessagePartsUpdate; }, options?: DirectStreamOptions): { activity: any; streamingText: any; streamingThinking: any; activeRunId: any; streamingReasoning: any; streamingFiles: any; connectMessage: (url: string, init: RequestInit, onAccepted: (response: SendMessageResponse) => void) => Promise; connectConversation: (url: string, init: RequestInit, expectedAssistantMessageId?: string) => Promise; beginMessage: () => void; disconnect: (reset?: boolean) => void; }; export {};