import type { BaseElement, DeviceAction, ElementTreeNode, MidsceneYamlFlowItem, PlanningAction, Rect, Size } from './types';
import type { ChatCompletionUserMessageParam } from 'openai/resources/index';
import { z } from 'zod';
/**
 * Expand the search area to at least 400 x 400 pixels
 *
 * Step 1: Extend 100px on each side (top, right, bottom, left)
 * - If the element is near a boundary, expansion on that side will be limited
 * - No compensation is made for boundary limitations (this is intentional)
 *
 * Step 2: Ensure the area is at least 400x400 pixels
 * - Scale up proportionally from the center if needed
 * - Final result is clamped to screen boundaries
 */
export declare function expandSearchArea(rect: Rect, screenSize: Size): Rect;
export declare function markupImageForLLM(screenshotBase64: string, tree: ElementTreeNode<BaseElement>, size: Size): Promise<string>;
export declare function buildYamlFlowFromPlans(plans: PlanningAction[], actionSpace: DeviceAction<any>[]): MidsceneYamlFlowItem[];
export declare const PointSchema: z.ZodObject<{
    left: z.ZodNumber;
    top: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
    left: number;
    top: number;
}, {
    left: number;
    top: number;
}>;
export declare const SizeSchema: z.ZodObject<{
    width: z.ZodNumber;
    height: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
    width: number;
    height: number;
}, {
    width: number;
    height: number;
}>;
export declare const RectSchema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
    left: z.ZodNumber;
    top: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
    left: number;
    top: number;
}, {
    left: number;
    top: number;
}>, z.ZodObject<{
    width: z.ZodNumber;
    height: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
    width: number;
    height: number;
}, {
    width: number;
    height: number;
}>>, z.ZodObject<{
    zoom: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    zoom?: number | undefined;
}, {
    zoom?: number | undefined;
}>>;
export declare const TMultimodalPromptSchema: z.ZodObject<{
    images: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        url: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        name: string;
        url: string;
    }, {
        name: string;
        url: string;
    }>, "many">>;
    convertHttpImage2Base64: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    images?: {
        name: string;
        url: string;
    }[] | undefined;
    convertHttpImage2Base64?: boolean | undefined;
}, {
    images?: {
        name: string;
        url: string;
    }[] | undefined;
    convertHttpImage2Base64?: boolean | undefined;
}>;
export declare const TUserPromptSchema: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
    prompt: z.ZodString;
}, "strip", z.ZodTypeAny, {
    prompt: string;
}, {
    prompt: string;
}>, z.ZodObject<{
    images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        url: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        name: string;
        url: string;
    }, {
        name: string;
        url: string;
    }>, "many">>>;
    convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
}, "strip", z.ZodTypeAny, {
    images?: {
        name: string;
        url: string;
    }[] | undefined;
    convertHttpImage2Base64?: boolean | undefined;
}, {
    images?: {
        name: string;
        url: string;
    }[] | undefined;
    convertHttpImage2Base64?: boolean | undefined;
}>>]>;
export type TMultimodalPrompt = z.infer<typeof TMultimodalPromptSchema>;
export type TUserPrompt = z.infer<typeof TUserPromptSchema>;
export declare const userPromptToString: (prompt: TUserPrompt) => string;
export declare const userPromptToMultimodalPrompt: (prompt: TUserPrompt) => TMultimodalPrompt | undefined;
export declare const multimodalPromptToChatMessages: (multimodalPrompt?: TMultimodalPrompt) => Promise<ChatCompletionUserMessageParam[]>;
/**
 * Returns the schema for locator fields.
 * This now returns the input schema which is more permissive and suitable for validation.
 */
