@empiricalrun/test-gen 0.38.2 → 0.38.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/actions/assert.js +3 -3
  3. package/dist/actions/click.js +4 -4
  4. package/dist/actions/fill.js +3 -3
  5. package/dist/actions/goto.d.ts.map +1 -1
  6. package/dist/actions/goto.js +4 -5
  7. package/dist/actions/hover.js +4 -4
  8. package/dist/actions/index.d.ts +4 -2
  9. package/dist/actions/index.d.ts.map +1 -1
  10. package/dist/actions/index.js +13 -1
  11. package/dist/actions/press.js +3 -3
  12. package/dist/actions/skill.d.ts.map +1 -1
  13. package/dist/actions/skill.js +25 -4
  14. package/dist/actions/text-content.js +3 -3
  15. package/dist/actions/utils/index.d.ts.map +1 -1
  16. package/dist/actions/utils/index.js +3 -1
  17. package/dist/agent/codegen/skills-retriever.d.ts.map +1 -1
  18. package/dist/agent/codegen/skills-retriever.js +36 -1
  19. package/dist/agent/codegen/use-skill.d.ts +2 -1
  20. package/dist/agent/codegen/use-skill.d.ts.map +1 -1
  21. package/dist/agent/codegen/use-skill.js +6 -2
  22. package/dist/agent/master/run.d.ts.map +1 -1
  23. package/dist/agent/master/run.js +36 -16
  24. package/dist/agent/master/with-hints.d.ts +2 -2
  25. package/dist/agent/master/with-hints.d.ts.map +1 -1
  26. package/dist/agent/planner/run-time-planner.d.ts +20 -0
  27. package/dist/agent/planner/run-time-planner.d.ts.map +1 -0
  28. package/dist/agent/planner/run-time-planner.js +121 -0
  29. package/dist/bin/utils/context.d.ts +1 -1
  30. package/dist/bin/utils/context.d.ts.map +1 -1
  31. package/dist/bin/utils/context.js +1 -1
  32. package/dist/bin/utils/platform/web/index.d.ts +1 -0
  33. package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
  34. package/dist/bin/utils/platform/web/index.js +27 -1
  35. package/dist/evals/master-agent.evals.d.ts.map +1 -1
  36. package/dist/evals/master-agent.evals.js +2 -1
  37. package/dist/page/index.d.ts +11 -0
  38. package/dist/page/index.d.ts.map +1 -0
  39. package/dist/page/index.js +16 -0
  40. package/dist/types/index.d.ts +3 -2
  41. package/dist/types/index.d.ts.map +1 -1
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.38.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 50c7a9a: feat: add support for page variables and state variables
8
+
9
+ ## 0.38.4
10
+
11
+ ### Patch Changes
12
+
13
+ - be5370d: chore: send skill usage message on chat
14
+
15
+ ## 0.38.3
16
+
17
+ ### Patch Changes
18
+
19
+ - ff76b50: fix: return first visible element matching with the CSS selector
20
+
3
21
  ## 0.38.2
4
22
 
5
23
  ### Patch Changes
