@empiricalrun/test-gen 0.70.1 → 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 +7 -0
- package/dist/tool-call-service/index.d.ts.map +1 -1
- package/dist/tool-call-service/index.js +1 -0
- package/dist/tools/commit-and-create-pr.d.ts.map +1 -1
- package/dist/tools/commit-and-create-pr.js +8 -5
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +5 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -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,EACN,KAAK,EACL,YAAY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M,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;
|
|
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
|
|
19
|
+
function descriptionWithMetadata(chatSessionId, description) {
|
|
20
20
|
const timestamp = new Date()
|
|
21
21
|
.toISOString()
|
|
22
22
|
.replace("T", " ")
|
|
23
23
|
.replace("Z", " UTC");
|
|
24
|
-
|
|
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:
|
|
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:
|
|
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,
|
|
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);
|
|
@@ -69,6 +69,9 @@ This tool handles the entire workflow: editing the package.json file, running "n
|
|
|
69
69
|
});
|
|
70
70
|
await new Promise((resolve) => setTimeout(resolve, 5_000));
|
|
71
71
|
const prBody = `Upgraded the following packages:\n\n${changes.map((c) => `- \`${c.name}\` → ${c.version ? c.version : "latest"}`).join("\n")}`;
|
|
72
|
+
const sessionMetadata = chatSessionId
|
|
73
|
+
? `PR created from session #${chatSessionId}`
|
|
74
|
+
: ``;
|
|
72
75
|
const prTitle = `chore: ${updateMessage}`;
|
|
73
76
|
let shouldMerge = false;
|
|
74
77
|
let prNumber = null;
|
|
@@ -80,7 +83,7 @@ This tool handles the entire workflow: editing the package.json file, running "n
|
|
|
80
83
|
apiKey,
|
|
81
84
|
branchName,
|
|
82
85
|
title: prTitle,
|
|
83
|
-
body: prBody
|
|
86
|
+
body: `${prBody}\n\n${sessionMetadata}`,
|
|
84
87
|
labels: ["automated"],
|
|
85
88
|
});
|
|
86
89
|
prNumber = pr.number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.70.
|
|
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.
|
|
85
|
+
"@empiricalrun/shared-types": "0.6.3"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"dev": "tspc --build --watch",
|