@empiricalrun/test-gen 0.53.0 → 0.53.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,19 @@
|
|
|
1
1
|
# @empiricalrun/test-gen
|
|
2
2
|
|
|
3
|
+
## 0.53.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [0aeca9d]
|
|
8
|
+
- @empiricalrun/llm@0.14.2
|
|
9
|
+
|
|
10
|
+
## 0.53.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [40fcbc2]
|
|
15
|
+
- @empiricalrun/llm@0.14.1
|
|
16
|
+
|
|
3
17
|
## 0.53.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -98,7 +98,7 @@ async function replaceTodoWithCreateTest({ testFilePath, testCaseName, testCaseS
|
|
|
98
98
|
throw new Error(`No "// TODO(agent):" comment found in file: ${testFilePath}`);
|
|
99
99
|
}
|
|
100
100
|
// TODO: figure out correct page variable name
|
|
101
|
-
await fs_extra_1.default.writeFile(testFilePath, fileContent.replace(todoRegex, (_, todoText) => `await createTest("${todoText.replace(/"/g, '\\"')}",
|
|
101
|
+
await fs_extra_1.default.writeFile(testFilePath, fileContent.replace(todoRegex, (_, todoText) => `await createTest("${todoText.replace(/"/g, '\\"')}", page);`));
|
|
102
102
|
await addImportForCreateTest(testFilePath);
|
|
103
103
|
await markTestAsOnly({
|
|
104
104
|
testCaseName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AAyFA,wBAAsB,SAAS,CAAC,EAC9B,aAA4C,EAC5C,mBAA2B,EAC3B,oBAAoB,GACrB,EAAE;IACD,aAAa,CAAC,EACV,4BAA4B,GAC5B,4BAA4B,GAC5B,8BAA8B,CAAC;IACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,mBAyFA"}
|
package/dist/agent/chat/index.js
CHANGED
|
@@ -56,6 +56,9 @@ function concludeAgent(usageSummary) {
|
|
|
56
56
|
console.log(`\n${(0, picocolors_1.gray)("Usage summary -> " + usageSummary)}`);
|
|
57
57
|
(0, chat_1.cleanupBackupFiles)(process.cwd());
|
|
58
58
|
}
|
|
59
|
+
function stopCriteria(userPrompt) {
|
|
60
|
+
return userPrompt?.toLowerCase() === "stop";
|
|
61
|
+
}
|
|
59
62
|
async function chatAgent({ selectedModel = "claude-3-7-sonnet-20250219", useDiskForChatState = false, initialPromptContent, }) {
|
|
60
63
|
let chatModel = createChatModel(useDiskForChatState, selectedModel);
|
|
61
64
|
let userPrompt = undefined;
|
|
@@ -82,7 +85,7 @@ async function chatAgent({ selectedModel = "claude-3-7-sonnet-20250219", useDisk
|
|
|
82
85
|
}
|
|
83
86
|
const systemPrompt = await (0, prompt_1.buildSystemPrompt)();
|
|
84
87
|
const { tools, toolExecutors } = getTools(selectedModel);
|
|
85
|
-
while (!userPrompt
|
|
88
|
+
while (!stopCriteria(userPrompt)) {
|
|
86
89
|
if (chatModel.askUserForInput) {
|
|
87
90
|
try {
|
|
88
91
|
userPrompt = await human_in_the_loop_1.humanLoop.getFeedback({
|
|
@@ -97,7 +100,9 @@ async function chatAgent({ selectedModel = "claude-3-7-sonnet-20250219", useDisk
|
|
|
97
100
|
}
|
|
98
101
|
throw e;
|
|
99
102
|
}
|
|
100
|
-
|
|
103
|
+
if (!stopCriteria(userPrompt)) {
|
|
104
|
+
chatModel.pushUserMessage(userPrompt);
|
|
105
|
+
}
|
|
101
106
|
continue;
|
|
102
107
|
}
|
|
103
108
|
const toolCalls = chatModel.getPendingToolCalls();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tsx": "^4.16.2",
|
|
69
69
|
"typescript": "^5.3.3",
|
|
70
70
|
"zod": "^3.23.8",
|
|
71
|
-
"@empiricalrun/llm": "^0.14.
|
|
71
|
+
"@empiricalrun/llm": "^0.14.2",
|
|
72
72
|
"@empiricalrun/r2-uploader": "^0.3.8",
|
|
73
73
|
"@empiricalrun/test-run": "^0.7.6"
|
|
74
74
|
},
|