@empiricalrun/test-gen 0.70.0 → 0.70.2

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.70.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 2b0a5ec: feat: add session id to pr description
8
+ - @empiricalrun/llm@0.19.3
9
+
10
+ ## 0.70.1
11
+
12
+ ### Patch Changes
13
+
14
+ - 5149581: chore: update pr title to be dynamic
15
+
3
16
  ## 0.70.0
4
17
 
5
18
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,eAAe,EACf,UAAU,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,mBAAmB,EACnB,IAAI,EACJ,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAmBpC,KAAK,aAAa,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CAC5B,CAAC;AAEF,qBAAa,eAAe;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAM;IACnB,aAAa,EAAE,aAAa,CAAM;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEjC,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACV,QAAQ,EACR,MAAM,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ACvB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEjC,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,YAAY,EACZ,oBAAyB,GAC1B,EAAE;QACD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,aAAa,EAAE,mBAAmB,CAAC;QACnC,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/C;IAoCK,WAAW,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBxD,OAAO,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAyEnE"}
@@ -116,6 +116,7 @@ class ToolCallService {
116
116
  repoPath: this.repoPath,
117
117
  apiKey: this.apiKey,
118
118
  trace: this.trace,
119
+ chatSessionId: this.chatSessionId,
119
120
  collectArtifacts: collectArtifactsFn,
120
121
  environmentOverrides: this.environmentOverrides,
121
122
  featureFlags: this.featureFlags,
@@ -1 +1 @@
1
- {"version":3,"file":"commit-and-create-pr.d.ts","sourceRoot":"","sources":["../../src/tools/commit-and-create-pr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AAoCpC,eAAO,MAAM,qBAAqB,EAAE,IAkFnC,CAAC"}
1
+ {"version":3,"file":"commit-and-create-pr.d.ts","sourceRoot":"","sources":["../../src/tools/commit-and-create-pr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AA0CpC,eAAO,MAAM,qBAAqB,EAAE,IAoFnC,CAAC"}
@@ -16,12 +16,15 @@ For example, if you used the test run tool, you should include the results (and
16
16
  videos and other artifacts that help the reviewer gain more context and confidence in the changes. If tests pass, reviewer will see the video and merge the PR.
17
17
  If tests fail, reviewer will see the video and the test artifacts, and will be able to help you debug the issue.`),
18
18
  });
19
- function descriptionWithTimestamp(description) {
19
+ function descriptionWithMetadata(chatSessionId, description) {
20
20
  const timestamp = new Date()
21
21
  .toISOString()
22
22
  .replace("T", " ")
23
23
  .replace("Z", " UTC");
24
- return `${description}\n\n<sup>Updated at ${timestamp}</sup>`;
24
+ const sessionInfo = chatSessionId
25
+ ? `\n\nPR created from session #${chatSessionId}`
26
+ : ``;
27
+ return `${description}${sessionInfo}\n\n<sup>Updated at ${timestamp}</sup>`;
25
28
  }
26
29
  exports.createPullRequestTool = {
27
30
  schema: {
@@ -37,7 +40,7 @@ Don't ask the user for this information, just come up with it yourself.
37
40
  parameters: createPullRequestSchema,
38
41
  },
39
42
  needsBrowser: false,
40
- execute: async ({ input, repoPath, apiKey, }) => {
43
+ execute: async ({ input, repoPath, apiKey, chatSessionId, }) => {
41
44
  try {
42
45
  const { pullRequestTitle, pullRequestDescription } = input;
43
46
  const branchName = await (0, git_1.getCurrentBranchName)(repoPath);
@@ -61,7 +64,7 @@ Don't ask the user for this information, just come up with it yourself.
61
64
  owner,
62
65
  repo,
63
66
  prNumber: existingPR.number,
64
- body: descriptionWithTimestamp(pullRequestDescription),
67
+ body: descriptionWithMetadata(chatSessionId, pullRequestDescription),
65
68
  apiKey,
66
69
  });
67
70
  return {
@@ -75,7 +78,7 @@ Don't ask the user for this information, just come up with it yourself.
75
78
  title: pullRequestTitle,
76
79
  head: branchName,
77
80
  base: "main",
78
- body: descriptionWithTimestamp(pullRequestDescription),
81
+ body: descriptionWithMetadata(chatSessionId, pullRequestDescription),
79
82
  apiKey,
80
83
  });
81
84
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAuBvD,eAAO,MAAM,mBAAmB,EAAE,IAiIjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAuBvD,eAAO,MAAM,mBAAmB,EAAE,IAwIjC,CAAC"}
@@ -25,7 +25,7 @@ This tool handles the entire workflow: editing the package.json file, running "n
25
25
  parameters: upgradePackagesSchema,
26
26
  },
27
27
  needsBrowser: false,
28
- execute: async ({ input, repoPath, apiKey, }) => {
28
+ execute: async ({ input, repoPath, apiKey, chatSessionId, }) => {
29
29
  const { packages: packagesToUpdate } = input;
30
30
  try {
31
31
  const repoName = path_1.default.basename(repoPath);
@@ -60,15 +60,19 @@ This tool handles the entire workflow: editing the package.json file, running "n
60
60
  isError: false,
61
61
  };
62
62
  }
63
+ const updateMessage = `upgrade ${changes.length} package${changes.length === 1 ? "" : "s"}`;
63
64
  await (0, git_1.commitFilesAndPushBranch)({
64
- commitMessage: `[upgrade-packages] upgrade ${changes.length} packages [skip ci]`,
65
+ commitMessage: `[upgrade-packages] ${updateMessage} [skip ci]`,
65
66
  branchName,
66
67
  files: ["package.json", "package-lock.json"],
67
68
  repoPath,
68
69
  });
69
70
  await new Promise((resolve) => setTimeout(resolve, 5_000));
70
71
  const prBody = `Upgraded the following packages:\n\n${changes.map((c) => `- \`${c.name}\` → ${c.version ? c.version : "latest"}`).join("\n")}`;
71
- const prTitle = `chore: upgrade ${changes.length} package(s)`;
72
+ const sessionMetadata = chatSessionId
73
+ ? `PR created from session #${chatSessionId}`
74
+ : ``;
75
+ const prTitle = `chore: ${updateMessage}`;
72
76
  let shouldMerge = false;
73
77
  let prNumber = null;
74
78
  let merged = false;
@@ -79,7 +83,7 @@ This tool handles the entire workflow: editing the package.json file, running "n
79
83
  apiKey,
80
84
  branchName,
81
85
  title: prTitle,
82
- body: prBody,
86
+ body: `${prBody}\n\n${sessionMetadata}`,
83
87
  labels: ["automated"],
84
88
  });
85
89
  prNumber = pr.number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.70.0",
3
+ "version": "0.70.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -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.2"
85
+ "@empiricalrun/shared-types": "0.6.3"
86
86
  },
87
87
  "scripts": {
88
88
  "dev": "tspc --build --watch",