@empiricalrun/test-gen 0.33.15 → 0.33.16

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,12 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.33.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 696d17b: fix: incorrect agent picked for the generation
8
+ - e4558cf: chore: make trace url clickable for coding agent
9
+
3
10
  ## 0.33.15
4
11
 
5
12
  ### Patch Changes
@@ -26,7 +26,7 @@ async function validateAndFixTypescriptErrors({ trace, logger = new logger_1.Cus
26
26
  trace?.event({ name: "code-fix-iteration-max-out" });
27
27
  logger.error([
28
28
  `Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors.`,
29
- `Trace: ${trace?.getTraceUrl()}`,
29
+ `View [trace](${trace?.getTraceUrl()})`,
30
30
  ].join("\n"));
31
31
  break;
32
32
  }
@@ -1,11 +1,9 @@
1
1
  import { TraceClient } from "@empiricalrun/llm";
2
2
  import { Agent, TestGenConfigOptions } from "../../types";
3
- export declare function inferAgentBasedTask({ task, testCode, options, trace, testName, }: {
3
+ export declare function inferAgentBasedTask({ task, options, trace, }: {
4
4
  task: string;
5
- testCode?: string;
6
5
  options?: TestGenConfigOptions;
7
6
  trace?: TraceClient;
8
- testName: string;
9
7
  }): Promise<{
10
8
  response: Agent;
11
9
  trace: TraceClient;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/infer-agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG1D,wBAAsB,mBAAmB,CAAC,EACxC,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,KAAK,EACL,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC,CAyFnD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/infer-agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG1D,wBAAsB,mBAAmB,CAAC,EACxC,IAAI,EACJ,OAAO,EACP,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAAC,CA6EnD"}
@@ -5,7 +5,7 @@ const llm_1 = require("@empiricalrun/llm");
5
5
  const constants_1 = require("../../constants");
6
6
  const session_1 = require("../../session");
7
7
  const session = (0, session_1.getSessionDetails)();
8
- async function inferAgentBasedTask({ task, testCode, options, trace, testName, }) {
8
+ async function inferAgentBasedTask({ task, options, trace, }) {
9
9
  trace =
10
10
  trace ||
11
11
  llm_1.langfuseInstance.trace({
@@ -17,8 +17,6 @@ async function inferAgentBasedTask({ task, testCode, options, trace, testName, }
17
17
  name: "infer-agent",
18
18
  input: {
19
19
  task,
20
- testCode,
21
- testName,
22
20
  options,
23
21
  },
24
22
  });
@@ -26,20 +24,10 @@ async function inferAgentBasedTask({ task, testCode, options, trace, testName, }
26
24
  name: "infer-agent-prompt",
27
25
  input: {
28
26
  task,
29
- testCode,
30
27
  },
31
28
  });
32
- const testNameAndCode = testCode
33
- ? `
34
- Test name: ${testName}
35
-
36
- Test code:
37
- ${testCode}
38
- `
39
- : "";
40
29
  const prompt = await (0, llm_1.getPrompt)("infer-agent", {
41
30
  task,
42
- testNameAndCode,
43
31
  });
44
32
  promptSpan?.end({ output: { prompt } });
45
33
  const llm = new llm_1.LLM({
package/dist/bin/index.js CHANGED
@@ -16,8 +16,6 @@ const session_1 = require("../session");
16
16
  const test_build_1 = require("../test-build");
17
17
  const logger_1 = require("./logger");
18
18
  const utils_2 = require("./utils");
19
- const context_1 = require("./utils/context");
20
- const web_1 = require("./utils/platform/web");
21
19
  dotenv_1.default.config({
22
20
  path: [".env.local", ".env"],
23
21
  });
@@ -25,21 +23,9 @@ process.on("beforeExit", async () => await (0, llm_1.flushAllTraces)());
25
23
  process.on("exit", async () => await (0, llm_1.flushAllTraces)());
26
24
  process.on("SIGINT", async () => await (0, llm_1.flushAllTraces)());
27
25
  process.on("SIGTERM", async () => await (0, llm_1.flushAllTraces)());
28
- async function resolveAgentUsingTask({ specPath, testCase, trace, }) {
29
- const { pomPrompt, testFileContent } = await (0, context_1.contextForGeneration)(specPath);
30
- const isUpdateFlow = (0, web_1.isTestPresent)({
31
- specPath,
32
- testCase,
33
- });
26
+ async function resolveAgentUsingTask({ testCase, trace, }) {
34
27
  const { response } = await (0, infer_agent_1.inferAgentBasedTask)({
35
28
  task: testCase.steps.join("\n"),
36
- testCode: isUpdateFlow ? `${pomPrompt}\n\n${testFileContent}` : "",
37
- testName: isUpdateFlow
38
- ? (0, web_1.buildTestNamePrompt)({
39
- testName: testCase.name,
40
- suites: testCase.suites,
41
- })
42
- : "",
43
29
  trace,
44
30
  });
45
31
  return response;
@@ -77,7 +63,6 @@ async function runAgent(testGenConfig) {
77
63
  }
78
64
  if (!agent || agent === "auto") {
79
65
  agent = await resolveAgentUsingTask({
80
- specPath,
81
66
  testCase,
82
67
  trace,
83
68
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.33.15",
3
+ "version": "0.33.16",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"