import { g as AIUsageInfo, B as BaseElement, U as UIContext, m as AIElementResponse, A as AISingleElementResponse, i as AISingleElementResponseById, n as AISectionParseResponse, o as AIAssertionResponse, F as PlanningAIResponse } from './types-55182ae1.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>(options: {
    msgs: AIArgs;
    AIActionType: 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;
    }): BaseElement | undefined;
}>;
/**
 * elements
 */
declare function retrieveElement(prompt: string, opt?: {
    multi: boolean;
}): string;
/**
 * sections
 */
declare function retrieveSection(prompt: string): string;

declare function transformElementPositionToId(aiResult: AIElementResponse, elementsInfo: BaseElement[]): {
    errors: string[] | undefined;
    elements: {
        id: string;
        reason: string;
        text: string;
    }[];
};
declare function AiInspectElement<ElementType extends BaseElement = BaseElement>(options: {
    context: UIContext<ElementType>;
    multi: boolean;
    targetElementDescription: string;
    callAI?: typeof callAiFn<AIElementResponse>;
    useModel?: 'coze' | 'openAI';
    quickAnswer?: AISingleElementResponse;
}): Promise<{
    parseResult: {
        elements: AISingleElementResponseById[];
        errors: never[];
    };
    elementById: (id: string) => ElementType;
    rawResponse?: undefined;
    usage?: undefined;
} | {
    parseResult: {
        errors: string[] | undefined;
        elements: {
            id: string;
            reason: string;
            text: string;
        }[];
    };
    elementById: (id: string) => ElementType;
    rawResponse?: undefined;
    usage?: undefined;
} | {
    parseResult: {
        errors: string[] | undefined;
        elements: {
            id: string;
            reason: string;
            text: string;
        }[];
    };
    rawResponse: {
        content: AIElementResponse;
        usage?: AIUsageInfo | undefined;
    };
    elementById: (id: string) => ElementType;
    usage: AIUsageInfo | undefined;
}>;
declare function AiExtractElementInfo<T, ElementType extends BaseElement = BaseElement>(options: {
    dataQuery: string | Record<string, string>;
    context: UIContext<ElementType>;
    useModel?: 'coze' | 'openAI';
}): Promise<{
    parseResult: AISectionParseResponse<T>;
    elementById: (id: string) => ElementType;
    usage: AIUsageInfo | undefined;
}>;
declare function AiAssert<ElementType extends BaseElement = BaseElement>(options: {
    assertion: string;
    context: UIContext<ElementType>;
    useModel?: 'coze' | 'openAI';
}): Promise<{
    content: AIAssertionResponse;
    usage: AIUsageInfo | undefined;
}>;

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

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