import type { HandleMessageStreamEvent } from "#protocol/message.js";
import type { SessionState } from "#client/types.js";
import type { InputRequest } from "#runtime/input/types.js";
/**
 * Returns a fresh session state with no active run.
 */
export declare function createInitialSessionState(): SessionState;
/**
 * Advances the session cursor after one streamed turn completes.
 *
 * When the boundary event is `session.waiting`, the session is preserved for
 * the next message. For `session.completed` and `session.failed`, the session
 * resets so the next call starts a new conversation.
 */
export declare function advanceSession(input: {
    readonly continuationToken?: string;
    readonly events: readonly HandleMessageStreamEvent[];
    readonly preserveCompletedSessions?: boolean;
    readonly sessionId: string;
    readonly session: SessionState;
}): SessionState;
/**
 * Extracts the final completed assistant message text from a turn's events.
 *
 * Only considers terminal messages (finish reason is not `"tool-calls"`).
 */
export declare function extractCompletedMessage(events: readonly HandleMessageStreamEvent[]): string | undefined;
/**
 * Derives the result status from a turn's boundary event.
 */
export declare function deriveResultStatus(events: readonly HandleMessageStreamEvent[]): "completed" | "failed" | "waiting";
/**
 * Collects HITL input requests emitted during one consumed turn.
 */
export declare function extractInputRequests(events: readonly HandleMessageStreamEvent[]): readonly InputRequest[];
