@empiricalrun/test-gen 0.69.1 → 0.69.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 +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;AAEzC,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;
|
|
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;AAEzC,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;CA4CxC"}
|
|
@@ -69,13 +69,22 @@ class PlaywrightPauseCodegenForRecorder {
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
await page.addInitScript(() => {
|
|
72
|
-
|
|
72
|
+
let displayNoneSet = false;
|
|
73
|
+
function setDisplayNone() {
|
|
73
74
|
const glassPane = document.querySelector("x-pw-glass");
|
|
74
75
|
if (glassPane) {
|
|
75
76
|
const styles = glassPane.getAttribute("style") || "";
|
|
76
77
|
glassPane.setAttribute("style", styles + "; display: none;");
|
|
78
|
+
displayNoneSet = true;
|
|
77
79
|
}
|
|
78
|
-
}
|
|
80
|
+
}
|
|
81
|
+
let interval = setInterval(() => {
|
|
82
|
+
if (displayNoneSet) {
|
|
83
|
+
clearInterval(interval);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setDisplayNone();
|
|
87
|
+
}, 100);
|
|
79
88
|
});
|
|
80
89
|
await Promise.all([pausePromise, evaluatePromise]);
|
|
81
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/recorder/upload.ts"],"names":[],"mappings":"AAcA,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBjE;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/recorder/upload.ts"],"names":[],"mappings":"AAcA,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAoBjE;AA6FD,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAAE,EACpB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAc1B"}
|
package/dist/recorder/upload.js
CHANGED
|
@@ -47,30 +47,56 @@ async function uploadVideos(videoPaths, testSlug) {
|
|
|
47
47
|
const uploadDestinationDir = `recorder-uploads/${testSlug}`;
|
|
48
48
|
const bucket = ASSETS_PRODUCTION_BUCKET;
|
|
49
49
|
try {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
50
|
+
// Step 1: Get pre-signed URLs from the API
|
|
51
|
+
const files = videoPaths
|
|
52
|
+
.filter((videoPath) => fs_1.default.existsSync(videoPath))
|
|
53
|
+
.map((videoPath) => ({
|
|
54
|
+
name: path_1.default.basename(videoPath),
|
|
55
|
+
type: "video/webm",
|
|
56
|
+
}));
|
|
57
|
+
if (files.length === 0) {
|
|
58
|
+
return null;
|
|
60
59
|
}
|
|
61
|
-
const
|
|
60
|
+
const presignedResponse = await api_client_1.apiClient.request("/api/upload", {
|
|
62
61
|
method: "POST",
|
|
63
|
-
|
|
62
|
+
headers: {
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
},
|
|
65
|
+
body: JSON.stringify({
|
|
66
|
+
files,
|
|
67
|
+
destination_dir: uploadDestinationDir,
|
|
68
|
+
bucket,
|
|
69
|
+
}),
|
|
64
70
|
});
|
|
65
|
-
if (!
|
|
66
|
-
console.warn(`Failed to
|
|
71
|
+
if (!presignedResponse.ok) {
|
|
72
|
+
console.warn(`Failed to get pre-signed URLs: ${presignedResponse.status} ${presignedResponse.statusText}`);
|
|
67
73
|
return null;
|
|
68
74
|
}
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
console.warn("
|
|
75
|
+
const presignedResult = await presignedResponse.json();
|
|
76
|
+
if (presignedResult.error) {
|
|
77
|
+
console.warn("Pre-signed URL error:", presignedResult.error.message);
|
|
72
78
|
return null;
|
|
73
79
|
}
|
|
80
|
+
// Step 2: Upload files directly to R2 using pre-signed URLs
|
|
81
|
+
const uploadPromises = presignedResult.data.presigned_urls.map(async (urlInfo) => {
|
|
82
|
+
const videoPath = videoPaths.find((p) => path_1.default.basename(p) === urlInfo.file_name);
|
|
83
|
+
if (!videoPath || !fs_1.default.existsSync(videoPath)) {
|
|
84
|
+
throw new Error(`Video file not found: ${urlInfo.file_name}`);
|
|
85
|
+
}
|
|
86
|
+
const fileBuffer = fs_1.default.readFileSync(videoPath);
|
|
87
|
+
const uploadResponse = await fetch(urlInfo.upload_url, {
|
|
88
|
+
method: "PUT",
|
|
89
|
+
body: fileBuffer,
|
|
90
|
+
headers: {
|
|
91
|
+
"Content-Type": "video/webm",
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
if (!uploadResponse.ok) {
|
|
95
|
+
throw new Error(`Failed to upload ${urlInfo.file_name}: ${uploadResponse.status} ${uploadResponse.statusText}`);
|
|
96
|
+
}
|
|
97
|
+
return urlInfo.key;
|
|
98
|
+
});
|
|
99
|
+
await Promise.all(uploadPromises);
|
|
74
100
|
return videoPaths.map((p) => buildVideoUrl(p, uploadDestinationDir, bucket));
|
|
75
101
|
}
|
|
76
102
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.69.
|
|
3
|
+
"version": "0.69.2",
|
|
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.1",
|
|
68
68
|
"@empiricalrun/r2-uploader": "^0.3.9",
|
|
69
69
|
"@empiricalrun/test-run": "^0.10.5"
|
|
70
70
|
},
|