@mablhq/mabl-cli 2.79.1 → 2.79.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/mablApiClient.js +10 -10
- package/browserLauncher/index.js +1 -1
- package/commands/tests/testsUtil.js +31 -56
- package/execution/index.js +1 -1
- package/package.json +1 -1
package/api/mablApiClient.js
CHANGED
|
@@ -1257,25 +1257,25 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
1257
1257
|
throw toApiError(`Failed to generate element description`, error);
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
async findElementImage(screenshot, findPrompt, workspaceId, context) {
|
|
1260
|
+
async findElementImage(screenshot, findPrompt, workspaceId, includeElementImage, context) {
|
|
1261
1261
|
try {
|
|
1262
|
-
const
|
|
1262
|
+
const response = await this.makePostRequest(`${this.baseApiAgentUrl}/agent/find/findElementImage?workspaceId=${workspaceId}`, {
|
|
1263
1263
|
screenshot,
|
|
1264
1264
|
description: findPrompt,
|
|
1265
1265
|
context,
|
|
1266
|
+
include_element_image: includeElementImage,
|
|
1266
1267
|
});
|
|
1267
|
-
if (!found) {
|
|
1268
|
+
if (!response.found) {
|
|
1268
1269
|
return undefined;
|
|
1269
1270
|
}
|
|
1270
|
-
if (
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
console.debug(`Incomplete bounding box for ${findPrompt}:`,
|
|
1271
|
+
if (response.bounding_box?.x === undefined ||
|
|
1272
|
+
response.bounding_box?.y === undefined ||
|
|
1273
|
+
response.bounding_box?.width === undefined ||
|
|
1274
|
+
response.bounding_box?.height === undefined) {
|
|
1275
|
+
console.debug(`Incomplete bounding box for ${findPrompt}:`, response.bounding_box);
|
|
1275
1276
|
return undefined;
|
|
1276
1277
|
}
|
|
1277
|
-
|
|
1278
|
-
return { x, y, width, height };
|
|
1278
|
+
return response;
|
|
1279
1279
|
}
|
|
1280
1280
|
catch (error) {
|
|
1281
1281
|
throw toApiError(`Failed to find element image ${findPrompt}`, error);
|