@empiricalrun/test-gen 0.55.0 → 0.56.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 +27 -0
- package/dist/agent/browsing/run.js +4 -4
- package/dist/agent/browsing/utils.d.ts.map +1 -1
- package/dist/agent/browsing/utils.js +39 -21
- package/dist/agent/chat/agent-loop.d.ts +3 -1
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.js +7 -23
- package/dist/agent/chat/exports.d.ts +8 -0
- package/dist/agent/chat/exports.d.ts.map +1 -0
- package/dist/agent/chat/exports.js +7 -0
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +5 -0
- package/dist/agent/chat/repo.js +4 -4
- package/dist/agent/codegen/fix-ts-errors.js +3 -3
- package/dist/agent/codegen/generate-code-apply-changes.js +4 -4
- package/dist/agent/codegen/repo-edit.js +2 -2
- package/dist/agent/codegen/run.js +4 -4
- package/dist/agent/codegen/update-flow.js +4 -4
- package/dist/agent/codegen/utils.js +11 -11
- package/dist/bin/index.js +4 -2
- package/dist/bin/utils/context.js +12 -12
- package/dist/bin/utils/fs/index.js +4 -4
- package/dist/bin/utils/platform/web/index.js +19 -19
- package/dist/reporter/index.js +5 -5
- package/dist/test-build/index.d.ts +2 -9
- package/dist/test-build/index.d.ts.map +1 -1
- package/dist/test-build/index.js +18 -17
- package/dist/tool-call-service/index.d.ts +6 -9
- package/dist/tool-call-service/index.d.ts.map +1 -1
- package/dist/tool-call-service/index.js +50 -36
- package/dist/tools/download-build.d.ts +3 -0
- package/dist/tools/download-build.d.ts.map +1 -0
- package/dist/tools/download-build.js +39 -0
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +1 -1
- package/dist/tools/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/str_replace_editor.js +20 -9
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/package.json +7 -5
|
@@ -86,6 +86,7 @@ async function strReplaceEditorExecutor(input) {
|
|
|
86
86
|
let content;
|
|
87
87
|
let lines;
|
|
88
88
|
let newContent;
|
|
89
|
+
let typeCheckErrors;
|
|
89
90
|
switch (input.command) {
|
|
90
91
|
case "view":
|
|
91
92
|
// TODO: This assumes repoDir is process.cwd()
|
|
@@ -150,6 +151,7 @@ async function strReplaceEditorExecutor(input) {
|
|
|
150
151
|
const escapedOldStr = escapeRegExp(input.old_str);
|
|
151
152
|
const occurences = content.match(new RegExp(escapedOldStr, "g"));
|
|
152
153
|
if (occurences && occurences.length > 1) {
|
|
154
|
+
// TODO: Help find unique matches
|
|
153
155
|
return {
|
|
154
156
|
result: `Error: old_str found ${occurences.length} times in file: ${filePath}. Please provide more context to make a unique match.`,
|
|
155
157
|
isError: true,
|
|
@@ -157,10 +159,10 @@ async function strReplaceEditorExecutor(input) {
|
|
|
157
159
|
}
|
|
158
160
|
newContent = content.replace(input.old_str, input.new_str);
|
|
159
161
|
fs_1.default.writeFileSync(filePath, newContent);
|
|
160
|
-
|
|
161
|
-
if (
|
|
162
|
+
typeCheckErrors = (0, web_1.validateTypescript)(filePath);
|
|
163
|
+
if (typeCheckErrors.length > 0) {
|
|
162
164
|
return {
|
|
163
|
-
result: `Edits to file ${filePath} have been applied. However, type checks are failing with errors:\n${
|
|
165
|
+
result: `Edits to file ${filePath} have been applied. However, type checks are failing with errors:\n${typeCheckErrors.join("\n")}`,
|
|
164
166
|
isError: true,
|
|
165
167
|
};
|
|
166
168
|
}
|
|
@@ -180,20 +182,29 @@ async function strReplaceEditorExecutor(input) {
|
|
|
180
182
|
lines = content.split("\n");
|
|
181
183
|
lines.splice(input.insert_line, 0, input.new_str);
|
|
182
184
|
fs_1.default.writeFileSync(filePath, lines.join("\n"));
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
typeCheckErrors = (0, web_1.validateTypescript)(filePath);
|
|
186
|
+
if (typeCheckErrors.length > 0) {
|
|
187
|
+
return {
|
|
188
|
+
result: `Insertion in file ${filePath} was applied. However, type checks are failing with errors:\n${typeCheckErrors.join("\n")}`,
|
|
189
|
+
isError: true,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
return {
|
|
194
|
+
result: `Insertion in file ${filePath} was applied. Type checks have also passed.`,
|
|
195
|
+
isError: false,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
187
198
|
case "undo_edit":
|
|
188
199
|
if (hasBackup(filePath)) {
|
|
189
200
|
restoreBackup(filePath);
|
|
190
201
|
return {
|
|
191
|
-
result:
|
|
202
|
+
result: `Successfully restored ${filePath} from backup`,
|
|
192
203
|
isError: false,
|
|
193
204
|
};
|
|
194
205
|
}
|
|
195
206
|
return {
|
|
196
|
-
result:
|
|
207
|
+
result: `No backup file found for ${filePath}`,
|
|
197
208
|
isError: true,
|
|
198
209
|
};
|
|
199
210
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,EAC5C,IAAI,EACJ,MAAc,EACd,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,GAAG,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,EAC5C,IAAI,EACJ,MAAc,EACd,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,GAAG,OAAO,CAAC,CAAC,CAAC,CAuBb;AAED,wBAAsB,eAAe,CAAC,EACpC,MAAM,EACN,GAAG,EACH,IAAI,GACL,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,oBAWA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"types": "./dist/agent/chat/state.d.ts",
|
|
19
19
|
"default": "./dist/agent/chat/state.js"
|
|
20
20
|
},
|
|
21
|
+
"./chat": {
|
|
22
|
+
"types": "./dist/agent/chat/exports.d.ts",
|
|
23
|
+
"default": "./dist/agent/chat/exports.js"
|
|
24
|
+
},
|
|
21
25
|
"./utils": {
|
|
22
26
|
"types": "./dist/utils/index.d.ts",
|
|
23
27
|
"default": "./dist/utils/index.js"
|
|
@@ -46,7 +50,6 @@
|
|
|
46
50
|
"dotenv": "^16.4.5",
|
|
47
51
|
"eslint": "^8.57.0",
|
|
48
52
|
"express": "^4.19.2",
|
|
49
|
-
"fs-extra": "^11.2.0",
|
|
50
53
|
"ignore": "^5.3.1",
|
|
51
54
|
"inquirer": "^12.4.2",
|
|
52
55
|
"jsdom": "^26.0.0",
|
|
@@ -61,16 +64,15 @@
|
|
|
61
64
|
"tsx": "^4.16.2",
|
|
62
65
|
"typescript": "^5.3.3",
|
|
63
66
|
"zod": "^3.23.8",
|
|
64
|
-
"@empiricalrun/llm": "^0.15.
|
|
67
|
+
"@empiricalrun/llm": "^0.15.1",
|
|
65
68
|
"@empiricalrun/r2-uploader": "^0.3.8",
|
|
66
|
-
"@empiricalrun/test-run": "^0.8.
|
|
69
|
+
"@empiricalrun/test-run": "^0.8.2"
|
|
67
70
|
},
|
|
68
71
|
"devDependencies": {
|
|
69
72
|
"@playwright/test": "1.47.1",
|
|
70
73
|
"@types/async-retry": "^1.4.8",
|
|
71
74
|
"@types/detect-port": "^1.3.5",
|
|
72
75
|
"@types/express": "^4.17.21",
|
|
73
|
-
"@types/fs-extra": "^11.0.4",
|
|
74
76
|
"@types/js-levenshtein": "^1.1.3",
|
|
75
77
|
"@types/jsdom": "^21.1.7",
|
|
76
78
|
"@types/serve-handler": "^6.1.4",
|