@empiricalrun/playwright-utils 0.25.22 → 0.25.23

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,15 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.25.23
4
+
5
+ ### Patch Changes
6
+
7
+ - a40b338: fix: add metadata to overlay tracing
8
+ - Updated dependencies [fb78386]
9
+ - Updated dependencies [a40b338]
10
+ - @empiricalrun/test-gen@0.53.11
11
+ - @empiricalrun/llm@0.14.6
12
+
3
13
  ## 0.25.22
4
14
 
5
15
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAOzC,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,WAKhE;AAoDD,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;AAwBD,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,GAAG,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAOzC,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,WAKhE;AA8DD,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;AAwBD,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,GAAG,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
@@ -15,6 +15,23 @@ function isErrorSupported(errorMessage) {
15
15
  return errorMessage.includes(ERROR_SUBSTRING_INTERCEPTION);
16
16
  }
17
17
  exports.isErrorSupported = isErrorSupported;
18
+ function traceThis(task) {
19
+ const metadata = {
20
+ projectName: process.env.PROJECT_NAME ?? "",
21
+ testRunId: process.env.TEST_RUN_GITHUB_ACTION_ID ?? "",
22
+ };
23
+ const trace = (0, llm_1.createLangfuseTrace)({
24
+ name: "overlay_dismiss",
25
+ input: task,
26
+ tags: ["overlay_dismiss"],
27
+ metadata,
28
+ });
29
+ if (trace) {
30
+ const traceUrl = trace.getTraceUrl();
31
+ console.log(`Starting computer use agent: ${traceUrl}`);
32
+ }
33
+ return trace;
34
+ }
18
35
  async function runAgentOnOverlay(pageRef, element) {
19
36
  const text = await (0, utils_1.textContent)(pageRef, element);
20
37
  const task = await (0, prompt_1.getTask)(pageRef, element, text);
@@ -38,15 +55,7 @@ async function runAgentOnOverlay(pageRef, element) {
38
55
  generatedCode = result.code;
39
56
  }
40
57
  else if (PREFERRED_AGENT === "openai-cua") {
41
- const trace = (0, llm_1.createLangfuseTrace)({
42
- name: "overlay_dismiss",
43
- input: task,
44
- tags: ["overlay_dismiss"],
45
- });
46
- if (trace) {
47
- const traceUrl = trace.getTraceUrl();
48
- console.log(`Starting computer use agent: ${traceUrl}`);
49
- }
58
+ const trace = traceThis(task);
50
59
  const result = await (0, run_1.createTestUsingComputerUseAgent)({
51
60
  page: pageRef,
52
61
  task,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.25.22",
3
+ "version": "0.25.23",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -38,9 +38,9 @@
38
38
  "mailosaur": "^8.6.1",
39
39
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
40
40
  "rimraf": "^6.0.1",
41
- "@empiricalrun/llm": "^0.14.5",
41
+ "@empiricalrun/llm": "^0.14.6",
42
42
  "@empiricalrun/r2-uploader": "^0.3.8",
43
- "@empiricalrun/test-gen": "^0.53.10"
43
+ "@empiricalrun/test-gen": "^0.53.11"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "tsc --build --watch",