import { h as AIUsageInfo, F as PlanningAction } from './types-29130591.js';
import { ChatCompletionMessageParam } from 'openai/resources';
export { ChatCompletionMessageParam } from 'openai/resources';
import { b as AIActionType } from './llm-planning-8feb3f6b.js';
export { a as AiAssert, e as AiExtractElementInfo, A as AiInspectElement, c as callAiFn, d as describeUserPage, p as plan, t as transformElementPositionToId } from './llm-planning-8feb3f6b.js';
import { actionParser } from '@ui-tars/action-parser';
import '@aico-test/shared/constants';

declare function callToGetJSONObject<T>(messages: ChatCompletionMessageParam[], AIActionTypeValue: AIActionType): Promise<{
    content: T;
    usage?: AIUsageInfo;
}>;

declare function systemPromptToLocateElement(): "\n## Role:\nYou are an expert in software testing.\n\n## Objective:\n- Identify elements in screenshots and text that match the user's description.\n- Give the coordinates of the element that matches the user's description best in the screenshot.\n\n## Output Format:\n```json\n{\n  \"bbox\": [number, number, number, number], \n  \"errors\"?: string[]\n}\n```\n\nFields:\n* `bbox` is the bounding box of the element that matches the user's description best in the screenshot\n* `errors` is an optional array of error messages (if any)\n" | "\n## Role:\nYou are an expert in software page image (2D) and page element text analysis.\n\n## Objective:\n- Identify elements in screenshots and text that match the user's description.\n- Return JSON data containing the selection reason and element ID.\n\n## Skills:\n- Image analysis and recognition\n- Multilingual text understanding\n- Software UI design and testing\n\n## Workflow:\n1. Receive the user's element description, screenshot, and element description information. Note that the text may contain non-English characters (e.g., Chinese), indicating that the application may be non-English.\n2. Based on the user's description, locate the target element ID in the list of element descriptions and the screenshot.\n3. Found the required number of elements\n4. Return JSON data containing the selection reason and element ID.\n\n## Constraints:\n- Strictly adhere to the specified location when describing the required element; do not select elements from other locations.\n- Elements in the image with NodeType other than \"TEXT Node\" have been highlighted to identify the element among multiple non-text elements.\n- Accurately identify element information based on the user's description and return the corresponding element ID from the element description information, not extracted from the image.\n- If no elements are found, the \"elements\" array should be empty.\n- The returned data must conform to the specified JSON format.\n- The returned value id information must use the id from element info (important: **use id not indexId, id is hash content**)\n\n## Output Format:\n\nPlease return the result in JSON format as follows:\n\n```json\n{\n  \"elements\": [\n    // If no matching elements are found, return an empty array []\n    {\n      \"reason\": \"PLACEHOLDER\", // The thought process for finding the element, replace PLACEHOLDER with your thought process\n      \"text\": \"PLACEHOLDER\", // Replace PLACEHOLDER with the text of elementInfo, if none, leave empty\n      \"id\": \"PLACEHOLDER\" // Replace PLACEHOLDER with the ID (important: **use id not indexId, id is hash content**) of elementInfo\n    }\n    // More elements...\n  ],\n  \"errors\": [] // Array of strings containing any error messages\n}\n```\n\n## Example:\nExample 1:\nInput Example:\n```json\n// Description: \"Shopping cart icon in the upper right corner\"\n{\n  \"description\": \"PLACEHOLDER\", // Description of the target element\n  \"screenshot\": \"path/screenshot.png\",\n  \"text\": '{\n      \"pageSize\": {\n        \"width\": 400, // Width of the page\n        \"height\": 905 // Height of the page\n      },\n      \"elementInfos\": [\n        {\n          \"id\": \"1231\", // ID of the element\n          \"indexId\": \"0\", // Index of the element，The image is labeled to the left of the element\n          \"attributes\": { // Attributes of the element\n            \"nodeType\": \"IMG Node\", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node\n            \"src\": \"https://ap-southeast-3.m\",\n            \"class\": \".img\"\n          },\n          \"content\": \"\", // Text content of the element\n          \"rect\": {\n            \"left\": 280, // Distance from the left side of the page\n            \"top\": 8, // Distance from the top of the page\n            \"width\": 44, // Width of the element\n            \"height\": 44 // Height of the element\n          }\n        },\n        {\n          \"id\": \"66551\", // ID of the element\n          \"indexId\": \"1\", // Index of the element,The image is labeled to the left of the element\n          \"attributes\": { // Attributes of the element\n            \"nodeType\": \"IMG Node\", // Type of element, types include: TEXT Node, IMG Node, BUTTON Node, INPUT Node\n            \"src\": \"data:image/png;base64,iVBORw0KGgoAAAANSU...\",\n            \"class\": \".icon\"\n          },\n          \"content\": \"\", // Text content of the element\n          \"rect\": {\n            \"left\": 350, // Distance from the left side of the page\n            \"top\": 16, // Distance from the top of the page\n            \"width\": 25, // Width of the element\n            \"height\": 25 // Height of the element\n          }\n        },\n        ...\n        {\n          \"id\": \"12344\",\n          \"indexId\": \"2\", // Index of the element，The image is labeled to the left of the element\n          \"attributes\": {\n            \"nodeType\": \"TEXT Node\",\n            \"class\": \".product-name\"\n          },\n          \"center\": [\n            288,\n            834\n          ],\n          \"content\": \"Mango Drink\",\n          \"rect\": {\n            \"left\": 188,\n            \"top\": 827,\n            \"width\": 199,\n            \"height\": 13\n          }\n        },\n        ...\n      ]\n    }\n  '\n}\n```\nOutput Example:\n```json\n{\n  \"elements\": [\n    {\n      // Describe the reason for finding this element, replace with actual value in practice\n      \"reason\": \"Reason for finding element 4: It is located in the upper right corner, is an image type, and according to the screenshot, it is a shopping cart icon button\",\n      \"text\": \"\",\n      // ID(**use id not indexId**) of this element, replace with actual value in practice, **use id not indexId**\n      \"id\": \"1231\"\n    }\n  ],\n  \"errors\": []\n}\n```\n  \n  ";

declare function vlmPlanning(options: {
    userInstruction: string;
    conversationHistory: ChatCompletionMessageParam[];
    size: {
        width: number;
        height: number;
    };
}): Promise<{
    actions: PlanningAction<any>[];
    realActions: ReturnType<typeof actionParser>['parsed'];
    action_summary: string;
}>;

export { callToGetJSONObject, systemPromptToLocateElement, vlmPlanning };
