@empiricalrun/test-gen 0.31.14 → 0.31.17

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,23 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.31.17
4
+
5
+ ### Patch Changes
6
+
7
+ - c58e91c: fix: show error message and stack in test-gen failure
8
+
9
+ ## 0.31.16
10
+
11
+ ### Patch Changes
12
+
13
+ - ad4af33: fix: update test agent halucinating in larger context
14
+
15
+ ## 0.31.15
16
+
17
+ ### Patch Changes
18
+
19
+ - 71898fe: fix: handle json string responses of o1
20
+
3
21
  ## 0.31.14
4
22
 
5
23
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"o1-completion.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/o1-completion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAKpC,wBAAsB,eAAe,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CA0D7C"}
1
+ {"version":3,"file":"o1-completion.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/o1-completion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAKpC,wBAAsB,eAAe,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CA6D7C"}
@@ -50,7 +50,9 @@ async function getO1Completion({ messages, tools, trace, }) {
50
50
  type: "function",
51
51
  function: {
52
52
  name: toolRespJSON.function.name,
53
- arguments: JSON.stringify(toolRespJSON.function.parameters, null, 2),
53
+ arguments: typeof parameters === "string"
54
+ ? parameters
55
+ : JSON.stringify(parameters, null, 2),
54
56
  },
55
57
  };
56
58
  completion = {
@@ -1 +1 @@
1
- {"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAqB3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAqIF,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,OAAO,GAAE,OAAc,EACvB,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CAuF5B;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA6E7B"}
1
+ {"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAqB3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAqIF,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,OAAO,GAAE,OAAc,EACvB,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CA2F5B;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA6E7B"}
@@ -141,13 +141,19 @@ async function updateTest(testCase, file, options, logging = true, validate = tr
141
141
  return text;
142
142
  }, "") + testCase.name
143
143
  : testCase.name;
144
+ const { testBlock: currentScenarioCodeBlock } = (0, web_1.getTypescriptTestBlock)({
145
+ scenarioName: testCase?.name,
146
+ content: testFileContent,
147
+ suites: testCase?.suites || [],
148
+ });
144
149
  const instruction = await (0, llm_1.getPrompt)(promptName, {
145
150
  testFiles: codePrompt,
146
151
  pageFiles: pomPrompt,
147
152
  scenarioName,
148
153
  scenarioSteps: testCase.steps.join("\n"),
149
154
  scenarioFile: file,
150
- }, 14);
155
+ currentScenarioCodeBlock,
156
+ });
151
157
  promptSpan.end({ output: { instruction } });
152
158
  const llm = new llm_1.LLM({
153
159
  trace,
package/dist/bin/index.js CHANGED
@@ -67,7 +67,7 @@ async function runAgent(testGenConfig) {
67
67
  }
68
68
  catch (e) {
69
69
  testGenFailed = true;
70
- new logger_1.CustomLogger().error(`Failed to generate test for the scenario. ${process.env.LOG_URL ? `[view log](${process.env.LOG_URL})` : ""}`);
70
+ new logger_1.CustomLogger().error(`Failed to generate test for the scenario. ${process.env.LOG_URL ? `[view log](${process.env.LOG_URL})` : ""}`, e?.message, e?.stack);
71
71
  }
72
72
  if (testGenConfig.options?.agent !== "code") {
73
73
  await new reporter_1.TestGenUpdatesReporter().reportGenAssets({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.31.14",
3
+ "version": "0.31.17",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -45,8 +45,8 @@
45
45
  "tsx": "^4.16.2",
46
46
  "typescript": "^5.3.3",
47
47
  "@empiricalrun/llm": "^0.9.3",
48
- "@empiricalrun/reporter": "^0.20.2",
49
- "@empiricalrun/r2-uploader": "^0.3.3"
48
+ "@empiricalrun/r2-uploader": "^0.3.3",
49
+ "@empiricalrun/reporter": "^0.20.2"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/detect-port": "^1.3.5",