@stablyai/internal-playwright-core 0.1.10 → 0.1.12

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.
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var compareScreenshots_exports = {};
30
20
  __export(compareScreenshots_exports, {
@@ -33,12 +23,7 @@ __export(compareScreenshots_exports, {
33
23
  module.exports = __toCommonJS(compareScreenshots_exports);
34
24
  var import_constants = require("./common/constants");
35
25
  var import_createFormData = require("./common/createFormData");
36
- var import_zod = __toESM(require("zod"));
37
26
  const SCREENSHOT_AUTOHEAL_ENDPOINT = "internal/v1/compare-screenshots";
38
- const zAutohealScreenshotResponse = import_zod.default.object({
39
- result: import_zod.default.boolean(),
40
- reason: import_zod.default.string()
41
- });
42
27
  async function aiCompareScreenshots({
43
28
  actualScreenshot,
44
29
  expectedScreenshot,
@@ -77,7 +62,7 @@ async function aiCompareScreenshots({
77
62
  body: formData
78
63
  }
79
64
  );
80
- return zAutohealScreenshotResponse.parse(await response.json());
65
+ return await response.json();
81
66
  }
82
67
  // Annotate the CommonJS export names for ESM import in node:
83
68
  0 && (module.exports = {
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var healLocator_exports = {};
30
20
  __export(healLocator_exports, {
@@ -33,19 +23,7 @@ __export(healLocator_exports, {
33
23
  module.exports = __toCommonJS(healLocator_exports);
34
24
  var import_constants = require("./common/constants");
35
25
  var import_createFormData = require("./common/createFormData");
36
- var import_zod = __toESM(require("zod"));
37
26
  const LOCATOR_AUTOHEAL_ENDPOINT = "internal/v1/heal-locator";
38
- const zFastAutohealLocatorResponse = import_zod.default.discriminatedUnion("success", [
39
- import_zod.default.object({
40
- reasoning: import_zod.default.string(),
41
- success: import_zod.default.literal(true),
42
- coordinates: import_zod.default.tuple([import_zod.default.number(), import_zod.default.number()])
43
- }),
44
- import_zod.default.object({
45
- reasoning: import_zod.default.string(),
46
- success: import_zod.default.literal(false)
47
- })
48
- ]);
49
27
  async function aiHealLocator({
50
28
  description,
51
29
  screenshot,
@@ -85,7 +63,7 @@ async function aiHealLocator({
85
63
  body: formData
86
64
  }
87
65
  );
88
- return zFastAutohealLocatorResponse.parse(await response.json());
66
+ return await response.json();
89
67
  }
90
68
  // Annotate the CommonJS export names for ESM import in node:
91
69
  0 && (module.exports = {
@@ -95,8 +95,8 @@ async function healLocator({
95
95
  actionName,
96
96
  model: config.model
97
97
  });
98
- const { coordinate, reasoning } = aiResponse;
99
- if (!coordinate) {
98
+ const { coordinates, reasoning } = aiResponse;
99
+ if (!coordinates) {
100
100
  return {
101
101
  success: false,
102
102
  message: "AI could not find a suitable element.",
@@ -105,8 +105,8 @@ async function healLocator({
105
105
  };
106
106
  }
107
107
  const { handle, frame: elementFrame } = await (0, import_elementHandleFromCoordinates.getElementHandleFromCoordinates)(frame, [
108
- coordinate[0],
109
- coordinate[1]
108
+ coordinates[0],
109
+ coordinates[1]
110
110
  ]);
111
111
  const context = await elementFrame._mainContext();
112
112
  const injectedScript = await context.injectedScript();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stablyai/internal-playwright-core",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",