@empiricalrun/test-gen 0.21.9 → 0.21.11

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,18 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.21.11
4
+
5
+ ### Patch Changes
6
+
7
+ - e2b7a29: fix: codegen adding extra changes than the requested task
8
+ - 29cad4a: feat: use vercel kv
9
+
10
+ ## 0.21.10
11
+
12
+ ### Patch Changes
13
+
14
+ - e077e2a: fix: verification agent should use model configured from test token
15
+
3
16
  ## 0.21.9
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAgJrB"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAkJrB"}
@@ -67,7 +67,7 @@ async function generateTest(testCase, file, options) {
67
67
  logger.success("Test generated successfully!");
68
68
  const readWriteFileSpan = trace.span({ name: "write-to-file" });
69
69
  let contents = fs_extra_1.default.readFileSync(file, "utf-8");
70
- const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(response);
70
+ const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(response, testCase?.name);
71
71
  let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
72
72
  if (isUpdate) {
73
73
  const testBlock = (0, web_1.getTypescriptTestBlock)(testCase?.name, contents);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,GAAG,EACH,KAAK,EACL,IAAI,EACJ,YAAY,GACb,EAAE;IACD,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;;;GA8DA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,GAAG,EACH,KAAK,EACL,IAAI,EACJ,YAAY,GACb,EAAE;IACD,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;;;GA6DA"}
@@ -48,7 +48,6 @@ ${conversation.join("\n")}
48
48
  },
49
49
  },
50
50
  ],
51
- model: "gpt-4o",
52
51
  modelParameters: {
53
52
  tool_choice: "required",
54
53
  },
@@ -1,7 +1,7 @@
1
1
  export declare function getTypescriptTestBlock(scenarioName: string, content: string): string | undefined;
2
2
  export declare function appendToTestBlock(testBlock: string, content: string): string;
3
3
  export declare function validateTypescript(filePath: string): string[];
4
- export declare function stripAndPrependImports(content: string): Promise<string[]>;
4
+ export declare function stripAndPrependImports(content: string, testName: string): Promise<(string | undefined)[]>;
5
5
  export declare function lintErrors(filePath: string): Promise<void>;
6
6
  export declare function formatCode(filePath: string): Promise<void>;
7
7
  export declare function addNewImport(contents: string, modules: string[], pkg: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAMA,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAmD7D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,qBAM3D;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAShD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,UAE5E;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAIpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAMA,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAmD7D;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,mCAOjB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAShD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,UAE5E;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAIpD"}
@@ -73,10 +73,10 @@ function validateTypescript(filePath) {
73
73
  return errors;
74
74
  }
75
75
  exports.validateTypescript = validateTypescript;
76
- async function stripAndPrependImports(content) {
76
+ async function stripAndPrependImports(content, testName) {
77
77
  const importRegexp = /import\s+\{[^}]*\}\s+from\s+["'][^"']+["'];?/g;
78
78
  const imports = content.match(importRegexp);
79
- const strippedContent = content.replace(importRegexp, "");
79
+ const strippedContent = getTypescriptTestBlock(testName, content);
80
80
  const prependContent = (imports?.join("\n") || "") + "\n\n";
81
81
  return [prependContent, strippedContent];
82
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.21.9",
3
+ "version": "0.21.11",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"