/**
 * ProviderEventNormalizer — converts raw provider events into normalized OmkEvent types.
 *
 * Two concrete implementations:
 *   KimiEventNormalizer  — structured wire-protocol events (kimi --wire)
 *   KimiPrintNormalizer  — raw stdout text chunks  (kimi --print)
 *
 * The normalizer never leaks raw provider output to the user; that is
 * OutputRouter's responsibility.  The normalizer only shapes the stream.
 */
import type { OmkEvent } from "./contracts/command-envelope.js";
export type OmkEventListener = (event: OmkEvent) => void;
export interface ProviderEventNormalizer {
    /** Register a listener for normalized OmkEvents. */
    onEvent(listener: OmkEventListener): () => void;
    /**
     * Feed a raw provider event into the normalizer.
     * The normalizer will emit one or more OmkEvents to registered listeners.
     */
    push(raw: unknown): void;
    /** Flush any buffered state and emit a turn_finished event. */
    finalize(outcome: NormalizerOutcome): void;
    /** Reset all internal state for a new turn. */
    reset(): void;
}
export interface NormalizerOutcome {
    readonly success: boolean;
    readonly durationMs: number;
    readonly tokenUsage?: {
        readonly input: number;
        readonly output: number;
    };
}
/**
 * Normalizes Kimi wire-protocol events (JSON-RPC 2.0 messages from kimi --wire).
 *
 * Input shapes (WireEvent union from wire-protocol-types.ts):
 *   { type: "TurnBegin",       payload: TurnBegin }
 *   { type: "TurnEnd" }
 *   { type: "StepBegin",       payload: StepBegin }
 *   { type: "StepInterrupted" }
 *   { type: "CompactionBegin" }
 *   { type: "CompactionEnd" }
 *   { type: "StatusUpdate",    payload: StatusUpdate }
 *   { type: "ContentPart",     payload: TextPart | ThinkPart | … }
 *   { type: "ToolCall",        payload: ToolCallEvent }
 *   { type: "ToolCallPart",    payload: ToolCallPart }
 *   { type: "ToolResult",      payload: ToolResultEvent }
 *   { type: "SubagentEvent",   payload: SubagentEvent }
 *   { type: "PlanDisplay",     payload: PlanDisplay }
 *   { type: "HookTriggered",   payload: HookTriggered }
 *   { type: "HookResolved",    payload: HookResolved }
 *   { type: "ApprovalResponse", payload: ApprovalResponseEvent }
 *   { type: "SteerInput",      payload: SteerInput }
 */
export declare class KimiEventNormalizer implements ProviderEventNormalizer {
    private listeners;
    private turnId;
    private startedAt;
    private stepCount;
    private accumulatedText;
    private toolCallCount;
    constructor(turnId?: string);
    onEvent(listener: OmkEventListener): () => void;
    push(raw: unknown): void;
    finalize(outcome: NormalizerOutcome): void;
    reset(): void;
    private emit;
}
/**
 * Normalizes raw stdout lines from `kimi --print` (execa child process).
 *
 * The print runtime emits plain text — no structured events.
 * This normalizer buffers lines and emits progress/result OmkEvents.
 *
 * Special markers it recognizes:
 *   [omk_mcp:<server>:<status>]   → mcp_status
 *   [ERROR] ...                   → error
 *   [WARN] ...                    → warning
 *   [omk_tool:<name>]             → progress (tool call indicator)
 */
export declare class KimiPrintNormalizer implements ProviderEventNormalizer {
    private listeners;
    private turnId;
    private startedAt;
    private buffer;
    private static readonly MCP_RE;
    private static readonly ERROR_RE;
    private static readonly WARN_RE;
    private static readonly TOOL_RE;
    constructor(turnId?: string);
    onEvent(listener: OmkEventListener): () => void;
    /**
     * Push a raw text chunk (may contain multiple lines).
     * The print runtime delivers stdout in arbitrary chunks.
     */
    push(raw: unknown): void;
    finalize(outcome: NormalizerOutcome): void;
    reset(): void;
    private processLine;
    private emit;
}
/**
 * Create a ProviderEventNormalizer for the given provider name.
 *
 * Supported providers:
 *   "kimi-wire"   → KimiEventNormalizer  (structured JSON-RPC events)
 *   "kimi-print"  → KimiPrintNormalizer   (raw stdout text)
 *   "kimi"        → KimiEventNormalizer   (alias for wire)
 *   "deepseek"    → KimiPrintNormalizer   (advisory uses print-style stdout)
 *   "codex"       → KimiPrintNormalizer   (CLI stdout)
 *   "gemini"      → KimiPrintNormalizer   (CLI stdout)
 *   "claude"      → KimiPrintNormalizer   (CLI stdout)
 *
 * Unknown providers default to KimiPrintNormalizer (stdout-based).
 */
export declare function createProviderEventNormalizer(provider: string, turnId?: string): ProviderEventNormalizer;
