/**
 * Codex stream event handling.
 *
 * Converts Codex SDK events into the unified StreamCallback format
 * used throughout the takt codebase.
 */
import type { AgentFailureCategory } from '../../shared/types/agent-failure.js';
import type { StreamCallback, StreamToolUseEventData } from '../../shared/types/provider.js';
export type CodexEvent = {
    type: string;
    [key: string]: unknown;
};
export type CodexItem = {
    id?: string;
    type: string;
    [key: string]: unknown;
};
/** Tracking state for stream offsets during a single Codex thread run */
export interface StreamTrackingState {
    startedItems: Set<string>;
    outputOffsets: Map<string, number>;
    textOffsets: Map<string, number>;
    thinkingOffsets: Map<string, number>;
    anonymousItemIds: Map<string, string>;
    activeTool?: StreamToolUseEventData;
}
export declare function createStreamTrackingState(): StreamTrackingState;
export declare function extractThreadId(value: unknown): string | undefined;
export declare function emitInit(onStream: StreamCallback | undefined, model: string | undefined, sessionId: string | undefined): void;
export declare function emitText(onStream: StreamCallback | undefined, text: string): void;
export declare function emitThinking(onStream: StreamCallback | undefined, thinking: string): void;
export declare function emitToolUse(onStream: StreamCallback | undefined, tool: string, input: Record<string, unknown>, id: string): void;
export declare function emitToolResult(onStream: StreamCallback | undefined, content: string, isError: boolean): void;
export declare function emitToolOutput(onStream: StreamCallback | undefined, tool: string, output: string): void;
export declare function emitResult(onStream: StreamCallback | undefined, success: boolean, result: string, sessionId: string | undefined, failureCategory?: AgentFailureCategory): void;
export declare function formatFileChangeSummary(changes: Array<{
    path?: string;
    kind?: string;
}>): string;
export declare function emitCodexItemStart(item: CodexItem, onStream: StreamCallback | undefined, state: StreamTrackingState): void;
export declare function emitCodexItemCompleted(item: CodexItem, onStream: StreamCallback | undefined, state: StreamTrackingState): void;
export declare function emitCodexItemUpdate(item: CodexItem, onStream: StreamCallback | undefined, state: StreamTrackingState): void;
//# sourceMappingURL=CodexStreamHandler.d.ts.map