/**
 * Zod schemas for SDK message validation.
 *
 * These schemas enforce the structural types defined in types.ts at runtime.
 * Use `safeParseSDKMessage` at ingestion boundaries (the for-await loop in
 * agent-interface.ts and the middleware pipeline) so malformed messages are
 * logged and skipped rather than causing uncaught property-access errors.
 *
 * The SDK message schema is a `z.discriminatedUnion('type', ...)` so each
 * variant (assistant, user, system, result, etc.) gets per-branch validation
 * and zod can narrow on `message.type` for downstream consumers. Each branch
 * uses `.passthrough()` so unknown forward-compatible fields don't cause
 * parse failures — the SDK adds new fields between minor versions and the
 * wizard has historically tolerated that.
 *
 * The `Other` branch (any unknown `type` string) is intentional: when the
 * SDK ships a brand new top-level message variant we want to log and skip
 * it, not throw. We accept any string `type` there and let the consuming
 * switch fall through to the default arm.
 */
import { z } from 'zod';
import type { SDKMessage, SDKUsage, SDKContentBlock, SDKCompactMetadata, SDKModelUsageEntry } from './types';
export declare const sdkUsageSchema: z.ZodType<SDKUsage>;
export declare const sdkContentBlockSchema: z.ZodType<SDKContentBlock>;
export declare const sdkCompactMetadataSchema: z.ZodType<SDKCompactMetadata>;
export declare const sdkModelUsageEntrySchema: z.ZodType<SDKModelUsageEntry>;
export declare const sdkAssistantMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"assistant">;
    subtype: z.ZodOptional<z.ZodString>;
    message: z.ZodOptional<z.ZodObject<{
        id: z.ZodOptional<z.ZodString>;
        usage: z.ZodOptional<z.ZodType<SDKUsage, unknown, z.core.$ZodTypeInternals<SDKUsage, unknown>>>;
        content: z.ZodOptional<z.ZodArray<z.ZodType<SDKContentBlock, unknown, z.core.$ZodTypeInternals<SDKContentBlock, unknown>>>>;
    }, z.core.$loose>>;
    usage: z.ZodOptional<z.ZodType<SDKUsage, unknown, z.core.$ZodTypeInternals<SDKUsage, unknown>>>;
    total_cost_usd: z.ZodOptional<z.ZodNumber>;
    modelUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SDKModelUsageEntry, unknown, z.core.$ZodTypeInternals<SDKModelUsageEntry, unknown>>>>;
}, z.core.$loose>;
export declare const sdkUserMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"user">;
    subtype: z.ZodOptional<z.ZodString>;
    message: z.ZodOptional<z.ZodObject<{
        id: z.ZodOptional<z.ZodString>;
        usage: z.ZodOptional<z.ZodType<SDKUsage, unknown, z.core.$ZodTypeInternals<SDKUsage, unknown>>>;
        content: z.ZodOptional<z.ZodArray<z.ZodType<SDKContentBlock, unknown, z.core.$ZodTypeInternals<SDKContentBlock, unknown>>>>;
    }, z.core.$loose>>;
}, z.core.$loose>;
export declare const sdkSystemMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"system">;
    subtype: z.ZodOptional<z.ZodString>;
    model: z.ZodOptional<z.ZodString>;
    tools: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
    mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        status: z.ZodString;
    }, z.core.$loose>>>;
    compact_metadata: z.ZodOptional<z.ZodType<SDKCompactMetadata, unknown, z.core.$ZodTypeInternals<SDKCompactMetadata, unknown>>>;
}, z.core.$loose>;
export declare const sdkResultMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"result">;
    subtype: z.ZodOptional<z.ZodString>;
    is_error: z.ZodOptional<z.ZodBoolean>;
    result: z.ZodOptional<z.ZodString>;
    errors: z.ZodOptional<z.ZodArray<z.ZodString>>;
    usage: z.ZodOptional<z.ZodType<SDKUsage, unknown, z.core.$ZodTypeInternals<SDKUsage, unknown>>>;
    total_cost_usd: z.ZodOptional<z.ZodNumber>;
    num_turns: z.ZodOptional<z.ZodNumber>;
    modelUsage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SDKModelUsageEntry, unknown, z.core.$ZodTypeInternals<SDKModelUsageEntry, unknown>>>>;
}, z.core.$loose>;
export declare const sdkStreamEventMessageSchema: z.ZodObject<{
    type: z.ZodLiteral<"stream_event">;
    subtype: z.ZodOptional<z.ZodString>;
}, z.core.$loose>;
/**
 * Catch-all branch for SDK message types the wizard doesn't model explicitly
 * (status, auth_status, tool_progress, rate_limit_event, prompt_suggestion,
 * tool_use_summary, etc.). Captures any non-matching `type` string so unknown
 * variants parse successfully and downstream switch statements fall through
 * to their default arm rather than crashing.
 */
export declare const sdkOtherMessageSchema: z.ZodObject<{
    type: z.ZodString;
    subtype: z.ZodOptional<z.ZodString>;
}, z.core.$loose>;
/**
 * Validates one SDK message. Tries the discriminated union of known types
 * first (assistant / user / system / result / stream_event); falls back to
 * the catch-all `sdkOtherMessageSchema` for forward-compatible unknown types.
 *
 * Cast to `z.ZodType<SDKMessage>` because the structural `SDKMessage` interface
 * in types.ts has a `[key: string]: unknown` index signature, so each branch
 * (with `.passthrough()`) is a structural subtype.
 */
export declare const sdkMessageSchema: z.ZodType<SDKMessage>;
export type AssistantMessage = z.infer<typeof sdkAssistantMessageSchema>;
export type UserMessage = z.infer<typeof sdkUserMessageSchema>;
export type SystemMessage = z.infer<typeof sdkSystemMessageSchema>;
export type ResultMessage = z.infer<typeof sdkResultMessageSchema>;
export type StreamEventMessage = z.infer<typeof sdkStreamEventMessageSchema>;
export type OtherMessage = z.infer<typeof sdkOtherMessageSchema>;
export type SDKMessageParseResult = {
    ok: true;
    message: SDKMessage;
} | {
    ok: false;
    error: z.ZodError;
};
/**
 * Validate an unknown value as an SDKMessage.
 * Returns a discriminated result so callers can log and skip bad messages.
 */
export declare function safeParseSDKMessage(value: unknown): SDKMessageParseResult;