@@ -7,9 +7,9 @@ exports.PLAYWRIGHT_ASSERT_TEXT_VISIBILITY_ACTION_NAME = "assert_text_visibility"
7
7
  const assertTextVisibilityActionGenerator = (page) => {
8
8
  return {
9
9
  execute: async ({ args }) => {
10
- const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(args.css_selector, args.xpath, page, args?.elementAnnotation);
10
+ const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(args.css_selector, args.xpath, page.pwPageInstance, args?.elementAnnotation);
11
11
  const exec = new Function("page", `return page.${locator}.isVisible({ timeout: 3000 })`);
12
- await exec(page);
12
+ await exec(page.pwPageInstance);
13
13
  return {
14
14
  locator,
15
15
  };
@@ -17,7 +17,7 @@ const assertTextVisibilityActionGenerator = (page) => {
17
17
  // TODO: args transformer to be kept at a single place
18
18
  template: (_, options) => {
19
19
  return {
20
- code: `await expect(${(0, utils_1.getPageVarName)()}.${options.locator}).toBeVisible();`,
20
+ code: `await expect(${page.name}.${options.locator}).toBeVisible();`,
21
21
  };
22
22
  },
23
23
  name: exports.PLAYWRIGHT_ASSERT_TEXT_VISIBILITY_ACTION_NAME,
@@ -8,10 +8,10 @@ const clickActionGenerator = (page) => {
8
8
  return {
9
9
  execute: async ({ args }) => {
10
10
  const selector = args.css_selector;
11
- const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(selector, args.xpath, page, args?.elementAnnotation);
11
+ const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(selector, args.xpath, page.pwPageInstance, args?.elementAnnotation);
12
12
  const exec = new Function("page", `return page.${locator}.click({ timeout: 3000 })`);
13
- await exec(page);
14
- await page.waitForTimeout(3000);
13
+ await exec(page.pwPageInstance);
14
+ await page.pwPageInstance.waitForTimeout(3000);
15
15
  return {
16
16
  locator,
17
17
  };
@@ -19,7 +19,7 @@ const clickActionGenerator = (page) => {
19
19
  // TODO: args transformer to be kept at a single place
20
20
  template: (_, options) => {
21
21
  return {
22
- code: `await ${(0, utils_1.getPageVarName)()}.${options.locator}.click();`,
22
+ code: `await ${page.name}.${options.locator}.click();`,
23
23
  };
24
24
  },
25
25
  name: exports.PLAYWRIGHT_CLICK_ACTION_NAME,
@@ -11,10 +11,10 @@ const fillActionGenerator = (page, options) => {
11
11
  return {
12
12
  execute: async ({ args }) => {
13
13
  const css = args.css_selector;
14
- const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(css, args.xpath, page, args?.elementAnnotation);
14
+ const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(css, args.xpath, page.pwPageInstance, args?.elementAnnotation);
15
15
  const textToFill = options?.stateVariables[args.variable_name] || args.text;
16
16
  const exec = new Function("page", `return page.${locator}.fill("${textToFill}", { timeout: 3000 })`);
17
- await exec(page);
17
+ await exec(page.pwPageInstance);
18
18
  return {
19
19
  locator,
20
20
  };
@@ -22,7 +22,7 @@ const fillActionGenerator = (page, options) => {
22
22
  // TODO: args transformer to be kept at a single place
23
23
  template: (args, options) => {
24
24
  return {
25
- code: `await ${(0, utils_1.getPageVarName)()}.${options.locator}.fill("${args.text}");`,
25
+ code: `await ${page.name}.${options.locator}.fill("${args.text}");`,
26
26
  };
27
27
  },
28
28
  name: exports.PLAYWRIGHT_FILL_ACTION_NAME,
@@ -1 +1 @@
1
- {"version":3,"file":"goto.d.ts","sourceRoot":"","sources":["../../src/actions/goto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAIrD,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,eAAO,MAAM,mBAAmB,EAAE,yBAuCjC,CAAC"}
1
+ {"version":3,"file":"goto.d.ts","sourceRoot":"","sources":["../../src/actions/goto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,eAAO,MAAM,mBAAmB,EAAE,yBAuCjC,CAAC"}
@@ -3,20 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.gotoActionGenerator = exports.PLAYWRIGHT_GOTO_ACTION_NAME = void 0;
4
4
  const utils_1 = require("../agent/browsing/utils");
5
5
  const constants_1 = require("./constants");
6
- const utils_2 = require("./utils");
7
6
  exports.PLAYWRIGHT_GOTO_ACTION_NAME = "page_goto";
8
7
  const gotoActionGenerator = (page) => {
9
8
  return {
10
9
  execute: async ({ args }) => {
11
10
  const url = args.url;
12
- await page.goto(url);
13
- await page.waitForTimeout(3000);
14
- await (0, utils_1.injectPwLocatorGenerator)(page);
11
+ await page.pwPageInstance.goto(url);
12
+ await page.pwPageInstance.waitForTimeout(3000);
13
+ await (0, utils_1.injectPwLocatorGenerator)(page.pwPageInstance);
15
14
  },
16
15
  // TODO: args transformer to be kept at a single place
17
16
  template: (args) => {
18
17
  const url = args.url;
19
- const code = `await ${(0, utils_2.getPageVarName)()}.goto("${url}");`;
18
+ const code = `await ${page.name}.goto("${url}");`;
20
19
  return {
21
20
  code,
22
21
  };
@@ -8,17 +8,17 @@ const hoverActionGenerator = (page) => {
8
8
  return {
9
9
  execute: async ({ args }) => {
10
10
  const selector = args.css_selector;
11
- const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(selector, args.xpath, page, args?.elementAnnotation);
11
+ const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(selector, args.xpath, page.pwPageInstance, args?.elementAnnotation);
12
12
  const exec = new Function("page", `return page.${locator}.hover({ timeout: 3000 })`);
13
- await exec(page);
14
- await page.waitForTimeout(3000);
13
+ await exec(page.pwPageInstance);
14
+ await page.pwPageInstance.waitForTimeout(3000);
15
15
  return {
16
16
  locator,
17
17
  };
18
18
  },
19
19
  // TODO: args transformer to be kept at a single place
20
20
  template: (args, options) => {
21
- return { code: `await ${(0, utils_1.getPageVarName)()}.${options.locator}.hover();` };
21
+ return { code: `await ${page.name}.${options.locator}.hover();` };
22
22
  },
23
23
  name: exports.PLAYWRIGHT_HOVER_ACTION_NAME,
24
24
  schema: {
@@ -1,12 +1,12 @@
1
1
  import { TraceClient } from "@empiricalrun/llm";
2
- import { Page } from "playwright";
2
+ import { TestGenPage } from "../page";
3
3
  import { ActionSchema } from "../types";
4
4
  export declare class PlaywrightActions {
5
5
  private page;
6
6
  private stateVariables;
7
7
  private actionGenerators;
8
8
  private recordedActions;
9
- constructor(page: Page, stateVariables?: Record<string, any>);
9
+ constructor(page: TestGenPage, stateVariables?: Record<string, any>);
10
10
  executeAction(name: string | undefined, args: Record<string, any>, trace?: TraceClient): Promise<string | undefined>;
11
11
  getBrowsingActionSchemas(): ActionSchema[];
12
12
  getMasterActionSchemas(): ActionSchema[];
@@ -24,5 +24,7 @@ export declare class PlaywrightActions {
24
24
  */
25
25
  isStuckInLoop(): boolean;
26
26
  isComplete(): boolean;
27
+ getStateVariables(): Record<string, any>;
28
+ setStateVariables(stateVariables: Record<string, any>): void;
27
29
  }
28
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,m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AAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAqD9B,wBAAwB,IAAI,YAAY,EAAE;IAmB1C,sBAAsB,IAAI,YAAY,EAAE;IAWxC,YAAY,IAAI;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB;IAUD,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAK9B;;;;;;OAMG;IACH,aAAa,IAAI,OAAO;IAQxB,UAAU;IAWV,iBAAiB;IAIjB,iBAAiB,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAItD"}
@@ -35,7 +35,10 @@ class PlaywrightActions {
35
35
  }
36
36
  async executeAction(name = "", args, trace) {
37
37
  const [action] = this.actionGenerators
38
- .map((a) => a(this.page, { stateVariables: this.stateVariables }))
38
+ .map((a) => a(this.page, {
39
+ stateVariables: this.stateVariables,
40
+ setStateVariables: this.setStateVariables.bind(this),
41
+ }))
39
42
  .filter((a) => a.name === name);
40
43
  if (!action) {
41
44
  throw Error(`No action registered for action: ${name}`);
@@ -93,6 +96,7 @@ class PlaywrightActions {
93
96
  ]
94
97
  .map((a) => a(this.page, {
95
98
  stateVariables: this.stateVariables,
99
+ setStateVariables: this.setStateVariables.bind(this),
96
100
  }))
97
101
  .map((a) => a.schema);
98
102
  }
@@ -100,6 +104,7 @@ class PlaywrightActions {
100
104
  return [skill_1.skillActionGenerator]
101
105
  .map((a) => a(this.page, {
102
106
  stateVariables: this.stateVariables,
107
+ setStateVariables: this.setStateVariables.bind(this),
103
108
  }))
104
109
  .map((a) => a.schema);
105
110
  }
@@ -135,5 +140,12 @@ class PlaywrightActions {
135
140
  this.recordedActions = this.recordedActions.filter((a) => a.name !== done_1.PLAYWRIGHT_DONE_ACTION_NAME);
136
141
  return !!doneAction;
137
142
  }
143
+ getStateVariables() {
144
+ return this.stateVariables;
145
+ }
146
+ setStateVariables(stateVariables) {
147
+ this.stateVariables = stateVariables;
148
+ console.log("setStateVariables", Object.keys(this.stateVariables));
149
+ }
138
150
  }
139
151
  exports.PlaywrightActions = PlaywrightActions;
@@ -8,9 +8,9 @@ const pressActionGenerator = (page) => {
8
8
  return {
9
9
  execute: async ({ args }) => {
10
10
  const css = args.css_selector;
11
- const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(css, args.xpath, page, args?.elementAnnotation);
11
+ const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(css, args.xpath, page.pwPageInstance, args?.elementAnnotation);
12
12
  const exec = new Function("page", `return page.${locator}.press("${args.key}", { timeout: 3000 })`);
13
- await exec(page);
13
+ await exec(page.pwPageInstance);
14
14
  return {
15
15
  locator,
16
16
  };
@@ -18,7 +18,7 @@ const pressActionGenerator = (page) => {
18
18
  // TODO: args transformer to be kept at a single place
19
19
  template: (args, options) => {
20
20
  return {
21
- code: `await ${(0, utils_1.getPageVarName)()}.${options.locator}.press("${args.key}");`,
21
+ code: `await ${page.name}.${options.locator}.press("${args.key}");`,
22
22
  };
23
23
  },
24
24
  name: exports.PLAYWRIGHT_PRESS_ACTION_NAME,
@@ -1 +1 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/actions/skill.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,cAAM,cAAc;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK,EAAE;IAEnC,kBAAkB;IAIlB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE;CAG7B;AAED,eAAO,MAAM,cAAc,gBAAyB,CAAC;AAErD,eAAO,MAAM,oBAAoB,EAAE,yBA2FlC,CAAC"}
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/actions/skill.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,cAAM,cAAc;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK,EAAE;IAEnC,kBAAkB;IAIlB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE;CAG7B;AAED,eAAO,MAAM,cAAc,gBAAyB,CAAC;AAErD,eAAO,MAAM,oBAAoB,EAAE,yBA8GlC,CAAC"}
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.skillActionGenerator = exports.testCaseSkills = exports.SKILL_USAGE = void 0;
7
+ const promises_1 = __importDefault(require("fs/promises"));
7
8
  const api_1 = __importDefault(require("tsx/cjs/api"));
8
9
  const use_skill_1 = require("../agent/codegen/use-skill");
10
+ const web_1 = require("../bin/utils/platform/web");
9
11
  const utils_1 = require("./utils");
10
12
  exports.SKILL_USAGE = "skill_usage";
11
13
  class TestCaseSkills {
@@ -34,23 +36,42 @@ const skillActionGenerator = (page, options) => {
34
36
  const [lastDir] = process.cwd().split("/").reverse();
35
37
  const dir = `${process.cwd()}/${lastDir}`;
36
38
  const module = await api_1.default.require(`./${skillFilePath}`, dir);
39
+ const skillFile = await promises_1.default.readFile(skillFilePath, "utf-8");
37
40
  const imports = Object.keys(module);
38
41
  const code = await (0, use_skill_1.generateSkillUsageCode)({
39
42
  task: skillDetails.testStep,
40
43
  sampleUsageMethod: skillDetails.usageExample,
41
44
  scopeVariablesMapStr: JSON.stringify(options.stateVariables || {}, null, 2),
42
45
  pageVariableName: (0, utils_1.getPageVarName)(),
46
+ skillMethodDefinition: skillFile,
43
47
  trace,
44
48
  });
45
49
  console.log("Usage code generated", code);
46
50
  const stateVarKeys = Object.keys(options.stateVariables || {});
51
+ const newVariablesSpan = trace?.span({
52
+ name: "new-state-variables",
53
+ });
54
+ const newVariables = (0, web_1.getVariableDeclarationsFromCode)(code);
55
+ newVariablesSpan?.end({
56
+ output: {
57
+ newVariables,
58
+ },
59
+ });
47
60
  const exec = new Function((0, utils_1.getPageVarName)(), ...imports, ...stateVarKeys,
48
- // assuming all POMs are async methods
61
+ // assuming all POMs are async methods and the LLM should respond with await keyword
49
62
  `
50
- return (async () => {
51
- return ${code}
63
+ return (async () => {
64
+ ${code}
65
+ return {
66
+ ${newVariables.join(",")}
67
+ }
52
68
  })()`);
53
- await exec(page, ...imports.map((i) => module[i]), ...stateVarKeys.map((s) => options.stateVariables[s]));
69
+ // extract the state variables after execution
70
+ const newStateVariables = await exec(page, ...imports.map((i) => module[i]), ...stateVarKeys.map((s) => options.stateVariables[s]));
71
+ options.setStateVariables({
72
+ ...options.stateVariables,
73
+ ...newStateVariables,
74
+ });
54
75
  return {
55
76
  locator: code,
56
77
  };
@@ -8,9 +8,9 @@ const textContentActionGenerator = (page, options) => {
8
8
  return {
9
9
  execute: async (args) => {
10
10
  const css = args.css_selector;
11
- const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(css, args.xpath, page, args?.elementAnnotation);
11
+ const locator = await (0, utils_1.getPlaywrightLocatorUsingCssSelector)(css, args.xpath, page.pwPageInstance, args?.elementAnnotation);
12
12
  const exec = new Function("page", `return page.${locator}.textContent()`);
13
- const value = (await exec(page));
13
+ const value = (await exec(page.pwPageInstance));
14
14
  if (options) {
15
15
  options.stateVariables[args.variable_name] = value;
16
16
  }
@@ -19,7 +19,7 @@ const textContentActionGenerator = (page, options) => {
19
19
  };
20
20
  },
21
21
  template: (args, options) => {
22
- const code = `const ${args.variable_name} = await ${(0, utils_1.getPageVarName)()}.${options.locator}.textContent();`;
22
+ const code = `const ${args.variable_name} = await ${page.name}.${options.locator}.textContent();`;
23
23
  return {
24
24
  code,
25
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,GAAG,CAAC;QAChB,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AAED,wBAAsB,oCAAoC,CACxD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,EACV,iBAAiB,CAAC,EAAE,MAAM,gBAkF3B;AAED,wBAAgB,cAAc,WAG7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,GAAG,CAAC;QAChB,MAAM,EAAE,GAAG,CAAC;KACb;CACF;AAED,wBAAsB,oCAAoC,CACxD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,EACV,iBAAiB,CAAC,EAAE,MAAM,gBAoF3B;AAED,wBAAgB,cAAc,WAG7B"}
@@ -52,10 +52,12 @@ async function getPlaywrightLocatorUsingCssSelector(cssSelector, xpath, page, el
52
52
  if (!selectedElem) {
53
53
  const elements = window.jQuery(locator.cssForJq);
54
54
  let elIdx = 0;
55
- Array.from(elements).forEach((el, i) => {
55
+ Array.from(elements).some((el, i) => {
56
56
  if (window.jQuery(el).is(":visible")) {
57
57
  elIdx = i;
58
+ return true;
58
59
  }
60
+ return false;
59
61
  });
60
62
  //@ts-ignore
61
63
  selectedElem = elements[elIdx];
@@ -1 +1 @@
1
- {"version":3,"file":"skills-retriever.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/skills-retriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG7D,eAAO,MAAM,cAAc;cAMf,QAAQ;;;;;;;;;;IA8CnB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,EACzC,QAAQ,EACR,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;;;;;;KA6BA"}
1
+ {"version":3,"file":"skills-retriever.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/skills-retriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBhE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG7D,eAAO,MAAM,cAAc;cAMf,QAAQ;;;;;;;;;;IAoFnB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,EACzC,QAAQ,EACR,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;;;;;;KA6BA"}
@@ -43,7 +43,42 @@ const fetchPomSkills = async ({ testCase, pomFiles, options, trace, }) => {
43
43
  },
44
44
  });
45
45
  let response = firstShotMessage?.content || "";
46
- const skills = (0, utils_1.extractTestStepsSuggestions)(response);
46
+ const { codePrompt } = await (0, context_1.contextForGeneration)();
47
+ const usageExampleUpdatePrompt = [
48
+ {
49
+ role: "system",
50
+ content: `
51
+ You are provided with usage examples of page object models of a Playwright test repository and you are given a task to update the usage example of the page object models with the usage of them in tests.
52
+
53
+ You need to ensure all the pre-requisites of calling the method is also mentioned in the usage example. Use the tests code for same
54
+ `,
55
+ },
56
+ {
57
+ role: "user",
58
+ content: `
59
+ Usage examples of page object models:
60
+
61
+ ${response}
62
+
63
+ Tests files:
64
+
65
+ ${codePrompt}
66
+
67
+ Before responding:
68
+ - ensure responding in the same format as provided to you in the usage example of page object models.
69
+ - respond only with the methods and not any test block
70
+ `,
71
+ },
72
+ ];
73
+ const updatedUsageExampleMessage = await llm.createChatCompletion({
74
+ messages: usageExampleUpdatePrompt,
75
+ traceName: "fetch-pom-skills-usage-eg-update-llm",
76
+ modelParameters: {
77
+ ...constants_1.DEFAULT_MODEL_PARAMETERS,
78
+ ...options?.modelParameters,
79
+ },
80
+ });
81
+ const skills = (0, utils_1.extractTestStepsSuggestions)(updatedUsageExampleMessage?.content || "");
47
82
  fetchSkillsUsingPOMFilesSpan?.end({ output: { skills } });
48
83
  return skills;
49
84
  };
@@ -1,9 +1,10 @@
1
1
  import { TraceClient } from "@empiricalrun/llm";
2
- export declare function generateSkillUsageCode({ task, sampleUsageMethod, scopeVariablesMapStr, pageVariableName, trace, }: {
2
+ export declare function generateSkillUsageCode({ task, sampleUsageMethod, scopeVariablesMapStr, pageVariableName, skillMethodDefinition, trace, }: {
3
3
  task: string;
4
4
  sampleUsageMethod: string;
5
5
  scopeVariablesMapStr: string;
6
6
  pageVariableName: string;
7
+ skillMethodDefinition: string;
7
8
  trace?: TraceClient;
8
9
  }): Promise<string>;
9
10
  //# sourceMappingURL=use-skill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-skill.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/use-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShE,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACJ,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,mBA0CA"}
1
+ {"version":3,"file":"use-skill.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/use-skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUhE,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACJ,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,mBAiDA"}
@@ -2,8 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateSkillUsageCode = void 0;
4
4
  const llm_1 = require("@empiricalrun/llm");
5
+ const logger_1 = require("../../bin/logger");
5
6
  const constants_1 = require("../../constants");
6
- async function generateSkillUsageCode({ task, sampleUsageMethod, scopeVariablesMapStr, pageVariableName, trace, }) {
7
+ async function generateSkillUsageCode({ task, sampleUsageMethod, scopeVariablesMapStr, pageVariableName, skillMethodDefinition, trace, }) {
8
+ const logger = new logger_1.CustomLogger();
9
+ logger.log(`Generating code using skill usage example: ${sampleUsageMethod}`);
7
10
  const skillUsageSpan = trace?.span({
8
11
  name: "skill-usage",
9
12
  input: {
@@ -21,7 +24,8 @@ async function generateSkillUsageCode({ task, sampleUsageMethod, scopeVariablesM
21
24
  sampleUsageMethod,
22
25
  scopeVariablesMapStr,
23
26
  pageVariableName,
24
- });
27
+ skillMethodDefinition,
28
+ }, 4);
25
29
  promptSpan?.end({ output: prompt });
26
30
  const llm = new llm_1.LLM({
27
31
  trace: skillUsageSpan,
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,GAAG,EACH,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAYlD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EACL,oBAAoB,EAErB,MAAM,aAAa,CAAC;AAQrB,wBAAsB,aAAa,CAAC,EAClC,IAAI,EACJ,eAAe,EACf,aAAa,EACb,OAAO,EACP,KAAK,EACL,GAAG,EACH,OAAO,EACP,cAAc,EACd,uBAAuB,EACvB,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,2FA2FA;AAGD,wBAAsB,0BAA0B,CAAC,EAC/C,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A2FA;AAGD,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;;;GAiUA"}
@@ -6,16 +6,27 @@ const vision_1 = require("@empiricalrun/llm/vision");
6
6
  const actions_1 = require("../../actions");
7
7
  const next_task_1 = require("../../actions/next-task");
8
8
  const skill_1 = require("../../actions/skill");
9
+ const utils_1 = require("../../actions/utils");
9
10
  const logger_1 = require("../../bin/logger");
10
11
  const constants_1 = require("../../constants");
12
+ const page_1 = require("../../page");
11
13
  const reporter_1 = require("../../reporter");
12
14
  const session_1 = require("../../session");
13
15
  const browsing_1 = require("../browsing");
14
- const utils_1 = require("../browsing/utils");
16
+ const utils_2 = require("../browsing/utils");
15
17
  const skills_retriever_1 = require("../codegen/skills-retriever");
16
- const verification_1 = require("../verification");
18
+ const run_time_planner_1 = require("../planner/run-time-planner");
17
19
  const with_hints_1 = require("./with-hints");
18
20
  const MAX_ERROR_COUNT = 2;
21
+ function getPageVariables(stateVariables) {
22
+ const keys = Object.keys(stateVariables);
23
+ const pageVariables = keys.filter((key) => key.endsWith("Page") || key.endsWith("page"));
24
+ const pages = pageVariables.reduce((acc, key) => {
25
+ acc[key] = stateVariables[key];
26
+ return acc;
27
+ }, {});
28
+ return pages;
29
+ }
19
30
  async function getNextAction({ task, executedActions, failedActions, pageUrl, trace, llm, options, pageScreenshot, annotatedPageScreenshot, actions, disableSkills, useHints = false, annotations, }) {
20
31
  const nextActionSpan = trace?.span({
21
32
  name: "master-agent-next-action",
@@ -105,6 +116,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
105
116
  const logger = new logger_1.CustomLogger({ useReporter: false });
106
117
  const testgenUpdatesReporter = new reporter_1.TestGenUpdatesReporter();
107
118
  const session = (0, session_1.getSessionDetails)();
119
+ const testGenPage = new page_1.TestGenPage(page, (0, utils_1.getPageVarName)());
108
120
  // add timeout for the page to settle in
109
121
  await page.waitForTimeout(3000);
110
122
  const trace = llm_1.langfuseInstance?.trace({
@@ -141,8 +153,8 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
141
153
  options,
142
154
  });
143
155
  skill_1.testCaseSkills.updateSkills(skills);
144
- const actions = new actions_1.PlaywrightActions(page, scopeVars);
145
- await (0, utils_1.injectPwLocatorGenerator)(page);
156
+ const actions = new actions_1.PlaywrightActions(testGenPage, scopeVars);
157
+ await (0, utils_2.injectPwLocatorGenerator)(page);
146
158
  trace?.update({ input: { task } });
147
159
  let isGivenTaskDone = false;
148
160
  const masterAgentActions = [];
@@ -160,17 +172,25 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
160
172
  failedActions,
161
173
  },
162
174
  });
163
- if (masterAgentActions.length > 0) {
164
- const verificationAgentResp = await (0, verification_1.verificationAgent)({
165
- trace: masterAgentSpan,
166
- task,
167
- conversation: ["Successfully executed actions", ...masterAgentActions],
168
- });
169
- isGivenTaskDone = verificationAgentResp.isDone;
170
- if (isGivenTaskDone) {
171
- await testgenUpdatesReporter.sendMessage(`${verificationAgentResp.reason} Marking the task as done.`);
172
- break;
173
- }
175
+ const plannerResp = await (0, run_time_planner_1.runtimePlanner)({
176
+ trace: masterAgentSpan,
177
+ task,
178
+ conversation: ["Successfully executed actions", ...masterAgentActions],
179
+ pages: getPageVariables(actions.getStateVariables()),
180
+ currentPage: (0, utils_1.getPageVarName)(),
181
+ });
182
+ isGivenTaskDone = plannerResp.isDone;
183
+ if (isGivenTaskDone) {
184
+ await testgenUpdatesReporter.sendMessage(`${plannerResp.reason} Marking the task as done.`);
185
+ break;
186
+ }
187
+ if (actions.getStateVariables()[plannerResp.pageName]) {
188
+ // update page for the master agent
189
+ page = actions.getStateVariables()[plannerResp.pageName];
190
+ // update page in actions
191
+ testGenPage.updatePage({ page, name: plannerResp.pageName });
192
+ // inject scripts in the updated
193
+ await (0, utils_2.injectPwLocatorGenerator)(testGenPage.pwPageInstance);
174
194
  }
175
195
  const buffer = await page.screenshot({
176
196
  //This is done to improve element annotation accuracy, anyways it doesn't annotate elements which are out of viewport
@@ -261,7 +281,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, scope
261
281
  const result = await (0, with_hints_1.triggerHintsFlow)({
262
282
  outputFromGetNextAction: output,
263
283
  generatedAnnotations: annotations,
264
- page,
284
+ page: testGenPage,
265
285
  llm,
266
286
  trace: triggerHintsFlowSpan,
267
287
  });
@@ -1,6 +1,6 @@
1
1
  import { LLM, TraceClient } from "@empiricalrun/llm";
2
2
  import OpenAI from "openai";
3
- import { Page } from "playwright";
3
+ import { TestGenPage } from "../../page";
4
4
  import { BrowsingAgentOptions } from "../browsing";
5
5
  export declare const getUserMessageWithForHints: ({ userMessage, options, pageScreenshot, annotatedPageScreenshot, }: {
6
6
  userMessage: OpenAI.ChatCompletionUserMessageParam;
@@ -14,7 +14,7 @@ export declare const triggerHintsFlow: ({ outputFromGetNextAction, generatedAnno
14
14
  elementAnnotation?: string;
15
15
  };
16
16
  generatedAnnotations: Record<string, any>;
17
- page: Page;
17
+ page: TestGenPage;
18
18
  llm: LLM;
19
19
  trace?: TraceClient | undefined;
20
20
  }) => Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"with-hints.d.ts","sourceRoot":"","sources":["../../../src/agent/master/with-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,0BAA0B;iBAMxB,OAAO,8BAA8B;;oBAElC,MAAM;6BACG,MAAM;MAC7B,MAAM,GAAG,OAAO,yBAAyB,EAiC5C,CAAC;AAEF,eAAO,MAAM,gBAAgB;6BAOF;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;0BACqB,OAAO,MAAM,EAAE,GAAG,CAAC;UACnC,IAAI;SACL,GAAG;;MAEN,QAAQ;IACV,sBAAsB,EAAE,OAAO,CAAC;IAChC,wBAAwB,EAAE,OAAO,qBAAqB,GAAG,SAAS,CAAC;CACpE,CAqGA,CAAC"}
1
+ {"version":3,"file":"with-hints.d.ts","sourceRoot":"","sources":["../../../src/agent/master/with-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,0BAA0B;iBAMxB,OAAO,8BAA8B;;oBAElC,MAAM;6BACG,MAAM;MAC7B,MAAM,GAAG,OAAO,yBAAyB,EAiC5C,CAAC;AAEF,eAAO,MAAM,gBAAgB;6BAOF;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;0BACqB,OAAO,MAAM,EAAE,GAAG,CAAC;UACnC,WAAW;SACZ,GAAG;;MAEN,QAAQ;IACV,sBAAsB,EAAE,OAAO,CAAC;IAChC,wBAAwB,EAAE,OAAO,qBAAqB,GAAG,SAAS,CAAC;CACpE,CAqGA,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { TraceClient } from "@empiricalrun/llm";
2
+ /**
3
+ * This agent is used to divide the tasl into individual actions and then
4
+ * compare each action against the actions listed in the conversation.
5
+ * If the task is not fully completed, identify which specific actions are missing and suggest next steps to complete the task.
6
+ *
7
+ * This is very initial stage planner and needs iteration and currently forked from verification agent
8
+ */
9
+ export declare function runtimePlanner({ trace, task, conversation, pages, currentPage, }: {
10
+ trace?: TraceClient;
11
+ conversation: string[];
12
+ task: string;
13
+ pages?: Record<string, any>;
14
+ currentPage?: string;
15
+ }): Promise<{
16
+ pageName: string;
17
+ isDone: boolean;
18
+ reason: string;
19
+ }>;
20
+ //# sourceMappingURL=run-time-planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-time-planner.d.ts","sourceRoot":"","sources":["../../../src/agent/planner/run-time-planner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,GACZ,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;GA6GA"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runtimePlanner = void 0;
4
+ const llm_1 = require("@empiricalrun/llm");
5
+ /**
6
+ * This agent is used to divide the tasl into individual actions and then
7
+ * compare each action against the actions listed in the conversation.
8
+ * If the task is not fully completed, identify which specific actions are missing and suggest next steps to complete the task.
9
+ *
10
+ * This is very initial stage planner and needs iteration and currently forked from verification agent
11
+ */
12
+ async function runtimePlanner({ trace, task, conversation, pages, currentPage, }) {
13
+ const runTimePlannerSpan = trace?.span({
14
+ name: "runtime-planner",
15
+ input: {
16
+ task,
17
+ conversation,
18
+ },
19
+ });
20
+ const llm = new llm_1.LLM({ provider: "openai" });
21
+ const prompt = [
22
+ {
23
+ role: "system",
24
+ content: `
25
+ Given a conversation that lists only the actions that were successfully executed and a task comprising multiple actions, your goal is to analyse the conversation and determine if the entire task is completed.
26
+ These conversations are between AI agents using Playwright to execute actions on browser. These agents already have access to browser tabs to execute steps. The successfully executed steps on browser post browser has opened, is provided to you as conversation.
27
+
28
+ If the task is not fully completed, identify which specific actions are missing and suggest next steps to complete the task. Assume that the conversation provided is entirely truthful and no additional actions were performed beyond those listed.
29
+
30
+ To fulfil your goal, follow these steps:
31
+ - Divide the task into individual actions.
32
+ - Compare each task action against the actions listed in the conversation.
33
+ - Identify which actions have been executed and which have not.
34
+ - If all actions are executed, respond with the task as done.
35
+ - If any actions are missing, respond with the task as not done, listing all actions and specifying which are complete and which are missing.
36
+ - If provided with list of pages, based on the next pending action and previously executed action, identify the page on which next action needs to be taken
37
+ `,
38
+ },
39
+ {
40
+ role: "user",
41
+ content: `
42
+ Task: ${task}
43
+
44
+ Conversation:
45
+ ${conversation.join("\n")}
46
+
47
+ Current page:
48
+ ${currentPage}
49
+ `,
50
+ },
51
+ ];
52
+ const response = await llm.createChatCompletion({
53
+ trace: runTimePlannerSpan,
54
+ traceName: "runtime-planner-llm",
55
+ model: "gpt-4o",
56
+ messages: prompt,
57
+ tools: [
58
+ {
59
+ type: "function",
60
+ function: {
61
+ name: "task_done",
62
+ description: "end the task by calling this method",
63
+ parameters: {
64
+ type: "object",
65
+ properties: {
66
+ actions: {
67
+ type: "string",
68
+ description: "actions extracted from task",
69
+ },
70
+ successful_actions: {
71
+ type: "string",
72
+ description: "successful actions mentioned in the conversation",
73
+ },
74
+ reason: {
75
+ type: "string",
76
+ description: "reasoning for identification of task status",
77
+ },
78
+ isDone: {
79
+ type: "boolean",
80
+ description: "whether the task is done",
81
+ },
82
+ pageName: {
83
+ type: "string",
84
+ enum: pages ? Object.keys(pages) : [],
85
+ description: "page name for the next action.",
86
+ },
87
+ },
88
+ required: ["isDone", "reason", "pageName"],
89
+ },
90
+ },
91
+ },
92
+ ],
93
+ modelParameters: {
94
+ tool_choice: "required",
95
+ temperature: 0.5,
96
+ },
97
+ });
98
+ const toolCallResp = (response?.tool_calls || [])[0];
99
+ if (toolCallResp) {
100
+ const toolCall = JSON.parse(toolCallResp.function.arguments);
101
+ const output = {
102
+ pageName: toolCall.pageName,
103
+ isDone: toolCall.isDone,
104
+ reason: toolCall.reason,
105
+ };
106
+ runTimePlannerSpan?.end({
107
+ output,
108
+ });
109
+ return output;
110
+ }
111
+ const output = {
112
+ pageName: "",
113
+ isDone: false,
114
+ reason: "LLM failed to generate a valid response",
115
+ };
116
+ runTimePlannerSpan?.end({
117
+ output,
118
+ });
119
+ return output;
120
+ }
121
+ exports.runtimePlanner = runtimePlanner;
@@ -1,5 +1,5 @@
1
1
  export declare function createGitIgnoreFileFilter(): Promise<(pathname: string) => boolean>;
2
- export declare function contextForGeneration(file: string): Promise<{
2
+ export declare function contextForGeneration(file?: string): Promise<{
3
3
  codePrompt: string | undefined;
4
4
  pomPrompt: string | undefined;
5
5
  testFileContent: string;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/context.ts"],"names":[],"mappings":"AAKA,wBAAsB,yBAAyB,2CAS9C;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM;;;;GAOtD;AAED,wBAAsB,iBAAiB,oBAYtC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/context.ts"],"names":[],"mappings":"AAKA,wBAAsB,yBAAyB,2CAS9C;AAED,wBAAsB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM;;;;GAOvD;AAED,wBAAsB,iBAAiB,oBAYtC"}
@@ -23,7 +23,7 @@ async function contextForGeneration(file) {
23
23
  return {
24
24
  codePrompt: await (0, fs_1.generatePromptFromDirectory)("./tests", filter),
25
25
  pomPrompt: await (0, fs_1.generatePromptFromDirectory)("./pages", filter),
26
- testFileContent: await fs_extra_1.default.readFile(file, "utf-8"),
26
+ testFileContent: file ? await fs_extra_1.default.readFile(file, "utf-8") : "",
27
27
  };
28
28
  }
29
29
  exports.contextForGeneration = contextForGeneration;
@@ -72,4 +72,5 @@ export declare function buildTestNamePrompt({ testName, suites, }: {
72
72
  testName: string;
73
73
  suites: string[];
74
74
  }): string;
75
+ export declare function getVariableDeclarationsFromCode(sourceCode: string): string[];
75
76
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,IAAI,EAEJ,UAAU,EAEX,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,eAAO,MAAM,gCAAgC,eAC/B,UAAU,KACrB,MAgBF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CA2CA;AAwBD,wBAAsB,0CAA0C,CAC9D,QAAQ,EAAE,MAAM,oBA+BjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,IAAI,GAAG,SAAS,CA4BlB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CA8C7D;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM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BAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAMpD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,UAcpD;AAED,wBAAsB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,+BAoBvE;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,UA0CtB;AAED,eAAO,MAAM,6BAA6B;qBAKvB,MAAM;iBACV,MAAM;YACX,MAAM,EAAE;YA2DjB,CAAC;AAEF,eAAO,MAAM,iCAAiC,cACjC,MAAM,EAAE,gBACL,MAAM,sBAyBrB,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,EAC1C,YAAY,EACZ,QAAQ,EACR,MAAM,GACP,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,iBAsDA;AAED,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EAAE,iBA2BzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,WAYA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,UAOA;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA4B5E"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.buildTestNamePrompt = exports.isTestPresent = exports.appendScopeToCreateTest = exports.addUserContextFixture = exports.importAllExportsStmtFromFilePaths = exports.injectCodeSnippetBySuiteChain = exports.replaceCreateTestWithNewCode = exports.getPageVariableNameFromCreateTest = exports.getFixtureImportPath = exports.removeTestOnly = exports.addNewImport = exports.formatCode = exports.lintErrors = exports.stripAndPrependImports = exports.validateTypescript = exports.appendToTestBlock = exports.findFirstSerialDescribeBlock = exports.hasTopLevelDescribeConfigureWithSerialMode = exports.getTypescriptTestBlock = exports.getTestModuleAliasFromSourceFile = void 0;
6
+ exports.getVariableDeclarationsFromCode = exports.buildTestNamePrompt = exports.isTestPresent = exports.appendScopeToCreateTest = exports.addUserContextFixture = exports.importAllExportsStmtFromFilePaths = exports.injectCodeSnippetBySuiteChain = exports.replaceCreateTestWithNewCode = exports.getPageVariableNameFromCreateTest = exports.getFixtureImportPath = exports.removeTestOnly = exports.addNewImport = exports.formatCode = exports.lintErrors = exports.stripAndPrependImports = exports.validateTypescript = exports.appendToTestBlock = exports.findFirstSerialDescribeBlock = exports.hasTopLevelDescribeConfigureWithSerialMode = exports.getTypescriptTestBlock = exports.getTestModuleAliasFromSourceFile = void 0;
7
7
  const eslint_1 = require("eslint");
8
8
  const fs_1 = require("fs");
9
9
  const fs_extra_1 = __importDefault(require("fs-extra"));
@@ -474,3 +474,29 @@ function buildTestNamePrompt({ testName, suites, }) {
474
474
  : testName;
475
475
  }
476
476
  exports.buildTestNamePrompt = buildTestNamePrompt;
477
+ function getVariableDeclarationsFromCode(sourceCode) {
478
+ const project = new ts_morph_1.Project();
479
+ const sourceFile = project.createSourceFile("temp.ts", sourceCode);
480
+ // Extract variable declarations
481
+ const variables = sourceFile.getDescendantsOfKind(ts_morph_1.SyntaxKind.VariableDeclaration);
482
+ // Function to extract individual variables from destructured declarations
483
+ function extractVariables(variable) {
484
+ const nameNode = variable.getNameNode();
485
+ if (nameNode.getKind() === ts_morph_1.SyntaxKind.ObjectBindingPattern) {
486
+ // For object destructuring
487
+ return nameNode.getElements().map((element) => element.getName());
488
+ }
489
+ else if (nameNode.getKind() === ts_morph_1.SyntaxKind.ArrayBindingPattern) {
490
+ // For array destructuring
491
+ return nameNode.getElements().map((element) => element.getText());
492
+ }
493
+ else {
494
+ // For regular variable declarations
495
+ return [variable.getName()];
496
+ }
497
+ }
498
+ // Collect all variable names
499
+ const allVariables = variables.flatMap((variable) => extractVariables(variable));
500
+ return allVariables;
501
+ }
502
+ exports.getVariableDeclarationsFromCode = getVariableDeclarationsFromCode;
@@ -1 +1 @@
1
- {"version":3,"file":"master-agent.evals.d.ts","sourceRoot":"","sources":["../../src/evals/master-agent.evals.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,eAAO,MAAM,4BAA4B,EAAE,UA4C1C,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"master-agent.evals.d.ts","sourceRoot":"","sources":["../../src/evals/master-agent.evals.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,eAAO,MAAM,4BAA4B,EAAE,UA4C1C,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -4,11 +4,12 @@ exports.masterGetNextActionEvaluator = void 0;
4
4
  const actions_1 = require("../actions");
5
5
  const skill_1 = require("../actions/skill");
6
6
  const run_1 = require("../agent/master/run");
7
+ const page_1 = require("../page");
7
8
  const masterGetNextActionEvaluator = async ({ item, trace, }) => {
8
9
  const { task, executedActions, failedActions, pageUrl, options, pageScreenshot, annotatedPageScreenshot, disableSkills, useHints, skills = [], annotations, } = item.input;
9
10
  const page = {};
10
11
  skill_1.testCaseSkills.updateSkills(skills);
11
- const actions = new actions_1.PlaywrightActions(page);
12
+ const actions = new actions_1.PlaywrightActions(new page_1.TestGenPage(page, "page"));
12
13
  const output = await (0, run_1.getNextAction)({
13
14
  task,
14
15
  executedActions,
@@ -0,0 +1,11 @@
1
+ import { Page } from "playwright";
2
+ export declare class TestGenPage {
3
+ pwPageInstance: Page;
4
+ name: string;
5
+ constructor(pwPageInstance: Page, name: string);
6
+ updatePage({ page, name }: {
7
+ page: Page;
8
+ name: string;
9
+ }): void;
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,qBAAa,WAAW;IAEb,cAAc,EAAE,IAAI;IACpB,IAAI,EAAE,MAAM;gBADZ,cAAc,EAAE,IAAI,EACpB,IAAI,EAAE,MAAM;IAGrB,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;CAIxD"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TestGenPage = void 0;
4
+ class TestGenPage {
5
+ pwPageInstance;
6
+ name;
7
+ constructor(pwPageInstance, name) {
8
+ this.pwPageInstance = pwPageInstance;
9
+ this.name = name;
10
+ }
11
+ updatePage({ page, name }) {
12
+ this.pwPageInstance = page;
13
+ this.name = name;
14
+ }
15
+ }
16
+ exports.TestGenPage = TestGenPage;
@@ -1,6 +1,6 @@
1
1
  import { LLMModel, LLMProvider, ModelParameters, TraceClient } from "@empiricalrun/llm";
2
2
  import OpenAI from "openai";
3
- import { Page } from "playwright";
3
+ import { TestGenPage } from "../page";
4
4
  export type FileContent = {
5
5
  filePath: string;
6
6
  content: string;
@@ -44,8 +44,9 @@ export type TestCase = {
44
44
  suites: string[];
45
45
  ai_gist?: string;
46
46
  };
47
- export type PlaywrightActionGenerator = (page: Page, options: {
47
+ export type PlaywrightActionGenerator = (page: TestGenPage, options: {
48
48
  stateVariables: Record<string, any>;
49
+ setStateVariables: (stateVariables: Record<string, any>) => void;
49
50
  }) => Action;
50
51
  export type ActionSchema = OpenAI.Chat.Completions.ChatCompletionTool;
51
52
  export type Action = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,WAAW,CAAC;IAC3B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,aAAa,GAAG,YAAY,CAAC;KAC3C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KA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 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.38.2",
3
+ "version": "0.38.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"