@empiricalrun/test-gen 0.7.0 → 0.7.1

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,11 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0aaf594: fix: make it easier to open trace
8
+
3
9
  ## 0.7.0
4
10
 
5
11
  ### Minor Changes
@@ -5,6 +5,7 @@ export default class LLMTracing {
5
5
  name?: string;
6
6
  });
7
7
  get id(): string;
8
+ get url(): string;
8
9
  event({ name, input, metadata, output, }: {
9
10
  name: string;
10
11
  input?: any;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/ai/trace/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAe5B,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,KAAK,CAAsB;gBACvB,EAAE,IAAuB,EAAE,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO;IAS/D,IAAI,EAAE,WAEL;IAED,KAAK,CAAC,EACJ,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,MAAM,CAAC,EAAE,GAAG,CAAC;KACd;IAID,MAAM,CAAC,EACL,KAAU,EACV,MAAW,EACX,QAAa,GACd,EAAE;QACD,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,MAAM,CAAC,EAAE,GAAG,CAAC;QACb,QAAQ,CAAC,EAAE,GAAG,CAAC;KAChB;IAID,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAC/B,QAAQ,GAAE,MA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AAe,CAAC,EACd,IAAS,EACT,KAAU,EACV,UAAe,EACf,KAAU,GACX,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,KAAK,EAAE,GAAG,CAAC;KACZ;;oBAYa,MAAM;;cAEZ,IAAI;;CAcb"}
@@ -24,6 +24,9 @@ class LLMTracing {
24
24
  get id() {
25
25
  return this.trace.traceId;
26
26
  }
27
+ get url() {
28
+ return this.trace.getTraceUrl();
29
+ }
27
30
  event({ name, input, metadata, output, }) {
28
31
  this.trace.event({ name, input, metadata, output });
29
32
  }
package/dist/bin/index.js CHANGED
@@ -83,7 +83,11 @@ async function generateTest(scenarios, file, isUpdate) {
83
83
  counter += 1;
84
84
  if (counter > maxIteration) {
85
85
  trace.event({ name: "code-fix-iteration-max-out" });
86
- logger.error(`Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors. Run the test-gen command again, once errors are fixed. [Trace: ${trace.id}]`);
86
+ logger.error([
87
+ `Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors.`,
88
+ `Run the test-gen command again, once errors are fixed.`,
89
+ `[Trace: ${trace.url}]`,
90
+ ].join("\n"));
87
91
  break;
88
92
  }
89
93
  trace.event({ name: "Found errors fixing" });
@@ -115,7 +119,7 @@ async function generateTest(scenarios, file, isUpdate) {
115
119
  }
116
120
  trace.event({ name: "format-file" });
117
121
  await (0, web_1.formatCode)(file);
118
- logger.success("File formatted successfully!", `[Trace: ${trace.id}]`);
122
+ logger.success("File formatted successfully!", `[Trace: ${trace.url}]`);
119
123
  generatedScenarios.push(scenario);
120
124
  trace.update({ input: { scenario }, output: { response } });
121
125
  }
@@ -4,10 +4,10 @@ exports.CustomLogger = void 0;
4
4
  const picocolors_1 = require("picocolors");
5
5
  class CustomLogger {
6
6
  log(message, ...optionalParams) {
7
- console.log("🪵 ", (0, picocolors_1.cyan)(message), ...optionalParams);
7
+ console.log("🪵", (0, picocolors_1.cyan)(message), ...optionalParams);
8
8
  }
9
9
  warn(message, ...optionalParams) {
10
- console.log("🟡 ", (0, picocolors_1.yellow)(message), ...optionalParams);
10
+ console.log("🟡", (0, picocolors_1.yellow)(message), ...optionalParams);
11
11
  }
12
12
  success(message, ...optionalParams) {
13
13
  console.log("✅", (0, picocolors_1.green)(message), ...optionalParams);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"