import { h as AIUsageInfo, B as BaseElement, U as UIContext, n as AIElementResponse, g as ElementTreeNode, l as AIElementIdResponse, A as AISingleElementResponse, k as AISingleElementResponseByPosition, w as ElementById, o as AISectionParseResponse, p as AIAssertionResponse, G as PlanningAIResponse } from './types-29130591.js';
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources';

type AIArgs = [
    ChatCompletionSystemMessageParam,
    ChatCompletionUserMessageParam
];
declare enum AIActionType {
    ASSERT = 0,
    INSPECT_ELEMENT = 1,
    EXTRACT_DATA = 2,
    PLAN = 3
}
declare function callAiFn<T>(msgs: AIArgs, AIActionTypeValue: AIActionType): Promise<{
    content: T;
    usage?: AIUsageInfo;
}>;

declare function describeUserPage<ElementType extends BaseElement = BaseElement>(context: Omit<UIContext<ElementType>, 'describer'>, opt?: {
    truncateTextLength?: number;
    filterNonTextContent?: boolean;
}): Promise<{
    description: string;
    elementById(id: string): ElementType;
    elementByPosition(position: {
        x: number;
        y: number;
    }, size: {
        width: number;
        height: number;
    }): BaseElement | undefined;
    insertElementByPosition(position: {
        x: number;
        y: number;
    }): ElementType;
    size: {
        width: number;
        height: number;
    };
}>;

declare function transformElementPositionToId(aiResult: AIElementResponse | [number, number], treeRoot: ElementTreeNode<BaseElement>, size: {
    width: number;
    height: number;
}, insertElementByPosition: (position: {
    x: number;
    y: number;
}) => BaseElement): Promise<AIElementIdResponse>;
declare function AiInspectElement<ElementType extends BaseElement = BaseElement>(options: {
    context: UIContext<ElementType>;
    targetElementDescription: string;
    callAI?: typeof callAiFn<AIElementResponse | [number, number]>;
    quickAnswer?: Partial<AISingleElementResponse | AISingleElementResponseByPosition>;
}): Promise<{
    parseResult: AIElementIdResponse;
    rawResponse: any;
    elementById: ElementById;
    usage?: AIUsageInfo;
}>;
declare function AiExtractElementInfo<T, ElementType extends BaseElement = BaseElement>(options: {
    dataQuery: string | Record<string, string>;
    context: UIContext<ElementType>;
}): Promise<{
    parseResult: AISectionParseResponse<T>;
    elementById: (id: string) => ElementType;
    usage: AIUsageInfo | undefined;
}>;
declare function AiAssert<ElementType extends BaseElement = BaseElement>(options: {
    assertion: string;
    context: UIContext<ElementType>;
}): Promise<{
    content: AIAssertionResponse;
    usage: AIUsageInfo | undefined;
}>;

declare function plan(userInstruction: string, opts: {
    log?: string;
    context: UIContext;
    callAI?: typeof callAiFn<PlanningAIResponse>;
}): Promise<PlanningAIResponse>;

export { AiInspectElement as A, AiAssert as a, AIActionType as b, callAiFn as c, describeUserPage as d, AiExtractElementInfo as e, plan as p, transformElementPositionToId as t };
