@empiricalrun/test-gen 0.69.5 → 0.69.6

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,15 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.69.6
4
+
5
+ ### Patch Changes
6
+
7
+ - c0c1a9a: fix: use gemini stable instead of preview
8
+ - d67ca35: feat: add fetch-chat-session command, handle artifacts with same name
9
+ - 9a923e2: chore: preview env resources are in ap-south-1
10
+ - Updated dependencies [c0c1a9a]
11
+ - @empiricalrun/llm@0.19.2
12
+
3
13
  ## 0.69.5
4
14
 
5
15
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,aAAa,EAGd,MAAM,4BAA4B,CAAC;AAkBpC,wBAAgB,2BAA2B,uBAM1C;AA6HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EAAE,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,EAAE,CAAC,CA6DrB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAA8B;gBAEvC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAKvC,OAAO,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAelD,iBAAiB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAMtD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EACR,aAAa,EAGd,MAAM,4BAA4B,CAAC;AAkBpC,wBAAgB,2BAA2B,uBAM1C;AA6HD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EAAE,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,EAAE,CAAC,CA8DrB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAA8B;gBAEvC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAKvC,OAAO,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAelD,iBAAiB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;CAMtD"}
@@ -167,8 +167,9 @@ async function collectArtifacts(inputs, repoDir, toolCallId) {
167
167
  try {
168
168
  const dirs = { destinationDir, sourceDir: repoDir };
169
169
  const dataArtifactsWithFileName = dataArtifacts.map((a) => {
170
+ const randomSuffix = Math.random().toString(36).substring(2, 15);
170
171
  const fileExt = mime_1.default.getExtension(a.contentType);
171
- const fileName = `${(0, slug_1.slugify)(a.name)}-${Date.now().toString()}.${fileExt}`;
172
+ const fileName = `${(0, slug_1.slugify)(a.name)}-${randomSuffix}.${fileExt}`;
172
173
  return { ...a, fileName };
173
174
  });
174
175
  await Promise.all([
package/dist/bin/index.js CHANGED
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const llm_1 = require("@empiricalrun/llm");
8
8
  const commander_1 = require("commander");
9
9
  const dotenv_1 = __importDefault(require("dotenv"));
10
+ const fs_1 = __importDefault(require("fs"));
10
11
  const run_1 = require("../agent/browsing/run");
11
12
  const utils_1 = require("../agent/browsing/utils");
12
13
  const chat_1 = require("../agent/chat");
@@ -310,6 +311,29 @@ async function main() {
310
311
  await (0, setup_1.runSetup)({ repoName: options.repoName });
311
312
  process.exit(0);
312
313
  });
314
+ program
315
+ .command("fetch-chat-state")
316
+ .description("Fetch chat session state from the dashboard")
317
+ .requiredOption("--id <id>", "Chat session ID")
318
+ .action(async (opts) => {
319
+ try {
320
+ const response = await api_client_1.apiClient.request(`/api/chat-sessions/${opts.id}`);
321
+ if (!response.ok) {
322
+ console.error("❌ Failed to fetch chat session:", response.statusText);
323
+ process.exit(1);
324
+ }
325
+ const responseData = await response.json();
326
+ const chatState = responseData.data.chat_session.chat_state;
327
+ const filename = `chat-session-${opts.id}.json`;
328
+ fs_1.default.writeFileSync(filename, JSON.stringify(chatState, null, 2));
329
+ console.log(`✅ Chat state saved to ${filename}`);
330
+ }
331
+ catch (error) {
332
+ console.error("❌ Error fetching chat session:", error.message);
333
+ process.exit(1);
334
+ }
335
+ process.exit(0);
336
+ });
313
337
  program
314
338
  .command("legacy")
315
339
  .description("Run the legacy workflows")
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKjE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAgBjE,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,UAAU,EACnB,cAAc,GAAE,MAAM,EAA+B,GACpD,OAAO,CAAC,UAAU,CAAC,CAqDrB;AAeD,wBAAsB,WAAW,kBAgDhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKjE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAejE,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,UAAU,EACnB,cAAc,GAAE,MAAM,EAA+B,GACpD,OAAO,CAAC,UAAU,CAAC,CAqDrB;AAeD,wBAAsB,WAAW,kBAgDhC"}
@@ -14,9 +14,8 @@ exports.ARGS_TO_MODEL_MAP = {
14
14
  "claude-4": "claude-sonnet-4-20250514",
15
15
  "claude-sonnet-4": "claude-sonnet-4-20250514",
16
16
  "claude-opus-4": "claude-opus-4-20250514",
17
- "gemini-2.5": "gemini-2.5-pro-preview-06-05",
18
- "gemini-2.5-pro": "gemini-2.5-pro-preview-06-05",
19
- "gemini-2.5-pro-preview-03-25": "gemini-2.5-pro-preview-06-05",
17
+ "gemini-2.5": "gemini-2.5-pro",
18
+ "gemini-2.5-pro": "gemini-2.5-pro",
20
19
  o3: "o3-2025-04-16",
21
20
  "o3-2025-04-16": "o3-2025-04-16",
22
21
  "o4-mini": "o4-mini-2025-04-16",
@@ -1,5 +1,6 @@
1
1
  import { PendingToolCall, ServicePayload, Tool } from "@empiricalrun/shared-types";
2
2
  export declare function appendBranchNameToQueueUrl(queueUrl: string, branchName: string): string;
3
+ export declare function replaceRegionInUrl(url: string, newRegion: string): string;
3
4
  export declare function getQueueUrl(toolCalls: PendingToolCall[], tools: Tool[]): string;
4
5
  export declare function sendToolRequestToRemoteQueue(queueUrl: string, payload: ServicePayload): Promise<void>;
5
6
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,cAAc,EACd,IAAI,EACL,MAAM,4BAA4B,CAAC;AAEpC,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAOR;AAYD,wBAAgB,WAAW,CACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,KAAK,EAAE,IAAI,EAAE,GACZ,MAAM,CAeR;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,iBAiBxB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,cAAc,EACd,IAAI,EACL,MAAM,4BAA4B,CAAC;AAEpC,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAOR;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzE;AAgBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,KAAK,EAAE,IAAI,EAAE,GACZ,MAAM,CAeR;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,iBAiBxB"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.appendBranchNameToQueueUrl = appendBranchNameToQueueUrl;
4
+ exports.replaceRegionInUrl = replaceRegionInUrl;
4
5
  exports.getQueueUrl = getQueueUrl;
5
6
  exports.sendToolRequestToRemoteQueue = sendToolRequestToRemoteQueue;
6
7
  const client_sqs_1 = require("@aws-sdk/client-sqs");
@@ -12,12 +13,18 @@ function appendBranchNameToQueueUrl(queueUrl, branchName) {
12
13
  const queueNameWithoutFifo = queueName?.replace(/\.fifo$/, "");
13
14
  return `${parts.join("/")}/${queueNameWithoutFifo}-${suffix}.fifo`;
14
15
  }
16
+ function replaceRegionInUrl(url, newRegion) {
17
+ const parsedUrl = new URL(url);
18
+ parsedUrl.hostname = parsedUrl.hostname.replace(/\.([a-z0-9-]+)\.amazonaws\.com$/, `.${newRegion}.amazonaws.com`);
19
+ return parsedUrl.toString();
20
+ }
15
21
  function buildQueueUrlsForPreview(baseQueueUrl) {
16
22
  const branch = process.env.VERCEL_GIT_COMMIT_REF;
17
23
  if (!branch) {
18
24
  throw new Error("VERCEL_GIT_COMMIT_REF is not set");
19
25
  }
20
- const queueUrl = appendBranchNameToQueueUrl(baseQueueUrl, branch);
26
+ const updatedRegionForQueue = replaceRegionInUrl(baseQueueUrl, process.env.AWS_REGION);
27
+ const queueUrl = appendBranchNameToQueueUrl(updatedRegionForQueue, branch);
21
28
  console.log("queueUrl for preview", queueUrl);
22
29
  return queueUrl;
23
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.69.5",
3
+ "version": "0.69.6",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -64,7 +64,7 @@
64
64
  "tsx": "^4.16.2",
65
65
  "typescript": "^5.3.3",
66
66
  "zod": "^3.23.8",
67
- "@empiricalrun/llm": "^0.19.1",
67
+ "@empiricalrun/llm": "^0.19.2",
68
68
  "@empiricalrun/r2-uploader": "^0.3.9",
69
69
  "@empiricalrun/test-run": "^0.10.6"
70
70
  },
@@ -82,7 +82,7 @@
82
82
  "playwright": "1.53.0",
83
83
  "serve-handler": "^6.1.6",
84
84
  "ts-patch": "^3.3.0",
85
- "@empiricalrun/shared-types": "0.6.0"
85
+ "@empiricalrun/shared-types": "0.6.1"
86
86
  },
87
87
  "scripts": {
88
88
  "dev": "tspc --build --watch",