{"version":3,"file":"utils.mjs","sources":["webpack://@ui-tars-test/agent-sdk/./src/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright (c) 2025 Bytedance, Inc. and its affiliates.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { BaseAction } from '@ui-tars-test/shared/types';\nimport { MultimodalToolCallResult } from '@ui-tars-test/tarko-agent';\n\nexport const createGUIErrorResponse = (\n  action: BaseAction,\n  errorMessage: string,\n): MultimodalToolCallResult => {\n  return {\n    content: [\n      {\n        type: 'text',\n        text: JSON.stringify({\n          action: action,\n          error: errorMessage,\n        }),\n      },\n    ],\n    // @ts-ignore: isError is not in MultimodalToolCallResult type but might be used by internal logic\n    isError: true,\n  };\n};\n\nexport const convertToAgentUIAction = (action: BaseAction) => {\n  // Use type assertion or access properties safely as BaseAction might be generic\n  // or properties might be on specific action types\n  const anyAction = action as any;\n  return {\n    action: anyAction.prediction,\n    thought: anyAction.thought,\n    action_type: anyAction.action_type,\n    action_input: anyAction.action_input,\n  };\n};\n"],"names":["createGUIErrorResponse","action","errorMessage","JSON","convertToAgentUIAction","anyAction"],"mappings":";;;;AASO,MAAMA,yBAAyB,CACpCC,QACAC,eAEO;QACL,SAAS;YACP;gBACE,MAAM;gBACN,MAAMC,KAAK,SAAS,CAAC;oBACnB,QAAQF;oBACR,OAAOC;gBACT;YACF;SACD;QAED,SAAS;IACX;AAGK,MAAME,yBAAyB,CAACH;IAGrC,MAAMI,YAAYJ;IAClB,OAAO;QACL,QAAQI,UAAU,UAAU;QAC5B,SAASA,UAAU,OAAO;QAC1B,aAAaA,UAAU,WAAW;QAClC,cAAcA,UAAU,YAAY;IACtC;AACF"}