@empiricalrun/test-gen 0.21.0 → 0.21.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,20 @@
|
|
|
1
1
|
# @empiricalrun/test-gen
|
|
2
2
|
|
|
3
|
+
## 0.21.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c3b31ae: fix: logic of extracting test block
|
|
8
|
+
|
|
9
|
+
## 0.21.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [cc33982]
|
|
14
|
+
- Updated dependencies [3649b78]
|
|
15
|
+
- @empiricalrun/reporter@0.14.2
|
|
16
|
+
- @empiricalrun/llm@0.4.4
|
|
17
|
+
|
|
3
18
|
## 0.21.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAWlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAMnD,KAAK,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,GAAG;IAC1D,YAAY,CAAC,EAAE;QACb,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAWlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAMnD,KAAK,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,GAAG;IAC1D,YAAY,CAAC,EAAE;QACb,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,oBAAoB,mBAmK9B;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,oBAAoB,mBAqG9B"}
|
|
@@ -40,7 +40,7 @@ async function browsingAgentUsingMasterAgent(task, page, options) {
|
|
|
40
40
|
llm,
|
|
41
41
|
trace: masterAgentSpan,
|
|
42
42
|
task,
|
|
43
|
-
conversation: ["
|
|
43
|
+
conversation: ["Successfully executed actions", ...masterAgentActions],
|
|
44
44
|
});
|
|
45
45
|
isGivenTaskDone = verificationAgentResp.isDone;
|
|
46
46
|
if (isGivenTaskDone) {
|
|
@@ -77,9 +77,11 @@ async function browsingAgentUsingMasterAgent(task, page, options) {
|
|
|
77
77
|
llm,
|
|
78
78
|
trace: browsingAgentSpan,
|
|
79
79
|
task: action,
|
|
80
|
-
conversation: ["
|
|
80
|
+
conversation: ["Successfully executed actions", ...successfulActions],
|
|
81
81
|
});
|
|
82
82
|
isTaskDone = verificationAgentResp.isDone;
|
|
83
|
+
logger.log(`isTaskDone: ${isTaskDone}`);
|
|
84
|
+
logger.log(`reason: ${verificationAgentResp.reason}`);
|
|
83
85
|
if (isTaskDone) {
|
|
84
86
|
browsingAgentSpan.event({ name: "task-done" });
|
|
85
87
|
browsingAgentSpan.end({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAMA,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAiD7D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,qBAM3D;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAOhD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,UAE5E;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAIpD"}
|
|
@@ -7,20 +7,19 @@ exports.removeTestOnly = exports.addNewImport = exports.formatCode = exports.lin
|
|
|
7
7
|
const eslint_1 = require("eslint");
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const prettier_1 = __importDefault(require("prettier"));
|
|
10
|
+
const ts_morph_1 = require("ts-morph");
|
|
10
11
|
const typescript_1 = __importDefault(require("typescript"));
|
|
11
12
|
function getTypescriptTestBlock(scenarioName, content) {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
13
|
+
const project = new ts_morph_1.Project();
|
|
14
|
+
const sourceFile = project.createSourceFile("test.ts", content);
|
|
15
|
+
const testFunction = sourceFile.getFirstDescendant((node) => !!(node.isKind(ts_morph_1.SyntaxKind.CallExpression) &&
|
|
16
|
+
node.getExpression().getText() === "test" &&
|
|
17
|
+
node.getArguments()[0]?.getText().includes(scenarioName)));
|
|
18
|
+
return testFunction?.getText();
|
|
20
19
|
}
|
|
21
20
|
exports.getTypescriptTestBlock = getTypescriptTestBlock;
|
|
22
21
|
function appendToTestBlock(testBlock, content) {
|
|
23
|
-
const updateTestBlock = testBlock.replace(/\}\)
|
|
22
|
+
const updateTestBlock = testBlock.replace(/\}\)$/, `\n\n${content}\n\n })`);
|
|
24
23
|
return updateTestBlock;
|
|
25
24
|
}
|
|
26
25
|
exports.appendToTestBlock = appendToTestBlock;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
"prettier": "^3.2.5",
|
|
39
39
|
"sanitize-html": "^2.13.0",
|
|
40
40
|
"slugify": "^1.6.6",
|
|
41
|
+
"ts-morph": "^23.0.0",
|
|
41
42
|
"tsx": "^4.16.2",
|
|
42
43
|
"typescript": "^5.3.3",
|
|
43
|
-
"@empiricalrun/llm": "^0.4.
|
|
44
|
-
"@empiricalrun/reporter": "^0.14.
|
|
44
|
+
"@empiricalrun/llm": "^0.4.4",
|
|
45
|
+
"@empiricalrun/reporter": "^0.14.2"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/detect-port": "^1.3.5",
|