export declare const getMidsceneLocationSchema: () => z.ZodObject<{
    prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
        prompt: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        prompt: string;
    }, {
        prompt: string;
    }>, z.ZodObject<{
        images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            url: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            name: string;
            url: string;
        }, {
            name: string;
            url: string;
        }>, "many">>>;
        convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
    }, "strip", z.ZodTypeAny, {
        images?: {
            name: string;
            url: string;
        }[] | undefined;
        convertHttpImage2Base64?: boolean | undefined;
    }, {
        images?: {
            name: string;
            url: string;
        }[] | undefined;
        convertHttpImage2Base64?: boolean | undefined;
    }>>]>;
    deepLocate: z.ZodOptional<z.ZodBoolean>;
    deepThink: z.ZodOptional<z.ZodBoolean>;
    cacheable: z.ZodOptional<z.ZodBoolean>;
    xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
    prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
        prompt: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        prompt: string;
    }, {
        prompt: string;
    }>, z.ZodObject<{
        images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            url: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            name: string;
            url: string;
        }, {
            name: string;
            url: string;
        }>, "many">>>;
        convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
    }, "strip", z.ZodTypeAny, {
        images?: {
            name: string;
            url: string;
        }[] | undefined;
        convertHttpImage2Base64?: boolean | undefined;
    }, {
        images?: {
            name: string;
            url: string;
        }[] | undefined;
        convertHttpImage2Base64?: boolean | undefined;
    }>>]>;
    deepLocate: z.ZodOptional<z.ZodBoolean>;
    deepThink: z.ZodOptional<z.ZodBoolean>;
    cacheable: z.ZodOptional<z.ZodBoolean>;
    xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
    prompt: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodObject<{
        prompt: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        prompt: string;
    }, {
        prompt: string;
    }>, z.ZodObject<{
        images: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            url: z.ZodString;
        }, "strip", z.ZodTypeAny, {
            name: string;
            url: string;
        }, {
            name: string;
            url: string;
        }>, "many">>>;
        convertHttpImage2Base64: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
    }, "strip", z.ZodTypeAny, {
        images?: {
            name: string;
            url: string;
        }[] | undefined;
        convertHttpImage2Base64?: boolean | undefined;
    }, {
        images?: {
            name: string;
            url: string;
        }[] | undefined;
        convertHttpImage2Base64?: boolean | undefined;
    }>>]>;
    deepLocate: z.ZodOptional<z.ZodBoolean>;
    deepThink: z.ZodOptional<z.ZodBoolean>;
    cacheable: z.ZodOptional<z.ZodBoolean>;
    xpath: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
}, z.ZodTypeAny, "passthrough">>;
export declare const ifMidsceneLocatorField: (field: any) => boolean;
export declare const dumpMidsceneLocatorField: (field: any) => string;
export declare const findAllMidsceneLocatorField: (zodType?: z.ZodType<any>, requiredOnly?: boolean) => string[];
export declare const dumpActionParam: (jsonObject: Record<string, any>, zodSchema: z.ZodType<any>) => Record<string, any>;
/**
 * Parse and validate action parameters using Zod schema.
 * All fields are validated through Zod, EXCEPT locator fields which are skipped.
 * Default values defined in the schema are automatically applied.
 *
 * Locator fields are special business logic fields with complex validation requirements,
 * so they are intentionally excluded from Zod parsing and use existing validation logic.
 *
 * When shrunkShotToLogicalRatio is provided and !== 1, coordinates in locate fields
 * are transformed from screenshot space to logical space.
 */
export declare const parseActionParam: (rawParam: Record<string, any> | undefined, zodSchema?: z.ZodType<any>, options?: {
    shrunkShotToLogicalRatio?: number;
}) => Record<string, any> | undefined;
export declare const finalizeActionName = "Finalize";
/**
 * Get a readable time string for a given timestamp or the current time
 * @param format - Optional format string. Supports: YYYY, MM, DD, HH, mm, ss. Default: 'YYYY-MM-DD HH:mm:ss'
 * @param timestamp - Optional timestamp in milliseconds. If not provided, uses current system time.
 * @returns A formatted time string with format label
 */
export declare const getReadableTimeString: (format?: string, timestamp?: number) => string;
