@empiricalrun/playwright-utils 0.39.3 → 0.39.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.39.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 9a18c3c: fix: maxFailures cannot be shard aware locally
8
+
9
+ ## 0.39.4
10
+
11
+ ### Patch Changes
12
+
13
+ - b58777e: refactor: extract CUA agent into standalone @empiricalrun/cua package
14
+ - fda9bc3: feat: extract DashboardAPIClient into standalone @empiricalrun/dashboard-client package
15
+ - Updated dependencies [b58777e]
16
+ - Updated dependencies [fda9bc3]
17
+ - @empiricalrun/cua@0.2.0
18
+ - @empiricalrun/dashboard-client@0.2.0
19
+
3
20
  ## 0.39.3
4
21
 
5
22
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAgBzD,wBAAgB,gBAAgB,IAAI,MAAM,CAazC;AA6BD,eAAO,MAAM,UAAU,EAAE,oBA4BxB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,iBAarB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAgBzD,wBAAgB,gBAAgB,IAAI,MAAM,CAazC;AA6BD,eAAO,MAAM,UAAU,EAAE,oBAyBxB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,iBAarB,CAAC"}
@@ -71,11 +71,8 @@ exports.baseConfig = {
71
71
  retries: process.env.CI ? 2 : 0,
72
72
  // Let playwright choose max workers based on size of infra
73
73
  workers: undefined,
74
- // maxFailures counts retries as individual failures, so this is equivalent to ~20 failed tests
75
- // When sharding, distribute the limit across shards (rounded up)
76
- maxFailures: process.env.CI
77
- ? Math.ceil(30 / (parseInt(process.env.TOTAL_SHARDS, 10) || 1))
78
- : undefined,
74
+ // maxFailures counts retries as individual failures, so this is equivalent to 20 failed tests
75
+ maxFailures: process.env.CI ? 30 : undefined,
79
76
  timeout: 15 * 60 * 1_000,
80
77
  expect: {
81
78
  timeout: 15_000,
package/dist/email.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EmailClient = void 0;
4
- const dashboard_1 = require("@empiricalrun/test-gen/dashboard");
4
+ const dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
5
  const mailosaur_client_1 = require("./mailosaur-client");
6
6
  const DEFAULT_TIMEOUT = 30_000;
7
7
  const SERVER_ID = "pnyrwq5o";
@@ -15,7 +15,7 @@ class EmailClient {
15
15
  this.timeout = timeout;
16
16
  const empiricalApiKey = process.env.EMPIRICALRUN_API_KEY;
17
17
  if (empiricalApiKey) {
18
- const apiClient = new dashboard_1.DashboardAPIClient({
18
+ const apiClient = new dashboard_client_1.DashboardAPIClient({
19
19
  authType: "project-api-key",
20
20
  });
21
21
  this.client = new mailosaur_client_1.MailosaurClient({
package/dist/kv.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KVClient = void 0;
4
- const dashboard_1 = require("@empiricalrun/test-gen/dashboard");
4
+ const dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
5
  class KVClient {
6
6
  client;
7
7
  constructor() {
8
8
  if (!process.env.EMPIRICALRUN_API_KEY) {
9
9
  throw new Error("EMPIRICALRUN_API_KEY environment variable is required");
10
10
  }
11
- this.client = new dashboard_1.DashboardAPIClient({
11
+ this.client = new dashboard_client_1.DashboardAPIClient({
12
12
  authType: "project-api-key",
13
13
  });
14
14
  }
package/dist/postgres.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PostgresClient = void 0;
4
- const dashboard_1 = require("@empiricalrun/test-gen/dashboard");
4
+ const dashboard_client_1 = require("@empiricalrun/dashboard-client");
5
5
  const pg_1 = require("pg");
6
6
  class PostgresClient {
7
7
  client;
@@ -9,7 +9,7 @@ class PostgresClient {
9
9
  if (!process.env.EMPIRICALRUN_API_KEY) {
10
10
  throw new Error("EMPIRICALRUN_API_KEY environment variable is required");
11
11
  }
12
- this.client = new dashboard_1.DashboardAPIClient({
12
+ this.client = new dashboard_client_1.DashboardAPIClient({
13
13
  authType: "project-api-key",
14
14
  });
15
15
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OverlayDismissAgent = void 0;
4
4
  exports.isErrorSupported = isErrorSupported;
5
5
  exports.extractInterceptingElement = extractInterceptingElement;
6
- const run_1 = require("@empiricalrun/test-gen/agent/master/run");
6
+ const cua_1 = require("@empiricalrun/cua");
7
7
  const telemetry_1 = require("../../../../telemetry");
8
8
  const cache_1 = require("./cache");
9
9
  const prompt_1 = require("./prompt");
@@ -84,7 +84,7 @@ class OverlayDismissAgent {
84
84
  async runAgent(element, text, testFn) {
85
85
  const task = await (0, prompt_1.getTask)(this.page, element, text);
86
86
  const trace = (0, utils_1.traceThis)(task, testFn);
87
- const result = await (0, run_1.createTestUsingComputerUseAgent)({
87
+ const result = await (0, cua_1.createTestUsingComputerUseAgent)({
88
88
  page: this.page,
89
89
  task,
90
90
  trace,
@@ -1 +1 @@
1
- {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../src/webhook.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,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AAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAaF,wBAAsB,aAAa,CACjC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GACvC,OAAO,CAAC,MAAM,CAAC,CAwCjB;AAgGD,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC,CAM3B"}
package/dist/webhook.js CHANGED
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWebhookUrl = getWebhookUrl;
4
4
  exports.queryWebhookRequests = queryWebhookRequests;
5
- const dashboard_1 = require("@empiricalrun/test-gen/dashboard");
5
+ const dashboard_client_1 = require("@empiricalrun/dashboard-client");
6
6
  const WEBHOOK_SITE_BASE_URL = "https://webhook.site";
7
7
  const DEFAULT_TOKEN_EXPIRY = 604800;
8
8
  async function getWebhookUrl(options = {}) {
9
9
  const expiry = options.expiry === undefined ? DEFAULT_TOKEN_EXPIRY : options.expiry;
10
10
  if (process.env.EMPIRICALRUN_API_KEY) {
11
- const apiClient = new dashboard_1.DashboardAPIClient({
11
+ const apiClient = new dashboard_client_1.DashboardAPIClient({
12
12
  authType: "project-api-key",
13
13
  });
14
14
  const result = await apiClient.callWebhookSiteProxy({
@@ -16,7 +16,8 @@ async function getWebhookUrl(options = {}) {
16
16
  path: "/token",
17
17
  body: { expiry },
18
18
  });
19
- return `${WEBHOOK_SITE_BASE_URL}/${result.uuid}`;
19
+ const tokenData = result.data;
20
+ return `${WEBHOOK_SITE_BASE_URL}/${tokenData.uuid}`;
20
21
  }
21
22
  const apiKey = process.env.WEBHOOK_SITE_API_KEY;
22
23
  if (!apiKey) {
@@ -63,7 +64,7 @@ function buildContentQuery(content) {
63
64
  return terms.map((t) => `content:"${escapeQueryTerm(t)}"`).join(" AND ");
64
65
  }
65
66
  async function queryViaProxy(token, content) {
66
- const apiClient = new dashboard_1.DashboardAPIClient({
67
+ const apiClient = new dashboard_client_1.DashboardAPIClient({
67
68
  authType: "project-api-key",
68
69
  });
69
70
  const params = new URLSearchParams({
@@ -75,10 +76,13 @@ async function queryViaProxy(token, content) {
75
76
  method: "GET",
76
77
  path: `/token/${token}/requests?${params.toString()}`,
77
78
  });
78
- if (!result.data || !Array.isArray(result.data)) {
79
+ const webhookResponse = result.data;
80
+ if (!webhookResponse ||
81
+ !webhookResponse.data ||
82
+ !Array.isArray(webhookResponse.data)) {
79
83
  throw new Error("webhook.site proxy response missing 'data' array");
80
84
  }
81
- return result.data;
85
+ return webhookResponse.data;
82
86
  }
83
87
  async function queryDirect(token, content) {
84
88
  const apiKey = process.env.WEBHOOK_SITE_API_KEY;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.39.3",
3
+ "version": "0.39.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -42,9 +42,10 @@
42
42
  "console-log-level": "^1.4.1",
43
43
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
44
44
  "rimraf": "^6.0.1",
45
+ "@empiricalrun/dashboard-client": "^0.2.0",
46
+ "@empiricalrun/cua": "^0.2.0",
45
47
  "@empiricalrun/llm": "^0.25.2",
46
- "@empiricalrun/r2-uploader": "^0.9.1",
47
- "@empiricalrun/test-gen": "^0.79.4"
48
+ "@empiricalrun/r2-uploader": "^0.9.1"
48
49
  },
49
50
  "scripts": {
50
51
  "dev": "tsc --build --watch",