Agent Harness
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
Публичная копия обвязки агентной разработки: гейты, journeys, скиллы и шаблоны. Без ключей и личных данных.
const { chromium } = require("playwright-core");
(async () => {
const b = await chromium.launch({ channel: "chrome" });
const p = await b.newPage({ viewport: { width: 1280, height: 720 }, deviceScaleFactor: 1 });
p.on("pageerror", (e) => console.log("ERR", e.message));
p.on("console", (m) => m.type() === "error" && console.log("CONSOLE-ERR", m.text()));
await p.addInitScript(() => {
window.__frames = []; let prev = 0, t0 = 0;
const tick = (t) => { if (!t0) t0 = t; if (prev) window.__frames.push([+(t - t0).toFixed(0), +(t - prev).toFixed(1)]); prev = t; requestAnimationFrame(tick); };
requestAnimationFrame(tick);
});
await p.goto("http://localhost:5173/arena/library.html", { waitUntil: "networkidle" });
await p.waitForTimeout(2500);
const stats = (label) => p.evaluate((label) => {
const f = window.__frames.slice(); const all = f.map((x) => x[1]).sort((a, b) => a - b);
const r = { label, n: f.length, p50: all[Math.floor(all.length * 0.5)], p90: all[Math.floor(all.length * 0.9)], p99: all[Math.floor(all.length * 0.99)], max: all[all.length - 1], over20: all.filter((x) => x > 20).length };
window.__frames.length = 0; return r;
}, label);
console.log(JSON.stringify(await stats("top (moves)")));
// into the heavy full-screen weather section
await p.evaluate(() => document.getElementById("weather")?.scrollIntoView());
await p.waitForTimeout(2000);
console.log(JSON.stringify(await stats("weather visible")));
// scroll through every section
await p.evaluate(async () => {
const h = document.body.scrollHeight;
for (let y = 0; y < h; y += 300) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 40)); }
});
console.log(JSON.stringify(await stats("whole page scroll")));
await b.close();
})();