mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 06:30:03 +00:00
feat(studio): make agent edits live and explicit (#3581)
This commit is contained in:
@@ -21,10 +21,9 @@
|
||||
* rather than trusting the caller: the server is configured by whoever started
|
||||
* it, and a mismatch would otherwise pass silently against the wrong build.
|
||||
*/
|
||||
import { existsSync, readdirSync } from "node:fs";
|
||||
import { homedir, platform, arch } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { platform, arch } from "node:os";
|
||||
import puppeteer from "puppeteer-core";
|
||||
import { resolveChromeExecutable } from "./chrome-executable.mjs";
|
||||
|
||||
const STUDIO_URL = process.env.STUDIO_URL;
|
||||
const PROFILE = process.env.TIMELINE_PROFILE || "dense-short";
|
||||
@@ -62,26 +61,6 @@ if (ROW_VIRTUALIZATION === "off" && ELEMENT_COUNT === 50_000) {
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
function resolveChromeExecutable() {
|
||||
const chromeRoot = join(homedir(), ".cache", "puppeteer", "chrome");
|
||||
const builds = existsSync(chromeRoot) ? readdirSync(chromeRoot).sort().reverse() : [];
|
||||
const installedCandidates = builds.flatMap((build) =>
|
||||
[
|
||||
"chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing",
|
||||
"chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing",
|
||||
"chrome-linux64/chrome",
|
||||
].map((relative) => join(chromeRoot, build, relative)),
|
||||
);
|
||||
return [
|
||||
process.env.PUPPETEER_EXECUTABLE_PATH,
|
||||
process.env.CHROME_PATH,
|
||||
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
||||
"/usr/bin/google-chrome",
|
||||
"/usr/bin/chromium",
|
||||
...installedCandidates,
|
||||
].find((candidate) => candidate && existsSync(candidate));
|
||||
}
|
||||
|
||||
function percentile(values, ratio) {
|
||||
if (values.length === 0) return 0;
|
||||
const sorted = [...values].sort((a, b) => a - b);
|
||||
|
||||
Reference in New Issue
Block a user