@empiricalrun/test-gen 0.69.6 → 0.69.8
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 +18 -0
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +3 -1
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +24 -25
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +2 -5
- package/dist/agent/cua/pw-codegen/pw-pause/utils.d.ts +2 -0
- package/dist/agent/cua/pw-codegen/pw-pause/utils.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/pw-pause/utils.js +6 -0
- package/dist/auth/api-client.d.ts +3 -1
- package/dist/auth/api-client.d.ts.map +1 -1
- package/dist/bin/environments.d.ts +2 -0
- package/dist/bin/environments.d.ts.map +1 -0
- package/dist/bin/environments.js +66 -0
- package/dist/bin/index.js +26 -1
- package/dist/bin/utils/index.d.ts.map +1 -1
- package/dist/bin/utils/index.js +1 -0
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +10 -2
- package/dist/recorder/temp-files.d.ts +2 -1
- package/dist/recorder/temp-files.d.ts.map +1 -1
- package/dist/recorder/temp-files.js +57 -27
- package/dist/test-build/index.d.ts +1 -2
- package/dist/test-build/index.d.ts.map +1 -1
- package/dist/test-build/index.js +2 -2
- package/dist/tools/download-build.js +2 -2
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +5 -9
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/recorder/glob.d.ts +0 -2
- package/dist/recorder/glob.d.ts.map +0 -1
- package/dist/recorder/glob.js +0 -74
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @empiricalrun/test-gen
|
|
2
2
|
|
|
3
|
+
## 0.69.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a2ce1ec: fix: glass pane removal across browser context
|
|
8
|
+
- ff7d9e6: fix: temp file computation for recorder
|
|
9
|
+
- 5e9aeb7: fix: environments list command in test-gen cli
|
|
10
|
+
- @empiricalrun/llm@0.19.3
|
|
11
|
+
|
|
12
|
+
## 0.69.7
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- bca8c8b: fix: codegen timing issue
|
|
17
|
+
- 49a3382: feat: add commands for environments and download build
|
|
18
|
+
- Updated dependencies [16f3927]
|
|
19
|
+
- @empiricalrun/llm@0.19.3
|
|
20
|
+
|
|
3
21
|
## 0.69.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAyCpC,wBAAsB,yBAAyB,IAAI,OAAO,CACxD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACvB,CAwBA;AAED,wBAAsB,kBAAkB,CAAC,EACvC,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAyCpC,wBAAsB,yBAAyB,IAAI,OAAO,CACxD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACvB,CAwBA;AAED,wBAAsB,kBAAkB,CAAC,EACvC,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C,iBAkIA;AAuBD,wBAAsB,wBAAwB,CAAC,EAC7C,aAAa,EACb,aAAa,GACd,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB,iBA6DA"}
|
package/dist/agent/chat/index.js
CHANGED
|
@@ -118,7 +118,9 @@ async function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialP
|
|
|
118
118
|
}
|
|
119
119
|
if (!stopCriteria(userPrompt)) {
|
|
120
120
|
const { text, attachments } = (0, utils_1.extractAttachments)(userPrompt);
|
|
121
|
-
const processed =
|
|
121
|
+
const processed = attachments.length > 0
|
|
122
|
+
? await chatModel.processAttachments(attachments)
|
|
123
|
+
: [];
|
|
122
124
|
chatModel.pushUserMessage(text, processed);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"for-recorder.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/for-recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"for-recorder.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/for-recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,qBAAa,iCAAiC;IAO1C,OAAO,CAAC,eAAe;IANzB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,iBAAiB,CAAqB;gBAGpC,eAAe,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;YAKtD,QAAQ;IAWhB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrC,sBAAsB,CAAC,IAAI,EAAE,IAAI;CA0CxC"}
|
|
@@ -7,6 +7,7 @@ exports.PlaywrightPauseCodegenForRecorder = void 0;
|
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const logger_1 = require("../../../../logger");
|
|
9
9
|
const ipc_1 = require("./ipc");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
10
11
|
class PlaywrightPauseCodegenForRecorder {
|
|
11
12
|
sourcesCallback;
|
|
12
13
|
port = 0;
|
|
@@ -45,30 +46,9 @@ class PlaywrightPauseCodegenForRecorder {
|
|
|
45
46
|
await this.startPlaywrightCodegen(page);
|
|
46
47
|
}
|
|
47
48
|
async startPlaywrightCodegen(page) {
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* # inside shadow DOM (closed)
|
|
52
|
-
* |----> x-pw-overlay (controls)
|
|
53
|
-
* |----> x-pw-highlight (red highlight)
|
|
54
|
-
* |----> x-pw-tooltip
|
|
55
|
-
*/
|
|
56
|
-
const timerPromise = new Promise((resolve) => {
|
|
57
|
-
setTimeout(resolve, 1000);
|
|
58
|
-
});
|
|
59
|
-
const pausePromise = page.pause();
|
|
60
|
-
await timerPromise;
|
|
61
|
-
const evaluatePromise = page.evaluate(() => {
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
console.log(window["__pw_recorderSetMode"]("recording"));
|
|
64
|
-
// Remove playwright's glass pane
|
|
65
|
-
const glassPane = document.querySelector("x-pw-glass");
|
|
66
|
-
if (glassPane) {
|
|
67
|
-
const styles = glassPane.getAttribute("style") || "";
|
|
68
|
-
glassPane.setAttribute("style", styles + "; display: none;");
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
await page.addInitScript(() => {
|
|
49
|
+
// TODO: Merge this with the other page.pause oriented codegen
|
|
50
|
+
const browserContext = page.context();
|
|
51
|
+
await browserContext.addInitScript(() => {
|
|
72
52
|
let displayNoneSet = false;
|
|
73
53
|
function setDisplayNone() {
|
|
74
54
|
const glassPane = document.querySelector("x-pw-glass");
|
|
@@ -86,7 +66,26 @@ class PlaywrightPauseCodegenForRecorder {
|
|
|
86
66
|
setDisplayNone();
|
|
87
67
|
}, 100);
|
|
88
68
|
});
|
|
89
|
-
|
|
69
|
+
const pausePromise = page.pause();
|
|
70
|
+
await (0, utils_1.sleep)(5_000);
|
|
71
|
+
const startRecordingWithoutGlassPane = page.evaluate(() => {
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
window["__pw_recorderSetMode"]("recording");
|
|
74
|
+
// Remove playwright's glass pane
|
|
75
|
+
/**
|
|
76
|
+
* x-pw-glass
|
|
77
|
+
* # inside shadow DOM (closed)
|
|
78
|
+
* |----> x-pw-overlay (controls)
|
|
79
|
+
* |----> x-pw-highlight (red highlight)
|
|
80
|
+
* |----> x-pw-tooltip
|
|
81
|
+
*/
|
|
82
|
+
const glassPane = document.querySelector("x-pw-glass");
|
|
83
|
+
if (glassPane) {
|
|
84
|
+
const styles = glassPane.getAttribute("style") || "";
|
|
85
|
+
glassPane.setAttribute("style", styles + "; display: none;");
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
await Promise.all([pausePromise, startRecordingWithoutGlassPane]);
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
exports.PlaywrightPauseCodegenForRecorder = PlaywrightPauseCodegenForRecorder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAKjD,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE9E,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,oBAyCvD;AAED,qBAAa,sBAAuB,YAAW,qBAAqB;IAClE,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,iBAAiB,CAAqB;;YAMhC,QAAQ;IAUhB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrC,sBAAsB,CAAC,IAAI,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAKjD,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAE9E,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,oBAyCvD;AAED,qBAAa,sBAAuB,YAAW,qBAAqB;IAClE,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,iBAAiB,CAAqB;;YAMhC,QAAQ;IAUhB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrC,sBAAsB,CAAC,IAAI,EAAE,IAAI;IAqBjC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;CAU9C"}
|
|
@@ -9,6 +9,7 @@ const express_1 = __importDefault(require("express"));
|
|
|
9
9
|
const logger_1 = require("../../../../logger");
|
|
10
10
|
const ipc_1 = require("./ipc");
|
|
11
11
|
const patch_1 = require("./patch");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
12
13
|
var patch_2 = require("./patch");
|
|
13
14
|
Object.defineProperty(exports, "preparePlaywrightForCodegen", { enumerable: true, get: function () { return patch_2.preparePlaywrightForCodegen; } });
|
|
14
15
|
Object.defineProperty(exports, "revertToOriginalPwCode", { enumerable: true, get: function () { return patch_2.revertToOriginalPwCode; } });
|
|
@@ -77,14 +78,10 @@ class PlaywrightPauseCodegen {
|
|
|
77
78
|
await this.startPlaywrightCodegen(page);
|
|
78
79
|
}
|
|
79
80
|
async startPlaywrightCodegen(page) {
|
|
80
|
-
// TODO: Glass pane needs to be removed on every page load
|
|
81
81
|
// We use bindings that Playwright exposes to the page
|
|
82
82
|
// Ref: https://github.com/microsoft/playwright/blob/e1c8e0f6b33923c95cc4b9416aefa6977b1d3c55/packages/playwright-core/src/server/recorder.ts#L191
|
|
83
|
-
const timerPromise = new Promise((resolve) => {
|
|
84
|
-
setTimeout(resolve, 1000);
|
|
85
|
-
});
|
|
86
83
|
const pausePromise = page.pause();
|
|
87
|
-
await
|
|
84
|
+
await (0, utils_1.sleep)(5_000);
|
|
88
85
|
const evaluatePromise = page.evaluate(() => {
|
|
89
86
|
// First, we start recording
|
|
90
87
|
// @ts-ignore
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/utils.ts"],"names":[],"mappings":"AAAA,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErD"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare class APIClient {
|
|
2
2
|
private appUrl;
|
|
3
3
|
constructor();
|
|
4
|
-
request(endpoint: string, options?: RequestInit): Promise<Response
|
|
4
|
+
request<T>(endpoint: string, options?: RequestInit): Promise<Response & {
|
|
5
|
+
json(): Promise<T>;
|
|
6
|
+
}>;
|
|
5
7
|
private makeRequest;
|
|
6
8
|
ensureAuthenticated(): Promise<void>;
|
|
7
9
|
private refreshToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/auth/api-client.ts"],"names":[],"mappings":"AAQA,cAAM,SAAS;IACb,OAAO,CAAC,MAAM,CAAS;;IAMjB,OAAO,
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/auth/api-client.ts"],"names":[],"mappings":"AAQA,cAAM,SAAS;IACb,OAAO,CAAC,MAAM,CAAS;;IAMjB,OAAO,CAAC,CAAC,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,QAAQ,GAAG;QAAE,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC;YA2B/B,WAAW;IAuBnB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;YAiB5B,YAAY;CA4C3B;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../../src/bin/environments.ts"],"names":[],"mappings":"AAQA,wBAAsB,gBAAgB,kBAiErC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listEnvironments = listEnvironments;
|
|
4
|
+
const api_client_1 = require("../auth/api-client");
|
|
5
|
+
const validation_1 = require("../recorder/validation");
|
|
6
|
+
async function listEnvironments() {
|
|
7
|
+
try {
|
|
8
|
+
let repoName = await (0, validation_1.validatePackageJson)(process.cwd());
|
|
9
|
+
const response = await api_client_1.apiClient.request(`/api/environments/list?project_repo_name=${encodeURIComponent(repoName)}`);
|
|
10
|
+
if (!response.ok) {
|
|
11
|
+
console.error(`❌ Failed to fetch environments for repo ${repoName}:`, response.statusText);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const result = await response.json();
|
|
15
|
+
if (result.data?.environments && result.data.environments.length > 0) {
|
|
16
|
+
result.data.environments.forEach((env, index) => {
|
|
17
|
+
if (index > 0) {
|
|
18
|
+
console.log(""); // Add spacing between environments
|
|
19
|
+
}
|
|
20
|
+
console.log(`Environment: ${env.name}`);
|
|
21
|
+
if (env.latest_build) {
|
|
22
|
+
const commit = env.latest_build.commit
|
|
23
|
+
? env.latest_build.commit.substring(0, 7)
|
|
24
|
+
: "N/A";
|
|
25
|
+
const branch = env.latest_build.branch || "N/A";
|
|
26
|
+
// Calculate relative time
|
|
27
|
+
const createdAt = new Date(env.latest_build.created_at);
|
|
28
|
+
const now = new Date();
|
|
29
|
+
const diffMs = now.getTime() - createdAt.getTime();
|
|
30
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
31
|
+
const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
|
|
32
|
+
const diffMinutes = Math.floor(diffMs / (1000 * 60));
|
|
33
|
+
let timeAgo;
|
|
34
|
+
if (diffDays > 0) {
|
|
35
|
+
timeAgo = `${diffDays} day${diffDays > 1 ? "s" : ""} ago`;
|
|
36
|
+
}
|
|
37
|
+
else if (diffHours > 0) {
|
|
38
|
+
timeAgo = `${diffHours} hour${diffHours > 1 ? "s" : ""} ago`;
|
|
39
|
+
}
|
|
40
|
+
else if (diffMinutes > 0) {
|
|
41
|
+
timeAgo = `${diffMinutes} minute${diffMinutes > 1 ? "s" : ""} ago`;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
timeAgo = "Just now";
|
|
45
|
+
}
|
|
46
|
+
console.log(` ┌─ Latest build`);
|
|
47
|
+
console.log(` │ Commit: ${commit}`);
|
|
48
|
+
console.log(` │ Branch: ${branch}`);
|
|
49
|
+
console.log(` │ Created: ${timeAgo}`);
|
|
50
|
+
console.log(` │ URL: ${env.latest_build.build_url}`);
|
|
51
|
+
console.log(` └─`);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
console.log(` └─ No builds available`);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.log(`No environments found for repository: ${repoName}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error("❌ Error fetching environments:", error.message);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
}
|
package/dist/bin/index.js
CHANGED
|
@@ -23,6 +23,7 @@ const recorder_1 = require("../recorder");
|
|
|
23
23
|
const reporter_1 = require("../reporter");
|
|
24
24
|
const session_1 = require("../session");
|
|
25
25
|
const test_build_1 = require("../test-build");
|
|
26
|
+
const environments_1 = require("./environments");
|
|
26
27
|
const logger_1 = require("./logger");
|
|
27
28
|
const setup_1 = require("./setup");
|
|
28
29
|
const utils_2 = require("./utils");
|
|
@@ -286,6 +287,31 @@ async function main() {
|
|
|
286
287
|
}
|
|
287
288
|
process.exit(0);
|
|
288
289
|
});
|
|
290
|
+
program
|
|
291
|
+
.command("environments")
|
|
292
|
+
.description("List environments and their latest builds")
|
|
293
|
+
.action(async () => {
|
|
294
|
+
await (0, environments_1.listEnvironments)();
|
|
295
|
+
process.exit(0);
|
|
296
|
+
});
|
|
297
|
+
program
|
|
298
|
+
.command("download-build")
|
|
299
|
+
.description("Download a build from a URL")
|
|
300
|
+
.requiredOption("--url <url>", "Build URL to download")
|
|
301
|
+
.action(async (opts) => {
|
|
302
|
+
try {
|
|
303
|
+
await (0, test_build_1.downloadBuild)({
|
|
304
|
+
buildUrl: opts.url,
|
|
305
|
+
repoPath: process.cwd(),
|
|
306
|
+
});
|
|
307
|
+
console.log("✅ Build downloaded successfully");
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
console.error("❌ Error downloading build:", error.message);
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
process.exit(0);
|
|
314
|
+
});
|
|
289
315
|
program
|
|
290
316
|
.command("chat-agent")
|
|
291
317
|
.description("Run the chat agent")
|
|
@@ -362,7 +388,6 @@ async function main() {
|
|
|
362
388
|
await (0, test_build_1.downloadBuild)({
|
|
363
389
|
buildUrl: testGenConfig.build.url,
|
|
364
390
|
repoPath: process.cwd(),
|
|
365
|
-
apiKey: process.env.EMPIRICALRUN_API_KEY,
|
|
366
391
|
});
|
|
367
392
|
}
|
|
368
393
|
let agentUsed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKjE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAKjE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAgBjE,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAQD,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,UAAU,EACnB,cAAc,GAAE,MAAM,EAA+B,GACpD,OAAO,CAAC,UAAU,CAAC,CAqDrB;AAeD,wBAAsB,WAAW,kBAgDhC"}
|
package/dist/bin/utils/index.js
CHANGED
|
@@ -14,6 +14,7 @@ exports.ARGS_TO_MODEL_MAP = {
|
|
|
14
14
|
"claude-4": "claude-sonnet-4-20250514",
|
|
15
15
|
"claude-sonnet-4": "claude-sonnet-4-20250514",
|
|
16
16
|
"claude-opus-4": "claude-opus-4-20250514",
|
|
17
|
+
gemini: "gemini-2.5-pro",
|
|
17
18
|
"gemini-2.5": "gemini-2.5-pro",
|
|
18
19
|
"gemini-2.5-pro": "gemini-2.5-pro",
|
|
19
20
|
o3: "o3-2025-04-16",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recorder/index.ts"],"names":[],"mappings":"AA4BA,wBAAsB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recorder/index.ts"],"names":[],"mappings":"AA4BA,wBAAsB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,iBA8I3D"}
|
package/dist/recorder/index.js
CHANGED
|
@@ -29,7 +29,7 @@ async function runRecorder({ name }) {
|
|
|
29
29
|
const repoDir = process.cwd();
|
|
30
30
|
let repoName = "";
|
|
31
31
|
let fileServer = null;
|
|
32
|
-
let tempTestFilePath = "tests/temp-
|
|
32
|
+
let tempTestFilePath = "tests/temp-file.spec.ts";
|
|
33
33
|
process.on("SIGINT", async () => {
|
|
34
34
|
try {
|
|
35
35
|
await (0, temp_files_1.deleteTempTestFile)(repoDir, tempTestFilePath);
|
|
@@ -86,7 +86,15 @@ async function runRecorder({ name }) {
|
|
|
86
86
|
selectedProjects = [selectedProject];
|
|
87
87
|
selectedProjectObj = projects.find((p) => p.name === selectedProject);
|
|
88
88
|
if (selectedProjectObj) {
|
|
89
|
-
|
|
89
|
+
const projectSpecificFile = (0, temp_files_1.getTempTestFileLocation)(selectedProjectObj, repoDir);
|
|
90
|
+
logger_1.logger.debug(`Project specific temp test file path: ${projectSpecificFile}`);
|
|
91
|
+
if (!projectSpecificFile) {
|
|
92
|
+
logger_1.logger.error(`No suitable test directory found for project ${selectedProject}.`);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
tempTestFilePath = projectSpecificFile;
|
|
97
|
+
}
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
100
|
// Create temp test file in the determined location
|
|
@@ -6,7 +6,8 @@ export type PlaywrightProject = {
|
|
|
6
6
|
testDir: string | undefined;
|
|
7
7
|
teardown: string | undefined;
|
|
8
8
|
};
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function findSubDirs(dir: string, subDirs?: string[], rootDir?: string): void;
|
|
10
|
+
export declare function getTempTestFileLocation(selectedProject: PlaywrightProject, repoDir: string): string | undefined;
|
|
10
11
|
export declare function createTempTestFile(port: number, repoDir: string, tempFileRelativePath: string): Promise<void>;
|
|
11
12
|
export declare function deleteTempTestFile(repoDir: string, tempFileRelativePath: string): Promise<void>;
|
|
12
13
|
//# sourceMappingURL=temp-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temp-files.d.ts","sourceRoot":"","sources":["../../src/recorder/temp-files.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"temp-files.d.ts","sourceRoot":"","sources":["../../src/recorder/temp-files.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAM,EAAO,EACtB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAcN;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,iBAAiB,EAClC,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAsDpB;AAqBD,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,oBAAoB,EAAE,MAAM,iBAkB7B;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,oBAAoB,EAAE,MAAM,iBAS7B"}
|
|
@@ -3,40 +3,70 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.findSubDirs = findSubDirs;
|
|
6
7
|
exports.getTempTestFileLocation = getTempTestFileLocation;
|
|
7
8
|
exports.createTempTestFile = createTempTestFile;
|
|
8
9
|
exports.deleteTempTestFile = deleteTempTestFile;
|
|
9
10
|
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const minimatch_1 = require("minimatch");
|
|
10
12
|
const path_1 = __importDefault(require("path"));
|
|
11
13
|
const logger_1 = require("../logger");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
function findSubDirs(dir, subDirs = [], rootDir) {
|
|
15
|
+
const root = rootDir || dir;
|
|
16
|
+
const entries = fs_1.default.readdirSync(dir, { withFileTypes: true });
|
|
17
|
+
for (const entry of entries) {
|
|
18
|
+
if (entry.isDirectory()) {
|
|
19
|
+
const fullPath = path_1.default.join(dir, entry.name);
|
|
20
|
+
// Calculate relative path from root directory
|
|
21
|
+
const relativePath = path_1.default.relative(root, fullPath);
|
|
22
|
+
subDirs.push(relativePath);
|
|
23
|
+
// Recursively search subdirectories
|
|
24
|
+
findSubDirs(fullPath, subDirs, root);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function getTempTestFileLocation(selectedProject, repoDir) {
|
|
29
|
+
const testsDir = path_1.default.join(repoDir, "tests");
|
|
30
|
+
if (!fs_1.default.existsSync(testsDir)) {
|
|
31
|
+
throw new Error(`Tests directory not found: ${testsDir}`);
|
|
32
|
+
}
|
|
33
|
+
const subDirs = [""];
|
|
34
|
+
findSubDirs(testsDir, subDirs);
|
|
35
|
+
const candidatesForTemp = subDirs.map((subDir) => {
|
|
36
|
+
return path_1.default.join("tests", subDir, "temp-file.spec.ts");
|
|
37
|
+
});
|
|
38
|
+
const { testDir, testMatch, testIgnore } = selectedProject;
|
|
39
|
+
for (const candidate of candidatesForTemp) {
|
|
40
|
+
const fullPath = path_1.default.join(repoDir, candidate);
|
|
41
|
+
if (testDir) {
|
|
42
|
+
const fullTestDir = path_1.default.join(repoDir, testDir);
|
|
43
|
+
if (!fullPath.startsWith(fullTestDir)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (testMatch) {
|
|
48
|
+
const testMatchArray = Array.isArray(testMatch) ? testMatch : [testMatch];
|
|
49
|
+
const withStarStar = testMatchArray.map((pattern) =>
|
|
50
|
+
// Playwright adds `**/` prefix to all string patterns
|
|
51
|
+
// https://github.com/microsoft/playwright/blob/3fb78b65847bd4ee373792f0778d51824a4a150b/packages/playwright/src/util.ts#L109
|
|
52
|
+
pattern.startsWith("**/") ? pattern : `**/${pattern}`);
|
|
53
|
+
const matches = withStarStar.some((pattern) => (0, minimatch_1.minimatch)(fullPath, pattern, { dot: true, nocase: true }));
|
|
54
|
+
if (!matches) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (testIgnore) {
|
|
59
|
+
const testIgnoreArray = Array.isArray(testIgnore)
|
|
60
|
+
? testIgnore
|
|
61
|
+
: [testIgnore];
|
|
62
|
+
const withStarStar = testIgnoreArray.map((pattern) => pattern.startsWith("**/") ? pattern : `**/${pattern}`);
|
|
63
|
+
const matches = withStarStar.some((pattern) => (0, minimatch_1.minimatch)(fullPath, pattern, { dot: true, nocase: true }));
|
|
64
|
+
if (matches) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return candidate;
|
|
38
69
|
}
|
|
39
|
-
return common;
|
|
40
70
|
}
|
|
41
71
|
function getFixturesImportPath(tempFileRelativePath) {
|
|
42
72
|
const tempFileStartsWithSlash = tempFileRelativePath.startsWith("/")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare function hasDownloadScript(repoPath: string): Promise<boolean>;
|
|
2
|
-
export declare function downloadBuild({ buildUrl, repoPath,
|
|
2
|
+
export declare function downloadBuild({ buildUrl, repoPath, }: {
|
|
3
3
|
buildUrl: string;
|
|
4
4
|
repoPath: string;
|
|
5
|
-
apiKey: string | undefined;
|
|
6
5
|
}): Promise<void>;
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-build/index.ts"],"names":[],"mappings":"AAgBA,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG1E;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-build/index.ts"],"names":[],"mappings":"AAgBA,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG1E;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhB"}
|
package/dist/test-build/index.js
CHANGED
|
@@ -18,7 +18,7 @@ async function hasDownloadScript(repoPath) {
|
|
|
18
18
|
const packageJSON = await getPackageJSON(repoPath);
|
|
19
19
|
return !!packageJSON.scripts["download"];
|
|
20
20
|
}
|
|
21
|
-
async function downloadBuild({ buildUrl, repoPath,
|
|
21
|
+
async function downloadBuild({ buildUrl, repoPath, }) {
|
|
22
22
|
const logger = new logger_1.CustomLogger({ useReporter: false });
|
|
23
23
|
const packageJSON = await getPackageJSON(repoPath);
|
|
24
24
|
const buildDownloadScript = packageJSON.scripts["download"];
|
|
@@ -26,7 +26,7 @@ async function downloadBuild({ buildUrl, repoPath, apiKey, }) {
|
|
|
26
26
|
logger.log(`Downloading build from ${buildUrl}`);
|
|
27
27
|
await (0, exec_1.cmd)(`npm`, ["run", "download", buildUrl], {
|
|
28
28
|
cwd: repoPath,
|
|
29
|
-
envOverrides: { ...Object(process.env)
|
|
29
|
+
envOverrides: { ...Object(process.env) },
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -17,7 +17,7 @@ Environment details will include the build URL.`,
|
|
|
17
17
|
needsBrowser: false,
|
|
18
18
|
execute: async (params) => {
|
|
19
19
|
const { input } = params;
|
|
20
|
-
const { repoPath
|
|
20
|
+
const { repoPath } = params;
|
|
21
21
|
if (!(await (0, test_build_1.hasDownloadScript)(repoPath))) {
|
|
22
22
|
return {
|
|
23
23
|
isError: true,
|
|
@@ -27,7 +27,7 @@ You probably don't need to worry about this, since it means this repo does not h
|
|
|
27
27
|
}
|
|
28
28
|
const { buildUrl } = input;
|
|
29
29
|
try {
|
|
30
|
-
await (0, test_build_1.downloadBuild)({ buildUrl, repoPath
|
|
30
|
+
await (0, test_build_1.downloadBuild)({ buildUrl, repoPath });
|
|
31
31
|
return {
|
|
32
32
|
isError: false,
|
|
33
33
|
result: "Build downloaded successfully",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAoGpC,eAAO,MAAM,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAoGpC,eAAO,MAAM,4BAA4B,EAAE,IA+L1C,CAAC"}
|
|
@@ -153,21 +153,17 @@ exports.generateTestWithBrowserAgent = {
|
|
|
153
153
|
catch (err) {
|
|
154
154
|
console.warn("[generateTestWithBrowserAgent] Error preparing playwright for codegen", err);
|
|
155
155
|
}
|
|
156
|
-
let envOverrides = {
|
|
156
|
+
let envOverrides = {
|
|
157
|
+
...environmentOverrides,
|
|
158
|
+
// Running browser agent in headed implies using page.pause method for codegen
|
|
159
|
+
RUN_PLAYWRIGHT_HEADED: "true",
|
|
160
|
+
};
|
|
157
161
|
if (input.buildUrl) {
|
|
158
162
|
envOverrides = {
|
|
159
163
|
...envOverrides,
|
|
160
164
|
BUILD_URL: input.buildUrl,
|
|
161
165
|
};
|
|
162
166
|
}
|
|
163
|
-
if (featureFlags.includes("headed_codegen_in_browser_agent")) {
|
|
164
|
-
// Running browser agent in headed implies using page.pause method for codegen
|
|
165
|
-
// which improves codegen quality when script injection fails (iframes, etc.)
|
|
166
|
-
envOverrides = {
|
|
167
|
-
...envOverrides,
|
|
168
|
-
RUN_PLAYWRIGHT_HEADED: "true",
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
167
|
const testGenToken = (0, scenarios_1.buildTokenFromOptions)({ name: testName, file: filePath, prompt: input.changeToMake }, { useComputerUseAgent: true });
|
|
172
168
|
console.log("[generateTestWithBrowserAgent] Validations passed, starting agent");
|
|
173
169
|
const agentResult = await (0, run_1.runBrowsingAgent)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.69.
|
|
3
|
+
"version": "0.69.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"tsx": "^4.16.2",
|
|
65
65
|
"typescript": "^5.3.3",
|
|
66
66
|
"zod": "^3.23.8",
|
|
67
|
-
"@empiricalrun/llm": "^0.19.
|
|
67
|
+
"@empiricalrun/llm": "^0.19.3",
|
|
68
68
|
"@empiricalrun/r2-uploader": "^0.3.9",
|
|
69
69
|
"@empiricalrun/test-run": "^0.10.6"
|
|
70
70
|
},
|
|
@@ -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.2"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"dev": "tspc --build --watch",
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/logger.ts","./src/actions/assert.ts","./src/actions/click.ts","./src/actions/done.ts","./src/actions/fill.ts","./src/actions/goto.ts","./src/actions/hover.ts","./src/actions/index.ts","./src/actions/next-task.ts","./src/actions/press.ts","./src/actions/skill.ts","./src/actions/text-content.ts","./src/actions/constants/index.ts","./src/actions/utils/index.ts","./src/agent/browsing/index.ts","./src/agent/browsing/run.ts","./src/agent/browsing/utils.ts","./src/agent/chat/agent-loop.ts","./src/agent/chat/exports.ts","./src/agent/chat/index.ts","./src/agent/chat/models.ts","./src/agent/chat/state.ts","./src/agent/chat/types.ts","./src/agent/chat/utils.ts","./src/agent/chat/prompt/index.ts","./src/agent/chat/prompt/pw-utils-docs.ts","./src/agent/chat/prompt/repo.ts","./src/agent/codegen/create-test-block.ts","./src/agent/codegen/fix-ts-errors.ts","./src/agent/codegen/generate-code-apply-changes.ts","./src/agent/codegen/lexical-scoped-vars.ts","./src/agent/codegen/repo-edit.ts","./src/agent/codegen/run.ts","./src/agent/codegen/skills-retriever.ts","./src/agent/codegen/test-update-feedback.ts","./src/agent/codegen/types.ts","./src/agent/codegen/update-flow.ts","./src/agent/codegen/use-skill.ts","./src/agent/codegen/utils.ts","./src/agent/cua/computer.ts","./src/agent/cua/index.ts","./src/agent/cua/model.ts","./src/agent/cua/pw-codegen/element-from-point.ts","./src/agent/cua/pw-codegen/types.ts","./src/agent/cua/pw-codegen/pw-pause/for-recorder.ts","./src/agent/cua/pw-codegen/pw-pause/index.ts","./src/agent/cua/pw-codegen/pw-pause/ipc.ts","./src/agent/cua/pw-codegen/pw-pause/patch.ts","./src/agent/cua/pw-codegen/pw-pause/types.ts","./src/agent/diagnosis-agent/index.ts","./src/agent/diagnosis-agent/strict-mode-violation.ts","./src/agent/enrich-prompt/index.ts","./src/agent/enrich-prompt/utils.ts","./src/agent/infer-agent/index.ts","./src/agent/master/action-tool-calls.ts","./src/agent/master/element-annotation.ts","./src/agent/master/execute-browser-action.ts","./src/agent/master/execute-skill-action.ts","./src/agent/master/next-action.ts","./src/agent/master/planner.ts","./src/agent/master/run.ts","./src/agent/master/scroller.ts","./src/agent/master/with-hints.ts","./src/agent/master/browser-tests/cua.spec.ts","./src/agent/master/browser-tests/fixtures.ts","./src/agent/master/browser-tests/index.spec.ts","./src/agent/master/browser-tests/skills.spec.ts","./src/agent/master/icon-descriptor/index.ts","./src/agent/master/icon-descriptor/normalize-svg.ts","./src/agent/planner/run-time-planner.ts","./src/agent/planner/run.ts","./src/artifacts/index.ts","./src/artifacts/utils.ts","./src/auth/api-client.ts","./src/auth/cli-auth.ts","./src/auth/index.ts","./src/auth/token-store.ts","./src/bin/index.ts","./src/bin/setup.ts","./src/bin/logger/index.ts","./src/bin/utils/context.ts","./src/bin/utils/index.ts","./src/bin/utils/fs/index.ts","./src/bin/utils/platform/web/index.ts","./src/bin/utils/platform/web/test-files/ts-path-import-validate.ts","./src/bin/utils/scenarios/index.ts","./src/browser-injected-scripts/annotate-elements.spec.ts","./src/constants/index.ts","./src/errors/index.ts","./src/evals/add-scenario-agent.evals.ts","./src/evals/append-create-test-agent.evals.ts","./src/evals/fetch-pom-skills-agent.evals.ts","./src/evals/infer-master-or-code-agent.evals.ts","./src/evals/master-agent.evals.ts","./src/evals/type.ts","./src/evals/update-scenario-agent.evals.ts","./src/file/client.ts","./src/file/server.ts","./src/human-in-the-loop/cli.ts","./src/human-in-the-loop/index.ts","./src/human-in-the-loop/ipc.ts","./src/page/index.ts","./src/prompts/lib/ts-transformer.ts","./src/recorder/env-variables.ts","./src/recorder/
|
|
1
|
+
{"root":["./src/index.ts","./src/logger.ts","./src/actions/assert.ts","./src/actions/click.ts","./src/actions/done.ts","./src/actions/fill.ts","./src/actions/goto.ts","./src/actions/hover.ts","./src/actions/index.ts","./src/actions/next-task.ts","./src/actions/press.ts","./src/actions/skill.ts","./src/actions/text-content.ts","./src/actions/constants/index.ts","./src/actions/utils/index.ts","./src/agent/browsing/index.ts","./src/agent/browsing/run.ts","./src/agent/browsing/utils.ts","./src/agent/chat/agent-loop.ts","./src/agent/chat/exports.ts","./src/agent/chat/index.ts","./src/agent/chat/models.ts","./src/agent/chat/state.ts","./src/agent/chat/types.ts","./src/agent/chat/utils.ts","./src/agent/chat/prompt/index.ts","./src/agent/chat/prompt/pw-utils-docs.ts","./src/agent/chat/prompt/repo.ts","./src/agent/codegen/create-test-block.ts","./src/agent/codegen/fix-ts-errors.ts","./src/agent/codegen/generate-code-apply-changes.ts","./src/agent/codegen/lexical-scoped-vars.ts","./src/agent/codegen/repo-edit.ts","./src/agent/codegen/run.ts","./src/agent/codegen/skills-retriever.ts","./src/agent/codegen/test-update-feedback.ts","./src/agent/codegen/types.ts","./src/agent/codegen/update-flow.ts","./src/agent/codegen/use-skill.ts","./src/agent/codegen/utils.ts","./src/agent/cua/computer.ts","./src/agent/cua/index.ts","./src/agent/cua/model.ts","./src/agent/cua/pw-codegen/element-from-point.ts","./src/agent/cua/pw-codegen/types.ts","./src/agent/cua/pw-codegen/pw-pause/for-recorder.ts","./src/agent/cua/pw-codegen/pw-pause/index.ts","./src/agent/cua/pw-codegen/pw-pause/ipc.ts","./src/agent/cua/pw-codegen/pw-pause/patch.ts","./src/agent/cua/pw-codegen/pw-pause/types.ts","./src/agent/cua/pw-codegen/pw-pause/utils.ts","./src/agent/diagnosis-agent/index.ts","./src/agent/diagnosis-agent/strict-mode-violation.ts","./src/agent/enrich-prompt/index.ts","./src/agent/enrich-prompt/utils.ts","./src/agent/infer-agent/index.ts","./src/agent/master/action-tool-calls.ts","./src/agent/master/element-annotation.ts","./src/agent/master/execute-browser-action.ts","./src/agent/master/execute-skill-action.ts","./src/agent/master/next-action.ts","./src/agent/master/planner.ts","./src/agent/master/run.ts","./src/agent/master/scroller.ts","./src/agent/master/with-hints.ts","./src/agent/master/browser-tests/cua.spec.ts","./src/agent/master/browser-tests/fixtures.ts","./src/agent/master/browser-tests/index.spec.ts","./src/agent/master/browser-tests/skills.spec.ts","./src/agent/master/icon-descriptor/index.ts","./src/agent/master/icon-descriptor/normalize-svg.ts","./src/agent/planner/run-time-planner.ts","./src/agent/planner/run.ts","./src/artifacts/index.ts","./src/artifacts/utils.ts","./src/auth/api-client.ts","./src/auth/cli-auth.ts","./src/auth/index.ts","./src/auth/token-store.ts","./src/bin/environments.ts","./src/bin/index.ts","./src/bin/setup.ts","./src/bin/logger/index.ts","./src/bin/utils/context.ts","./src/bin/utils/index.ts","./src/bin/utils/fs/index.ts","./src/bin/utils/platform/web/index.ts","./src/bin/utils/platform/web/test-files/ts-path-import-validate.ts","./src/bin/utils/scenarios/index.ts","./src/browser-injected-scripts/annotate-elements.spec.ts","./src/constants/index.ts","./src/errors/index.ts","./src/evals/add-scenario-agent.evals.ts","./src/evals/append-create-test-agent.evals.ts","./src/evals/fetch-pom-skills-agent.evals.ts","./src/evals/infer-master-or-code-agent.evals.ts","./src/evals/master-agent.evals.ts","./src/evals/type.ts","./src/evals/update-scenario-agent.evals.ts","./src/file/client.ts","./src/file/server.ts","./src/human-in-the-loop/cli.ts","./src/human-in-the-loop/index.ts","./src/human-in-the-loop/ipc.ts","./src/page/index.ts","./src/prompts/lib/ts-transformer.ts","./src/recorder/env-variables.ts","./src/recorder/index.ts","./src/recorder/request.ts","./src/recorder/temp-files.ts","./src/recorder/upload.ts","./src/recorder/validation.ts","./src/reporter/index.ts","./src/reporter/lib.ts","./src/session/index.ts","./src/test-build/index.ts","./src/tool-call-service/index.ts","./src/tool-call-service/utils.ts","./src/tools/commit-and-create-pr.ts","./src/tools/diagnosis-fetcher.ts","./src/tools/download-build.ts","./src/tools/list-environments.ts","./src/tools/str_replace_editor.ts","./src/tools/test-gen-browser.ts","./src/tools/test-run.ts","./src/tools/grep/index.ts","./src/tools/grep/ripgrep/index.ts","./src/tools/grep/ripgrep/types.ts","./src/tools/test-run-fetcher/index.ts","./src/tools/test-run-fetcher/types.ts","./src/tools/upgrade-packages/index.ts","./src/tools/upgrade-packages/utils.ts","./src/tools/utils/index.ts","./src/types/handlebars.d.ts","./src/types/index.ts","./src/uploader/index.ts","./src/uploader/utils.ts","./src/utils/checkpoint.ts","./src/utils/env.ts","./src/utils/exec.ts","./src/utils/file-tree.ts","./src/utils/file.ts","./src/utils/git.ts","./src/utils/html.ts","./src/utils/index.ts","./src/utils/json.ts","./src/utils/repo-tree.ts","./src/utils/slug.ts","./src/utils/string.ts","./src/utils/stripAnsi.ts"],"version":"5.8.3"}
|
package/dist/recorder/glob.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/recorder/glob.ts"],"names":[],"mappings":"AAGA,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CA8FxE"}
|
package/dist/recorder/glob.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateMatchingString = generateMatchingString;
|
|
7
|
-
const minimatch_1 = require("minimatch");
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
function generateMatchingString(patterns) {
|
|
10
|
-
// Separate positive and negative patterns
|
|
11
|
-
const positivePatterns = patterns.filter((p) => !p.startsWith("!"));
|
|
12
|
-
const negativePatterns = patterns
|
|
13
|
-
.filter((p) => p.startsWith("!"))
|
|
14
|
-
.map((p) => p.slice(1));
|
|
15
|
-
// Start with the most specific pattern - temp-test.spec.ts
|
|
16
|
-
const tempTestPattern = positivePatterns.find((p) => p.includes("temp-test.spec.ts"));
|
|
17
|
-
if (!tempTestPattern) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
// Extract the base directory from the testDirPattern
|
|
21
|
-
const testDirPattern = positivePatterns.find((p) => p.includes("/**"));
|
|
22
|
-
if (!testDirPattern) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
// Get the base directory (everything before /**)
|
|
26
|
-
const baseDir = testDirPattern.replace("/**", "");
|
|
27
|
-
// Generate a simple path that matches all positive patterns
|
|
28
|
-
let candidatePath = path_1.default.join(baseDir, "temp-test.spec.ts");
|
|
29
|
-
// Check if it matches all positive patterns
|
|
30
|
-
for (const pattern of positivePatterns) {
|
|
31
|
-
if (!(0, minimatch_1.minimatch)(candidatePath, pattern)) {
|
|
32
|
-
// If it doesn't match, try to adjust the path
|
|
33
|
-
// For patterns like **/*.spec.ts, we might need to add subdirectories
|
|
34
|
-
if (pattern.includes("**/")) {
|
|
35
|
-
// Try adding a subdirectory
|
|
36
|
-
candidatePath = path_1.default.join(baseDir, "e2e", "temp-test.spec.ts");
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
// Check against negative patterns
|
|
41
|
-
for (const pattern of negativePatterns) {
|
|
42
|
-
if ((0, minimatch_1.minimatch)(candidatePath, pattern)) {
|
|
43
|
-
// If it matches a negative pattern, try to find an alternative path
|
|
44
|
-
// Add a different subdirectory or modify the path
|
|
45
|
-
candidatePath = path_1.default.join(baseDir, "integration", "temp-test.spec.ts");
|
|
46
|
-
// Re-check against all patterns
|
|
47
|
-
const matchesAllPositive = positivePatterns.every((p) => (0, minimatch_1.minimatch)(candidatePath, p));
|
|
48
|
-
const matchesNoNegative = !negativePatterns.some((p) => (0, minimatch_1.minimatch)(candidatePath, p));
|
|
49
|
-
if (!matchesAllPositive || !matchesNoNegative) {
|
|
50
|
-
// Try another path
|
|
51
|
-
candidatePath = path_1.default.join(baseDir, "specs", "temp-test.spec.ts");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// Final validation
|
|
56
|
-
const matchesAllPositive = positivePatterns.every((p) => (0, minimatch_1.minimatch)(candidatePath, p));
|
|
57
|
-
const matchesNoNegative = !negativePatterns.some((p) => (0, minimatch_1.minimatch)(candidatePath, p));
|
|
58
|
-
if (matchesAllPositive && matchesNoNegative) {
|
|
59
|
-
return candidatePath;
|
|
60
|
-
}
|
|
61
|
-
// If we still can't find a valid path, try a more systematic approach
|
|
62
|
-
const subdirs = ["", "e2e", "integration", "specs", "playwright", "tests"];
|
|
63
|
-
for (const subdir of subdirs) {
|
|
64
|
-
const testPath = subdir
|
|
65
|
-
? path_1.default.join(baseDir, subdir, "temp-test.spec.ts")
|
|
66
|
-
: path_1.default.join(baseDir, "temp-test.spec.ts");
|
|
67
|
-
const matchesAllPositive = positivePatterns.every((p) => (0, minimatch_1.minimatch)(testPath, p));
|
|
68
|
-
const matchesNoNegative = !negativePatterns.some((p) => (0, minimatch_1.minimatch)(testPath, p));
|
|
69
|
-
if (matchesAllPositive && matchesNoNegative) {
|
|
70
|
-
return testPath;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|