import type { StreamLifecycleError, StreamLifecycleFrame, StreamSignal, StreamSnapshot, StreamToolSnapshot } from "./types.js"; export interface StreamReducerState { snapshot: StreamSnapshot; sequence: number; activeTextId: string | null; activeReasoningId: string | null; nextTextIndex: number; tools: Map; terminal: boolean; terminalError: StreamLifecycleError | null; } export interface StreamReduction { state: StreamReducerState; frames: StreamLifecycleFrame[]; semanticProgress: boolean; } export declare function createInitialReducerState(): StreamReducerState; export declare function reduceStreamSignal(current: StreamReducerState, signal: StreamSignal, elapsedMs: number): StreamReduction; export type LocalToolDeadlineResolution = { kind: "handoff"; reduction: StreamReduction; } | { kind: "failed"; reduction: StreamReduction; code: "TOOL_INPUT_TIMEOUT" | "TOOL_INPUT_INCOMPLETE"; }; export declare function resolveLocalToolDeadline(current: StreamReducerState, _reason: "tool_input_idle" | "tool_commit_grace", elapsedMs: number): LocalToolDeadlineResolution; /** * Close any open read-projection segments. This is a projection-only * finalizer: it does not set a provider finish reason, settle a Stream * Outcome, or change lifecycle terminal meaning. */ export declare function finalizeStreamProjection(current: StreamReducerState, elapsedMs: number): StreamReduction; //# sourceMappingURL=reducer.d.ts.map